/* Base: reset, type, focus, and the controls everything shares. */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  min-height: 100vh; background: var(--bg); color: var(--t1); font: 400 var(--fs-14)/1.5 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-synthesis: none;
}
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: default; }

/* ---- Press: buttons and button-like links scale to --press-ui while held and spring back (--press-t, 240 ms).
   `scale` is its own property, so it composes with every transform already in use; :where() keeps the specificity at zero so a
   component's own :active rule wins, and a component that sets its own `transition` list appends var(--press-t) to it. ---- */
:where(button, a.btn, a.btn-s, a.ghost, a.link-btn, a.chip, a.pill, [role="tab"], .bar-nav > a, .shelf-link) { transition: var(--press-t); }
:where(button:not(:disabled), a.btn, a.btn-s, a.ghost, a.link-btn, a.chip, a.pill, [role="tab"], .bar-nav > a, .shelf-link):active { scale: var(--press-ui); }
ul { list-style: none; padding: 0; }
a { color: inherit; }
svg { display: block; }
img { max-width: 100%; }
[hidden] { display: none !important; }
kbd { font: 500 11px/1 var(--mono); border-radius: 6px; padding: 4px 6px; color: var(--t2); background: var(--s3); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--t3); }
.n { font: 400 var(--fs-12)/1 var(--sans); color: var(--t3); font-variant-numeric: tabular-nums; }
.ic { width: 16px; height: 16px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 300; background: var(--t1); color: var(--on-t1); padding: 10px 16px; border-radius: var(--r-ctl); text-decoration: none; font-weight: 500; transition: top var(--dur-quick); }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--t1); outline-offset: 2px; border-radius: 6px; }
:focus:not(:focus-visible) { outline: 0; }
::selection { background: color-mix(in srgb, var(--t1) 24%, transparent); }


.icon-btn { width: 36px; height: 36px; border-radius: var(--r-ctl); display: grid; place-items: center; color: var(--t2); transition: background var(--dur-quick), color var(--dur-quick), var(--press-t); flex: none; }
.icon-btn:hover { background: var(--s2); color: var(--t1); }

/* buttons: primary is a white pill with dark text, secondary an outline pill, ghost is text that fills on hover */
.btn, .btn-s { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-2); border-radius: var(--r-pill); font-weight: 500; transition: background var(--dur-quick), border-color var(--dur-quick), color var(--dur-quick), var(--press-t); white-space: nowrap; text-decoration: none; }
.btn { height: 40px; padding: 0 20px; font-size: var(--fs-14); }
.btn-s { height: 32px; padding: 0 14px; font-size: var(--fs-13); }
.btn:hover, .btn-s:hover { background: var(--s2); }
.btn.primary { background: var(--t1); color: var(--on-t1); border-color: var(--t1); }
.btn.primary:hover { background: color-mix(in srgb, var(--t1) 86%, var(--bg)); }
.btn kbd, .btn-s kbd { background: color-mix(in srgb, currentColor 14%, transparent); color: inherit; opacity: .8; }
.btn .ic, .btn-s .ic { width: 16px; height: 16px; }
.ghost { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: var(--r-ctl); color: var(--t2); font-size: var(--fs-13); font-weight: 500; text-decoration: none; transition: background var(--dur-quick), color var(--dur-quick), var(--press-t); white-space: nowrap; }
.ghost:hover { background: var(--s2); color: var(--t1); }
.ghost .ic { width: 14px; height: 14px; }
.link-btn { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-13); color: var(--t2); padding: 8px 12px; margin-left: -12px; border-radius: var(--r-ctl); }
.link-btn:hover { color: var(--t1); background: var(--s2); }
.link-btn .ic { width: 14px; height: 14px; }

/* filter chips: pills, the only pills in the app */
.chip, .pill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: var(--r-pill); background: var(--s2); color: var(--t2); font-size: var(--fs-13); font-weight: 450; text-decoration: none; transition: background var(--dur-quick), color var(--dur-quick), var(--press-t); white-space: nowrap; }
.chip:hover, .pill:hover { background: var(--s3); color: var(--t1); }
.chip[aria-pressed="true"], .chip[aria-current="page"], .pill[aria-pressed="true"] { background: var(--t1); color: var(--on-t1); }
.chip[aria-pressed="true"] .n, .chip[aria-current="page"] .n, .pill[aria-pressed="true"] .n { color: inherit; opacity: .7; }
.chip.zero, .pill.zero { color: var(--t3); }
a.chip { text-decoration: none; }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--c, #999); box-shadow: inset 0 0 0 1px rgba(128, 128, 128, .35); flex: none; }

/* select */
.sel { display: flex; align-items: center; gap: 8px; font-size: var(--fs-13); color: var(--t3); }
.sel select { appearance: none; -webkit-appearance: none; height: 36px; border: 0; border-radius: var(--r-ctl); background-color: var(--s2); background-repeat: no-repeat; background-position: right 12px center; font-weight: 500; font-size: var(--fs-13); color: var(--t1); padding: 0 34px 0 14px; cursor: pointer; transition: background-color var(--dur-quick); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23a1a1a1' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
:root[data-theme="light"] .sel select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23555555' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.sel select:hover { background-color: var(--s3); }
.sel select option { background: var(--s2); color: var(--t1); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }

/* a quiet on/off switch (the account menu, Your taste): the track is the state, no label inside */
.sw { flex: none; position: relative; display: inline-block; width: 30px; height: 18px; border-radius: var(--r-pill); background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-2); transition: background var(--dur-quick) var(--ease-out); }
.sw i { position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--text-3); transition: translate var(--dur-quick) var(--ease-out), background var(--dur-quick) var(--ease-out); }
[aria-checked="true"] > .sw, [aria-checked="true"] .sw { background: var(--text-1); box-shadow: none; }
[aria-checked="true"] .sw i { translate: 12px 0; background: var(--bg); }
@media (prefers-reduced-motion: reduce) { .sw, .sw i { transition: none; } }

/* broken.js: an image or video that failed to load is out of sight at once, then removed (or put back if only the network failed) */
.dl-bad { visibility: hidden !important; }
