/* ==========================================================================
   BrewNight · kit — the components every non-game page is assembled from:
   page frame, tabs, filter bar, deck posters, card tiles, deck lists, stats,
   empty and loading states. Tokens only (tokens.css); load after components.css.
   Naming: short nouns, no clash with the dashboard's older classes.
   Touch: --control-h is 44px on coarse pointers and phones. A control that is visually smaller (stepper, remove, chip ×)
   keeps its look and widens its hit area with a ::after on those devices.
   ========================================================================== */

/* ── Page frame ─────────────────────────────────────────────────────────── */
.page { max-width: var(--page-max); margin: 0 auto; padding: var(--sp-8) var(--page-pad) var(--sp-9); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4) var(--sp-6); flex-wrap: wrap; margin-bottom: var(--sp-5); }
.page-head h1 { font-size: var(--fs-40); line-height: var(--lh-tight); letter-spacing: var(--ls-display); overflow-wrap: anywhere; }
.page-head .eyebrow { margin-bottom: var(--sp-2); }
.page-head .sub { margin-top: var(--sp-2); }
.page-actions { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.crumb { display: inline-flex; align-items: center; gap: var(--sp-1h); min-height: var(--control-h); color: var(--muted); font-size: var(--fs-12); text-decoration: none; margin-bottom: var(--sp-2); }
.crumb:hover { color: var(--text); }
.crumb .icon { width: 12px; height: 12px; }
.skip-link { position: fixed; top: -100px; left: var(--sp-4); padding: var(--sp-3); background: var(--action-bg); color: var(--ink); z-index: var(--z-modal); border-radius: var(--r-2); }
.skip-link:focus { top: var(--sp-3); }
.sub { color: var(--muted); font-size: var(--fs-13); }
.sub a { color: var(--muted); text-decoration-color: var(--line2); text-underline-offset: 3px; }
.sub a:hover { color: var(--gold); }
.dot { color: var(--dim); padding: 0 var(--sp-1h); }
.page .credits { padding-inline: 0; }
.tools-row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-2); }
.tools-row .fbar { position: static; flex: 1 1 320px; max-width: 560px; margin: 0; padding: 0; background: none; backdrop-filter: none; }
.tools-row .page-actions { margin: 0; }

