/* ID Quiz, design A2 ("Quiet"): white and near-black, a forest-green accent, thin rules,
   large type, Geist. Every color is a token here, redefined for dark mode below. */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --sunk: #f3f4f2;
  --ink: #111412;
  --muted: #5e6561;
  --line: #e1e4e0;
  --line-soft: #eef0ed;
  --brand: #1f6b45;
  --brand-strong: #14492f;
  --brand-ink: #ffffff;
  --accent: #eaf4ee;
  --good: #1f6b45;
  --good-bg: #eaf4ee;
  --bad: #b3261e;
  --bad-bg: #fbeae8;
  --key-bg: #fafbfa;
  --key-line: #cfd3ce;
  --sel: #111412;         /* selected chip or tile */
  --sel-ink: #ffffff;
  --radius: 14px;
  --sans: Geist, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* chart series, one per animal group */
  --series-1: #2a7a4b; --series-2: #c2571a; --series-3: #3b6fb6; --series-4: #a8326e;
  --series-5: #8a7a12; --series-6: #6b4fb3; --series-7: #1b8a8f; --series-8: #7a5a3a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1211;
    --surface: #161a18;
    --sunk: #1c211e;
    --ink: #eef1ee;
    --muted: #9aa39e;
    --line: #2c332f;
    --line-soft: #222825;
    --brand: #5fbf86;
    --brand-strong: #8ad3a7;
    --brand-ink: #0b1a11;
    --accent: #17291f;
    --good: #6fd394;
    --good-bg: #17291f;
    --bad: #ff8a80;
    --bad-bg: #3a1c1a;
    --key-bg: #1c211e;
    --key-line: #3a423d;
    --sel: #eef1ee;
    --sel-ink: #0f1211;
    --series-1: #5fbf86; --series-2: #f08a4b; --series-3: #6fa2e8; --series-4: #e070a8;
    --series-5: #d4c252; --series-6: #a68ce8; --series-7: #4fc8cc; --series-8: #c49a70;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 var(--sans);
  -webkit-text-size-adjust: 100%;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column;
}
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-strong); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Top bar */
.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 4px 16px; padding: 6px 22px; padding-top: max(6px, env(safe-area-inset-top));
  background: var(--bg); color: var(--ink); border-bottom: 1px solid var(--line-soft);
}
.brand {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  color: inherit; font-weight: 600; font-size: 15px; letter-spacing: -.01em; text-decoration: none;
}
.brand:hover { color: inherit; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.status { margin-left: auto; font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.account { display: flex; align-items: center; gap: 16px; }
.account a, .bar-button {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--muted); font-size: 13px; text-decoration: none;
}
.account a:hover, .bar-button:hover { color: var(--ink); }
.bar-button { background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
#sign-in { color: var(--brand); font-weight: 600; }
.brand, .status, .account a, .bar-button { white-space: nowrap; }
@media (max-width: 420px) {
  .bar { gap: 0 12px; padding-left: 16px; padding-right: 16px; }
  .account { gap: 12px; }
}

main {
  flex: 1; width: 100%; max-width: 640px; margin: 0 auto;
  padding: 22px 22px max(24px, env(safe-area-inset-bottom));
}
@media (max-width: 420px) { main { padding-left: 16px; padding-right: 16px; } }
.screen.center { display: flex; flex-direction: column; align-items: center; padding-top: 25vh; color: var(--muted); }

h1 { font-size: 30px; line-height: 1.1; letter-spacing: -.03em; font-weight: 600; margin: 4px 0 8px; text-wrap: balance; }
h2 { font-size: 18px; letter-spacing: -.01em; font-weight: 600; margin: 24px 0 8px; }
.lede { color: var(--muted); font-size: 15px; margin: 0 0 24px; }

/* Small uppercase labels, as in the mockup */
legend, .lab {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); font-weight: 400; margin: 0 0 10px; padding: 0;
}
legend label { cursor: pointer; }
.optional { text-transform: none; letter-spacing: 0; font-family: var(--sans); font-size: 12px; }

fieldset { border: 0; padding: 0; margin: 0 0 24px; min-width: 0; }

/* Pills */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 8px 16px; font: inherit; font-size: 14px; cursor: pointer; min-height: 40px;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--sel); border-color: var(--sel); color: var(--sel-ink); }
.chip.filter { background: var(--accent); border-color: var(--brand); color: var(--ink); }
.chip.filter::after { content: " ×"; color: var(--muted); }
.picked-filters:not(:empty) { margin-bottom: 8px; }

