/* 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;
}

body.has-bg {
  background-color: var(--bg);
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  pointer-events: none;
  opacity: var(--bg-opacity, 0.28);
}

.page-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

body.has-bg > .wrap {
  position: relative;
  z-index: 1;
}

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

.prose-card {
  max-width: 42rem;
  margin: 0 auto;
}

.prose-card h2 {
  margin-top: 0;
}

.prose-card h3 {
  margin-top: 1.35rem;
}

.prose-card ol,
.prose-card ul {
  padding-left: 1.25rem;
}

.prose-card li {
  margin: 0.35rem 0;
}

.contact-warn {
  background: #5c1a24;
  border: 1px solid #a33;
  color: #ffe8e8;
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin: 0.85rem 0 1.1rem;
  font-size: 0.95rem;
}

.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.compose-shell {
  display: grid;
  grid-template-columns: minmax(200px, 260px) 1fr;
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1rem;
}

.compose-intro {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--muted);
}

.compose-intro p {
  margin: 0 0 0.85rem;
}

.compose-intro p:last-child {
  margin-bottom: 0;
}

@media (max-width: 960px) {
  .compose-shell {
    grid-template-columns: 1fr;
  }
}

/* Two-column form: message/notify | schedule */
.form-grid {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 320px);
  gap: 1.25rem;
  align-items: stretch;
  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: auto;
  margin-bottom: 0;
}

.form-main {
  align-self: start;
  margin-bottom: 0;
}

.form-side {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-self: stretch;
}

.form-side .card,
.form-side .note {
  margin-bottom: 0;
}

.form-side .hint:last-child {
  margin-bottom: 0;
}

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

.note-side {
  margin-bottom: 0;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  line-height: 1.35;
}

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 h1.site-banner-dev {
  background: #8b0000;
  color: #fff;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

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

.header-nav {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.85rem 1.15rem;
}

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

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

.bmc-wrap {
  line-height: 0;
  transform: scale(0.5);
  transform-origin: top right;
  margin-bottom: -1.1rem;
}

.bmc-wrap iframe,
.bmc-wrap img,
.bmc-wrap a {
  max-width: 100%;
}

.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;
}

.help-wrap {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.help-icon {
  display: inline;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  margin: 0 0 0 0.1em;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  color: var(--accent);
  font-size: inherit;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  vertical-align: baseline;
}

.help-icon sup {
  font-size: 0.75em;
  line-height: 0;
  color: inherit;
}

.help-icon:hover,
.help-toggle:focus + .help-icon {
  color: var(--fg);
  text-decoration: underline;
}

.help-overlay {
  display: none;
  position: fixed;
}

.help-toggle:checked ~ .help-overlay {
  display: flex;
}

.help-scrim {
  position: absolute;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.help-dialog {
  position: relative;
  z-index: 1;
  max-width: 28rem;
}

.help-title {
  margin-right: auto;
  padding: 0.65rem 0 0.35rem 0.5rem;
  font-size: 1.05rem;
  color: var(--fg);
}

.field-head {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  margin-bottom: 0.35rem;
}

.field-head label {
  display: inline;
  margin-bottom: 0;
}

.field-head .help-wrap {
  position: static;
  top: auto;
}

.check-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.check-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  font-size: 0.9rem;
  margin: 0;
}

.check-row label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  margin: 0;
  cursor: pointer;
}

.check-row input[type="checkbox"] {
  width: auto;
  margin: 0;
  flex-shrink: 0;
}

.checksum-warn {
  color: #e8c07a;
}

.token-wrap {
  margin-bottom: 1rem;
}

.retrieve-layout {
  display: grid;
  grid-template-columns: 1fr minmax(160px, 200px);
  gap: 1.25rem;
  align-items: stretch;
}

@media (max-width: 640px) {
  .retrieve-layout {
    grid-template-columns: 1fr;
  }
}

.retrieve-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  border: none;
  min-width: 0;
  min-height: 100%;
}

.retrieve-actions-stack .radio-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  cursor: pointer;
  font-weight: 600;
}

.retrieve-actions-stack .radio-row input {
  width: auto;
  margin: 0;
}

.retrieve-actions-stack .btn {
  margin-top: auto;
}

.checksum-wrap {
  background: #5c2748;
  border: 1px solid #8a3d6a;
  border-radius: var(--radius);
  padding: 0.85rem 1rem 0.75rem;
  margin: 0;
  text-align: center;
}

.checksum-title {
  display: block;
  margin: 0 0 0.45rem;
  font-weight: 700;
  color: #f6e6ef;
  text-align: center;
}

.checksum-destroy {
  display: block;
  margin: 0 0 0.65rem;
  color: #ffe8f4;
  font-size: 0.88rem;
  text-align: center;
}

.checksum-wrap input[type="text"] {
  display: block;
  width: 33%;
  min-width: 6.5rem;
  max-width: 10rem;
  margin: 0 auto;
  text-align: center;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: #2a1220;
  border-color: #a45a82;
  color: #fff;
}

.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;
}

.form-grid > .card,
.form-grid .form-side .card {
  margin-bottom: 0;
}

.notfound-stage {
  min-height: 55vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notfound-card {
  max-width: 36rem;
  width: 100%;
}

.notfound-list {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
}

.notfound-list li {
  margin: 0.65rem 0;
}

.notfound-list em {
  font-style: italic;
  color: #c4a574;
  opacity: 0.85;
}

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;
}

.motd-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

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

.motd {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  text-align: center;
}

.motd-u0 {
  background: #12201a;
  border: 1px solid #1e3a2f;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 400;
}

.motd-u1 {
  background: #5c4a00;
  border: 1px solid #8a7000;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 500;
}

.motd-u2 {
  background: #b34700;
  border: 1px solid #d45a00;
  color: #ffffff;
  font-weight: 600;
}

.motd-u3 {
  background: #e10600;
  border: 1px solid #ff2a24;
  color: #ffffff;
  font-weight: 800;
}

.motd-side {
  background: #4a0e16;
  border: 1px solid #6e1a26;
  color: #ffffff;
  margin-bottom: 0;
}

.motd-align {
  display: block;
}

.motd-align-left { text-align: left; }
.motd-align-right { text-align: right; }
.motd-align-center { text-align: center; }

.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;
}

.note-risk {
  background: #4a0e16;
  border: 1px solid #6e1a26;
  color: #ffffff;
}

.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;
}

.verify-actions {
  justify-content: space-between;
  align-items: center;
}

.btn-bmc {
  background: #411900;
}

.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;
}

.copy-label {
  margin: 1rem 0 0.35rem;
  font-weight: 700;
}

.copy-label + .hint {
  margin-top: 0;
  margin-bottom: 0.35rem;
}

.copy-field {
  display: flex;
  align-items: stretch;
  gap: 0.6rem;
}

.copy-field .url-box {
  flex: 1;
  min-width: 0;
}

.copy-field .copy-btn {
  flex-shrink: 0;
  align-self: center;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .copy-field {
    flex-direction: column;
  }
  .copy-field .copy-btn {
    align-self: stretch;
  }
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 1.5rem;
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
}

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

.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: 1rem;
  padding-top: 0.5rem;
  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; }