/* ── Tabs: an underlined strip; the current one carries the accent underline ── */
.seg { display: flex; gap: var(--sp-5); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg a, .seg button { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: var(--control-h); background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; margin-bottom: -1px; padding: var(--sp-2h) 1px; color: var(--muted); font-size: var(--fs-14); font-weight: var(--fw-semibold); text-decoration: none; white-space: nowrap; box-shadow: none; }
.seg a:hover, .seg button:hover { background: none; color: var(--text); }
.seg [aria-current=page], .seg [aria-pressed=true], .seg .on { color: var(--text); border-bottom-color: var(--gold); }
.seg .count { font-size: var(--fs-12); color: var(--dim); font-variant-numeric: tabular-nums; }

/* ── Filter bar ─────────────────────────────────────────────────────────── */
.fbar { position: sticky; top: 0; z-index: var(--z-chrome); display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-4); margin: 0 calc(var(--page-pad) * -1); padding: var(--sp-3) var(--page-pad); background: var(--chrome); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color var(--t-2); }
.fbar.stuck { border-bottom-color: var(--line); }
.search-field { position: relative; flex: 1 1 280px; min-width: 200px; max-width: 560px; display: block; }
.search-field input { height: var(--tap); padding: 0 var(--sp-6) 0 40px; border-radius: var(--r-2); background: var(--panel); margin: 0; }
.search-field input[type=search]::-webkit-search-cancel-button { display: none; }
.search-field .icon { position: absolute; left: 15px; top: 50%; translate: 0 -50%; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search-field kbd { position: absolute; right: var(--sp-3); top: 50%; translate: 0 -50%; color: var(--muted); }
.fbar-group { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; max-width: 100%; }
.fbar-label { color: var(--muted); font-size: var(--fs-12); letter-spacing: var(--ls-caps-sm); text-transform: uppercase; }
.fbar select { width: auto; max-width: 100%; height: var(--control-h); padding: 0 var(--sp-3); margin: 0; background: var(--panel); }
.pipbtn { width: var(--control-h); height: var(--control-h); padding: 0; border: 2px solid transparent; border-radius: var(--r-round); display: inline-grid; place-items: center; background: var(--pip-C); color: var(--pip-ink); font-size: var(--fs-12); font-weight: var(--fw-bold); box-shadow: none; transition: border-color var(--t-2), box-shadow var(--t-2); }
.pipbtn.W { background: var(--pip-W); } .pipbtn.U { background: var(--pip-U); } .pipbtn.B { background: var(--pip-B); } .pipbtn.R { background: var(--pip-R); } .pipbtn.G { background: var(--pip-G); }
.pipbtn .sym-face { display: block; width: 100%; height: 100%; border-radius: var(--r-round); }
.pipbtn:has(.sym-face) { background: none; }
.pipbtn:hover { border-color: var(--edge); }
.pipbtn[aria-pressed=true] { opacity: 1; border-color: var(--text); box-shadow: 0 0 0 3px var(--gold-a30); }
.toggle { display: inline-flex; align-items: center; gap: var(--sp-2); height: var(--control-h); padding: 0 var(--sp-3); border-radius: var(--r-pill); background: transparent; border: 1px solid var(--line2); color: var(--muted); font-size: var(--fs-12); cursor: pointer; white-space: nowrap; transition: color var(--t-2), border-color var(--t-2), background var(--t-2); }
.toggle:hover { background: var(--panel2); color: var(--text); }
.toggle[aria-pressed=true] { color: var(--text); border-color: var(--gold); background: var(--gold-a08); }
.toggle .icon { width: 13px; height: 13px; }
.fbar-end { margin-left: auto; display: flex; align-items: center; gap: var(--sp-3); }
/* active-filter chips and result summary */
.summary { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); min-height: 34px; margin: var(--sp-3) 0 var(--sp-5); color: var(--muted); font-size: var(--fs-13); }
.summary strong { color: var(--text); font-weight: var(--fw-semibold); }
.chip.x { position: relative; cursor: pointer; padding-right: var(--sp-2); }
.chip.x .icon { width: 10px; height: 10px; }
.chip.x:hover { border-color: var(--line3); color: var(--text); background: var(--panel2); }
.linkish { background: none; border: 0; padding: 0; color: var(--gold); font-size: inherit; text-decoration: underline; text-decoration-color: var(--gold-a30); text-underline-offset: 3px; }
.linkish:hover { background: none; text-decoration-color: var(--gold); }

/* popover menu: <details class="menu"><summary>…</summary><div class="menu-panel">…</div></details> */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; z-index: var(--z-panel); top: calc(100% + var(--sp-2)); right: 0; min-width: 260px; display: grid; gap: var(--sp-3); padding: var(--sp-4); background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r-4); box-shadow: var(--sh-3); }
.menu.left .menu-panel { left: 0; right: auto; }
.menu-panel label { display: grid; gap: var(--sp-1h); }
.menu-panel label input, .menu-panel label select { margin: 0; }
.menu-item { display: flex; align-items: center; gap: var(--sp-2h); width: 100%; min-height: var(--control-h); background: none; border: 0; border-radius: var(--r-2); padding: var(--sp-2) var(--sp-3); color: var(--text); font-size: var(--fs-13); text-align: left; text-decoration: none; }
.menu-item:hover { background: var(--panel2); }
.menu-item.danger { color: var(--danger); }
.menu-panel.menu-list:is([popover], [data-anchored]) { position: fixed; inset: auto; margin: 0; width: min(280px, calc(100vw - 16px)); min-width: 0; overflow-y: auto; overscroll-behavior: contain; }
.menu-panel.menu-list[popover]:not(:popover-open) { display: none; }
.menu-list { display: grid; gap: 1px; margin: calc(var(--sp-2) * -1); }