/* Animal groups: a 4 x 2 grid of icon tiles */
.taxa { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.taxon {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--radius);
  padding: 10px 2px 8px; font: inherit; font-size: 12px; line-height: 1.2; min-height: 76px; cursor: pointer;
  text-align: center;
}
.taxon:hover { border-color: var(--ink); }
.taxon svg { width: 30px; height: 30px; flex: none; }
.taxon[aria-pressed="true"] { background: var(--sel); border-color: var(--sel); color: var(--sel-ink); }

/* Search boxes: a single rule underneath */
.combo { position: relative; }
input[type="search"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; font: inherit; font-size: 17px; /* 16px or more stops iOS zooming on focus */
  padding: 10px 0; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0;
  background: transparent; color: var(--ink);
}
input[type="search"]::placeholder { color: var(--muted); opacity: .8; }
input[type="search"]:focus { outline: none; border-bottom-color: var(--brand); box-shadow: 0 1px 0 0 var(--brand); }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 5;
  list-style: none; margin: 0; padding: 4px 0; max-height: 50vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 12px 40px rgb(17 20 18 / .12);
}
.suggest li { padding: 10px 14px; cursor: pointer; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--sunk); }
.suggest .type { color: var(--muted); font-size: 13px; margin-left: 6px; }
.suggest .empty { color: var(--muted); cursor: default; }
.suggest .meta { display: block; color: var(--muted); font-size: 13px; }
.picked { margin: 8px 0 0; color: var(--muted); font-size: 14px; }

/* Buttons */
button { font: inherit; }
.primary, .secondary {
  display: block; width: 100%; min-height: 52px; border-radius: var(--radius);
  font-weight: 600; font-size: 16px; cursor: pointer; padding: 14px 16px;
}
.primary { background: var(--brand); color: var(--brand-ink); border: 0; }
.primary:hover:not(:disabled) { background: var(--brand-strong); }
.primary:disabled { opacity: .4; cursor: default; }
.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.secondary:hover { border-color: var(--ink); color: var(--ink); }
.link { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 4px 0; text-decoration: underline; text-underline-offset: 2px; }
.error { color: var(--bad); background: var(--bad-bg); padding: 10px 12px; border-radius: 10px; }

/* Key caps: on the answers, in the keyboard hint, and on Next */
kbd, .key {
  font-family: var(--mono); color: var(--ink); background: var(--key-bg);
  border: 1px solid var(--key-line); border-bottom-width: 2px;
}
kbd { font-size: 11px; border-radius: 5px; padding: 1px 5px; line-height: 1.4; }
.key {
  flex: none; width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600;
}

.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--ink);
  animation: spin 0.9s linear infinite; margin-bottom: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Question */
#question { display: flex; flex-direction: column; gap: 14px; }
#question > * { margin: 0; }
.progress { height: 3px; background: var(--line-soft); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--ink); border-radius: 2px; transition: width .3s; }

/* Photo viewer: the image fits the box; zoom and pan move it with a transform. Its height
   leaves room for four answers below it on a phone. */
