/*
 * Overrides on top of avian.css (the upstream look). The upstream is a JS SPA
 * that animates a sliding pill behind the active tab; we server-render, so we
 * hide that pill and give the active link the raised-pill look directly. The
 * nav items are links, not buttons, so we mirror the button styling onto <a>.
 */

.seg-pill { display: none !important; }

/* Window picker (top) — links styled like the upstream buttons. */
.top .window-pick a {
  background: transparent;
  border: 0;
  color: var(--ink-soft);
  font: 10px/1 var(--mono);
  letter-spacing: 0.18em;
  padding: 9px 16px;
  border-radius: 999px;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 200ms ease;
}
.top .window-pick a:hover { color: var(--ink); }
.top .window-pick a[aria-current="true"] {
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--raised);
}

/* Bottom view slider — same treatment. */
.slider a {
  background: transparent;
  border: 0;
  color: var(--ink-soft);
  font: 10px/1 var(--mono);
  letter-spacing: 0.2em;
  padding: 11px 24px;
  border-radius: 999px;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 200ms ease;
}
.slider a:hover { color: var(--ink); }
.slider a[aria-current="true"] {
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--raised);
}

/* Atlas sort + scope controls — links styled like the upstream icon buttons. */
.atlas-sort a, .atlas-scope a {
  background: transparent;
  border: 0;
  color: var(--ink-soft);
  font: 10px/1 var(--mono);
  letter-spacing: 0.16em;
  padding: 7px 13px;
  border-radius: 999px;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 200ms ease;
}
.atlas-sort a:hover, .atlas-scope a:hover { color: var(--ink); }
.atlas-sort a[aria-current="true"], .atlas-scope a[aria-current="true"] {
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--raised);
}

/* The upstream sizes timeline squares in px via JS; we drive width as a % of
   the column, so aspect-ratio keeps them square. */
.stats-tl-square { aspect-ratio: 1; }

/* English gloss beside the Irish name in the stats side-lists. */
.stats-side .gloss {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 0.82em;
  margin-left: 6px;
}

/* In the web view the birds sit on the page; only the Inky screenshot needs the
   cream paper ground, so hide it here (the bare /panel has no CSS, keeps it). */
.gcollage .collage__bg { display: none; }

/* Collage web view: centre our 800x480 SVG panel in the available space. */
.gcollage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Caption pill — matches the parent: a centred, drop-shadowed pill that's blank
   until a bird is hovered/tapped, naming that one bird and its windowed count. */
.collage-tip {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  margin: 0;
  padding: 8px 18px;
  background: var(--paper);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  font: italic 15px/1.3 var(--serif);
  color: var(--ink);
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}
.collage-tip[aria-hidden="false"] { opacity: 1; }
.collage-tip .ct-name { font-style: normal; font-weight: 600; }
.collage-tip .ct-n { font-style: normal; font-weight: 700; }
.collage-tip .ct-w { color: var(--ink-soft); }
.gcollage svg {
  width: auto;
  height: auto;
  max-width: min(100%, 1600px);
  max-height: 100%;
}

/* Species detail modal — avian.css styles the shell (#detail-modal, .modal-card,
   .modal-stats, …); these fill the gaps for our bilingual panel. */
body.modal-open { overflow: hidden; }
.modal-info .common {
  margin: 2px 0 0;
  font-size: 15px;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

/* Header bar: the follow checkbox sits far left, the language toggle + close far
   right — the panel's own chrome, in the mono broadsheet voice like the masthead. */
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 26px; margin: -8px 0 16px;
}
/* margin-left:auto keeps this pinned right even when FollowButton renders nothing
   (signed out) — otherwise space-between parks the lone child on the left. */