/* ── Deck poster: identity stripe, art stage, title block, actions ──────── */
.posters { display: grid; grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); gap: var(--sp-6); }
.poster { position: relative; display: flex; flex-direction: column; min-width: 0; container-type: inline-size; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; transition: border-color var(--t-2), box-shadow var(--t-3); }
.poster:hover, .poster:focus-within { border-color: var(--line2); box-shadow: var(--sh-2); }
.stripe { display: flex; height: 4px; }
.stripe i { flex: 1; background: var(--pip-C); }
.stripe .W { background: var(--pip-W); } .stripe .U { background: var(--pip-U); } .stripe .B { background: var(--pip-B); } .stripe .R { background: var(--pip-R); } .stripe .G { background: var(--pip-G); }
/* The art runs edge to edge and carries its own credit; the text below is a title, a commander and one line of facts, then the actions. */
.stage { position: relative; aspect-ratio: 3 / 2; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--panel2); border-bottom: 1px solid var(--line); }
.stage > img.crop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 28%; transition: transform var(--t-4) var(--ease); }
.poster:hover .stage > img.crop { transform: scale(1.03); }
.stage .face { position: relative; height: 86%; aspect-ratio: var(--card-aspect); box-shadow: var(--sh-3); }
.stage .face + .face { margin-left: -16%; }
.poster-body { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; flex: 1; gap: var(--sp-1); padding: var(--sp-3) var(--sp-4); }   /* minmax(0): a long fact shrinks instead of widening the tile */
.poster-title { font-size: var(--fs-18); font-weight: var(--fw-bold); line-height: var(--lh-snug); overflow-wrap: anywhere; }
.poster-title a { color: var(--text); text-decoration: none; }
.poster-title a::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.poster-title a:focus-visible { outline: none; }
.poster:has(.poster-title a:focus-visible) { outline: var(--focus); outline-offset: var(--focus-offset); }
.poster-sub { color: var(--text2); font-size: var(--fs-13); line-height: var(--lh-snug); }
.poster-art-credit { color: var(--dim); font-size: var(--fs-12); line-height: var(--lh-snug); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The colours appear once. On a wide tile (260px and up) with one or two colours they end the name's line, the way a card's mana cost ends its title bar;
   everywhere else they lead the facts line, so a name keeps the whole width of its line. Each tile asks its own width, not the screen's. */
.poster-head { display: flex; align-items: flex-start; column-gap: var(--sp-2); }
.poster-head .poster-title { flex: 1 1 auto; min-width: 0; }
.poster .pc { flex: none; }
.poster-head .pc { display: none; margin-top: .32em; }
.poster-meta .pc { display: inline-flex; }
/* One line of facts. Each fact stays whole; the one marked .lead (the product name) is what gives way, so a date is never orphaned onto a line of its own. */
.poster-meta { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--sp-1h); margin: 0; padding: 0; border: 0; color: var(--muted); font-size: var(--fs-12); line-height: var(--lh-snug); }
.poster-meta a { position: relative; z-index: 2; color: var(--muted); text-decoration-color: var(--line2); }
.poster-meta a:hover { color: var(--gold); }
.poster-meta .fact { max-width: 100%; white-space: nowrap; }
.poster-meta .fact:not(:last-child)::after { content: ' ·'; }
.poster-meta.one-line { flex-wrap: nowrap; }
.poster-meta.one-line > .lead { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.poster-meta.one-line > .fact:not(:last-child)::after { content: none; }
.poster-meta.one-line > .fact + .fact::before { content: '·'; margin-right: var(--sp-1h); }
.poster-meta .pip { height: 15px; min-width: 15px; }
/* A wide tile with one or two colours puts them at the end of the name's line (there is room, and it is where a card keeps its cost). */
@container (min-width: 260px) { .poster:not(.pc-meta) .poster-head .pc { display: inline-flex; } .poster:not(.pc-meta) .poster-meta .pc { display: none; } }
/* No room for the product name beside the colours: it stays for screen readers and the tooltip, and the date keeps its place. */
@container (max-width: 199px) { .poster-meta.one-line > .lead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } .poster-meta.one-line > .fact + .fact::before { content: none; } }
@container (max-width: 259px) { .poster.pc-meta .poster-meta.one-line > .lead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } .poster.pc-meta .poster-meta.one-line > .fact + .fact::before { content: none; } }
.poster-acts { position: relative; z-index: 2; display: flex; gap: var(--sp-2); padding: 0 var(--sp-4) var(--sp-4); }
.poster-acts button, .poster-acts .btn { flex: 1; z-index: 2; min-height: var(--control-h); display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-1h); padding: var(--sp-2) var(--sp-3); font-size: var(--fs-12); background: var(--panel2); }
.poster-acts button.primary, .poster-acts .primary { background: var(--action-bg); border-color: var(--edge); color: var(--ink); }

