:root { color-scheme: light dark; --radius:10px; --badge-fg:#fff; --badge-shadow:#000; }
/* Aurum palette. Tokens are named by role; each block below only swaps values. */
:root { --bg:#f4eee0; --surface:#fffdf7; --row:#faf5e8; --chip:#ebe3cf; --line:#cfc4a6; --fg:#1a160d; --fg-secondary:#352f20; --muted:#4c4531; --accent:#5d3f05; --control-border:#876a24; --focus:#5d3f05; --inverse-bg:#1a160d; --inverse-fg:#f4eee0; --state-owned:#094f2a; --state-lost:#831108; --state-accessible:#0f4388; --state-later:#5d3f05; --state-muted:#4c4531; --met-fg:#0b5f33; --met-bg:#eaf6ee; --unmet-fg:#8c1208; --unmet-bg:#fbe2dd; --unmet-border:#8c1208; --tag-fg:#5a3b00; --tag-bg:#f6dfa3; --tag-border:#997626; }
@media (prefers-color-scheme: dark) {
  :root { --bg:#0e0d0b; --surface:#18160f; --row:#121109; --chip:#24211a; --line:#3d3727; --fg:#f3ecd9; --fg-secondary:#d9d0b8; --muted:#d8d2c4; --accent:#eecc7d; --control-border:#9b8647; --focus:#f6d27a; --inverse-bg:#f3ecd9; --inverse-fg:#0e0d0b; --state-owned:#87e3ad; --state-lost:#ffc1ba; --state-accessible:#b3d2ff; --state-later:#eecc7d; --state-muted:#d8d2c4; --met-fg:#8ce9b4; --met-bg:#0f2d1d; --unmet-fg:#1b0805; --unmet-bg:#ffbdb3; --unmet-border:#ffbdb3; --tag-fg:#f3cf85; --tag-bg:#3a2b0e; --tag-border:#8f7330; }
}
@media (prefers-contrast: more) {
  :root { --fg:#000; --fg-secondary:#000; --muted:#000; --control-border:#806522; --line:#806522; }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root { --fg:#fff; --fg-secondary:#fff; --muted:#fff; --control-border:#9b8647; --line:#9b8647; }
}
/* Lowest tones that still reach 4.5:1 and APCA Lc 60 on the backgrounds they sit on */
@media (prefers-contrast: less) {
  :root { --fg:#686459; --fg-secondary:#6a6456; --muted:#6c6552; --accent:#7b6231; --state-owned:#3a7050; --state-lost:#a04a40; --state-accessible:#3f679a; --state-later:#7b6231; --met-fg:#357c57; --unmet-fg:#aa4a42; --tag-fg:#7c5f24; --inverse-fg:#b9b4a7; }
}
@media (prefers-contrast: less) and (prefers-color-scheme: dark) {
  :root { --fg:#beb9aa; --fg-secondary:#bdb5a0; --muted:#beb8ac; --accent:#d1b36e; --state-owned:#77c798; --state-lost:#e0aaa3; --state-accessible:#9eb8df; --state-later:#d1b36e; --met-fg:#77c99a; --unmet-fg:#66443e; --tag-fg:#d7b673; --inverse-fg:#6e6b62; }
}
@media (forced-colors: active) {
  :root { --bg:Canvas; --surface:Canvas; --row:Canvas; --chip:Canvas; --fg:CanvasText; --fg-secondary:CanvasText; --muted:CanvasText; --state-owned:CanvasText; --state-lost:CanvasText; --state-accessible:CanvasText; --state-later:CanvasText; --state-muted:CanvasText; --met-fg:CanvasText; --met-bg:Canvas; --unmet-fg:CanvasText; --unmet-bg:Canvas; --tag-fg:CanvasText; --tag-bg:Canvas; --inverse-bg:Canvas; --inverse-fg:CanvasText; --accent:LinkText; --line:ButtonBorder; --control-border:ButtonBorder; --unmet-border:ButtonBorder; --tag-border:ButtonBorder; --focus:Highlight; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* component display rules would otherwise override the hidden attribute */
@font-face { font-family:"Cinzel"; font-weight:600; font-display:swap; src:url(resources/fonts/cinzel-600.woff2) format("woff2"); }
@font-face { font-family:"Lex Text"; font-weight:400; font-display:swap; src:url(resources/fonts/lex-text-400.woff2) format("woff2"); }
@font-face { font-family:"Lex Text"; font-weight:500; font-display:swap; src:url(resources/fonts/lex-text-500.woff2) format("woff2"); }
@font-face { font-family:"Lex Text"; font-weight:600; font-display:swap; src:url(resources/fonts/lex-text-600.woff2) format("woff2"); }
@font-face { font-family:"Lex Mono"; font-weight:400; font-display:swap; src:url(resources/fonts/lex-mono-400.woff2) format("woff2"); }
/* Fallback faces: a local font scaled to the web font's metrics, so the swap does not move text (values: CONTRIBUTING.md, Fonts) */
@font-face { font-family:"Cinzel Fallback"; font-weight:600; src:local("Palatino Linotype Bold"), local("Palatino-Bold"), local("URW Palladio L Bold"), local("P052-Bold"); size-adjust:99.73%; ascent-override:97.87%; descent-override:37.3%; line-gap-override:0%; }
@font-face { font-family:"Lex Text Fallback"; font-weight:400; src:local("Arial"), local("Liberation Sans"); size-adjust:91.87%; ascent-override:123.54%; descent-override:47.78%; line-gap-override:0%; }
@font-face { font-family:"Lex Text Fallback"; font-weight:500; src:local("Arial"), local("Liberation Sans"); size-adjust:93.39%; ascent-override:121.53%; descent-override:47.01%; line-gap-override:0%; }
@font-face { font-family:"Lex Text Fallback"; font-weight:600; src:local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold"); size-adjust:86.89%; ascent-override:130.62%; descent-override:50.52%; line-gap-override:0%; }
@font-face { font-family:"Lex Mono Fallback"; font-weight:400; src:local("Courier New"), local("CourierNewPSMT"), local("Liberation Mono"); size-adjust:99.98%; ascent-override:102.52%; descent-override:27.5%; line-gap-override:0%; }
:root { --font-text:"Lex Text", "Lex Text Fallback", system-ui, sans-serif; --font-mono:"Lex Mono", "Lex Mono Fallback", ui-monospace, monospace; --font-wordmark:"Cinzel", "Cinzel Fallback", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", P052, Georgia, serif; }
body { margin:0; background:var(--bg); color:var(--fg); font:15px/1.5 var(--font-text); }
button, input, select { font-family:inherit; }
.layout { max-width: 1280px; height: 100vh; height: 100dvh; margin: 0 auto; padding: 0 32px; display: flex; flex-direction: column; gap: 20px; }
.site-header { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; padding: 24px 0 16px; border-bottom: 1px solid var(--line); }
.brand { flex: 1 1 0; min-width: min-content; } /* shrinks to its longest unbreakable line before the builds grid wraps below it */
.wordmark { margin: 0 0 4px; font: 600 28px/1.2 var(--font-wordmark); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; color: var(--accent); }
.disclaimer { max-width: 640px; margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.disclaimer > span { display: block; }
.disclaimer .clause { white-space: nowrap; } /* a clause never splits, so a narrow column wraps between them */
.builds-grid { --avatar-size: 36px; --target-size: 44px; flex: none; display: grid; grid-template-columns: repeat(8, var(--target-size)); gap: 0; margin: 0; padding: 0; list-style: none; }
.build-link { display: grid; place-items: center; width: var(--target-size); height: var(--target-size); border-radius: 50%; } /* the avatar stays small inside a 44px target */
.builds-grid .avatar { display: block; width: var(--avatar-size); height: var(--avatar-size); margin: 0; }
@media (max-width: 860px) { .builds-grid { --avatar-size: 34px; } .brand { text-wrap: balance; } .disclaimer .clause { white-space: normal; } } /* the brand text wraps so the builds grid stays beside it */
.open-all-cell { grid-column: span 3; display: flex; }
.open-all { flex: 1; min-height: 44px; }
@media (pointer: coarse) { .open-all-cell { display: none; } } /* touch browsers open one tab per tap */
#controls { flex: none; }
#controls:focus { outline: none; }
.content { flex: 1; min-height: 0; display: flex; gap: 32px; }
.sidebar { flex: 0 0 320px; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; display: flex; flex-direction: column; gap: 24px; padding: 8px 8px 32px; margin: -4px -8px 0; } /* 8px of room for a slot's focus ring; the 304px left after the margins fits five portraits or six slot buttons per row beside a scrollbar */
main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
#results { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 4px 6px 32px; margin: 0 -6px; }
#summaryAnchor { display: none; }
@media (min-width: 769px) { .phone-only { display: none; } }
.filter-group, .doll-section { display: flex; flex-direction: column; gap: 8px; }
.filter-heading, .doll h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.filter-heading h2 { margin: 0; font: inherit; }
.filter-value { color: var(--accent); text-transform: none; letter-spacing: 0; }
.portraits { display: flex; flex-wrap: wrap; gap: 6px; }
.portrait { width: 52px; height: 52px; padding: 0; overflow: hidden; border: 0; border-radius: 50%; background: var(--chip); color: var(--fg); font: 600 13px var(--font-text); cursor: pointer; }
.portrait img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.portrait[aria-pressed=true] { box-shadow: 0 0 0 2px var(--fg); } /* the focus colour is the focus ring; with it, 4px in all: a neighbour's ring stays inside the 6px gap */
.portrait:focus-visible { outline-offset: 2px; }
@media (forced-colors: active) {
  .portrait[aria-pressed=true] { outline: 3px solid Highlight; }
  .toggle[aria-pressed=true] { outline: 2px solid Highlight; }
  .state-glyph { forced-color-adjust: none; } /* the glyph is a masked background, which forced colours would otherwise repaint as Canvas */
  .sidebar select:disabled, .toggle:disabled, #resetAll:disabled { color: GrayText; }
  #toast:not(.visually-hidden) { border: 1px solid ButtonBorder; }
}
.doll { display: flex; flex-direction: column; gap: 16px; }
.doll-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.slot { position: relative; width: 44px; height: 44px; padding: 0; border: 0; background: url(resources/slots/frame.webp) center / 100% 100% no-repeat; cursor: pointer; }
.slot .icon { position: absolute; inset: 4px; width: 36px; height: 36px; filter: brightness(1.7) saturate(1.2); pointer-events: none; }
.slot .badge { position: absolute; right: 3px; bottom: 1px; font: 700 11px/1 var(--font-text); color: var(--badge-fg); text-shadow: 0 0 3px var(--badge-shadow); }
.slot[aria-pressed=true]::after { content: ""; position: absolute; inset: -4px; background: url(resources/slots/frame-selected.webp) center / 100% 100% no-repeat; pointer-events: none; }
.slot:focus-visible { z-index: 1; outline-offset: 5px; box-shadow: 0 0 0 5px var(--bg); } /* clears the selected frame, which extends 4px */
.slot:disabled, .portrait:disabled { opacity: .3; cursor: default; }
.sidebar select:disabled, .toggle:disabled, #resetAll:disabled { opacity: .45; cursor: default; }
.doll-grid:focus-within { outline: 1px solid var(--muted); outline-offset: 6px; border-radius: 2px; }
.sidebar select, .toggle { min-height: 44px; padding: 0 12px; font: inherit; font-size: 14px; border: 1px solid var(--control-border); border-radius: 6px; background: var(--surface); color: var(--fg); }
.filter-group select { width: 100%; }
.toggle { align-self: flex-start; white-space: nowrap; cursor: pointer; }
.toggle[aria-pressed=true] { background: var(--inverse-bg); color: var(--inverse-fg); border-color: var(--inverse-bg); } /* inverted, so the state does not rely on hue */
.search-row { display:flex; gap:12px; align-items:stretch; }
#resetAll { display:flex; align-items:center; gap:6px; white-space:nowrap; }
#resetAll img { filter:invert(1); } /* the sprite is white; flip it on the light theme */
@media (prefers-color-scheme: dark) { #resetAll img { filter:none; } }
input[type=search] { flex:1; min-width:0; min-height:48px; padding:10px 14px; font-size:16px; border:1px solid var(--control-border); border-radius:8px; background:var(--surface); color:var(--fg); }
.visually-hidden, .item-sources .item-state-label, .skip-link:not(:focus) { position:absolute; width:1px; height:1px; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.skip-link { position:fixed; z-index:3; top:8px; left:8px; padding:12px 16px; border-radius:8px; background:var(--inverse-bg); color:var(--inverse-fg); font-weight:600; text-decoration:none; } /* shown only while focused, above the sticky summary */
:focus-visible { outline:2px solid var(--focus); outline-offset:2px; }
::placeholder { color:var(--muted); opacity:1; }
.avatar { width:26px; height:26px; border-radius:50%; object-fit:cover; object-position:top; vertical-align:middle; margin-right:6px; background:var(--chip); }
.toolbar { display:flex; flex: none; flex-wrap:wrap; gap:4px 16px; align-items:center; justify-content:space-between; margin:6px 0 14px; }
#count { color:var(--muted); font-size:14px; }
#summaryText { flex:1; min-width:0; display:flex; gap:8px; align-items:center; overflow:hidden; color:var(--muted); }
.summary-token { flex:none; padding:4px 10px; border:1px solid var(--line); border-radius:999px; background:var(--chip); color:var(--fg); white-space:nowrap; }
.summary-search { flex:0 1 auto; min-width:0; max-width:40%; overflow:hidden; text-overflow:ellipsis; }
.summary-avatar { flex:none; display:flex; }
.summary-avatar .avatar { width:28px; height:28px; margin:0; }
.summary-slot { flex:none; width:32px; height:32px; padding:4px; background:url(resources/slots/frame.webp) center / 100% 100% no-repeat; }
.summary-slot .icon { display:block; width:24px; height:24px; filter:brightness(1.7) saturate(1.2); }
#backToTop { flex:none; display:flex; align-items:center; justify-content:center; width:44px; height:44px; }
#backToTop svg { width:20px; height:20px; }
#backToTop, #resetAll, .sources-menu summary, .open-all { font:inherit; font-size:13px; padding:4px 10px; border:1px solid var(--control-border); border-radius:6px; background:var(--surface); color:var(--fg); cursor:pointer; }
#backToTop { padding:0; }
@media (min-width: 769px) {
  input[type=search] { min-height:52px; padding:10px 18px; font-size:18px; border-radius:6px; }
  #resetAll { padding:0 20px; font-size:15px; }
}
@media (max-width: 768px) {
  .layout { display: block; height: auto; padding: 0 16px; }
  .site-header { display: block; padding: 20px 0 12px; border: 0; }
  .wordmark { margin: 0; font-size: 20px; }
  .content, main { display: block; }
  .sidebar { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; overflow: visible; padding: 12px 0 0; margin: 0; }
  .sidebar select, .toggle { width: 100%; min-width: 0; padding: 0 12px; border-radius: 999px; background: var(--surface); }
  .sidebar > select { grid-column: span 3; }
  #stateFilter { grid-column: span 4; } /* room for the longest state name */
  .sidebar > .toggle { grid-column: span 2; padding: 0 8px; }
  @media (min-width: 600px) {
    .sidebar { grid-template-columns: 1fr 1fr 1.4fr auto; }
    .sidebar > select, .sidebar > .toggle, #stateFilter { grid-column: auto; }
  }
  .toggle { align-self: auto; }
  #stateSelect { display: contents; }
  #stateFilter:disabled, .toggle:disabled { display: none; } /* the phone filters stay out of the way when they cannot narrow */
  #results { overflow: visible; }
  .toolbar { position: relative; margin: 6px 0; }
  #summaryAnchor { display: block; position: sticky; top: 0; z-index: 1; height: 0; }
  :root { --summary-height: 52px; }
  #summary { position: absolute; top: 0; left: -16px; right: -16px; display: flex; gap: 8px; align-items: center; min-height: var(--summary-height); padding: 0 8px 0 16px; background: var(--bg); border-bottom: 1px solid var(--line); font-size: 13px; }
  .site-header .disclaimer, .builds-nav, .wide-only { display: none; }
  .site-footer { padding: 16px 0 32px; border-top: 1px solid var(--line); }
  .sources-menu summary { list-style: none; display: flex; align-items: center; min-height: 44px; }
  .sources-menu summary::-webkit-details-marker { display: none; }
  .sources-menu summary::before { content: "\25B8"; content: "\25B8" / ""; display: inline-block; width: 1em; }
  .sources-menu[open] summary::before { content: "\25BE"; content: "\25BE" / ""; }
  /* floats under the button, so opening the menu leaves the button where it is */
  .sources-panel { position: absolute; z-index: 2; top: 100%; right: 0; width: min(320px, calc(100vw - 32px)); margin-top: 6px; padding: 4px 12px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
  .sources-menu ul { display: flex; flex-wrap: wrap; gap: 0 14px; list-style: none; margin: 0; padding: 0; }
  .sources-menu li a { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; color: inherit; text-decoration: none; }
  .sources-menu .avatar { width: 24px; height: 24px; }
}
/* the first content declaration is the fallback for browsers without alt-text syntax */
.ext::after { content:" \2197"; content:" \2197" / " (opens in a new tab)"; color:var(--muted); }
.items { display:flex; flex-direction:column; gap:16px; list-style:none; margin:0; padding:0; }
.item { --icon-size:72px; display:flex; flex-direction:column; gap:16px; padding:20px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.item-head { display:flex; gap:18px; align-items:flex-start; }
.item-icon { flex:none; display:flex; align-items:center; justify-content:center; width:var(--icon-size); height:var(--icon-size); padding:4px; border:1px solid var(--line); border-radius:8px; background:var(--bg); }
.item-icon.has-state { border-color:currentColor; }
.item-icon.owned-not-worn { border-color:var(--state-accessible); } /* no state colour fits "owned, but worn by none of the characters whose builds use it"; "accessible" is the closest */
.item-icon img { display:block; width:100%; height:100%; object-fit:contain; }
.item-body { flex:1; min-width:0; display:flex; flex-direction:column; gap:6px; }
.item-title { display:flex; flex-wrap:wrap; align-items:baseline; gap:0 10px; }
.item h2 { font-size:22px; font-weight:600; margin:0; overflow-wrap:anywhere; }
.item-title small { color:var(--muted); font-size:13px; }
.item h2 a { padding-block:12px; color:inherit; text-decoration-color:var(--line); } /* grows the hit area to 44px without moving the text */
.item h2 a:hover { color:var(--accent); }
.ext-marker { margin-left:.25em; font-size:14px; color:var(--muted); }
.item-state { display:flex; flex-wrap:wrap; align-items:center; gap:0 8px; margin:0; font-size:14px; }
.item-state-label { font-weight:600; }
.item-state-glyph { display:inline-flex; align-items:center; justify-content:center; flex:none; width:22px; height:22px; border:1.5px solid currentColor; border-radius:50%; }
.item-state-glyph .state-glyph { width:14px; height:14px; }
.item-location { color:var(--fg); }
.item-state .separator { color:var(--muted); }
.item-effect { display:flex; flex-direction:column; gap:4px; margin:0; padding:4px 0 0; list-style:none; font-size:14px; line-height:1.5; color:var(--fg-secondary); }
.item-effect-multiple li { position:relative; padding-left:16px; }
.item-effect-multiple li::before { content:"\2022"; content:"\2022" / ""; position:absolute; left:4px; color:var(--muted); }
.state-owned { color:var(--state-owned); }
.state-lost { color:var(--state-lost); }
.state-accessible { color:var(--state-accessible); }
.state-not-yet-accessible { color:var(--state-later); }
.state-dlc-locked, .state-unknown, .state-gone { color:var(--state-muted); }
.threshold-chip { display:inline-flex; align-items:center; gap:4px; padding:0 8px; border:1px solid var(--line); border-radius:4px; background:var(--chip); font-size:13px; }
.threshold-chip-met { border-color:var(--met-fg); background:var(--met-bg); color:var(--met-fg); }
.threshold-chip-not-met { border-color:var(--unmet-border); background:var(--unmet-bg); color:var(--unmet-fg); font-weight:600; }
.threshold-chip-gone { border-color:var(--line); background:var(--chip); color:var(--state-muted); font-weight:400; } /* for a source that is already gone; overrides the met and not met colours */
.uses { display:flex; flex-wrap:wrap; gap:8px; margin:0; padding:0; list-style:none; }
.use { background:var(--chip); border:1px solid var(--line); border-radius:999px; }
.use-body { display:flex; align-items:center; gap:8px; font:inherit; font-size:13px; padding:4px 12px 4px 5px; color:var(--fg); }
.use strong { font-weight:600; }
.use-unworn { background:none; border:1px dashed var(--control-border); }
.use-worn { background:var(--met-bg); border-color:var(--met-fg); }
.use-worn strong { color:var(--met-fg); }
.placement-tag { padding:1px 7px; font-weight:500; color:var(--tag-fg); background:var(--tag-bg); border:1px solid var(--tag-border); border-radius:4px; }
.use .avatar { width:20px; height:20px; margin:0; }
.use-detail { color:var(--muted); }
.use-worn .use-detail { color:var(--fg); }
.blueprint { display:flex; flex-wrap:wrap; gap:8px; padding-top:6px; }
.copy-pill { display:inline-grid; min-height:44px; padding:0 10px; font:12px var(--font-mono); border:1px solid var(--control-border); border-radius:4px; background:var(--bg); color:var(--fg); text-align:left; overflow-wrap:anywhere; cursor:pointer; }
.copy-icon { margin-left:6px; vertical-align:-1px; color:var(--muted); }
.copy-pill:hover { border-color:var(--accent); }
.copy-pill > span { grid-area:1 / 1; align-self:center; }
.copy-pill-done { text-align:center; color:var(--state-owned); visibility:hidden; } /* both labels share one cell, so the pill keeps the size of the larger */
.copy-pill.copied .copy-pill-text { visibility:hidden; }
.copy-pill.copied .copy-pill-done { visibility:visible; }
.item-sources-section { display:flex; flex-direction:column; gap:12px; padding-top:14px; border-top:1px solid var(--line); }
.sources-summary { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px 12px; }
@media (min-width: 769px) {
  .sources-summary { flex-wrap:nowrap; min-height:44px; } /* a long place wraps inside the line, so the button stays on the right; the height is the button's, so a card without one is as tall */
  .item-sources { flex:1 1 auto; min-width:0; }
  .sources-toggle { flex:none; margin-left:auto; min-height:44px; }
}
.item-sources, .item-sources-all { margin:0; padding:0; list-style:none; font-size:14px; }
.item-sources li, .item-sources-all li { display:flex; flex-wrap:wrap; align-items:center; gap:6px 16px; }
.source-chapter { color:var(--muted); }
.state-glyph { display:block; flex:none; width:16px; height:16px; background:currentColor; mask:var(--glyph) center / contain no-repeat; -webkit-mask:var(--glyph) center / contain no-repeat; }
.glyph-owned { --glyph:url(resources/state-glyphs/owned.svg); }
.glyph-cross { --glyph:url(resources/state-glyphs/cross.svg); }
.glyph-accessible { --glyph:url(resources/state-glyphs/accessible.svg); }
.glyph-not-yet-accessible { --glyph:url(resources/state-glyphs/not-yet-accessible.svg); }
.glyph-dlc-locked { --glyph:url(resources/state-glyphs/dlc-locked.svg); }
.glyph-unknown { --glyph:url(resources/state-glyphs/unknown.svg); }
.source-gone { color:var(--muted); } /* muted text, not row opacity, so every colour keeps its contrast */
.source-detail { display:flex; flex-wrap:wrap; align-items:center; gap:6px 12px; flex:1 1 200px; min-width:0; }
.source-chips { display:inline-flex; flex-wrap:wrap; gap:8px; margin-left:auto; }
.source-detail .threshold-chip { padding:2px 10px; }
.item-sources .source-detail { flex:0 1 auto; }
.item-sources .source-chips { margin-left:0; }
.item-sources-all .source-chapter { margin-left:auto; }
.sources-toggle { display:inline-flex; align-items:center; gap:8px; min-height:44px; padding:0 14px; font:inherit; font-size:13px; font-weight:500; color:var(--accent); background:none; border:1px solid var(--control-border); border-radius:6px; cursor:pointer; }
.sources-toggle:hover { border-color:var(--accent); }
.sources-toggle[aria-expanded=true] .when-closed, .sources-toggle[aria-expanded=false] .when-open { display:none; }
.sources-drawer { display:flex; flex-direction:column; gap:14px; }
.item-sources-all { border:1px solid var(--line); border-radius:8px; overflow:hidden; }
.item-sources-all li { padding:10px 14px; border-top:1px solid var(--line); background:var(--row); }
.item-sources-all li:first-child { border-top:0; }
@media (min-width: 769px) { .item-sources-all .item-state { flex:0 0 150px; } }
@media (min-width: 769px) { .item-sources-all strong { flex:0 0 110px; font-weight:400; color:var(--muted); } }
@media (min-width: 769px) { .item-sources-single .sources-toggle, .item-sources-single .sources-drawer { display:none; } } /* nothing to expand beyond the line already shown */
.category-card .item-head { align-items:center; }
.category-card .item-icon { border-style:dashed; border-color:var(--muted); color:var(--muted); }
.category-card .item-title { gap:4px 12px; align-items:center; }
.category-card h2 { font-size:20px; font-weight:500; }
.category-tag, .hands-tag { padding:2px 8px; border:1px solid var(--line); border-radius:4px; font-size:12px; color:var(--muted); }
.category-note { font-size:13px; color:var(--muted); }
/* the live region stays in the DOM and only swaps the visually-hidden class, so screen readers announce the text either way */
#toast:not(.visually-hidden) { position:fixed; z-index:2; left:50%; bottom:max(20px, env(safe-area-inset-bottom)); transform:translateX(-50%); max-width:calc(100vw - 32px); padding:8px 14px; border-radius:8px; background:var(--inverse-bg); color:var(--inverse-fg); font-size:13px; overflow-wrap:anywhere; }
@media (max-width: 768px) {
  #results { scroll-margin-top:calc(var(--summary-height) + 8px); }
  .item { --icon-size:64px; gap:12px; padding:16px; scroll-margin-top:calc(var(--summary-height) + 8px); } /* clears the sticky filter summary */
  .item-head { gap:14px; }
  .item h2 { font-size:18px; }
  .category-card h2 { font-size:18px; }
  .item-state, .item-sources, .item-sources-all { font-size:13px; }
  .sources-summary { flex-direction:column; align-items:stretch; }
  /* phone rows stack: state and chapter, then the type, then the place, then the chips */
  .item-sources-all li { gap:6px 12px; }
  .item-sources-all .item-state { order:1; }
  .item-sources-all .source-chapter { order:2; margin-left:auto; }
  .item-sources-all strong { order:3; flex:1 0 100%; }
  .item-sources-all .source-detail { order:4; flex:1 1 100%; }
  .item-sources-all .source-chips { flex:1 0 100%; margin-left:0; } /* the chips take their own line under the place */
  .sources-open .item-sources { display:none; } /* the drawer lists that source in full */
  .item-sources .source-text { display:none; }
  .sources-toggle { justify-content:space-between; min-height:44px; font-size:14px; }
  .sources-drawer .blueprint { flex-direction:column; align-items:stretch; padding-top:14px; }
  .sources-drawer .copy-pill { min-height:44px; padding:0 12px; }
  .item-state-glyph { width:20px; height:20px; }
  .use-body { font-size:12px; gap:6px; padding:3px 10px 3px 4px; }
  .use .avatar { width:18px; height:18px; }
}
