/* WORO / echodrop.net – minimal, accessible, works without JS */

:root {
  --bg: #0f1115;
  --fg: #e6e8ec;
  --muted: #9aa3b2;
  --accent: #5b9cff;
  --danger: #ff6b6b;
  --ok: #3dd68c;
  --border: #2a2f3a;
  --card: #171a21;
  --radius: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  min-height: 100vh;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* Two-column form: message/notify | schedule */
.form-grid {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 320px);
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1rem;
}

@media (max-width: 720px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.section-title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--fg);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.form-main .section-title + .section-title,
.form-main h2.section-title:nth-of-type(2) {
  margin-top: 1.5rem;
}

.form-actions {
  margin-top: 0;
  margin-bottom: 0;
}

.form-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.note-side {
  margin-bottom: 0;
  font-size: 0.85rem;
}

header {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.header-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.header-nav a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.header-nav a:hover {
  text-decoration: underline;
}

.server-log-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  line-height: 1.2;
  vertical-align: middle;
}

.server-log-on {
  background: #c62828;
  color: #fff;
  animation: log-pulse 2s ease-in-out infinite;
}

.server-log-off {
  background: #1b5e20;
  color: #c8f7c5;
}

.server-log-unknown {
  background: #f9a825;
  color: #1a1200;
}

@keyframes log-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

/* About overlay */
.about-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.about-overlay[hidden] {
  display: none !important;
}

.about-dialog {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 560px;
  width: 100%;
  max-height: min(85vh, 720px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.about-dialog-header {
  display: flex;
  justify-content: flex-end;
  padding: 0.5rem 0.75rem 0;
  flex-shrink: 0;
}

.about-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.about-close:hover {
  color: var(--fg);
}

.about-dialog-body {
  overflow-y: auto;
  padding: 0 1.25rem 1.25rem;
  -webkit-overflow-scrolling: touch;
}

.about-body h2 {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
}

.about-body h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: 1rem;
  color: var(--accent);
}

.about-body ul {
  margin: 0.35rem 0 0;
  padding-left: 1.25rem;
}

.about-body li {
  margin-bottom: 0.35rem;
}

.about-body code {
  font-size: 0.85em;
  background: #0c0e12;
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.about-open {
  overflow: hidden;
}

.banner {
  background: #3a2a00;
  color: #ffd666;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-weight: 700;
  text-align: center;
}

html.debug-on,
html.debug-on body {
  background: #3b0000;
}

.banner-debug {
  background: #8b0000;
  color: #fff;
  font-size: 1.1rem;
  letter-spacing: 0.06em;
}

.debug-ack {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}

.debug-ack label {
  display: block;
  font-weight: 400;
  margin: 0.35rem 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
  font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="datetime-local"],
textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #0c0e12;
  color: var(--fg);
  font: inherit;
  margin-bottom: 1rem;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: -0.75rem;
  margin-bottom: 1rem;
}

.errors {
  background: #2a1215;
  border: 1px solid var(--danger);
  color: #ffb4b4;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
}

.errors ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.note {
  background: #12201a;
  border: 1px solid #1e3a2f;
  color: #a8e6c3;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.note-warning {
  background: #3a2e00;
  border: 1px solid #6b5a10;
  color: #ffd666;
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { filter: brightness(1.08); }
.btn-danger { background: var(--danger); }
.btn-secondary { background: #3a4150; }
.btn-block { width: 100%; text-align: center; }

.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.url-box {
  word-break: break-all;
  background: #0c0e12;
  border: 1px solid var(--border);
  padding: 0.75rem;
  border-radius: 6px;
  font-family: ui-monospace, monospace;
  font-size: 0.9rem;
}

.meta-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.meta-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}

.meta-list li:last-child { border-bottom: none; }

.message-body {
  white-space: pre-wrap;
  word-break: break-word;
  background: #0c0e12;
  border: 1px solid var(--border);
  padding: 1rem;
  border-radius: 6px;
  margin-top: 0.75rem;
}

footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.noscript-only { display: none; }
.no-js .noscript-only { display: block; }
.no-js .js-only { display: none; }