/* ── Rail: a horizontal strip of posters ────────────────────────────────── */
.rail-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-4); margin: var(--sp-8) 0 var(--sp-4); }
.rail-head h2 { font-size: var(--fs-24); }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 248px); align-items: start; gap: var(--sp-5); overflow-x: auto; padding: var(--sp-2) var(--page-pad) var(--sp-5); margin: 0 calc(var(--page-pad) * -1); scroll-snap-type: x proximity; scroll-padding-inline: var(--page-pad); }   /* a strip of tiles is read one at a time: each is as tall as its own words, never as tall as the longest tile somewhere off-screen */
.rail > * { scroll-snap-align: start; }
@media (min-width: 1700px) { .rail { padding-inline: 0; margin-inline: 0; } }

/* ── Card tile grid ─────────────────────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: var(--sp-6) var(--sp-5); }
.cards.compact { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: var(--sp-4) var(--sp-3); }
.ctile { position: relative; display: grid; gap: var(--sp-2); min-width: 0; align-content: start; }
.ctile-open { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; border-radius: var(--card-r); transition: transform var(--t-3) var(--ease), box-shadow var(--t-3); }
.ctile-open:hover { background: none; transform: translateY(-2px); box-shadow: var(--sh-3); }
.ctile-open:focus-visible { outline: var(--focus); outline-offset: var(--focus-offset); }
.ctile-cap { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); min-width: 0; font-size: var(--fs-12); line-height: var(--lh-snug); }
.ctile-name { overflow-wrap: anywhere; color: var(--text2); flex: 1 1 7ch; min-width: 0; }
.ctile-cap .mana { flex-shrink: 0; flex-wrap: wrap; max-width: 100%; padding-top: 1px; }
.ctile-foot { display: flex; align-items: center; gap: var(--sp-2); }
.ctile-text { display: flex; flex-wrap: wrap; align-items: flex-start; column-gap: var(--sp-2); row-gap: var(--sp-0); min-width: 0; flex: 1; }   /* name and cost share a line, like a card's title bar; the cost drops under a long name */
.ctile-meta { display: flex; align-items: center; flex: none; flex-wrap: wrap; max-width: 100%; gap: var(--sp-1h) var(--sp-2); }
.ctile-meta:empty { display: none; }
.ctile-add { flex: 0 0 auto; width: var(--control-h); height: var(--control-h); padding: 0; display: grid; place-items: center; border-radius: var(--r-round); background: var(--action-bg); border-color: var(--edge); color: var(--ink); }
.ctile-add:hover { background: var(--action-hover); border-color: var(--line3); }
.ctile-add[data-add] { background: transparent; border-color: transparent; color: var(--muted); }
.ctile-add[data-add]:is(:hover,:focus-visible) { background: var(--panel2); border-color: var(--line2); color: var(--text); }
.ctile-add .icon { width: 16px; height: 16px; }
.ctile.in-deck .ctile-open { box-shadow: var(--ring); }
.ctile .qty-tag { display: inline-flex; align-items: center; padding: 3px var(--sp-2h); border-radius: var(--r-pill); background: var(--panel3); color: var(--text2); font-size: var(--fs-12); font-weight: var(--fw-bold); white-space: nowrap; }
.load-more { display: flex; justify-content: center; padding: var(--sp-7) 0 var(--sp-2); }