.viewer {
  position: relative; overflow: hidden; touch-action: none; user-select: none;
  height: clamp(220px, calc(100vh - 440px), 560px);
  height: clamp(220px, calc(100svh - 440px), 560px);
  border-radius: 18px; background: #000;
}
.viewer img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  transform-origin: 0 0; will-change: transform; -webkit-user-drag: none;
}
.viewer.dragging img { cursor: grabbing; }
/* The controls sit on the photo, so they keep the same colors in light and dark. */
.viewer-tools { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 5px; }
.tool {
  width: 38px; height: 38px; border-radius: 12px; border: 0; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgb(255 255 255 / .92); color: #111412;
}
.tool:hover { background: #fff; }
.tool svg { width: 18px; height: 18px; }
.tool[aria-expanded="true"] { background: #111412; color: #fff; }
.photo-missing {
  position: absolute; inset: 0; margin: 0; padding: 24px 64px; display: flex; align-items: center;
  justify-content: center; text-align: center; color: #fff; font-size: 14px; pointer-events: none;
}
/* Previous / next photo of the same observation */
.pnav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 1;
  width: 40px; height: 40px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: rgb(255 255 255 / .92); color: #111412; box-shadow: 0 1px 4px rgb(0 0 0 / .25);
}
.pnav svg { width: 20px; height: 20px; }
.pnav.prev { left: 10px; }
.pnav.fwd { right: 58px; }
.pnav:disabled { opacity: .35; cursor: default; }
.photo-count {
  position: absolute; right: 12px; bottom: 10px; margin: 0; pointer-events: none;
  font-family: var(--mono); font-size: 11px; color: #fff; background: rgb(17 20 18 / .55);
  border-radius: 999px; padding: 3px 8px;
}
.photo-count:not([hidden]) ~ .credit { max-width: calc(100% - 84px); }
.hint, .credit {
  position: absolute; left: 12px; margin: 0; pointer-events: none;
  color: #fff; background: rgb(17 20 18 / .55); border-radius: 999px; padding: 3px 8px;
}
.hint { top: 12px; font-size: 11px; transition: opacity .4s; max-width: calc(100% - 80px); }
.hint.gone { opacity: 0; }
.credit {
  bottom: 10px; max-width: calc(100% - 24px); border-radius: 8px;
  font-family: var(--mono); font-size: 11px; color: rgb(255 255 255 / .9);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Brightness, contrast and saturation */
.adjust {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px;
}
.sl {
  grid-column: 1; display: grid; grid-template-columns: 76px minmax(0, 1fr) 40px; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted);
}
.sl input { width: 100%; accent-color: var(--ink); margin: 0; min-height: 32px; }
.sl .v { font-family: var(--mono); font-size: 11px; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.rs {
  grid-column: 2; grid-row: 1 / span 3; align-self: stretch; min-height: 44px; cursor: pointer;
  background: none; border: 0; border-left: 1px solid var(--line-soft);
  color: var(--brand); font-size: 13px; padding: 0 0 0 12px;
}

.photo-location { font-size: 14px; font-weight: 500; margin-top: -4px !important; }

.choices { display: flex; flex-direction: column; gap: 8px; }
.choice {
  display: flex; align-items: center; gap: 12px; text-align: left; min-height: 56px; cursor: pointer;
  padding: 10px 14px 10px 10px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
}
button.choice:hover:not(:disabled) { border-color: var(--ink); }
.choice:disabled { cursor: default; }
div.choice { cursor: default; }
.choice .nm a { color: inherit; text-decoration: underline; text-decoration-color: var(--key-line); text-underline-offset: 3px; align-self: flex-start; }
.choice .nm a:hover { text-decoration-color: currentColor; }
.choice .nm a > span { display: block; }
.nm { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cn { font-weight: 500; font-size: 15px; }
.sci { font-style: italic; font-size: 12.5px; color: var(--muted); }
.sci.only { font-size: 15px; color: var(--ink); }
.choice.right { border-color: var(--good); background: var(--good-bg); }
.choice.right .key { background: var(--good); border-color: var(--brand-strong); color: var(--brand-ink); }
.choice.wrong { border-color: var(--bad); background: var(--bad-bg); }
.choice.wrong .key { background: var(--bad); border-color: var(--bad); color: var(--bg); }
.choice.right::after, .choice.wrong::after { flex: none; font-size: 13px; font-weight: 600; }
.choice.right::after { content: "Correct"; color: var(--good); }
.choice.wrong::after { content: "Your answer"; color: var(--bad); }

.keys { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
/* No keyboard on touch screens: hide the key caps and shortcut hints there (PCs only). */
@media (hover: none), (pointer: coarse) {
  .keys, .next kbd, .choice .key { display: none !important; }
  .choice { padding-left: 14px; }
}

.feedback { display: grid; gap: 10px; }
.verdict { margin: 0; font-weight: 600; font-size: 17px; }
.verdict.good { color: var(--good); }
.verdict.bad { color: var(--bad); }
.next { display: flex; justify-content: center; align-items: center; gap: 10px; }
.next kbd { background: transparent; color: inherit; border-color: currentColor; opacity: .65; }

/* Results */
.actions { display: grid; gap: 10px; margin: 16px 0 24px; }
.review { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.review li {
  display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px;
}
.review img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; background: var(--sunk); }
.review .sp { display: flex; flex-direction: column; text-decoration: none; }
.review a.sp .cn, .review a.sp .sci.only { text-decoration: underline; text-underline-offset: 2px; }
.review .you { color: var(--bad); font-size: 13px; }
.review .ok { color: var(--good); font-size: 13px; }
.review a { color: inherit; }

/* My scores */
.note { color: var(--muted); font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 10px; text-align: center; }
.stat b { display: block; font-size: 24px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 12px; }
.history { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; }
.history a {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; color: var(--ink); text-decoration: none;
}
.history a:hover { border-color: var(--ink); }
.history .what { font-weight: 500; }
.history .when { color: var(--muted); font-size: 13px; }
.history .score { grid-row: span 2; font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; }
.history .score.open { color: var(--muted); font-weight: 400; font-size: 13px; }

/* Footer */
.foot {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 20px;
  padding: 10px 22px max(16px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line-soft);
}
.foot a { color: var(--muted); font-size: 13px; text-decoration: none; min-height: 40px; display: inline-flex; align-items: center; }
.foot a:hover { color: var(--ink); }

/* About, Privacy */
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 8px; }
.prose h3 { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 400; margin: 24px 0 10px; }
.warn { background: var(--accent); border-left: 3px solid var(--brand); padding: 12px 14px; border-radius: 10px; }

/* Forms: Contact us and sign-in */
.contact-form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
.field em { color: var(--muted); font-weight: 400; font-style: normal; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 16px; font-weight: 400; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink);
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.field input[readonly] { color: var(--muted); background: var(--sunk); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.as-button { text-align: center; text-decoration: none; }
.pw { position: relative; }
.pw input { width: 100%; padding-right: 72px; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--brand); font-size: 14px; font-weight: 600; cursor: pointer;
  padding: 8px 10px; min-height: 40px;
}
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; font-size: 15px; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); margin: 0; flex: none; }
.si-links { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 16px; }
.si-links .link { min-height: 40px; }
.ok-note { color: var(--good); background: var(--good-bg); padding: 10px 12px; border-radius: 10px; }

/* Number tiles, panels, bars and tables (About and Admin) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.tile .k { color: var(--muted); font-size: 13px; }
.tile .v { font-size: 26px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; margin: 2px 0; }
.tile .s { color: var(--muted); font-size: 12px; }
#about .tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
#about .tile .v { font-size: 22px; }
#about table.t td:last-child { min-width: 14em; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 16px; min-width: 0;
}
.panel h2 { margin-top: 0; font-size: 16px; }
details.panel summary { cursor: pointer; font-weight: 500; }
details.panel[open] summary { margin-bottom: 10px; }
.bars { display: grid; gap: 6px; }
.bars .b { display: grid; grid-template-columns: minmax(0, 12em) 1fr auto; align-items: center; gap: 10px; font-size: 14px; }
.bars .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .track { height: 8px; background: var(--line-soft); border-radius: 4px; overflow: hidden; }
.bars .fill { height: 100%; background: var(--series-1); border-radius: 4px; }
.bars .n { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); min-width: 2.5em; text-align: right; }
.scroll { overflow-x: auto; }
table.t { border-collapse: collapse; width: 100%; font-size: 14px; }
table.t th, table.t td { padding: 7px 8px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
table.t th { color: var(--muted); font-weight: 500; font-size: 12px; white-space: nowrap; }
table.t .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Admin */
body.wide main { max-width: 1180px; }
.adm-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 8px 0 16px; }
.adm-range { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.adm-range input {
  font: inherit; font-size: 16px; padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); color: var(--ink);
}
.adm-apply { color: var(--brand); font-weight: 600; min-height: 36px; padding: 0 6px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; cursor: pointer; min-height: 36px; font-size: 14px;
}
.seg button:hover { border-color: var(--ink); }
.seg button.on { background: var(--sel); border-color: var(--sel); color: var(--sel-ink); }
.adm-grid { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
@media (min-width: 860px) { .adm-grid { grid-template-columns: 1fr 1fr; } }
.chart-box { position: relative; height: 260px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); margin-bottom: 8px; min-height: 1.2em; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.msg { border-bottom: 1px solid var(--line-soft); padding: 10px 0; }
.msg:last-child { border-bottom: 0; }
.msg-body { white-space: pre-wrap; margin: 6px 0 0; overflow-wrap: anywhere; }

/* Admin header and feature flags */
.adm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.adm-head-btn { display: inline-flex; width: auto; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 8px; font-size: 14px; font-weight: 500; text-decoration: none; }
.flags { list-style: none; margin: 16px 0 0; padding: 0; border-top: 1px solid var(--line); }
.flag { padding: 14px 0; border-bottom: 1px solid var(--line); }
.flag-main { display: flex; align-items: center; gap: 12px 16px; }
.flag-cfg { width: auto; min-height: 36px; padding: 0 14px; border-radius: 8px; font-size: 14px; font-weight: 500; flex: none; }
.flag-settings { display: grid; gap: 6px; margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.flag-settings label { font-weight: 600; font-size: 14px; margin-top: 6px; }
.flag-settings input { font: inherit; min-height: 40px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); width: 100%; box-sizing: border-box; }
.flag-settings .note { margin: 0; font-size: 13px; }
.cfg-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cfg-btn { width: auto; min-height: 40px; padding: 0 18px; font-size: 15px; }
.cfg-status { margin: 4px 0 0; font-size: 14px; min-height: 1.4em; }
.cfg-status.good { color: var(--good); }
.cfg-status.bad { color: var(--bad); }
.etym { border-top: 1px solid var(--line); padding-top: 10px; }
.etym p { margin: 0 0 6px; }
.etym-open { font-size: 15px; }
.etym-head { font-size: 16px; }
.etym-parts { margin: 4px 0 8px; padding-left: 20px; font-size: 14px; }
.etym-play { font: inherit; font-size: 13px; border: 1px solid var(--line); background: none; color: var(--ink); border-radius: 999px; padding: 2px 10px; cursor: pointer; }
.etym-src { font-size: 12px; }
.flag-text { flex: 1; min-width: 0; }
.flag-name { font-weight: 600; }
.flag-desc, .flag-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.switch { position: relative; flex: none; width: 46px; height: 28px; border-radius: 14px; border: 0; padding: 0; cursor: pointer; background: var(--line); transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--brand); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.switch:disabled { opacity: .5; cursor: wait; }
.switch:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