.modal-head-right { display: inline-flex; align-items: center; gap: 16px; margin-left: auto; }
/* EN | GA: parted by a hairline bar, the live one underlined. */
.modal-head .ed-lang { gap: 0; }
.modal-head .ed-lang-opt { padding: 0 9px; }
.modal-head .ed-lang-opt + .ed-lang-opt { border-left: 1px solid var(--rule); }
.modal-head .ed-lang-opt.is-on { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
/* The close leaves its round plate for a bare ink mark (scoped so avian.css's
   About modal keeps its button). */
.modal-head .modal-close {
  position: static; top: auto; right: auto;
  width: auto; height: auto; padding: 0 2px;
  background: none; box-shadow: none; border-radius: 0;
  font-size: 20px; color: var(--ink-2);
}
.modal-head .modal-close:hover { color: var(--accent-2); }

/* Fact & folklore — the latest enrichment for this bird, each block cited. On the
   open page: a printer's-mark label over serif prose, folklore set in the voice-
   italic as lore not fact. No plate. */
/* The on-demand "look it up now" — a quiet mono prompt (line icon + words), no plate,
   shown to a signed-in viewer when this bird hasn't been enriched yet. */
.modal-lore-lookup {
  display: inline-flex; align-items: center; gap: 8px; margin: 2px 0 18px;
  background: none; border: 0; padding: 0; cursor: pointer;
  font: 10px ui-monospace, Menlo, monospace; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-soft);
  transition: color 140ms ease;
}
.modal-lore-lookup .ti { font-size: 15px; }
.modal-lore-lookup:hover { color: var(--ink); }
.modal-lore-lookup:disabled { cursor: default; color: var(--ink-soft); }
@keyframes modal-lore-spin { to { transform: rotate(360deg); } }
.modal-lore-lookup .ti-loader { animation: modal-lore-spin 900ms linear infinite; }

.modal-lore { margin: 2px 0 18px; display: grid; gap: 15px; }
.modal-lore-item {
  margin: 0;
  font: 13.5px/1.6 ui-serif, Georgia, serif; color: var(--ink);
}
.modal-lore-item.is-folk { font-style: italic; color: var(--ink-2); }
.modal-lore-k {
  display: block; margin-bottom: 5px;
  font: 8.5px ui-monospace, Menlo, monospace; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-soft); font-style: normal;
}
.modal-lore-src {
  display: inline-flex; flex-wrap: wrap; gap: 4px 12px; margin-left: 8px;
  font: 9.5px ui-monospace, Menlo, monospace; font-style: normal;
}
.modal-lore-src a { color: var(--ink-soft); text-decoration: none; }
.modal-lore-src a:hover { color: var(--accent-2); text-decoration: underline; }

/* Recordings: open rows on the page, parted by faint dotted rules — no plates. */
.modal-recordings ol { gap: 0; max-height: 264px; }
.modal-recordings li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 11px 2px; border-bottom: 1px dotted var(--rule);
}
.modal-recordings li:last-child { border-bottom: 0; }
.modal-recordings .rec-when { color: var(--ink); }
.modal-recordings .rec-when small {
  margin-left: 10px; color: var(--ink-soft);
  font-size: 11px; letter-spacing: 0.02em;
}
.modal-recordings .rec-conf {
  font-variant-numeric: tabular-nums; color: var(--ink-soft);
  font-size: 12px; font-weight: 600;
}

/* Call playback — a borderless inline bar, not the native pill: a bare play/pause
   mark, the label, a thin seek line, a running clock, and a mute toggle. */
.modal-audio { margin-top: 4px; }
.modal-audio-label {
  display: block; margin-bottom: 8px;
  font: 9px ui-monospace, Menlo, monospace; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-soft);
}
.audiobar { display: flex; align-items: center; gap: 14px; }
.audiobar-btn {
  flex: 0 0 auto; background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--ink); line-height: 0;
}
.audiobar-btn svg { width: 15px; height: 15px; display: block; }
.audiobar-btn:hover { color: var(--accent-2); }
.audiobar-seek {
  flex: 1 1 auto; position: relative; height: 14px; cursor: pointer;
  display: flex; align-items: center;
}
/* A hairline track with a thin filled lead — the panel's one thread of motion. */
.audiobar-track { position: absolute; left: 0; right: 0; height: 1px; background: var(--rule); }
.audiobar-fill { position: absolute; left: 0; height: 1px; background: var(--ink-2); }
.audiobar-head {
  position: absolute; top: 50%; width: 7px; height: 7px; border-radius: 999px;
  background: var(--ink); transform: translate(-50%, -50%);
}
.audiobar-time {
  flex: 0 0 auto; font: 10.5px ui-monospace, Menlo, monospace;
  color: var(--ink-soft); font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
}
.audiobar-mute {
  flex: 0 0 auto; background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--ink-soft); line-height: 0;
}
.audiobar-mute svg { width: 15px; height: 15px; display: block; }
.audiobar-mute:hover { color: var(--ink); }