/* ── Deck list (grouped by type) ────────────────────────────────────────── */
.dl { column-width: 290px; column-gap: var(--sp-7); }
.dl-group { break-inside: avoid; margin-bottom: var(--sp-6); }
.dl-group h3 { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: var(--sp-2); margin-bottom: var(--sp-1h); border-bottom: 1px solid var(--line); color: var(--muted); font-size: var(--fs-12); font-weight: var(--fw-semibold); letter-spacing: var(--ls-caps-sm); text-transform: uppercase; }
.dl-group h3 span { color: var(--dim); font-variant-numeric: tabular-nums; }
.dl-row { display: flex; align-items: center; gap: var(--sp-2h); min-height: 30px; font-size: var(--fs-14); border-radius: var(--r-1); }
.dl-row:hover { background: var(--panel2); }
.dl-qty { flex: 0 0 22px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; font-size: var(--fs-13); }
.dl-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: none; border: 0; padding: var(--sp-1) 0; color: var(--text); text-align: left; border-radius: 0; box-shadow: none; }
.dl-name:hover { background: none; color: var(--gold); text-decoration: underline; }
.dl-row .mana { flex-shrink: 0; }
.dl-row .pip { height: 15px; min-width: 15px; font-size: var(--fs-10); }
.dl-note { color: var(--dim); font-size: var(--fs-12); }
.dl.edit { column-width: 420px; }
.stepper { display: inline-flex; align-items: center; flex-shrink: 0; border: 1px solid var(--line2); border-radius: var(--r-pill); }
.stepper button { position: relative; width: 26px; height: 26px; min-height: 0; padding: 0; display: grid; place-items: center; border: 0; background: none; border-radius: var(--r-round); color: var(--muted); box-shadow: none; }
.stepper button:hover { background: var(--panel3); color: var(--text); }
.stepper output { min-width: 22px; text-align: center; font-size: var(--fs-13); font-variant-numeric: tabular-nums; }
.stepper .icon { width: 12px; height: 12px; }
.stepper input { width: 40px; min-width: 0; min-height: 0; margin: 0; padding: 0; border: 0; background: none; text-align: center; font-size: var(--fs-14); font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { appearance: none; margin: 0; }
.stepper input:focus { background: var(--panel2); outline: none; border-radius: var(--r-1); }
.stepper.lg button { width: 40px; height: 40px; }
.stepper.lg input { width: 48px; height: 40px; font-size: var(--fs-16); }
.stepper.lg .icon { width: 14px; height: 14px; }
.row-x { position: relative; opacity: 0; width: 26px; height: 26px; min-height: 0; padding: 0; display: grid; place-items: center; background: none; border: 0; color: var(--muted); border-radius: var(--r-round); box-shadow: none; }
.dl-row:hover .row-x, .dl-row:focus-within .row-x { opacity: 1; }
.row-x:hover { background: var(--danger-a08); color: var(--danger); }
@media (hover: none) { .row-x { opacity: 1; } }
/* Small on screen, 44px to a finger: the control keeps its size and a transparent pseudo-element extends what a tap reaches. */
@media (pointer: coarse) {
  .stepper button::after, .row-x::after, .chip.x::after { content: ''; position: absolute; inset: 50% auto auto 50%; width: var(--tap); height: var(--tap); translate: -50% -50%; }
  .chip.x::after { width: 100%; min-width: var(--tap); }
  .dl-row { min-height: var(--tap); }
}

/* gallery view of a deck: grouped images */
.dg-group + .dg-group { margin-top: var(--sp-7); }
.dg-group h3 { margin-bottom: var(--sp-4); color: var(--muted); font-size: var(--fs-12); font-weight: var(--fw-semibold); letter-spacing: var(--ls-caps-sm); text-transform: uppercase; }
.dg-group h3 span { color: var(--dim); margin-left: var(--sp-2); }

/* ── Statistics ─────────────────────────────────────────────────────────── */
.stats { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-5) var(--sp-7); }
.stat { display: grid; gap: var(--sp-1); }
.stat strong { font: var(--fw-heavy) var(--fs-28)/1 var(--font-display); font-variant-numeric: lining-nums; }
.stat span { color: var(--muted); font-size: var(--fs-12); letter-spacing: var(--ls-caps-sm); text-transform: uppercase; }
.curve { display: flex; align-items: flex-end; gap: var(--sp-1h); height: 64px; }
.curve > div { display: grid; grid-template-rows: 1fr auto; justify-items: center; gap: var(--sp-1); width: 26px; height: 100%; font-size: var(--fs-12); color: var(--muted); }
.curve i { align-self: end; width: 100%; height: calc(var(--h, 0) * 1%); min-height: 2px; border-radius: var(--r-1) var(--r-1) 0 0; background: var(--gold-dim); transition: height var(--t-4) var(--ease); }
.curve > div:hover i { background: var(--gold); }
.meter { display: flex; height: 6px; width: 140px; border-radius: var(--r-pill); overflow: hidden; background: var(--panel3); }
.meter i { flex: var(--n, 1); background: var(--pip-C); }
.meter .W { background: var(--pip-W); } .meter .U { background: var(--pip-U); } .meter .B { background: var(--pip-B); } .meter .R { background: var(--pip-R); } .meter .G { background: var(--pip-G); }
.legal { display: inline-flex; align-items: center; gap: var(--sp-1h); font-size: var(--fs-12); color: var(--green2); }
.legal.bad { color: var(--danger); }
.legal.maybe { color: var(--muted); }
.legal .icon { width: 13px; height: 13px; }

/* ── Notes, empty and loading states ────────────────────────────────────── */
.nada { display: grid; justify-items: center; gap: var(--sp-2); text-align: center; padding: var(--sp-9) var(--sp-5); color: var(--muted); grid-column: 1 / -1; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-3); }
.nada h2 { color: var(--text); font-size: var(--fs-24); }
.nada p { max-width: 460px; line-height: var(--lh-body); }
.nada .page-actions { justify-content: center; margin-top: var(--sp-3); }
.skel { background: linear-gradient(100deg, var(--panel) 30%, var(--panel2) 50%, var(--panel) 70%); background-size: 220% 100%; animation: skel 1.5s linear infinite; border-radius: var(--r-3); }
@keyframes skel { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.skel.poster-skel { aspect-ratio: 236 / 300; }
.skel.card-skel { aspect-ratio: var(--card-aspect); }
.notice { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-3); background: var(--panel2); border: 1px solid var(--line2); color: var(--text); font-size: var(--fs-13); line-height: var(--lh-snug); }
.notice.warn { background: var(--warn-a08); border-color: var(--warn-a30); color: var(--warn); }
.notice.bad { background: var(--danger-a08); border-color: var(--danger-a30); color: var(--danger); }
.notice.ok { background: var(--green-a08); border-color: var(--green-a30); color: var(--green2); }

/* ── Add menu (the + on a card) ─────────────────────────────────────────── */
.add-menu { position: fixed; z-index: var(--z-panel); min-width: 220px; max-width: min(320px, calc(100vw - 16px)); display: grid; gap: 1px; padding: var(--sp-2); background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r-4); box-shadow: var(--sh-3); }
.add-menu-head { padding: var(--sp-1h) var(--sp-3); color: var(--muted); font-size: var(--fs-12); letter-spacing: var(--ls-caps-sm); text-transform: uppercase; }
.add-menu button { display: flex; align-items: center; gap: var(--sp-2h); width: 100%; min-height: var(--control-h); background: none; border: 0; border-radius: var(--r-2); padding: var(--sp-2) var(--sp-3); color: var(--text); font-size: var(--fs-13); text-align: left; box-shadow: none; }
.add-menu button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.add-menu button:hover, .add-menu button:focus-visible { background: var(--panel3); }
.stage-empty { display: grid; place-items: center; width: 64px; height: 64px; border: 1px solid var(--line2); border-radius: var(--r-round); color: var(--muted); }

/* ── Segmented pill: a few exclusive options ────────────────────────────── */
.seg-pill { display: inline-flex; border: 1px solid var(--line2); border-radius: var(--r-pill); padding: 2px; }
.seg-pill button { display: inline-flex; align-items: center; gap: var(--sp-1h); min-height: var(--control-h); border: 0; background: none; border-radius: var(--r-pill); padding: var(--sp-1h) var(--sp-3); color: var(--muted); font-size: var(--fs-12); box-shadow: none; }
.seg-pill button:hover { background: none; color: var(--text); }
.seg-pill button[aria-pressed=true] { background: var(--panel3); color: var(--text); font-weight: var(--fw-semibold); box-shadow: inset 0 0 0 1px var(--edge); }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 850px) {
  .fbar { gap: var(--sp-2h) var(--sp-3); }
  .search-field { flex-basis: 100%; max-width: none; }
  .fbar-end { margin-left: 0; width: 100%; }
  .fbar-end .fbar-group, .fbar > .fbar-group:has(select) { flex: 1; }
  .fbar-group select { width: 100%; }
}
@media (max-width: 560px) {
  :root { --page-pad: max(16px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)); }
  .page { padding-top: var(--sp-6); }
  .page-head h1 { font-size: var(--fs-32); }
  .posters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4) var(--sp-3); }
  .poster-body { padding: var(--sp-2h) var(--sp-3) var(--sp-3); }
  .poster-title { font-size: var(--fs-16); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4) var(--sp-3); }
  .rail { grid-auto-columns: 62%; }
  .dl, .dl.edit { column-width: auto; }
  .stats { gap: var(--sp-4) var(--sp-5); }
  .seg { gap: var(--sp-1) var(--sp-4); flex-wrap: wrap; overflow: visible; }
  .seg a, .seg button { font-size: var(--fs-13); }
}