/* Stats page — a clean bar chart + side lists. (Replaces the parent's
   JS-driven editorial timeline, which didn't survive the static port: its
   bars rendered zero-height inside zero-width columns.) Species rows open
   the detail modal, like the collage and atlas. */
.view#v1 { overflow-y: auto; }
.stats2 {
  display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 56px;
  max-width: 1080px; width: 100%; margin: 0 auto;
  align-items: start;
}
@media (max-width: 820px) { .stats2 { grid-template-columns: 1fr; gap: 36px; } }
.stats2 h3 {
  font: 700 10px var(--mono); letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink);
  border-left: 2px solid var(--accent); padding-left: 10px; margin: 0 0 2px;
}
.stats2 small {
  display: block; font: 9px var(--mono); color: var(--ink-soft);
  letter-spacing: 0.06em; margin: 0 0 14px 12px;
}

/* Horizontal bars — bilingual name, proportional bar, count. */
.barlist { list-style: none; margin: 0; padding: 0; }
.barlist-row {
  display: grid; grid-template-columns: minmax(110px, 1.05fr) minmax(0, 2fr) auto;
  gap: 16px; align-items: center;
  padding: 5px 0; text-decoration: none; color: inherit;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.05);
}
.barlist-name .com { display: block; font: 600 13.5px/1.2 var(--serif); color: var(--ink); }
.barlist-name .sci { display: block; font-style: italic; font-size: 10.5px; color: var(--ink-soft); }
.barlist-track {
  height: 12px; background: var(--paper-2); border-radius: 999px; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}
.barlist-fill {
  /* Muted, not heavy black: bar length (not ink weight) shows dominance. Darkens
     to the accent on hover. */
  display: block; height: 100%; min-width: 3px;
  background: var(--ink-soft); border-radius: 999px;
  transition: background 140ms ease, width 320ms cubic-bezier(.2, .7, .3, 1);
}
.barlist-row:hover .barlist-fill { background: var(--accent); }
.barlist-ct {
  font: 11.5px var(--mono); color: var(--ink-soft);
  font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right;
}

/* Side lists — By Period, First Detections. */
.stats2-side .grp + .grp { margin-top: 26px; }
.stats2-side .rows { list-style: none; margin: 0; padding: 0; }
.stats2-side .row {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: baseline;
  padding: 4px 0; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.05);
  text-decoration: none; color: inherit;
  font: 12.5px/1.3 var(--serif);
}
a.row:hover { background: var(--paper-2); }
.stats2-side .gloss { font-style: italic; color: var(--ink-soft); font-size: 11px; margin-left: 6px; }
.stats2-side .ct { font: 11px var(--mono); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.stats2-side .yr { font: 10px var(--mono); color: var(--accent-2); letter-spacing: 0.04em; }

/* Bilingual description toggle — English ⇄ Gaeilge, shown only when the Irish
   Wikipedia article exists. */
.desc-langs { margin: 14px 0 0; }
.lang-toggle {
  display: inline-flex; gap: 2px; margin-bottom: 8px;
  padding: 2px; border-radius: 999px; background: var(--paper-2);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.lang-toggle button {
  border: 0; background: transparent; cursor: pointer;
  padding: 4px 12px; border-radius: 999px;
  font: 10px var(--mono); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-soft);
  transition: color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
.lang-toggle button[aria-current="true"] {
  color: var(--ink); background: var(--paper); box-shadow: var(--edge);
}
.lang-toggle button:hover { color: var(--ink); }
.desc-langs .desc { margin-top: 0; }

/* Atlas cards are links (they open the detail modal) — drop the anchor underline
   and inherit ink colour so they read as cards, not hyperlinks. */
a.bird-card { text-decoration: none; color: inherit; }

/* Atlas cards: flat to suit the bold linocut prints. The soft drop-shadow was
   tuned for the old watercolour art; under hard black keylines it reads as
   clutter, so drop it for a clean hairline that lifts only slightly on hover. */
.atlas-grid .bird-card {
  box-shadow: none;
  border: 1px solid rgba(0, 0, 0, 0.10);
}
.atlas-grid .bird-card:hover {
  box-shadow: none;
  border-color: rgba(0, 0, 0, 0.26);
  transform: translateY(-1px);
}

/* ── Account / alerts page (server-rendered /account) ───────────────────── */
/* A full-height scrolling document, but it shares the application layout with avian.css's
   fixed wall shell (body overflow:hidden). Undo that — scoped to the page — so it scrolls.
   It also carries the language switch, so its .lang-* spans need the same show/hide the
   SPA gets from editorial.css. */
body:has(.acct) { overflow-y: auto; overflow-x: hidden; height: auto; min-height: 100%; position: static; }
[data-lang="en"] .acct .lang-ga { display: none; }
[data-lang="ga"] .acct .lang-en { display: none; }
.acct {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  color: var(--ink);
}
.acct-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.acct-home {
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
}
/* Language switch — the same restrained EN | GA control as the site chrome. */
.acct-lang { display: inline-flex; align-items: center; }
.acct-lang-opt {
  background: transparent; border: 0; cursor: pointer; padding: 2px 8px;
  font: 11px var(--mono); letter-spacing: 0.1em; color: var(--ink-soft);
}
.acct-lang-opt + .acct-lang-opt { border-left: 1px solid var(--rule); }
.acct-lang-opt.is-on { color: var(--ink); }
.acct-h1 { font-size: 30px; margin: 14px 0 4px; }
.acct-lead { color: var(--ink-2); margin: 0 0 8px; }
.acct-sec { margin-top: 36px; }
/* Profile header — the signed-in identity, quiet and unchromed. */
.acct-me { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
.acct-avatar {
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  object-fit: cover; background: var(--paper-2);
}
.acct-avatar-initial {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-soft); font-size: 20px;
}
.acct-me-id { display: flex; flex-direction: column; }
.acct-me-name { font-size: 18px; color: var(--ink); }
.acct-me-email { font-size: 13px; color: var(--ink-soft); }
/* Admin (right of the profile row) + Sign out (page foot) — quiet mono links in the
   masthead-nav voice, not bordered buttons. */
.acct-me-admin { margin-left: auto; }
.acct-link {
  background: transparent; border: 0; padding: 0; cursor: pointer;
  font: 11px var(--mono); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-soft); text-decoration: none; transition: color 140ms ease;
}
.acct-link:hover { color: var(--ink); }
.acct-foot { margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--rule); }
.acct-foot form { margin: 0; }
.acct-h2 {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 8px;
}
.acct-rules, .acct-list { list-style: none; margin: 0; padding: 0; }
.acct-rule, .acct-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}
.acct-rule-label, .acct-name { flex: 1; }
.acct-ga { color: var(--ink-soft); font-style: italic; }
.acct-empty { color: var(--ink-soft); }
.acct-add { display: flex; gap: 8px; margin-top: 16px; }
.acct-select {
  flex: 1;
  padding: 9px 10px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
}
.acct-btn {
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
}
.acct-btn.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.acct-add-btn { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.acct-remove { color: var(--ink-soft); }

/* Delivery cadence — a quiet segmented control (Now / Digest / Off). */
/* Delivery is a single checkbox now: ticked = on (in the daily letter / immediate),
   unticked = off. A quiet inked box, in keeping with the ink-on-paper voice. */
.acct-cadence { display: inline-flex; }
.acct-check { display: inline-flex; align-items: center; cursor: pointer; }
.acct-check-input { position: absolute; opacity: 0; width: 0; height: 0; }
.acct-check-box {
  width: 20px; height: 20px; border: 1.5px solid var(--rule); border-radius: 4px;
  background: var(--paper); transition: background 140ms ease, border-color 140ms ease;
  position: relative;
}
.acct-check-input:checked + .acct-check-box { background: var(--ink); border-color: var(--ink); }
.acct-check-input:checked + .acct-check-box::after {
  content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px;
  border: solid var(--paper); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.acct-check-input:focus-visible + .acct-check-box { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Admin health panel — a plain instrument read-out in the same restrained voice. */
.adm-lead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--ink-2); margin: 0; }
.adm-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ink-soft); }
.adm-dot.fresh { background: var(--green); }
.adm-dot.quiet { background: var(--amber); }
.adm-dot.stale, .adm-dot.none { background: var(--ink-soft); }
.adm-abs { font: 12px var(--mono); color: var(--ink-soft); }
.adm-note { color: var(--ink-soft); font-size: 12px; font-style: italic; margin: 8px 0 0; }
.adm-stats { display: flex; flex-wrap: wrap; gap: 32px; margin-top: 18px; }
.adm-stat { display: flex; flex-direction: column; gap: 3px; }
.adm-fig { font: 20px var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.adm-lbl { font: 10px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.adm-warn { color: var(--amber); }
