/* One meaning per colour:
   --accent = LEGO red: anything you can click, and the selected tab
              (--accent-fill is the same red for solid fills with white text; in dark
              mode it's deeper than --accent so white text on it stays readable)
   --ochre  = LEGO yellow: the brand, and "sealed"
   --warn   = LEGO orange: "retiring soon", the one act-now signal
   --data   = chart bars and lines (neutral, so charts don't read as warnings)
   --moss / --brick = gain / loss on money figures (--brick is a darker, browner red than
     --accent on purpose, so a loss never looks like something to click)
   Buttons: solid red = the main action or a selected toggle; everything else is white with
   a thin border and turns red on hover. No black or grey-filled buttons. */
:root, [data-theme="light"]{
  color-scheme:light;
  --paper:#F5F4F0; --panel:#FFFFFF; --callout:#EEEDE8; --callout-edge:#DCDAD3; --field-edge:#8F8C84; --plate:#FFFFFF;
  --ink:#1B1A17; --ink-soft:#4A4944; --ink-faint:#5F5D56; --rule:#E3E1DA;
  --accent:#C8102E; --accent-fill:#C8102E; --data:#55534D; --brick:#8E2A23; --moss:#237A3E; --ochre:#F2C200; --warn:#F57C00;
  --on-ink:#FFFFFF; --on-ochre:#1B1A17; --overlay:rgba(255,255,255,.9);
  --shadow:0 1px 2px rgba(27,26,23,.05), 0 8px 20px -12px rgba(27,26,23,.18);
  --shadow-hover:0 2px 4px rgba(27,26,23,.06), 0 16px 32px -14px rgba(27,26,23,.26);
  --r-sm:4px; --r-card:0; --sp:clamp(16px,2.2vw,28px);
  /* the name "Studbook" only (header, splash, 404); everything else is Inter */
  --font-brand:'Bricolage Grotesque','Inter',system-ui,sans-serif;
}
[data-theme="dark"]{
  color-scheme:dark;
  --paper:#121211; --panel:#222120; --callout:#2B2A27; --callout-edge:#3B3935; --field-edge:#74716A; --plate:var(--plate-dark,#EFEFEF);
  --ink:#EEEDEA; --ink-soft:#B9B7B0; --ink-faint:#A3A19A; --rule:#34322E;
  --accent:#FF5A5F; --accent-fill:#B71C32; --data:#B9B7B0; --brick:#F2A196; --moss:#5CC98A; --ochre:#E2BD3C; --warn:#EB9142;
  --on-ink:#121211; --on-ochre:#1B1A17; --overlay:rgba(28,27,25,.92);
  --shadow:0 1px 2px rgba(0,0,0,.4), 0 12px 28px -12px rgba(0,0,0,.6);
  --shadow-hover:0 2px 4px rgba(0,0,0,.5), 0 18px 36px -14px rgba(0,0,0,.75);
}
*{box-sizing:border-box}
button,input,select,textarea{font-family:inherit}
input[type=checkbox],input[type=radio],input[type=range]{accent-color:var(--accent)}
/* keep the scrollbar's space reserved, so locking the page scroll for a popup doesn't widen the page and reflow the cards */
html{scroll-behavior:smooth;scrollbar-gutter:stable;background:var(--paper)}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{animation:none!important;transition:none!important}}
body{margin:0;background:var(--paper);color:var(--ink);font-family:'Inter',system-ui,sans-serif;
  font-size:14px;line-height:1.55;-webkit-font-smoothing:antialiased}
h1,h2,h3{font-weight:700;margin:0;line-height:1.15;letter-spacing:-.015em}
a{color:var(--accent)}
.skip{position:absolute;left:-999px;top:0;background:var(--accent-fill);color:#fff;padding:10px 16px;z-index:99}
.skip:focus{left:8px;top:8px}
:focus-visible{outline:2.5px solid var(--accent);outline-offset:3px;border-radius:var(--r-sm)}
.cap{font-size:14px;font-weight:500;color:var(--ink-faint)}

/* masthead */
.masthead{background:#FFCF00;color:#1B1A17;--hover-fill:rgba(27,26,23,.1)}
/* light mode: the header is LEGO yellow (as on lego.com), so everything on it gets its own dark ink and a deeper
   red, since the page's tokens are tuned for paper and panels. The ⋯ menu's popup is left out so it keeps the
   normal panel colours. Dark mode keeps a dark header with a yellow edge: a bright band over a black page glares. */
:root:not([data-theme="dark"]) .masthead :is(.brand,.totals,.iconbtn,.menubtn,.tabs){
  --ink:#1B1A17; --ink-soft:#33322E; --ink-faint:#4A4944; --accent:#A30E26;
  --panel:transparent; --callout-edge:rgba(27,26,23,.25)}
/* the header's buttons have no outline: on the band they'd be its heaviest shapes. A soft fill shows on hover. */
.masthead :is(.iconbtn,.menubtn){border-color:transparent;background:transparent}
/* hover fills only with a real mouse: on a phone a tap leaves the button "hovered", so it would stay lit after
   switching the theme or closing the menu. The ⋯ button stays filled only while its menu is open. */
.masthead .menu[open] .menubtn{border-color:transparent;background:var(--hover-fill);color:var(--ink)}
@media (hover:hover){
  .masthead :is(.iconbtn:hover,.menubtn:hover){border-color:transparent;background:var(--hover-fill);color:var(--ink)}
}
/* "+ Add a set" is the owner's main action, so it has its own header button; on its page it stays filled, like a
   selected tab (just the + on phones) */
.masthead .addbtn{width:auto;padding:0 12px;gap:6px;font-size:14px;font-weight:600}
.masthead .addbtn[aria-current]{background:var(--hover-fill)}
.mast-top #themeBtn{margin-left:-20px}
:root[data-theme="dark"] .masthead{background:var(--panel);color:var(--ink);box-shadow:inset 0 -2px 0 var(--ochre);
  --hover-fill:rgba(255,255,255,.1)}
/* the yellow edge is drawn inside the header's last 2px, exactly where the tabs' underlines are, so the selected
   tab's red covers it at any zoom and the edge reads as one line: red under the tab. Same 2px, or it reads as a step. */
:root[data-theme="dark"] .masthead .tab{border-bottom-width:2px;padding-bottom:10px}
/* unselected tabs stay a dimmer grey in dark mode: it only looked muddy on the yellow band */
:root[data-theme="dark"] .masthead .tab:not([aria-selected="true"]):not(:hover){color:var(--ink-faint)}
/* on the yellow band the selected tab is underlined in the logo's LEGO red, so the two reds match (the deeper
   #A30E26 stays for text, which needs more contrast than a line) */
:root:not([data-theme="dark"]) .masthead .tab[aria-selected="true"]{border-bottom-color:var(--accent-fill)}
/* a red brick on the yellow band, the usual yellow one on the dark header */
.logo-dark,:root[data-theme="dark"] .logo-light{display:none!important}
:root[data-theme="dark"] .logo-dark{display:block!important}
.mast-inner{padding:14px var(--sp) 0;max-width:1600px;margin:0 auto}
.mast-top{display:flex;align-items:center;flex-wrap:wrap;gap:12px 28px}
/* the name stands about as tall as the logo's studs, so the two read as one. "St" sits closer, where the font
   leaves a gap at this weight; the d gets a little more room, or its bowl touches the b (the bars use the same) */
.brand{display:flex;align-items:center;gap:9px;font-family:var(--font-brand);font-size:23px;font-weight:800;letter-spacing:-.03em;line-height:1;margin:0}
.wm .k1{letter-spacing:-.05em}
.wm .k2{letter-spacing:0}
/* the drawn name (the header's, and the splash hero's): the books in the logo's reds, or its yellows in dark mode, as
   the logo turns yellow there. In the header it's as tall as the letters were at 23px (ascender to descender) */
.brand .wmark{display:block;height:.75em;width:auto}
.wmark .bk1 rect{fill:#C8102E}.wmark .bk1 .band{fill:#DE2C46}
.wmark .bk2 rect{fill:#E0485C}.wmark .bk2 .band{fill:#EC6A7B}
:root[data-theme="dark"] .wmark .bk1 rect{fill:#F2C200}:root[data-theme="dark"] .wmark .bk1 .band{fill:#FFD633}
:root[data-theme="dark"] .wmark .bk2 rect{fill:#FFE16B}:root[data-theme="dark"] .wmark .bk2 .band{fill:#FFEC9E}
/* the brand links to the Sets tab, as a logo usually goes home */
.brand a{display:flex;align-items:center;gap:9px;color:inherit;text-decoration:none}
.brand .logo{width:32px;height:32px;display:block;filter:drop-shadow(0 1.5px 1.5px rgba(27,26,23,.3))}
:root[data-theme="dark"] .brand .logo{filter:drop-shadow(0 1.5px 1.5px rgba(0,0,0,.6))}
.totals{display:flex;flex-wrap:wrap;gap:4px 24px;margin:0}
.totals div{display:flex;align-items:baseline;gap:6px}
.totals dt{font-size:12px;color:var(--ink-faint);order:2}
.totals dd{margin:0;font-size:16px;font-weight:700;font-variant-numeric:tabular-nums}
/* when the totals don't fit beside the title, they go on their own line and the buttons stay up top
   (otherwise the buttons drop to a line of their own and leave an empty strip) */
@media (max-width:960px){.totals{order:3;width:100%}}
/* beside the totals, the name gets twice their spacing, so it reads as the name and not a fifth total */
/* on a computer the name lines up with the tabs under it: its k ends where "Minifigs" does, and the first total starts
   where "Wishlist" does (the tab words are 36px apart, as the name is from the totals) */
@media (min-width:961px){.brand{margin-right:8px}.masthead .tab{font-size:17.5px}}

/* ---- Toybox header: the name and the tabs on one line, outlined buttons on the right, and the totals under them as
   big numbers. Dark mode keeps its dark band with the yellow edge; light mode the yellow band ---- */
.masthead{--band-line:#6B5600}
:root[data-theme="dark"] .masthead{--band-line:#6A6B74}
.mast-inner{padding:18px var(--sp) 16px}
.mast-top{flex-wrap:nowrap;gap:12px}
.mast-top .brand{margin-right:16px}
.mast-gap{flex:1 1 auto}
.masthead .tabs{margin:0;gap:6px}
.masthead .tab{margin:0;padding:12px 14px 9px;font-size:16px;font-weight:600}
:root[data-theme="dark"] .masthead .tab{border-bottom-width:3px;padding-bottom:9px}
.masthead :is(.iconbtn,.menubtn){margin:0;width:44px;height:44px;border:1px solid var(--band-line);border-radius:12px}
.masthead .menu[open] .menubtn{border-color:var(--band-line)}
@media (hover:hover){.masthead :is(.iconbtn:hover,.menubtn:hover){border-color:var(--band-line)}}
.masthead .addbtn{width:auto;padding:0 16px;gap:8px;font-size:15px}
.masthead .mast-top :is(#themeBtn,.menu){margin-left:0}
#themeIcon{display:flex}
.masthead .totals{margin:14px 0 0;gap:0;font-size:16px}
.masthead .totals div{gap:6px}
.masthead .totals div+div::before{content:'·';margin:0 10px;color:var(--ink-faint)}
.masthead .totals dt{font-size:16px;order:2}
.masthead .totals dd{font-family:var(--font-brand);font-size:20px;font-weight:800}
:root:not([data-theme="dark"]) .masthead .totals{--ink:#1B1A17;--ink-faint:#4A4944}
@media (max-width:960px){
  .mast-top{flex-wrap:wrap}
  .masthead .tabs{order:5;width:100%;margin-top:6px}
}
@media (max-width:600px){
  .mast-inner{padding-top:12px;padding-bottom:12px}
  .masthead .addbtn{width:44px;padding:0}
  .mast-top{gap:8px}
  .mast-top .brand{margin-right:0}
  .masthead .totals{margin-top:6px;font-size:14px;row-gap:2px}
  .masthead .totals dt{font-size:14px}
  .masthead .totals dd{font-family:inherit;font-size:14px;font-weight:700}
  .masthead .totals div+div::before{margin:0 6px}
  .masthead .totals>div:nth-child(n+4){display:flex}
  .masthead .totals>div:nth-child(4){flex-basis:100%}
  .masthead .totals>div:nth-child(4)::before{content:none}
  .masthead .tab{padding:10px 10px 8px}
}

.shell{display:grid;grid-template-columns:320px minmax(0,1fr);max-width:1600px;margin:0 auto;align-items:start}
@media (max-width:960px){.shell{grid-template-columns:minmax(0,1fr)}}
.rail,main{min-width:0}

/* ---- search bar: the search box and Filters button, above the results at every size, kept at the top ---- */
.findbar{position:sticky;top:0;z-index:30;background:var(--paper);border-bottom:1px solid var(--rule)}
.findbar-in{display:flex;align-items:stretch;gap:8px;max-width:1600px;margin:0 auto;padding:12px var(--sp)}
/* one fixed width whether or not the filters show, so the box and the Filters button never move when it's clicked */
.findbar .find{flex:0 1 360px;min-width:0}
/* on a computer the tab's Sort (and on Sets, grid / table) sits at the right of the bar, at hand with the filters hidden too */
.barsort{display:none}
@media (min-width:961px){
  .barsort{display:flex;align-items:center;gap:20px;margin-left:auto}
  /* grid / table sits last, its icons speaking for themselves */
  .barsort .viewgrp{order:1}
  .barsort .viewgrp label.fl{display:none}
  .barsort .viewswitch{margin:0}
  .barsort .viewbtn{width:40px;height:40px}
  .barsort .sortgrp{display:flex}
  .barsort label.fl{margin:0 10px 0 0;align-self:center}
  .barsort .sel{width:auto}
}
/* on Stats the bar holds the title, after the Contents button, with any filter note beside it */
.bartitle{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 10px;align-self:center;min-width:0;margin-left:8px}
.bartitle h2{font-size:20px}
.bartitle p{margin:0;font-size:14px;color:var(--ink-soft)}
.railbtn{display:flex;align-items:center;gap:8px;flex-shrink:0;min-height:42px;padding:0 14px 0 12px;background:var(--panel);color:var(--ink);
  border:1px solid var(--callout-edge);border-radius:var(--r-sm);font-size:14px;font-weight:500;cursor:pointer}
/* hovers are ink with a faint fill, like the filter chips: red is for links (from 22 Nov 2026) */
.railbtn:hover{border-color:var(--ink);color:var(--ink);background:rgba(127,127,127,.12)}

/* ---- Toybox toolbar: 44px controls with 12px corners on the page colour; the search has its magnifier, Filters a
   panel icon and fills while filters are on; the count sits before Sort; Grid / Table say their names ---- */
.findbar{border-bottom:0}
.findbar-in{padding:20px var(--sp) 8px;gap:12px;align-items:center}
.findbar .find{height:44px;border-radius:12px;border-color:var(--field-edge);padding-left:42px;font-size:16px;
  background:var(--panel) no-repeat 14px 50%/18px var(--mag)}
:root{--mag:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2355534D' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E")}
:root[data-theme="dark"]{--mag:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A3A19A' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E")}
.railbtn{height:44px;min-height:44px;padding:0 16px;border-radius:12px;border-color:var(--field-edge);font-size:15px;font-weight:600}
.railbtn.on{background:var(--ink);border-color:var(--ink);color:var(--paper)}
.railbtn.on:hover{color:var(--paper);opacity:.9}
.barcount{margin-left:auto;font-size:15px;color:var(--ink-soft);white-space:nowrap}
.barcount b{color:var(--ink)}
@media (min-width:961px){
  .barsort{margin-left:0;gap:12px}
  .barsort .sortgrp label.fl{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  .barsort .sel{height:44px;border-radius:12px 0 0 12px;font-weight:600;font-size:14px}
  .barsort .dirbtn{height:44px;border-radius:0 12px 12px 0;font-weight:600}
  .barsort .viewswitch{border-radius:12px;padding:3px;gap:3px;border-color:var(--field-edge);background:var(--panel)}
  .barsort .viewbtn{width:auto;height:36px;padding:0 14px;border-radius:9px;border:0;display:flex;align-items:center;gap:6px;font-weight:600;font-size:14px;color:var(--ink)}
  .barsort .viewbtn+.viewbtn{border-left:0}
  .barsort .viewbtn[aria-pressed="true"]{background:var(--ink);color:var(--paper)}
}
.vlabel{display:none}
@media (min-width:961px){.barsort .vlabel{display:inline}}
@media (max-width:960px){.barcount{display:none}}

/* ---- Toybox filter panel: sections under small muted headings, divided by rules; Show only chips and the Vs paid
   choice; the main facets open as lists with their counts; checkboxes drawn at 20px ---- */
.rail h2{font-size:13px;font-weight:700;letter-spacing:.02em;color:var(--ink-faint);margin:18px 0 8px}
.rail .chips{gap:8px}
.rail .chip{height:40px;padding:0 14px;border-radius:12px;font-size:14px;font-weight:600;border:1px solid var(--field-edge);background:none;color:var(--ink)}
.rail .chip[aria-pressed="true"]{background:var(--ink);border-color:var(--ink);color:var(--paper)}
@media (hover:hover){.rail .chip:not([aria-pressed="true"]):hover{border-color:var(--ink);color:var(--ink);background:rgba(127,127,127,.12)}}
.vsrow{display:flex;align-items:center;gap:10px;width:100%;margin-top:2px}
.vslabel{font-size:14px;font-weight:600;white-space:nowrap}
.vsseg{display:flex;gap:3px;padding:3px;border:1px solid var(--field-edge);border-radius:12px}
#railSets .vsseg :is(.chip,.vsany){height:34px;padding:0 14px;border:0;border-radius:9px;background:none;color:var(--ink);font:600 14px 'Inter',sans-serif;cursor:pointer}
#railSets .vsseg :is(.chip,.vsany)[aria-pressed="true"]{background:var(--ink);color:var(--paper)}
details.fg.main{border-top:1px solid var(--rule);padding:4px 0 10px}
details.fg.main>summary{font-size:13px;font-weight:700;letter-spacing:.02em;color:var(--ink-faint);padding:14px 0 8px}
details.fg.main>summary:hover{color:var(--ink)}
details.fg.main .optlist{max-height:none;overflow:visible}
details.fg.main .opt.beyond{display:none}
details.fg.main.all .opt.beyond{display:flex}
.optmore{appearance:none;margin-top:6px;height:44px;padding:0 14px;border-radius:12px;border:1px solid var(--field-edge);background:none;color:var(--ink);font:600 14px 'Inter',sans-serif;cursor:pointer}
.optmore:hover{border-color:var(--ink)}
.rail .opt{min-height:36px;gap:10px;font-size:15px;color:var(--ink)}
.rail .opt .on-c{font-size:14px;color:var(--ink-faint)}
.rail .opt input{appearance:none;-webkit-appearance:none;width:20px;height:20px;margin:0;border-radius:6px;border:1.5px solid var(--field-edge);
  background:none no-repeat center/14px;display:grid;place-content:center}
.rail .opt input:checked{background-color:var(--ink);border-color:var(--ink);background-image:var(--tick)}
:root{--tick:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E")}
:root[data-theme="dark"]{--tick:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23121211' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E")}
.rail .opt .locdot{width:10px;height:10px;margin-right:8px}   /* inside the label, so the row gap doesn't reach it */
:root:not([data-theme="dark"]) .rail .opt .locdot{box-shadow:inset 0 0 0 1.5px rgba(0,0,0,.6)}
.rail .sel{height:40px;border-radius:10px}
.rail .reset{height:44px;border-radius:12px;border-color:var(--field-edge);font-weight:600}

/* ---- filter rail ---- */
/* always as tall as the screen under the bar, not its filters, so its dividing line runs to the bottom */
.rail{position:sticky;top:var(--barh,0px);height:calc(100vh - var(--barh,0px));overflow-y:auto;
  padding:20px 16px var(--sp) var(--sp);border-right:1px solid var(--rule);scrollbar-width:thin}
.rail h2{font-size:14px;
  color:var(--ink-faint);margin:26px 0 12px;font-weight:600}
.rail h2:first-child{margin-top:0}
/* filters hidden on a computer: the results take the whole width */
@media (min-width:961px){
  .shell.rail-collapsed{grid-template-columns:minmax(0,1fr)}
  .rail-collapsed .rail{display:none}
}
.find,.sel,.mini,.numin{width:100%;padding:9px 12px;border:1px solid var(--field-edge);background:var(--panel);
  border-radius:var(--r-sm);font:inherit;font-size:14px;color:var(--ink)}
.sel{cursor:pointer}
/* dropdowns draw their own arrow, 12px from the right edge like the text is from the left (the browser's own sits
   almost on the border) */
.sel{appearance:none;-webkit-appearance:none;padding-right:34px;background-image:var(--chev);background-repeat:no-repeat;
  background-position:right 12px center;background-size:12px}
:root{--chev:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%2355534D' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")}
:root[data-theme="dark"]{--chev:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23B9B7B0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")}
label.fl{display:block;font-size:14px;
  color:var(--ink-faint);margin:14px 0 5px}
/* the first label in a panel starts at its top edge: the panel's padding is space enough */
.foldable>div>label.fl:first-child,.foldable>div>.sortgrp:first-child>label.fl,.foldable>div>.viewgrp:first-child>label.fl{margin-top:0}
/* the sort and its direction are one control, so they share a box, divided like the grid / table switch: the label
   above (beside it in the bar), the dropdown taking the room left */
.sortgrp{display:grid;grid-template-columns:minmax(0,1fr) auto}
.sortgrp label.fl{grid-column:1/-1}
.sortgrp .sel{border-radius:var(--r-sm) 0 0 var(--r-sm)}
/* focus traces the half's own edge: the usual ring, 3px out, wrapped one half of the box and looked broken (a
   dropdown keeps it after a pick); raised so the shared edge shows red in full */
.sortgrp :is(.sel,.dirbtn):focus-visible{outline-offset:-1px;position:relative;z-index:1}
/* after a pick with the mouse or a finger a dropdown drops its ring, as a button does (see by-pointer in script.js) */
.by-pointer select:focus-visible{outline:none}
.dirbtn{appearance:none;background:var(--panel);border:1px solid var(--field-edge);margin-left:-1px;
  border-radius:0 var(--r-sm) var(--r-sm) 0;padding:0 14px 0 12px;cursor:pointer;white-space:nowrap;
  font-size:14px;color:var(--ink);display:inline-flex;align-items:center;gap:6px}
/* hover reddens the edge, as on the other buttons (and the direction's words too); the two halves overlap on the
   divider, so the hovered one comes forward to show its edge in full. A real mouse only: a tap would leave it lit */
@media (hover:hover){
  /* not while picked from (.picking, see script.js): after the list closes Chrome still thinks the pointer is over
     it, so the edge stayed red a while after a pick */
  .sel:hover:not(.picking){border-color:var(--ink)}
  .dirbtn:hover{border-color:var(--ink);color:var(--ink);background:rgba(127,127,127,.12)}
  .sortgrp :is(.sel,.dirbtn):hover{position:relative;z-index:1}
}
.dirbtn .flip{flex:none}
#quick:not(.all) .chip.extra:not([aria-pressed="true"]){display:none}
#quick.all .chipmore{display:none}
.chipmore{appearance:none;background:none;border:1px dashed var(--callout-edge);border-radius:var(--r-sm);
  padding:5px 9px;font-size:12px;color:var(--ink-soft);cursor:pointer}
.chipmore:hover{border-color:var(--ink);color:var(--ink)}
.viewbtn svg{display:block}
details.more{border-top:1px solid var(--rule)}
details.more>summary{cursor:pointer;list-style:none;padding:10px 0;font-size:14px;font-weight:600;color:var(--ink);
  display:flex;align-items:center;gap:8px}
details.more>summary::-webkit-details-marker{display:none}
:is(details.more,details.fg)>summary::after{content:'';width:6px;height:6px;margin:0 4px 3px auto;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);transition:transform .15s ease}
details.more[open]>summary::after{transform:rotate(225deg);margin-bottom:-2px}
details.more .more-n:not(:empty){font-size:12px;background:var(--ink);color:var(--paper);border-radius:999px;padding:1px 7px}
details.more>div,details.more>details{margin-left:10px}
details.fg{border-top:1px solid var(--rule)}
details.fg>summary{cursor:pointer;padding:8px 0;font-size:14px;display:flex;justify-content:space-between;
  align-items:center;list-style:none;gap:8px}
details.fg>summary::-webkit-details-marker{display:none}
details.fg .mini{margin-bottom:6px}
details.fg>summary:hover{color:var(--ink)}
details.fg>summary::after{border-color:var(--ink-faint)}
details.fg[open]>summary::after{transform:rotate(225deg);margin-bottom:-2px}
details.fg>summary .on-n{font-size:12px;background:var(--ink);color:var(--paper);
  border-radius:var(--r-sm);padding:1px 7px;display:none}
details.fg.active>summary .on-n{display:inline-block}
details.fg.active>summary{color:var(--ink);font-weight:600}
.optlist{max-height:210px;overflow-y:auto;padding:2px 0 10px;scrollbar-width:thin}
.opt{display:flex;align-items:center;gap:7px;padding:3px 0;font-size:14px;cursor:pointer;color:var(--ink-soft)}
.opt:hover{color:var(--ink)}
.opt input{accent-color:var(--accent);width:14px;height:14px;flex:none;cursor:pointer}
.opt .on-c{margin-left:auto;font-size:12px;color:var(--ink-faint)}
.chips{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px}
.rail .chips{margin-bottom:14px}
.chip{font-size:12px;
  padding:5px 9px;border:1px solid var(--callout-edge);background:var(--panel);border-radius:var(--r-sm);cursor:pointer;color:var(--ink-soft)}
.chip:hover{border-color:var(--ink);color:var(--ink);background:rgba(127,127,127,.12)}
.chip[aria-pressed="true"]{background:var(--accent-fill);border-color:var(--accent-fill);color:#fff}
.viewswitch{display:flex;border:1px solid var(--callout-edge);border-radius:var(--r-sm);overflow:hidden;
  width:fit-content;margin-bottom:14px}
.viewbtn{appearance:none;border:0;background:var(--panel);color:var(--ink-soft);cursor:pointer;
  padding:6px 12px;font-size:16px;line-height:1;display:flex;align-items:center}
.viewbtn+.viewbtn{border-left:1px solid var(--callout-edge)}
.viewbtn:not([aria-pressed="true"]):hover{color:var(--ink);background:rgba(127,127,127,.12)}
.viewbtn[aria-pressed="true"]{background:var(--accent-fill);color:#fff}
.pair{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.range2{position:relative;height:22px;margin:2px 0}
.range2-track{position:absolute;top:50%;left:0;right:0;height:3px;transform:translateY(-50%);
  background:var(--callout-edge);border-radius:var(--r-sm)}
.range2-fill{position:absolute;top:0;height:100%;background:var(--accent);border-radius:var(--r-sm)}
.range2-input{-webkit-appearance:none;appearance:none;position:absolute;top:0;left:0;
  width:100%;height:22px;margin:0;background:transparent;pointer-events:none}
.range2-input::-webkit-slider-runnable-track{-webkit-appearance:none;background:transparent}
.range2-input::-moz-range-track{background:transparent}
.range2-input::-webkit-slider-thumb{-webkit-appearance:none;pointer-events:auto;width:14px;height:14px;
  border-radius:50%;background:var(--panel);border:2px solid var(--accent);cursor:pointer}
.range2-input::-moz-range-thumb{pointer-events:auto;width:14px;height:14px;border-radius:50%;
  background:var(--panel);border:2px solid var(--accent);cursor:pointer;border-style:solid}
.range2-vals{display:flex;justify-content:space-between;
  font-size:12px;color:var(--ink-soft);margin-bottom:12px}
.reset{width:100%;margin-top:16px;padding:10px;background:var(--panel);border:1px solid var(--callout-edge);
  border-radius:var(--r-sm);font-size:14px;font-weight:500;
  cursor:pointer;color:var(--ink)}
.reset:hover{border-color:var(--ink);color:var(--ink);background:rgba(127,127,127,.12)}
.toc{list-style:none;margin:0;padding:0}
.rail.toc-single .toc,.rail.toc-single .toc-h{display:none}
.toc a{display:flex;justify-content:space-between;gap:10px;align-items:baseline;padding:4px 0;text-decoration:none;
  color:var(--ink);font-size:14px}
.toc a:hover{color:var(--ink);text-decoration:underline;text-underline-offset:3px}
.toc a .ct{font-size:12px;color:var(--ink-faint)}
.toc a.on{color:var(--ink);font-weight:700}
.sheethead,.sheetfoot{display:none}
@media (max-width:960px){
  /* small screens: the filters open as a sheet over the results, just under the search bar, so you can search and
     filter together */
  .rail{position:static;max-height:none;overflow:visible;padding:0;border:0}
  .rail:not(.open){display:none}
  .rail.open .foldable{position:fixed;top:var(--sheettop,0px);left:0;right:0;bottom:0;z-index:70;margin:0;
    padding:0 var(--sp);background:var(--paper);overflow-y:auto;overscroll-behavior:contain}
  .rail.underbar .foldable{padding-top:16px}
  /* under the bar its Filters button already names and closes the sheet, so the sheet's own heading would repeat it */
  .rail.underbar .sheethead{display:none}
  .sheethead{display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:3;
    margin:0 0 8px;padding:14px 0;background:var(--paper);border-bottom:1px solid var(--rule);font-size:16px}
  .sheetfoot{display:block;position:sticky;bottom:0;z-index:3;margin-top:20px;padding:12px 0 16px;
    background:var(--paper);border-top:1px solid var(--rule)}
  .sheetfoot .reset{margin-top:0}
  body.sheet-open{overflow:hidden}
}

/* ---- Toybox phone dock: on a phone the search and Filters sit at the bottom over a tab bar with icons, all in thumb
   reach (the header keeps the name, its buttons and the totals). The filters open as a sheet rising from the bottom
   over a dimmed page, with its own Close and "Show N sets" ---- */
@media (max-width:600px){
  /* the dock is 120px (14 fade + 46 search + 6 + 54 tabs; it was 142, trimmed 22 Nov 2026 for more of the grid) */
  body{padding-bottom:calc(128px + env(safe-area-inset-bottom))}
  .findbar{position:fixed;top:auto;left:0;right:0;bottom:calc(54px + env(safe-area-inset-bottom));z-index:31;border:0;
    background:linear-gradient(to bottom,transparent,var(--paper) 30%)}
  .findbar-in{padding:14px 14px 6px;gap:8px}
  .findbar .find{height:46px;border-radius:14px}
  .railbtn{height:46px;border-radius:14px}
  .masthead .tabs{position:fixed;left:0;right:0;bottom:0;z-index:32;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));
    width:auto;margin:0;padding:0 0 env(safe-area-inset-bottom);background:var(--paper);overflow:visible;gap:0}
  .masthead .tab{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;height:54px;margin:0;padding:0;border:0;
    font-size:13px;font-weight:600;color:var(--ink-faint)}
  :root[data-theme="dark"] .masthead .tab{border:0;padding:0}
  .masthead .tab[aria-selected="true"]{color:var(--accent)}
  .masthead .tab::before{content:'';width:22px;height:22px;background:currentColor;-webkit-mask:var(--ic) center/contain no-repeat;mask:var(--ic) center/contain no-repeat}
  #tabSets{--ic:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='8' height='8' rx='2'/%3E%3Crect x='13' y='3' width='8' height='8' rx='2'/%3E%3Crect x='3' y='13' width='8' height='8' rx='2'/%3E%3Crect x='13' y='13' width='8' height='8' rx='2'/%3E%3C/svg%3E")}
  #tabFigs{--ic:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3Cpath d='M5 21v-2a5 5 0 0 1 5-5h4a5 5 0 0 1 5 5v2'/%3E%3C/svg%3E")}
  #tabWish{--ic:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20s-7-4.4-7-10a4 4 0 0 1 7-2.6A4 4 0 0 1 19 10c0 5.6-7 10-7 10z'/%3E%3C/svg%3E")}
  #tabGraphs{--ic:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 20V11M12 20V4M19 20v-6'/%3E%3C/svg%3E")}
  .rail.open::before{content:'';position:fixed;inset:0;z-index:69;background:rgba(0,0,0,.55)}
  .rail.open .foldable{top:max(56px,16vh);border-radius:24px 24px 0 0;border-top:1px solid var(--field-edge);box-shadow:0 -18px 40px -20px rgba(0,0,0,.6)}
  .rail.open .sheethead{border-bottom:0;padding:16px 0 6px;font-size:18px;font-weight:700}
  .rail.open .sheetfoot{padding-bottom:calc(14px + env(safe-area-inset-bottom));border-top:1px solid var(--rule)}
  .rail.open .sheetfoot .reset{height:50px;border-radius:12px}
  .rail.open .sheetfoot .reset.primary{background:var(--ink);border-color:var(--ink);color:var(--paper)}
  .rail.open .sheethead .x{width:44px;height:44px;border-radius:12px;border-color:var(--field-edge);font-size:20px}
  .rail .viewswitch{border-radius:12px;padding:3px;gap:3px;border-color:var(--field-edge);background:var(--panel);width:max-content}
  .rail .viewbtn{width:auto;height:36px;padding:0 14px;border-radius:9px;border:0;display:flex;align-items:center;gap:6px;font-weight:600;font-size:14px;color:var(--ink)}
  .rail .viewbtn+.viewbtn{border-left:0}
  .rail .viewbtn[aria-pressed="true"]{background:var(--ink);color:var(--paper)}
  .rail .vlabel{display:inline}
  .rail .sortgrp .sel{height:44px;border-radius:12px 0 0 12px}
  .rail .sortgrp .dirbtn{height:44px;border-radius:0 12px 12px 0}
  /* above the search bar, not over the tabs (body: so the phone rules further down, from before the dock, don't win) */
  body .savebar,body .toast,body .totop{bottom:calc(106px + env(safe-area-inset-bottom))}
  body:has(.savebar:not([hidden])) :is(.toast,.totop){bottom:calc(182px + env(safe-area-inset-bottom))}
}

main{padding:var(--sp)}
.menu{position:relative}
.iconbtn{margin-left:auto;width:36px;height:36px;display:flex;align-items:center;justify-content:center;cursor:pointer;
  border:1px solid var(--callout-edge);border-radius:var(--r-sm);background:var(--panel);color:var(--ink);font-size:16px;line-height:1}
@media (hover:hover){.iconbtn:hover{border-color:var(--ink);color:var(--ink);background:rgba(127,127,127,.12)}}
.mast-top .menu{margin-left:-20px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.menubtn{list-style:none;cursor:pointer;width:36px;height:36px;display:flex;align-items:center;justify-content:center;
  border:1px solid var(--callout-edge);border-radius:var(--r-sm);font-size:20px;line-height:1;color:var(--ink);user-select:none}
.menubtn::-webkit-details-marker{display:none}
/* something in Status needs a look (paintDot): Status's warning colour, a dot on ⋯ and after Status in the menu. On the
   light-mode yellow header orange alone is too faint, so a thin dark ring there (3:1 for a status mark) */
.menubtn{position:relative}
.menubtn.alert::after,.menu-item.alert::after{content:'';width:9px;height:9px;border-radius:50%;background:var(--warn);flex:none}
.menubtn.alert::after{position:absolute;top:5px;right:5px}
:root:not([data-theme="dark"]) .masthead .menubtn.alert::after{box-shadow:0 0 0 1.5px var(--ink)}
.menu-item.alert::after{margin-left:auto}
.menu[open] .menubtn{border-color:var(--ink);color:var(--ink);background:rgba(127,127,127,.12)}
@media (hover:hover){.menubtn:hover{border-color:var(--ink);color:var(--ink);background:rgba(127,127,127,.12)}}
/* rows without an icon start where the icon rows' text does: padding 10 + icon 16 + gap 8 */
.menu-pop{--menu-text:34px;position:absolute;right:0;top:calc(100% + 6px);z-index:45;min-width:190px;padding:6px;background:var(--panel);
  border:1px solid var(--rule);border-radius:var(--r-sm);box-shadow:var(--shadow-hover);display:flex;flex-direction:column}
.menu-item{appearance:none;border:0;background:none;text-align:left;padding:9px 10px;border-radius:var(--r-sm);
  font-size:14px;line-height:1.3;color:var(--ink);cursor:pointer;display:flex;align-items:center;gap:8px;text-decoration:none}
.menu-item:hover{background:var(--callout);color:var(--ink)}
.menu-item svg{flex:none}
.menu-field{display:flex;align-items:center;gap:8px;padding:6px 10px 6px var(--menu-text);font-size:14px;color:var(--ink)}
/* the menu's groups (actions, settings, links, then the version) are split by a hairline, not each field */
.menu-group{display:flex;flex-direction:column}
.menu-group+.menu-group,.menu-group+.menu-info{border-top:1px solid var(--rule);margin-top:4px;padding-top:4px}
/* the version row's hover fill is rounded, but only at the bottom, so the divider above it stays straight */
.menu-group+.menu-info{border-radius:0 0 var(--r-sm) var(--r-sm)}
.menu-field{white-space:nowrap}
.menu-info:hover{background:var(--callout)}
.menu-info .menu-new{color:var(--accent);margin-left:4px}
/* the "What's new" popup */
.sheet-panel.changelog{max-width:560px}
/* a set's locations in its popup: the pills, "Change", and when open the chips to pick from */
.locline{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px}
.locline .linkbtn{font-size:14px}
/* "Remove": quiet grey, turning loss red on hover, so it doesn't look like "Change" next to it; the question it asks
   says plainly what goes. Under the purchase for one copy, on each copy's heading line for several, centred under
   "Mark as bought" on the wishlist */
.linkbtn.removecopy{display:flex;align-items:center;gap:5px;width:max-content;margin:2px 0 14px;font-size:13px;
  color:var(--ink-faint);text-decoration:none}
.linkbtn.removecopy span{text-decoration:underline;text-underline-offset:3px}
.linkbtn.removecopy svg{flex:none}
.linkbtn.removecopy:hover,.linkbtn.removecopy:focus-visible{color:var(--brick)}
@media (max-width:600px){.linkbtn.removecopy{min-height:44px}}
.copyhead{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 6px}
.copyhead h4{margin:0}
/* a table heading with its action keeps the heading's own space above */
.spechead{margin:20px 0 4px}
.mtabpanel>.spechead:first-child{margin-top:4px}
.copyhead .linkbtn.removecopy{margin:0;min-height:0}
/* a 44px tap target on phones without moving the line */
@media (max-width:600px){.copyhead .linkbtn.removecopy{padding:12px 0 12px 12px;margin:-12px 0}}
.boughtbtn+.removecopy{margin:-6px auto 16px}
/* "Edit" before Remove on the same line, as quiet; it turns ink on hover, not loss red: nothing is lost */
.copyacts{display:flex;align-items:center;gap:18px}
.linkbtn.copyedit{display:flex;align-items:center;gap:5px;width:max-content;margin:0;font-size:13px;color:var(--ink-faint);text-decoration:none}
.linkbtn.copyedit span{text-decoration:underline;text-underline-offset:3px}
.linkbtn.copyedit svg{flex:none}
.linkbtn.copyedit:hover,.linkbtn.copyedit:focus-visible{color:var(--ink)}
.copyacts .linkbtn{margin:0;min-height:0}
@media (max-width:600px){.copyacts .linkbtn{padding:12px 0;margin:-12px 0}}
/* the Edit form: the Add form's fields and picks, in a small popup */
.editform label.fl{font-size:14px;font-weight:600;color:var(--ink);margin:16px 0 8px}
.editform .find{height:44px;width:100%;border-radius:12px;border-color:var(--field-edge);font-size:16px}
.editform .locpick{display:flex;flex-wrap:wrap;gap:8px}
.editform .formchip{height:40px;padding:0 14px;border-radius:12px;font-size:14px;font-weight:600;border:1px solid var(--field-edge);background:none;color:var(--ink)}
.editform .formchip[aria-pressed="true"]{background:var(--ink);border-color:var(--ink);color:var(--paper)}
.editform .buyrow .find{height:44px}
.editsheet.sheet-panel.tokensheet{margin-top:6vh}
.editform .tokenwhy.miss{margin:14px 0 0}
.locwas{display:flex;align-items:center;gap:6px;margin-top:4px;font-size:12px;color:var(--ink-soft)}
.locwas::before{content:"";width:6px;height:6px;border-radius:50%;background:var(--accent);flex:none}
.locpick{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.locchip{display:inline-flex;align-items:center;gap:6px;min-height:36px}
/* a set's note: its lines as typed; open, a text box under "Done" in place of the text */
.notetext{white-space:pre-wrap;overflow-wrap:anywhere}
.notebox{display:block;margin-bottom:6px;resize:vertical;min-height:72px}
/* the old note can run to two lines: the dot stays by the first */
.noteedit .locwas{align-items:flex-start}
/* open, Done is alone on its line under the box: no gap before it, so it lines up with the box and the dot above */
.noteedit .notechange[aria-expanded="true"]{margin-left:0}
.noteedit .locwas::before{margin-top:6px}
/* the review list: each change on its line, old → new, with its own Undo */
.sheet-panel.reviewsheet{max-width:560px}
.reviewlist{list-style:none;margin:0;padding:0;max-height:min(55vh,480px);overflow-y:auto}
.reviewlist li{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0;font-size:14px}
.reviewlist li+li{border-top:1px solid var(--rule)}
.locdiff{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:4px}
.locdiff>span[aria-label]{color:var(--ink-faint)}
/* a long note in the list shows its first two lines */
.notediff{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere}
/* the access token: a small popup, asked for by whichever action needs it, and opened from the ⋯ menu */
.sheet-panel.tokensheet{max-width:440px;margin-top:12vh}
.tokenform .tokenwhy{margin:0 0 12px;font-size:14px;color:var(--ink-soft)}
.tokenform .tokenwhy.miss{color:var(--brick)}
.tokenacts{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}
.tokenacts .reset{width:auto;margin:0;padding-inline:16px}
/* a menu row that opens a setting: laid out like the fields beside it, with its state on the right */
.menu-field.tokenbtn{appearance:none;border:0;background:none;width:100%;text-align:left;font:inherit;font-size:14px;cursor:pointer;border-radius:var(--r-sm)}
.menu-field.tokenbtn:hover{background:var(--callout);color:var(--ink)}
.menu-val{margin-left:auto;font-size:12px;color:var(--ink-faint)}
.changelog .cl-h{font-size:16px;margin:4px 0 6px}
.changelog .cl-h:not(:first-child){margin-top:20px}
.changelog .cl-list{margin:0;padding-left:18px;font-size:14px;line-height:1.55;color:var(--ink-soft)}
.menu-info{appearance:none;border:0;background:none;width:100%;text-align:left;cursor:pointer;border-radius:var(--r-sm);padding:6px 10px 6px var(--menu-text);font-size:12px;line-height:1.6;color:var(--ink-faint);white-space:nowrap;font-variant-numeric:tabular-nums}
/* the photo-brightness slider only does anything in dark mode */
:root:not([data-theme="dark"]) .platefield{display:none}
.menu-field input[type=range]{width:96px;margin-left:auto}
.menu-field .faint{font-size:12px}
.menu-field .numin{width:72px;margin-left:auto;padding:5px 8px}
.subswitch{margin-bottom:20px}
.subswitch .viewbtn{font-size:14px;padding:8px 14px}
.subswitch .n{margin-left:6px;opacity:.7;font-size:12px}
#viewGraphs .charts{margin-bottom:0}
#viewGraphs details.gr{margin-bottom:12px}
.ghead{margin-bottom:24px}
.ghead h2{font-size:20px;margin-bottom:5px}
.ghead p{margin:0;font-size:14px;color:var(--ink-soft);max-width:62ch}
#viewAddSet .ghead p{max-width:none}
/* the access token field, with an eye button inside its right end */
.pwfield{position:relative}
.pwfield .mini{padding-right:44px}
.pwtoggle{position:absolute;right:4px;top:50%;transform:translateY(-50%);width:36px;height:36px;display:flex;align-items:center;
  justify-content:center;border:0;border-radius:var(--r-sm);background:none;color:var(--ink-faint);cursor:pointer}
.pwtoggle:hover{color:var(--ink);background:var(--callout)}
/* tabs */
.tabs{display:flex;margin:10px 0 0 -6px;
  overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;scrollbar-width:thin}
.tab{appearance:none;background:none;border:0;border-bottom:3px solid transparent;padding:10px 6px 9px;
  margin-right:24px;cursor:pointer;flex-shrink:0;white-space:nowrap;
  font-weight:700;font-size:16px;color:var(--ink-soft);letter-spacing:-.01em}
.tab:hover,.tab[aria-selected="true"]{color:var(--ink)}
.tab[aria-selected="true"]{border-bottom-color:var(--accent)}
[hidden]{display:none!important}
/* minifig cards */
.fgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(146px,1fr));gap:16px}
/* set and minifig cards share one frame: a panel that lifts on hover */
:is(.card,.fig){background:var(--panel);border:1px solid var(--rule);border-radius:var(--r-card);overflow:hidden;display:flex;
  flex-direction:column;text-align:left;font:inherit;color:inherit;padding:0;cursor:pointer;
  text-decoration:none;transition:transform .16s ease,box-shadow .16s ease;box-shadow:var(--shadow)}
:is(.card,.fig):hover{transform:translateY(-2px);box-shadow:var(--shadow-hover)}
.fig .plate{aspect-ratio:3/4}
.fig .plate img{padding:6px}
.fbody{padding:10px 10px 11px;display:flex;flex-direction:column;gap:3px;flex:1;border-top:1px solid var(--rule);min-width:0}
.fname{font-size:14px;line-height:1.25;font-weight:600;min-height:2.5em;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.fdesc{font-size:12px;line-height:1.3;color:var(--ink-faint);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.fid{font-size:12px;color:var(--ink-faint)}
.fmeta{font-variant-numeric:tabular-nums;margin-top:auto;display:flex;justify-content:space-between;align-items:baseline;gap:6px;
  font-size:12px;color:var(--ink-soft);padding-top:5px}
.fmeta b{color:var(--ink)}
/* ×2 on a card's photo: a dark pill in both themes, as photos stay light in dark mode (the page's ink colour, near
   white there, faded into them) */
.qty2{position:absolute;top:8px;right:8px;background:#1B1A17;color:#fff;
  font-size:12px;font-weight:600;line-height:1;padding:5px 8px;border-radius:999px;box-shadow:0 1px 2px rgba(0,0,0,.12);z-index:2}
.setlist{list-style:none;margin:6px 0 0;padding:0;font-size:14px}
/* each set on two lines: its name, then its number with its location pills, so the pills don't wrap in after the
   number wherever the name happens to end */
.setlist li{display:flex;flex-direction:column;align-items:flex-start;gap:4px;padding:8px 0;border-bottom:1px dotted var(--rule)}
.setmeta{display:flex;flex-wrap:wrap;align-items:center;gap:4px 6px;font-size:12px}
.setlist a{text-decoration:none}
.setjump{all:unset;cursor:pointer;color:var(--accent);font-weight:500}
.setjump:hover,.setjump:focus-visible{text-decoration:underline}
.sec{margin-bottom:44px;scroll-margin-top:16px}
.sec-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 10px;padding-bottom:8px;
  border-bottom:1px solid var(--rule);margin-bottom:16px}
.sec-head h2{font-size:20px}
.sec-head .qty{font-size:14px;font-weight:500;color:var(--ink-faint)}
.sec-head .spend{font-size:14px;color:var(--ink-faint);margin-left:auto}
.sec-head .par{font-size:14px;color:var(--ink-faint);}

/* ---- charts ---- */
.charts{margin-bottom:44px}
details.gr{background:var(--panel);border:1px solid var(--rule);border-radius:var(--r-card);margin-bottom:10px}
details.gr>summary{cursor:pointer;padding:13px 16px;display:flex;align-items:center;gap:12px;list-style:none;
  font-weight:600;font-size:16px}
details.gr>summary::-webkit-details-marker{display:none}
details.gr>summary::before{content:'';width:7px;height:7px;flex:none;margin:0 3px 0 2px;border-right:2px solid var(--ink-soft);border-bottom:2px solid var(--ink-soft);transform:rotate(-45deg);transition:transform .15s ease}
details.gr[open]>summary::before{transform:rotate(45deg)}
details.gr>summary .hint{margin-left:auto;font-size:12px;color:var(--ink-faint);font-weight:400}
@media (max-width:400px){details.gr>summary .hint{display:none}}
.gr-body{padding:4px 16px 18px;border-top:1px solid var(--rule)}
.gr-body:empty{display:none}
.two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:26px 32px}
@media (max-width:760px){.two{grid-template-columns:minmax(0,1fr)}}
.gtitle{font-size:14px;font-weight:600;
  color:var(--ink-faint);margin:20px 0 12px}
.hb{list-style:none;margin:0;padding:0}
.hb li{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1.4fr) 64px;gap:9px;align-items:center;padding:2.5px 0;font-size:14px}
.hb .hl{overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;line-height:1.25;color:var(--ink-soft)}
.hb .hbar{background:var(--callout);height:11px;border-radius:var(--r-sm);overflow:hidden}
.hb .hbar i{display:block;height:100%;background:var(--data)}
.hb .hv{font-size:12px;font-weight:600;white-space:nowrap;text-align:right}
.hb.gain .hbar i{background:var(--moss)}
/* a bar cut short to keep the others readable shows a break near its end */
.hb .hbar.over i{-webkit-mask:linear-gradient(90deg,#000 calc(100% - 12px),transparent 0 calc(100% - 8px),#000 0);mask:linear-gradient(90deg,#000 calc(100% - 12px),transparent 0 calc(100% - 8px),#000 0)}
.hb.loss .hbar i{background:var(--brick)}
.vb{display:flex;align-items:flex-end;gap:2px;height:120px}
.vb .b{flex:1;background:var(--data);min-height:2px;border-radius:var(--r-sm) var(--r-sm) 0 0;position:relative}
.vb .b.z{background:var(--callout-edge)}
.vb .b:hover{opacity:.75}
.vb .b span{position:absolute;bottom:100%;left:50%;transform:translateX(-50%);
  font-size:12px;color:var(--ink);background:var(--panel);border:1px solid var(--rule);padding:1px 5px;border-radius:var(--r-sm);
  display:none;pointer-events:none;white-space:nowrap;z-index:3}
/* not just transparent: hidden labels still took up room and pushed the page sideways on phones */
.vb .b:hover span{display:block}
/* labels for bars near either end open inwards so they stay on screen */
.vb .b:nth-child(-n+4) span{left:0;transform:none}
.vb .b:nth-last-child(-n+4) span{left:auto;right:0;transform:none}
.axis{display:flex;justify-content:space-between;margin-top:6px;font-size:12px;color:var(--ink-faint)}
.ychart{position:relative;padding-left:56px}
.ychart .vb,.ychart svg.plot.cum{position:relative;z-index:1}
.ygrid{position:absolute;left:0;right:0;top:0;height:var(--h)}
.ygrid i{position:absolute;left:56px;right:0;border-top:1px dashed var(--rule)}
.ygrid span{position:absolute;right:calc(100% + 6px);top:-8px;font-size:12px;color:var(--ink-faint);font-style:normal;white-space:nowrap}
.ticks{position:relative;height:18px;margin-top:6px;border-top:1px solid var(--rule);font-size:12px;color:var(--ink-faint)}
.ticks span{position:absolute;top:3px;transform:translateX(-50%);white-space:nowrap}
.ticks span::before{content:'';position:absolute;left:50%;top:-4px;height:4px;border-left:1px solid var(--rule)}
.legend{display:flex;flex-wrap:wrap;gap:4px 14px;margin-top:9px;font-size:12px;color:var(--ink-soft)}
.legend span{display:flex;align-items:center;gap:5px}
.legend b{width:9px;height:9px;border-radius:var(--r-sm);display:inline-block}
svg.plot{width:100%;height:auto;display:block;overflow:visible}
svg.plot text{fill:var(--ink-faint)}
/* viewBox units scale with the chart's width, so size these charts and their labels together */
svg.plot.cum{height:140px}
.scatter-row{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:20px 32px;align-items:start;margin-top:12px}
@media (max-width:760px){.scatter-row{grid-template-columns:minmax(0,1fr)}}
svg.plot.scatter{margin:0}
svg.plot.scatter text{font-size:2.7px}
/* the chart shrinks with the screen: keep its labels at 12px or more on phones */
@media (max-width:600px){svg.plot.scatter text{font-size:3.8px}}
svg.plot.scatter text.lbl{fill:var(--ink-soft)}
svg.plot.scatter .gl{stroke:var(--rule);stroke-width:.25}
svg.plot.scatter .even{stroke:var(--ink-faint);stroke-width:.3;stroke-dasharray:1.2 1.2}
svg.plot.scatter circle.gain{fill:var(--moss);opacity:.8}
svg.plot.scatter circle.loss{fill:none;stroke:var(--brick);stroke-width:.45;opacity:.85}
.legend b.lg-gain{background:var(--moss);border-radius:50%}
.legend b.lg-loss{background:none;border:2px solid var(--brick);border-radius:50%}
.note{font-size:12px;color:var(--ink-faint);margin-top:12px;line-height:1.5}
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:1px;background:var(--rule);
  border:1px solid var(--rule);border-radius:var(--r-card);overflow:hidden;margin-bottom:16px}
.kpis div{background:var(--panel);padding:14px 16px}
.kpis dt{font-size:12px;font-weight:500;color:var(--ink-faint)}
.kpis dd{margin:3px 0 0;font-size:16px;font-weight:600}
.kpis dd.kpi-sub{margin-top:2px;font-size:12px;font-weight:400;color:var(--ink-faint)}
.up{color:var(--moss)}.down{color:var(--brick)}

/* ---- table view ---- */
.settable{width:100%;border-collapse:collapse;background:var(--panel);border:1px solid var(--rule)}
.settable thead th{position:sticky;top:var(--barh,0px);z-index:1;text-align:left;
  font-size:12px;font-weight:600;color:var(--ink-faint);padding:9px 10px;background:var(--panel);
  border-bottom:1px solid var(--rule);white-space:nowrap}
.thsort{all:unset;cursor:pointer;white-space:nowrap}
/* the sorted column is ink and bold, a hovered one underlined: red is for links */
.thsort:hover{color:var(--ink);text-decoration:underline;text-underline-offset:3px}
.thsort.on{color:var(--ink);font-weight:700}
.thsort:focus-visible{outline:2.5px solid var(--accent);outline-offset:2px;border-radius:var(--r-sm)}
.setrow{cursor:pointer;transition:background .1s ease}
.setrow:hover,.setrow:focus-within{background:var(--callout)}
.rowopen{all:unset;cursor:pointer}
.rowopen:focus-visible{outline:2.5px solid var(--accent);outline-offset:3px;border-radius:var(--r-sm)}
.setrow td{padding:7px 10px;border-bottom:1px solid var(--rule);vertical-align:middle;font-size:14px}
.setrow:last-child td{border-bottom:0}
.rowthumb{width:44px}
.rowplate{display:block;width:36px;height:36px;background:var(--plate);border-radius:var(--r-sm);overflow:hidden;isolation:isolate}
.rowthumb img{width:100%;height:100%;object-fit:contain;mix-blend-mode:multiply;display:block}
.rowname{min-width:180px}
.rn{font-weight:600;font-size:14px;line-height:1.25}
.rnum{font-size:12px;color:var(--ink-faint)}
.rowcn{white-space:nowrap}
.rownum{font-variant-numeric:tabular-nums;white-space:nowrap}

/* ---- Toybox table: a rounded panel, a header row on the control colour, 48px photo plates, right-aligned numbers,
   the status as badges; on a phone only the set, its value and vs paid ---- */
.settable{border-radius:20px;border-collapse:separate;border-spacing:0;border:1px solid var(--rule);font-size:15px}
/* rounded without clipping (clipping would stop the header row sticking): the corner cells take the curve */
.settable thead th:first-child{border-top-left-radius:19px}.settable thead th:last-child{border-top-right-radius:19px}
.settable tbody tr:last-child td:first-child{border-bottom-left-radius:19px}.settable tbody tr:last-child td:last-child{border-bottom-right-radius:19px}
.settable thead th{background:var(--callout);font-size:13px;font-weight:700;color:var(--ink-faint);padding:10px 12px;border-bottom:1px solid var(--rule)}
.settable th.rownum{text-align:right}
.settable .thsort.on{color:var(--ink)}
.settable td{padding:8px 12px;border-top:1px solid var(--rule);vertical-align:middle}
.settable tbody tr:first-child td{border-top:0}
.settable td:first-child,.settable th:first-child{padding-left:16px}
.settable td:last-child,.settable th:last-child{padding-right:16px}
.settable .rowthumb{width:60px}
.settable .rowplate{width:48px;height:48px;border-radius:10px;background:var(--plate)}
.settable .rowthumb img{padding:4px}
.settable .rn{font-size:15px}
.settable .rn .rowopen{font-weight:600}
.settable .rnum{font-size:13px}
.settable .rownum{text-align:right}
.rowstatus{display:flex;align-items:center;gap:6px;white-space:nowrap}
.rowstatus .status{font-size:13px;font-weight:700;padding:4px 10px;line-height:1.25;color:#1B1A17;box-shadow:none}
.rowstatus .status:is(.parted,.points){background:#C9C8C3;color:#1B1A17}
:root:not([data-theme="dark"]) .rowstatus .status{box-shadow:inset 0 0 0 1.5px rgba(0,0,0,.5)}
:root:not([data-theme="dark"]) .rowstatus .status:is(.parted,.points){background:#DCDCE0}
.rowplain{font-size:14px}
@media (max-width:600px){
  .settable .rowpaid,.settable .rowcn,.settable .rowacq,.settable .rowpc,.settable .rowyr{display:none}
  .settable .rowname{min-width:0}
  .settable thead th{top:0}
  .settable thead th.rowvs{border-top-right-radius:19px}
  .settable td{padding:8px 8px}
  .settable .rowthumb{width:52px}.settable .rowplate{width:40px;height:40px}
}

/* ---- Toybox Stats: what was built first (the biggest set on its theme colour, the counts), then what it cost as
   its own card; the chart sections below are rounded cards like the rest ---- */
.statshero{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:16px}
.bigset{all:unset;box-sizing:border-box;position:relative;overflow:hidden;cursor:pointer;border-radius:24px;background:var(--c-bg);color:var(--ink);
  padding:28px;min-height:280px;display:flex;flex-direction:column}
.bigset:focus-visible{outline:2.5px solid var(--accent);outline-offset:3px}
.bigk,.bigmeta{font-size:15px;color:var(--c-meta);position:relative;z-index:1}
.bigmeta{margin-top:auto}
.bigname{position:relative;z-index:1;font-family:var(--font-brand);font-weight:800;font-size:36px;line-height:1.05;letter-spacing:-.03em;max-width:55%}
.bigset>img{position:absolute;right:8px;bottom:-6px;height:270px;width:auto;max-width:55%;object-fit:contain;filter:drop-shadow(0 20px 26px rgba(0,0,0,.45))}
.bigplate{position:absolute;right:24px;top:24px;bottom:24px;width:42%;border-radius:18px;background:var(--plate);display:flex;align-items:center;justify-content:center}
.bigplate img{max-width:88%;max-height:88%;object-fit:contain}
.statcard{border-radius:24px;background:var(--panel);border:1px solid var(--rule);padding:28px}
.statcard.built{display:flex;flex-direction:column;gap:18px}
.statcard.built dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px 18px;margin:0}
.statcard.built dt{font-size:14px;color:var(--ink-faint)}
.statcard.built dd{margin:2px 0 0;font-family:var(--font-brand);font-weight:800;font-size:34px;font-variant-numeric:tabular-nums}
.statcard.built p{margin:auto 0 0;padding-top:18px;border-top:1px solid var(--rule);font-size:15px;color:var(--ink-soft)}
.statcard.money{display:grid;grid-template-columns:220px minmax(0,1fr);gap:8px 32px;margin-bottom:16px;padding:24px 28px}
.moneyk h2{margin:0;font-family:var(--font-brand);font-weight:800;font-size:20px;letter-spacing:-.02em}
.moneyk .faint{font-size:14px;margin-top:10px}
.moneyk .faint+.moneybig+.faint{margin-top:0}
.moneybig{font-family:var(--font-brand);font-weight:800;font-size:30px;font-variant-numeric:tabular-nums}
.moneytext p{margin:0 0 8px;font-size:15px;line-height:1.5;color:var(--ink-soft)}
.moneytext p.lead{font-size:18px}
.moneytext b{color:var(--ink)}
.moneytext b.up{color:var(--moss)}.moneytext b.down{color:var(--brick)}
.moneytext .moneyfoot{font-size:14px;margin:0}
.statcard.built dl>div{display:flex;flex-direction:column;justify-content:flex-end}
/* the Stats and Wishlist Sets / Minifigs switches: the same segmented control as Grid / Table */
.subswitch{border-radius:12px;padding:3px;gap:3px;border:1px solid var(--field-edge);background:var(--panel);width:max-content}
.subswitch .viewbtn{height:36px;padding:0 14px;border-radius:9px;border:0;font-weight:600;font-size:14px;color:var(--ink);display:flex;align-items:center;gap:6px}
.subswitch .viewbtn+.viewbtn{border-left:0}
.subswitch .viewbtn[aria-pressed="true"]{background:var(--ink);color:var(--paper)}
.subswitch .viewbtn .n{color:inherit;opacity:.7;font-weight:600}
details.gr{border-radius:24px;overflow:hidden}
details.gr>summary{padding:18px 22px;font-family:var(--font-brand);font-weight:800;font-size:18px;letter-spacing:-.01em}
.kpis{border-radius:24px;overflow:hidden}
@media (max-width:760px){
  .statshero{grid-template-columns:1fr}
  .statcard.money{grid-template-columns:1fr}
  .bigname{font-size:28px}
  .bigset>img{height:200px}
}

/* ---- Toybox minifig cards: the set card's frame (rounded, no shadow), the photo on a rounded white plate inside it ---- */
.fgrid .fig{border-radius:20px;border:1px solid var(--rule);box-shadow:none;background:var(--panel);padding:8px}
.fgrid .fig:hover{transform:translateY(-3px);box-shadow:0 18px 30px -16px rgba(0,0,0,.55)}
.fgrid .fig .plate{border-radius:14px;background:var(--plate)}
.fgrid .fbody{border-top:0;padding:10px 6px 6px}
.fgrid .fname{font-size:15px}

/* ---- Toybox Add a set: the form in a rounded card under a big title; its switches the Grid / Table control, its
   picks the filter chips, the add button the popup's filled bar ---- */
#viewAddSet{max-width:600px}
#viewAddSet .addset-form{background:var(--panel);border:1px solid var(--rule);border-radius:24px;padding:28px}
#viewAddSet .ghead h2{font-family:var(--font-brand);font-weight:800;font-size:32px;letter-spacing:-.03em}
#viewAddSet .ghead p{font-size:16px;color:var(--ink-soft);margin:8px 0 18px}
#viewAddSet .formswitch{border-radius:12px;padding:3px;gap:3px;border:1px solid var(--field-edge);background:var(--panel);width:max-content}
#viewAddSet .formswitch .viewbtn{height:36px;padding:0 16px;border-radius:9px;border:0;font-weight:600;font-size:14px;color:var(--ink)}
#viewAddSet .formswitch .viewbtn+.viewbtn{border-left:0}
#viewAddSet .formswitch .viewbtn[aria-pressed="true"]{background:var(--ink);color:var(--paper)}
#viewAddSet label.fl{font-size:14px;font-weight:600;color:var(--ink);margin:18px 0 8px}
#viewAddSet .find{height:44px;border-radius:12px;border-color:var(--field-edge);font-size:16px}
#viewAddSet textarea.find{height:auto;min-height:88px}
#viewAddSet .spec-h{font-family:var(--font-brand);font-weight:800;font-size:20px;letter-spacing:-.01em}
#viewAddSet .formchip{height:40px;padding:0 14px;border-radius:12px;font-size:14px;font-weight:600;border:1px solid var(--field-edge);background:none;color:var(--ink);display:inline-flex;align-items:center}
#viewAddSet .formchip[aria-pressed="true"]{background:var(--ink);border-color:var(--ink);color:var(--paper)}
#viewAddSet .locpick{gap:8px}
#asAddBtn{height:52px;border-radius:14px;background:var(--ink);border-color:var(--ink);color:var(--paper);font-size:16px;font-weight:600;margin-top:24px}
#asAddBtn:hover{opacity:.92;color:var(--paper)}
#asAddBtn:disabled{opacity:.45}
/* a popup over the tab it was opened from: the page dims behind it; a phone gets the whole screen */
body.adding{overflow:hidden}
body.adding #viewAddSet{position:fixed;inset:0;z-index:50;max-width:none;overflow-y:auto;overscroll-behavior:contain;
  padding:var(--sp);background:rgba(19,23,27,.62);display:flex;justify-content:center;align-items:flex-start}
#viewAddSet .addset-form{position:relative;width:100%;max-width:600px;margin:0 auto;border-color:var(--field-edge);box-shadow:0 24px 70px -18px rgba(0,0,0,.6)}
.addclose{position:absolute;top:18px;right:18px;width:44px;height:44px;border:0;border-radius:12px;background:none;color:var(--ink-soft);
  display:flex;align-items:center;justify-content:center;cursor:pointer}
.addclose:hover{background:rgba(127,127,127,.15);color:var(--ink)}
#viewAddSet .ghead{padding-right:48px}
@media (max-width:600px){
  body.adding #viewAddSet{padding:0}
  #viewAddSet .addset-form{padding:20px 20px calc(24px + env(safe-area-inset-bottom));border-radius:0;border:0;min-height:100%;max-width:none}
  #viewAddSet .ghead h2{font-size:28px}
  .addclose{top:12px;right:12px}
}

/* ---- Toybox menu: a rounded panel with 44px rows and the same fields ---- */
.menu-pop{border-radius:16px;padding:8px;min-width:260px;border:1px solid var(--field-edge);box-shadow:0 18px 40px -16px rgba(0,0,0,.55)}
.menu-item{min-height:44px;border-radius:10px;font-size:15px;padding:0 12px;display:flex;align-items:center;gap:10px}
.menu-item:hover{background:rgba(127,127,127,.14);color:var(--ink)}
.menu-field{min-height:44px;font-size:15px;padding:0 12px 0 var(--menu-text)}
.menu-field.tokenbtn{font-size:15px;border-radius:10px}
.menu-field.tokenbtn:hover{background:rgba(127,127,127,.14);color:var(--ink)}
.menu-field .numin{height:36px;border-radius:10px;border-color:var(--field-edge)}
.menu-group+.menu-group,.menu-group+.menu-info{margin-top:6px;padding-top:6px}
.menu-info{border-radius:10px;padding:8px 12px 8px var(--menu-text);font-size:13px}
.menu-info:hover{background:rgba(127,127,127,.14)}

/* ---- cards ---- */
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:16px}
@media (max-width:600px){
  .grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .fig .status,.qty2{padding:3px 6px}
  .fgrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .mast-inner{padding-top:10px}
  .mast-top{gap:8px 18px}
  .mast-top .menu,.mast-top #themeBtn{margin-left:-10px}
  .masthead .addbtn{width:36px;padding:0}
  .addtxt{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  /* the totals wrap under the brand, the fourth dropped for room */
  .totals{order:3;width:100%;gap:2px 12px}
  .totals>div:nth-child(n+4){display:none}
  .totals dd{font-size:14px}
  .tabs{margin-top:4px}
  main{padding-top:16px}
  .tab{margin-right:6px}
}
/* ---- the Toybox set card ----
   Tinted by theme family (THEME_FAM in script.js): --c-bg the card, --c-meta its small text. One grid: number and
   badges, the photo in the space that's left, then theme · pieces and the name on up to two lines */
/* one lightness and chroma for all (OKLCH 0.31/0.072 deep, 0.915/0.048 pale), hues spread round the wheel: the old
   deep tones were too dark and grey for their hues to show, and navy, steel, teal and grey all read as navy */
.fam-navy{--c-bg:#1B2F54;--c-meta:#C4D5F3}.fam-purple{--c-bg:#37264E;--c-meta:#D9CEEE}
.fam-pink{--c-bg:#4A1F37;--c-meta:#ECC9D9}.fam-red{--c-bg:#4F1F1E;--c-meta:#F1C9C6}
.fam-copper{--c-bg:#4B2504;--c-meta:#EDCDB9}.fam-gold{--c-bg:#3D2E00;--c-meta:#DFD4B3}
.fam-green{--c-bg:#0B3A1D;--c-meta:#BFDDC6}.fam-teal{--c-bg:#003A3F;--c-meta:#B3DEE0}
.fam-grey{--c-bg:#32302C;--c-meta:#D6D4D0}
:root:not([data-theme="dark"]) .fam-navy{--c-bg:#D2E4FF;--c-meta:#2E4775}
:root:not([data-theme="dark"]) .fam-purple{--c-bg:#E8DCFE;--c-meta:#503B6E}
:root:not([data-theme="dark"]) .fam-pink{--c-bg:#FDD7E9;--c-meta:#683350}
:root:not([data-theme="dark"]) .fam-red{--c-bg:#FFD7D4;--c-meta:#6E3331}
:root:not([data-theme="dark"]) .fam-copper{--c-bg:#FDDBC5;--c-meta:#6A3913}
:root:not([data-theme="dark"]) .fam-gold{--c-bg:#EEE3BF;--c-meta:#584500}
:root:not([data-theme="dark"]) .fam-green{--c-bg:#CCEDD4;--c-meta:#1C5430}
:root:not([data-theme="dark"]) .fam-teal{--c-bg:#BFEDEF;--c-meta:#00555A}
/* grey on a grey page needs an edge */
:root:not([data-theme="dark"]) .fam-grey{--c-bg:#E4E3DE;--c-meta:#494844}
:root:not([data-theme="dark"]) .card.fam-grey{--c-bg:#E4E3DE;--c-meta:#494844;box-shadow:inset 0 0 0 1px rgba(133,134,141,.28)}
/* a hairline on sharp screens: a full pixel read as a thick outline there */
@media (min-resolution:2dppx){:root:not([data-theme="dark"]) .card.fam-grey{box-shadow:inset 0 0 0 .5px rgba(133,134,141,.5)}}
.grid .card{display:grid;grid-template-rows:auto minmax(0,1fr) auto;grid-template-columns:minmax(0,1fr);gap:8px;height:300px;padding:14px 14px 16px;
  background:var(--c-bg);color:var(--ink);border:0;border-radius:24px;box-shadow:none;position:relative;
  transition:transform .25s cubic-bezier(.2,.7,.2,1),box-shadow .25s}
.grid .card:hover{transform:translateY(-3px);box-shadow:0 18px 30px -16px rgba(0,0,0,.55)}
.card-top{display:flex;flex-wrap:wrap;align-items:flex-start;gap:6px;min-height:26px}
.card-num{font-size:13px;font-weight:600;color:var(--c-meta);padding:4px 4px 0;font-variant-numeric:tabular-nums}
/* plain text by the number: it kept the old corner pill's black fill, a black dot in light mode until 22 Nov 2026 */
.card .qty2{position:static;font-size:13px;font-weight:700;color:var(--c-meta);background:none;padding:4px 0 0}
.card .badges{position:static;margin-left:auto;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px;max-width:none}
.card .status{font-size:13px;font-weight:700;padding:4px 10px;line-height:1.25;box-shadow:none;color:#1B1A17}
/* a narrow card (an iPad's four columns are 240px) tightens the top row, so a long number and two badges ("71053-13",
   Sealed, 12/26) still fit on one line instead of wrapping and taking a line from the photo. On a phone's cards
   (194px) they still wrap; no spacing closes that */
.card{container-type:inline-size}
@container (max-width:260px){.card-top,.card .badges{gap:4px}.card .status{padding-inline:7px}.card-num{padding-inline:2px}}
/* on a card the points badge is the tick alone (its words are its tooltip and for screen readers): with a word, a
   number and the retiring badge wrapped on a phone and took a line from the photo. The popup and table say "Claimed" */
.card .status.points>span[aria-hidden]{display:none}
.card .status.points{padding-inline:5px}
:root:not([data-theme="dark"]) .card .status{box-shadow:inset 0 0 0 1.5px rgba(0,0,0,.5)}
/* dark text, as on the other badges: the shared .parted rule further down gave it ink, near-white in dark mode */
.card .status:is(.parted,.points){background:#C9C8C3;color:#1B1A17}
:root:not([data-theme="dark"]) .card .status:is(.parted,.points){background:#DCDCE0}
.card-pic{display:flex;align-items:flex-end;justify-content:center;min-height:0}
.card-pic>img{display:block;max-width:100%;max-height:100%;object-fit:contain;filter:drop-shadow(0 14px 16px rgba(0,0,0,.45))}
:root:not([data-theme="dark"]) .card-pic>img{filter:drop-shadow(0 14px 16px rgba(40,30,0,.28))}
/* no cut-out yet: the photo on a white plate, as it comes */
/* no cut-out: the whole picture (box art, a box scan, a photo with its own backdrop) straight on the theme colour,
   rounded and shadowed like a print laid on the card. No white plate around it, and never cropped: box art filling
   the plate lost its edges (from 22 Nov 2026) */
.card-pic .plate{width:100%;height:100%;aspect-ratio:auto;background:none;overflow:visible;display:flex;align-items:center;justify-content:center}
.card-pic .plate img,.card-pic .plate.fill img{position:static;width:auto;height:auto;max-width:100%;max-height:100%;padding:0;
  object-fit:contain;border-radius:12px;mix-blend-mode:normal;box-shadow:0 12px 22px -10px rgba(0,0,0,.6)}
:root:not([data-theme="dark"]) .card-pic .plate img{box-shadow:0 12px 22px -10px rgba(40,30,0,.35)}
.grid .card .card-body{padding:0 4px;gap:3px;border:0;flex:none}
.grid .card .card-meta{font-size:14px;color:var(--c-meta);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.card-row{display:flex;align-items:flex-end;gap:8px}
.card-open{all:unset;cursor:pointer;flex:1;min-width:0;font-family:var(--font-brand);font-weight:800;font-size:19px;line-height:1.15;
  letter-spacing:-.02em;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.grid .card .instrlink{width:44px;height:44px;padding:0;justify-content:center;border-radius:12px;border:1px solid var(--c-meta);color:var(--ink)}
.grid .card .instrlink svg{width:18px;height:18px}
.grid .card .instrlink:hover{border-color:var(--ink);background:rgba(127,127,127,.15)}
:is(.flag,.status):is(.retiring,.points){display:inline-flex;align-items:center;gap:4px}
:is(.flag,.status):is(.retiring,.points) svg{flex:none}
.grid .card.wish{height:344px}
.card-buy{font-size:14px;font-variant-numeric:tabular-nums}
.card-buy .card-meta{font-size:inherit}
.card:has(.card-open:focus-visible){outline:2.5px solid var(--accent);outline-offset:3px}
.card-open:focus-visible{outline:0}
@media (prefers-reduced-motion:reduce){.grid .card:hover{transform:none}}
@media (max-width:600px){
  .grid .card{height:250px;padding:12px 12px 14px;border-radius:20px}
  .card-open{font-size:16px}
  .grid .card .card-meta{font-size:13px}
  /* instructions are in the popup on a phone, so the name gets the card's width */
  .grid .card .instrlink{display:none}
  .card .status{padding:3px 7px;font-size:12px}
  .card .badges{gap:4px}
  .card .status:is(.retiring,.points){gap:3px}
  .card .status:is(.retiring,.points) svg{width:10px;height:10px}
  .card-num{padding:3px 2px 0}
}
.flag{font-size:12px;padding:2px 6px;border-radius:999px;font-weight:600;white-space:nowrap}
.flag.built{background:var(--callout);color:var(--ink-soft)}
#viewAddSet{max-width:500px}
/* the form's two-button switches; nothing below them adds space of its own, so the gap to the next label is the
   same whichever sections show */
.formswitch{margin:0}
.formswitch .viewbtn{font-size:14px;padding:8px 16px}
#viewAddSet .ghead{margin-bottom:4px}
.reset.primary:disabled{background:var(--callout);border-color:var(--callout-edge);color:var(--ink-faint);cursor:default}
.reset.primary{background:var(--accent-fill);border-color:var(--accent-fill);color:#fff;font-weight:600}
/* a main button keeps its own colours on hover, just a touch lighter: a red edge and white text vanished on dark
   mode's near-white fill */
.reset.primary:hover:not(:disabled){opacity:.9}
/* the wishlist popup's main action, under the link row */
.reset.boughtbtn{margin:0 0 16px}
@media (max-width:600px){.reset.boughtbtn{min-height:44px}}
.addset-form{display:flex;flex-direction:column}
/* Set or Minifig comes first, with a label's gap above it, as it has no label of its own */
#asWhat{margin-top:14px}
/* its conditions and locations are a popup's chips; the label above gives the space, not the chips */
.locpick.formpick{margin-top:0}
/* the collection's part of the form is the purchase, headed like a popup's sections */
#asCollBox .spec-h{margin:22px 0 0;padding-top:14px;border-top:1px solid var(--rule)}
.formchip{display:inline-flex;align-items:center;min-height:36px;font-size:13px}
.formchip .locdot{margin-right:6px}
/* date and price side by side, at any width: both are short */
/* minmax(0,…): plain 1fr lets the date's own width (wide on the iPhone) push its column into the price */
.buyrow{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
/* one fixed height: the date's calendar icon makes it 2px taller than the price otherwise */
.buyrow .find{width:100%;min-width:0;height:42px;box-sizing:border-box}
/* the iPhone draws its own date box, centred and ignoring the width, unless told not to */
.buyrow input[type=date]{-webkit-appearance:none;appearance:none;display:block}
.buyrow input[type=date]::-webkit-date-and-time-value{text-align:left}
#asSrc{width:100%;box-sizing:border-box}
/* the set preview under a set number box */
.setpeek{display:flex;align-items:center;gap:12px;margin-top:8px;padding:8px;background:var(--panel);
  border:1px solid var(--rule);border-radius:var(--r-card);font-size:14px}
.setpeek img{width:64px;height:64px;flex:none;object-fit:contain;background:var(--plate)}
.setpeek b{display:block;font-weight:600}
.setpeek span{display:block;font-size:12px;color:var(--ink-faint);margin-top:2px}
.setpeek .have{color:var(--ink);font-weight:600}
.setpeek.peek-note{display:block;padding:8px 10px;font-size:12px;color:var(--ink-faint)}
.setpeek.miss{color:var(--brick)}
/* Scan sits beside the number box, outlined like the form's other controls, the same 44px tall */
.numrow{display:flex;gap:8px}
.numrow .find{flex:1 1 auto;min-width:0}
.scanbtn{flex:none;display:inline-flex;align-items:center;gap:6px;height:44px;padding:0 14px;background:var(--panel);
  border:1px solid var(--field-edge);border-radius:12px;color:var(--ink);font:inherit;font-size:14px;font-weight:600;cursor:pointer}
.scanbtn:hover,.scanbtn[aria-expanded="true"]{border-color:var(--ink);background:rgba(127,127,127,.12)}
.scanbtn[hidden]{display:none}
/* the camera, square, under the box; black until it starts */
.scanbox{margin-top:8px;text-align:center}
.scanbox video{display:block;width:100%;max-width:320px;aspect-ratio:1;margin:0 auto;object-fit:cover;background:#000;border-radius:var(--r-card)}
.scannote{margin:8px 0 2px;font-size:13px;color:var(--ink-faint)}
.scanbox video[hidden]{display:none}
.scannote.miss{color:var(--brick)}
/* Use a photo, then Cancel: two quiet links side by side */
.scanacts{display:flex;justify-content:center;gap:24px}
@media (max-width:600px){.scanacts .linkbtn{min-height:44px}}
/* after a scan: the set's LEGO points, on LEGO's own page */
.legopts{display:flex;align-items:center;justify-content:center;min-height:44px;margin-top:8px;padding:0 12px;
  border:1px solid var(--callout-edge);border-radius:var(--r-sm);background:var(--panel);color:var(--ink);
  font-size:14px;font-weight:600;text-decoration:none}
.legopts:hover{border-color:var(--ink);background:rgba(127,127,127,.12)}
.legopts[hidden]{display:none}
/* a booklet scanned again: when it was registered, instead of the link */
.legodone{display:flex;align-items:flex-start;gap:8px;margin:8px 0 0;padding:10px 12px;font-size:13px;color:var(--ink-soft);
  background:var(--callout);border:1px solid var(--callout-edge);border-radius:var(--r-sm)}
.legodone svg{flex:none;margin-top:2px}
.legodone[hidden]{display:none}
/* a name's matches: preview-card rows in one bordered list; the row under the arrow keys or pointer gets the
   ink edge, as hovered buttons get an ink edge */
.setresults{list-style:none;margin:8px 0 0;padding:0;border:1px solid var(--rule);border-radius:var(--r-card);
  background:var(--panel);max-height:min(60vh,452px);overflow-y:auto;overscroll-behavior:contain}
.setresults .setpeek{margin:0;border:0;border-radius:0;box-shadow:inset 3px 0 0 transparent;cursor:pointer;min-height:44px}
.setresults .setpeek+.setpeek{border-top:1px solid var(--rule)}
.setresults .setpeek[aria-selected="true"]{box-shadow:inset 3px 0 0 var(--ink);background:var(--paper)}
@media (hover:hover){.setresults .setpeek:hover{box-shadow:inset 3px 0 0 var(--ink);background:var(--paper)}}
.addset-form .msg{font-size:14px;color:var(--ink-soft);min-height:20px;margin-top:10px}
.addset-form .msg.err{color:var(--brick)}
/* a successful add: the set's photo and what happened, edged in the gain green */
.addset-form .msg.done{display:flex;align-items:center;gap:12px;padding:8px;background:var(--panel);
  border:1px solid var(--rule);border-left:3px solid var(--moss);color:var(--ink)}
.msg.done img{width:64px;height:64px;flex:none;object-fit:contain;background:var(--plate)}
.msg.done b{display:block;font-weight:600}
.msg.done span{display:block;font-size:12px;margin-top:2px}
.plate{position:relative;aspect-ratio:4/3;background-color:var(--plate);overflow:hidden}
.plate img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;padding:8px;opacity:0;transition:opacity .22s ease;mix-blend-mode:multiply}
.plate img.show{opacity:1}
/* full-bleed photos (flagged by refresh_collection.py) fill the frame instead of floating in it */
.plate.fill img{object-fit:cover;padding:0;mix-blend-mode:normal}
.plate .none{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  font-size:12px;color:var(--ink-soft);text-align:center;padding:12px}
.nav-arrow{position:absolute;top:50%;transform:translateY(-50%);width:28px;height:28px;border:0;cursor:pointer;
  background:var(--overlay);color:var(--ink);font-size:16px;line-height:1;display:none;align-items:center;
  justify-content:center;border-radius:50%;padding:0;box-shadow:var(--shadow)}
.nav-arrow:hover{background:var(--panel);color:var(--ink)}
.prev{left:7px}.next{right:7px}
.plate.multi .nav-arrow{display:flex}
/* with a mouse, arrows appear on hover so they don't sit on the product */
@media (hover:hover){.nav-arrow{opacity:0;transition:opacity .15s ease}.plate:hover .nav-arrow,.nav-arrow:focus-visible{opacity:1}}
.dots{position:absolute;left:0;right:0;bottom:7px;display:none;justify-content:center;align-items:center;gap:4px}
.plate.multi .dots{display:flex}
/* leave a strip at the bottom for the dots, so they never sit on top of the photo */
.plate.multi img{padding-bottom:20px}
/* photos sit on a white plate in both themes, so the dots stay dark in both */
.dots i{width:5px;height:5px;border-radius:50%;background:rgba(27,26,23,.24)}
.dots i.on{background:#1B1A17}
/* a big gallery's window of dots: the ones at its ends shrink where there are more photos beyond */
.dots i.sm{width:4px;height:4px}
.dots i.xs{width:3px;height:3px}
/* BrickLink minifig photos are small: don't blow them up past roughly their real size */
.figsheet .plate img{max-width:280px;max-height:360px;margin:auto}
.card-body{padding:12px 14px 14px;display:flex;flex-direction:column;gap:4px;flex:1;border-top:1px solid var(--rule)}
.card .nav-arrow,.card .dots{display:none!important}
.card-meta{font-size:12px;color:var(--ink-faint);font-variant-numeric:tabular-nums;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.instrlink{display:inline-flex;align-items:center;gap:5px;flex:none;font-size:12px;font-weight:500;text-decoration:none;
  color:var(--ink-soft);border:1px solid var(--callout-edge);border-radius:var(--r-sm);padding:4px 9px}
.instrlink:hover{border-color:var(--ink);color:var(--ink);background:rgba(127,127,127,.12)}
.instrlink:focus-visible{border-color:var(--accent);color:var(--accent)}
.badges{position:absolute;top:8px;left:8px;z-index:2;display:flex;flex-wrap:wrap;gap:4px;max-width:calc(100% - 48px)}
.status{position:relative;font-size:12px;font-weight:600;line-height:1;white-space:nowrap;
  padding:5px 8px;border-radius:999px;box-shadow:0 1px 2px rgba(0,0,0,.12)}
/* the same colours on the card badges (.status) and the table's condition pills (.flag) */
:is(.flag,.status).sealed{background:var(--ochre);color:var(--on-ochre)}
:is(.flag,.status).retiring{background:var(--warn);color:var(--on-ochre)}
/* minifig photos have the ×N count top-right, so their badge sits bottom-left out of its way */
.fig .badges{top:auto;bottom:8px;max-width:calc(100% - 16px)}
:is(.flag,.status):is(.added,.parted,.points){background:var(--callout-edge);color:var(--ink)}
/* Location pills: filled with the Brickset flag colour (script.js picks dark or white text; grey if none), with a
   thin edge so pale ones show on white */
.status.loc{background:var(--callout-edge);color:var(--ink);font-weight:500;box-shadow:inset 0 0 0 1px rgba(0,0,0,.18)}
.locdot{display:inline-block;width:9px;height:9px;border-radius:50%;flex:none;box-shadow:inset 0 0 0 1px rgba(0,0,0,.25);margin-right:5px}

/* arriving from the splash page on a set: the set's photo there flies into the popup's (both pages opt in; script.js
   names the popup's photo "set" and the popup "sheet" for the moment of arrival). So it reads as one object moving,
   not one page dissolving into the other: the old page goes quickly and the new one comes in just after (never both
   at half strength), the popup rises to meet the set, and the set stays solid for most of its flight, becoming the
   popup's photo only as it lands. The photo keeps its shape while it flies. */
@media (prefers-reduced-motion:no-preference){
  @view-transition{navigation:auto}
}
::view-transition-old(root){animation:vt-out .22s ease-out both}
::view-transition-new(root){animation:vt-in .3s .12s ease-out both}
::view-transition-new(sheet){animation:vt-rise .5s .1s cubic-bezier(.2,.7,.2,1) both}
/* the popup only exists on the new page, so the browser would draw it above the set: keep the set in front */
::view-transition-group(set){z-index:1;animation-duration:.7s;animation-timing-function:cubic-bezier(.3,.75,.2,1)}
::view-transition-old(set),::view-transition-new(set){height:100%;object-fit:contain}
/* the set is picked up and put down: it rises and grows a little, with a shadow under it, then settles. So the flight
   shows even when the photo starts close to where the popup's photo is (a theme photo, on the left like the popup's) */
::view-transition-image-pair(set){animation:vt-lift .7s cubic-bezier(.3,.75,.2,1) both}
::view-transition-old(set){animation:vt-hold .7s both}
::view-transition-new(set){animation:vt-land .7s both}
@keyframes vt-out{to{opacity:0}}
@keyframes vt-in{from{opacity:0}}
@keyframes vt-rise{from{opacity:0;transform:translateY(28px) scale(.97)}}
@keyframes vt-lift{40%{transform:translateY(-7%) scale(1.1);filter:drop-shadow(0 26px 22px rgba(19,23,27,.28))}}
@keyframes vt-hold{0%,80%{opacity:1}100%{opacity:0}}
@keyframes vt-land{0%,60%{opacity:0}100%{opacity:1}}

/* modal */
.modal{position:fixed;inset:0;z-index:50;display:none;padding:var(--sp);overflow-y:auto;background:rgba(19,23,27,.62)}
.modal.open{display:block}
/* the review list sits over the set's popup: above the save bar, and a lighter dim, as the popup's is already there */
.modal.over{z-index:66;background:rgba(19,23,27,.35)}
/* an edge, so it doesn't run into the popup behind (in dark mode the two are the same colour) */
.modal.over .sheet-panel{box-shadow:0 0 0 1px var(--rule),0 24px 70px -18px rgba(0,0,0,.7)}
.sheet-panel{max-width:900px;margin:0 auto;background:var(--panel);border-radius:20px;overflow:clip;
  box-shadow:0 24px 70px -18px rgba(19,23,27,.6)}
.sheet-top{position:sticky;top:calc(-1 * var(--sp));z-index:4;background:var(--panel);display:flex;justify-content:space-between;align-items:center;gap:12px;padding:11px 15px;border-bottom:1px solid var(--rule)}
/* ×2: a dark pill in both themes. It sits on the photo, which stays light in dark mode, where the page's own ink
   colour made a pale pill that faded into it; a thin edge keeps it apart on the dark popup bar */
.status.count{background:#1B1A17;color:#fff;box-shadow:inset 0 0 0 1px rgba(255,255,255,.22)}
.sheet-top-actions{display:flex;align-items:center;gap:10px}
.x{border:1px solid var(--callout-edge);background:var(--panel);width:30px;height:30px;border-radius:var(--r-sm);cursor:pointer;font-size:16px;line-height:1;color:var(--ink)}
.x:hover{border-color:var(--ink);color:var(--ink);background:rgba(127,127,127,.12)}
.back{border:1px solid var(--callout-edge);background:var(--panel);padding:0 12px;height:30px;border-radius:var(--r-sm);cursor:pointer;
  font-size:12px;color:var(--ink);white-space:nowrap;overflow:hidden;
  text-overflow:ellipsis;max-width:34vw}
.back:hover{border-color:var(--ink);color:var(--ink);background:rgba(127,127,127,.12)}
/* ---- Toybox set popup: the photo on its theme colour (hero), then the set's line, a big title, a sentence for the
   purchase, the money and counts, the links; Close and Instructions in a bar at the bottom, the same on phone and
   computer. On a computer the hero and details sit side by side; on a phone the popup fills the screen ---- */
.setsheet{max-width:1120px;border-radius:28px;background:var(--paper);overflow:clip;border:1px solid var(--field-edge)}
.setsheet .sheet-body{grid-template-columns:minmax(0,46%) minmax(0,1fr)}
.setsheet .sheet-body>:nth-child(2){border-left:0}
/* the hero stays in view as the details scroll, as tall as the screen allows, the photo centred in it */
.setsheet .shotwrap{background:var(--c-bg);padding:20px;gap:12px;position:sticky;top:calc(-1 * var(--sp));align-self:start;
  height:calc(100vh - 2 * var(--sp));justify-content:center}
.setsheet .herobadges{position:absolute;top:20px;left:20px;right:20px}
.setsheet .herobadges{display:flex;flex-wrap:wrap;gap:6px;min-height:26px}
.setsheet .herobadges .status{font-size:13px;font-weight:700;padding:4px 10px;line-height:1.25;color:#1B1A17;box-shadow:none}
:root:not([data-theme="dark"]) .setsheet .herobadges .status{box-shadow:inset 0 0 0 1.5px rgba(0,0,0,.5)}
/* the grey badges as on a card: they sit on the theme's tint too, and dark mode's own grey with this dark text was
   dark on dark (the badge on SpongeBob's navy, on the iPhone, 27 Nov 2026) */
.setsheet .herobadges .status:is(.parted,.points){background:#C9C8C3}
:root:not([data-theme="dark"]) .setsheet .herobadges .status:is(.parted,.points){background:#DCDCE0}
.setsheet .shotwrap .plate{border-radius:18px;background:var(--plate);aspect-ratio:1/1}
.setsheet .shotcount{border:0;padding:0;color:var(--c-meta)}
.setsheet .shotcount a{color:inherit}
.setsheet .detail{padding:32px 36px 24px}
.dmeta{margin:0;font-size:14px;color:var(--ink-faint)}
.setsheet .detail h3{margin:6px 0 0;font-family:var(--font-brand);font-weight:800;font-size:32px;line-height:1.05;letter-spacing:-.03em;text-wrap:balance}
.dsum{margin:10px 0 0;font-size:16px;line-height:1.5;color:var(--ink-soft)}
.dsum b{color:var(--ink)}
.setsheet .facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 16px;margin:18px 0 0;border:0;border-radius:0;overflow:visible;background:none}
.setsheet .facts div{padding:0;border:0;min-width:0;background:none}
.setsheet .facts dt{font-size:14px;color:var(--ink-faint)}
.setsheet .facts dd{margin:2px 0 0;font-size:15px;font-weight:400;white-space:normal}
.setsheet .facts dd .sub{display:block;font-size:13px;font-weight:400}
.setsheet .facts div:nth-child(n+3) dd{font-family:var(--font-brand);font-weight:800;font-size:20px}
.setsheet .facts div:nth-child(n+3) dd .faint{font-family:'Inter',sans-serif;font-weight:400;font-size:15px}
.setsheet .linkrow{gap:6px;margin:20px 0 4px}
.setsheet .linkrow a{flex:1 1 0;min-width:0;height:64px;padding:0 2px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;
  border:1px solid var(--field-edge);border-radius:14px;font-size:12px;font-weight:600;color:var(--ink);text-decoration:none;background:none}
.setsheet .linkrow a:hover{border-color:var(--ink);color:var(--ink);background:rgba(127,127,127,.12)}
.setsheet .linkrow .linkicon{width:20px;height:20px;margin:0}
.setsheet .mtabs{margin-top:22px}
.setsheet .spec-h{margin:22px 0 6px;font-family:var(--font-brand);font-weight:800;font-size:20px;letter-spacing:-.01em}
.setsheet .spec{font-size:15px}
.setsheet .spec th{width:44%;font-weight:400;color:var(--ink-faint);padding:11px 12px 11px 0;vertical-align:middle}
.setsheet .spec td{padding:11px 0;border-bottom:0}
.setsheet .spec tr{border-top:1px solid var(--rule)}
.sheet-bar{position:sticky;bottom:calc(-1 * var(--sp));z-index:5;display:flex;gap:8px;padding:14px 16px;background:var(--paper);border-top:1px solid var(--rule)}
/* Close: a quiet × in the popup's top-right corner, part of it rather than floating over it (it scrolls away with the
   popup; Escape, a tap outside and swiping down still close it) */
.setsheet{position:relative}
.setsheet .xfloat{position:absolute;z-index:6;top:18px;right:18px;width:44px;height:44px;border:0;border-radius:12px;
  background:none;color:var(--ink-soft);display:flex;align-items:center;justify-content:center}
.setsheet .xfloat svg{width:22px;height:22px}
.setsheet .xfloat:hover{background:rgba(127,127,127,.15);color:var(--ink);border:0}
.setsheet .dmeta{padding-right:40px}
.instrbig{flex:1;height:52px;border-radius:14px;display:flex;align-items:center;justify-content:center;gap:8px;background:var(--ink);color:var(--paper);
  font-size:16px;font-weight:600;text-decoration:none}
.instrbig svg{width:18px;height:18px}
.wishacts{display:flex;align-items:center;gap:16px;margin-top:18px}
.wishacts .removecopy{margin:0}
/* the minifig popup keeps its top row (back to the set, badges, ×) but lays it over the hero, quiet like the set's × */
.figsheet.setsheet .sheet-top{position:absolute;top:0;left:0;right:0;z-index:6;padding:16px 18px;background:none;border:0}
.figsheet.setsheet .sheet-top .x{width:44px;height:44px;border:0;border-radius:12px;background:none;color:var(--ink-soft);display:flex;align-items:center;justify-content:center}
.figsheet.setsheet .sheet-top .x:hover{background:rgba(127,127,127,.15);color:var(--ink)}
.figsheet.setsheet .back{height:36px;border-radius:999px;border-color:var(--field-edge);background:var(--panel);font-size:13px;font-weight:600}
.figsheet.setsheet .shotwrap{padding-top:68px}
.figsheet.setsheet .detail{padding-top:72px}
.figsheet.setsheet .fig-desc{margin:8px 0 0;font-size:16px;color:var(--ink-soft)}
.figsheet.setsheet .dnum{margin:6px 0 0;font-size:14px;color:var(--ink-faint)}
.figsheet.setsheet .facts{margin-top:18px}
.figsheet.setsheet .facts dd{font-family:var(--font-brand);font-weight:800;font-size:20px}
@media (max-width:740px){.figsheet.setsheet .detail{padding-top:22px}.figsheet.setsheet .shotwrap{padding-top:64px}}
.wishsheet .facts dd{font-family:var(--font-brand);font-weight:800;font-size:20px}
.wishacts .boughtbtn{width:auto;margin:0;height:48px;padding:0 20px;border-radius:12px;background:var(--ink);border-color:var(--ink);color:var(--paper);font-weight:600}
.setsheet .herobadges .status.added{background:var(--panel);color:var(--ink)}
.instrbig:hover{opacity:.92}
@media (min-width:741px){
  /* the hero's colour runs the column's full height, under the sticky photo too */
  .setsheet{background:linear-gradient(90deg,var(--c-bg) 46%,var(--paper) 46%)}
  .setsheet .sheet-bar{margin-left:46%}
}
@media (max-width:740px){
  .modal:has(.setsheet){padding:0}
  .setsheet{border-radius:0;border:0;min-height:100%}
  .setsheet .sheet-body{grid-template-columns:1fr}
  .setsheet .shotwrap{border-radius:0 0 32px 32px;padding:18px;position:static;height:auto}
  .setsheet .herobadges{position:static;margin-right:56px}
  .setsheet .xfloat{top:10px;right:10px;color:var(--ink)}
  .setsheet .dmeta{padding-right:0}
  .setsheet .shotwrap .plate{aspect-ratio:auto;height:280px}
  .setsheet .detail{padding:22px 20px 20px}
  .sheet-bar{bottom:0;padding:14px 16px calc(14px + env(safe-area-inset-bottom))}
}

.copyblock{margin-bottom:14px}
.copyblock:not(:first-child){padding-top:14px;border-top:1px solid var(--rule)}
.copyblock h4{margin:0 0 6px;font-size:14px;color:var(--ink);font-weight:600}
.sheet-body{display:grid;grid-template-columns:1.05fr 1fr}
@media (max-width:740px){.sheet-body{grid-template-columns:1fr}}
.sheet-body .plate{aspect-ratio:1/1}
/* the photo column is sticky and short, so the dividing line belongs to the details column */
.sheet-body>:nth-child(2){border-left:1px solid var(--rule)}
@media (max-width:740px){.sheet-body>:nth-child(2){border-left:0}
  /* one-column popups: a shorter photo, so the details show on the first screen */
  .sheet-body .plate{aspect-ratio:auto;height:320px}}
@media (max-width:600px){.sheet-body .plate{height:260px}}
.shotwrap{display:flex;flex-direction:column;align-self:start;position:sticky;top:calc(53px - var(--sp))}
.shotwrap .plate{border-right:0}
.shotcount{margin:0;padding:8px 12px;border-top:1px solid var(--rule);
  font-size:14px;color:var(--ink-faint);text-align:center}
@media (max-width:740px){.shotwrap{border-right:0;position:static}}
.detail{padding:20px}
.detail h3{font-size:20px;margin-bottom:3px}
.fig-desc{margin:4px 0 2px;font-size:14px;color:var(--ink-soft);line-height:1.4}
.detail .dnum{font-size:14px;color:var(--ink-faint);margin-bottom:16px}
.facts{display:flex;flex-wrap:wrap;margin:0 0 16px;border:1px solid var(--rule);border-radius:var(--r-card);overflow:hidden}
.facts div{flex:1 1 0;min-width:80px;padding:10px 12px;border-right:1px solid var(--rule)}
.facts div:last-child{border-right:0}
.facts dt{font-size:12px;color:var(--ink-faint)}
.facts dd{margin:2px 0 0;font-size:16px;font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap}
.facts dd .sub{display:block;font-size:12px;font-weight:500;white-space:normal}
.spec-h{margin:20px 0 4px;font-size:14px;font-weight:700;color:var(--ink)}
.spec th{width:112px}
.mtabpanel>.spec-h:first-child{margin-top:4px}
.faint{color:var(--ink-faint)}
.sheet-top-left{display:flex;align-items:center;gap:10px}
.status.inline{position:static;box-shadow:none}
.spec{width:100%;border-collapse:collapse;font-size:14px}
.spec th{text-align:left;font-weight:500;color:var(--ink-faint);padding:6px 12px 6px 0;white-space:nowrap;
  font-size:14px;vertical-align:top}
.spec td{padding:6px 0;border-bottom:1px dotted var(--rule)}
.spec tr:last-child td{border-bottom:0}
.desc-details summary{display:inline;cursor:pointer;color:inherit;list-style:none}
.desc-details summary::-webkit-details-marker{display:none}
.desc-details .more-hint{color:var(--accent);font-weight:600;white-space:nowrap}
.desc-details:hover .more-hint{text-decoration:underline}
.desc-details[open] .more-hint{display:none}
.less-hint{all:unset;cursor:pointer;color:var(--accent);font-weight:600;white-space:nowrap;margin-left:4px}
.less-hint:hover,.less-hint:focus-visible{text-decoration:underline}
/* the five links share one row: icon above a short label, each a full-size tap target. Equal widths while they fit;
   on a narrow phone a long name ("Rebrickable") takes room from a short one ("LEGO"), and only then does one wrap */
.linkrow{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:16px}
.linkrow a{flex:1 1 0;min-width:max-content;font-size:12px;font-weight:500;
  background:var(--panel);color:var(--ink);border:1px solid var(--callout-edge);text-decoration:none;border-radius:var(--r-sm);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:44px;padding:6px 2px}
.linkrow a:hover{border-color:var(--ink);color:var(--ink);background:rgba(127,127,127,.12)}
/* smaller phones (iPhone mini, SE): a size down keeps all five on one row (after the rule above, or it loses) */
@media (max-width:399px){.linkrow{gap:4px}.linkrow a{font-size:11px}}
.linkicon{width:14px;height:14px;object-fit:contain;border-radius:3px;flex:none;font-size:14px;
  display:inline-flex;align-items:center;justify-content:center;line-height:1}
.mtabs{display:flex;margin:16px 0 0;border-bottom:1px solid var(--rule)}
.mtab{appearance:none;background:none;border:0;border-bottom:2px solid transparent;padding:8px 0 7px;
  margin-right:20px;cursor:pointer;font-size:14px;font-weight:500;
  color:var(--ink-faint)}
.mtab .n{font-size:12px;margin-left:6px;color:var(--ink-faint)}
.mtab[aria-selected="true"]{color:var(--ink);border-bottom-color:var(--accent)}
.mtab[aria-selected="true"] .n{color:var(--ink-soft)}
.mtabpanel{margin-top:14px}
.mtabpanel.fgrid{margin-top:16px}
.empty{padding:44px 0;text-align:center;color:var(--ink-soft)}
/* "Not in your collection? Add “…”" on a line of its own under Nothing matches */
.empty .addfind:not([hidden]){display:block;margin-top:12px}
.linkbtn{background:none;border:0;padding:0;margin-left:6px;font:inherit;color:var(--accent);cursor:pointer;text-decoration:underline;text-underline-offset:3px}
.foot{max-width:1600px;margin:0 auto;padding:24px var(--sp) 48px;border-top:1px solid var(--rule);
  font-size:12px;color:var(--ink-faint);line-height:1.75}

/* a short message (e.g. "Refresh started") at the bottom right, the same side as the ⋯ menu that usually triggers it,
   gone after a few seconds. While the back-to-top button shows, it sits just above it (button 44px + 12px gap).
   Inverted colours (ink on paper swapped) so it can't pass for a card; it slides up as it appears. */
.toast{position:fixed;right:22px;bottom:22px;z-index:70;max-width:min(420px,calc(100vw - 32px));display:flex;
  align-items:center;gap:10px;padding:12px 16px;background:var(--ink);color:var(--panel);border-radius:var(--r-sm);
  box-shadow:0 6px 24px rgba(0,0,0,.28);font-size:14px;font-weight:500;line-height:1.4;animation:toastin .2s ease-out}
.toast svg{flex:none}
@keyframes toastin{from{opacity:0;transform:translateY(8px)}}
body:has(.totop.show) .toast{bottom:78px}
@media (max-width:600px){.toast{left:16px;right:16px;bottom:16px;max-width:none}}
/* unsaved location changes: a bar at the bottom centre (full width on phones) that stays until they're saved or
   discarded; the message and back-to-top sit above it meanwhile */
.savebar{position:fixed;left:50%;bottom:22px;transform:translateX(-50%);z-index:65;display:flex;align-items:center;gap:16px;
  padding:10px 10px 10px 18px;background:var(--panel);border:1px solid var(--callout-edge);border-radius:16px;
  box-shadow:0 10px 32px -8px rgba(19,23,27,.4);font-size:14px;white-space:nowrap;animation:toastin .2s ease-out}
.savecount{display:flex;align-items:center;gap:8px;font-weight:600;color:var(--ink)}
.savecount::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--accent)}
.savebar .reset.primary{width:auto;margin:0;padding-inline:16px}
body:has(.savebar:not([hidden])) .toast{bottom:92px}
body:has(.savebar:not([hidden])) .totop{bottom:92px}
/* phones: "● 3 changes  Review  [Save]", with Discard in Review */
@media (max-width:600px){
  .savebar{left:16px;right:16px;bottom:16px;transform:none;gap:14px;padding-left:14px}
  .savebar .reset.primary{margin-left:auto;min-height:44px}
  .savebar .linkbtn{min-height:44px}
  #saveDiscard{display:none}
  body:has(.savebar:not([hidden])) .toast{bottom:88px}}
.toast .spin{transform-origin:8px 8px;animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(1turn)}}
@media (prefers-reduced-motion:reduce){.toast .spin{animation:none}}
/* Reload, or a link to the run on GitHub: in the toast's own inverted colours, underlined like the site's links */
.toastact{margin-left:auto;flex:none;appearance:none;border:0;background:none;padding:4px 0 4px 8px;font:inherit;
  font-weight:600;color:inherit;text-decoration:underline;text-underline-offset:3px;cursor:pointer;white-space:nowrap}
.totop{position:fixed;right:22px;bottom:22px;z-index:40;width:44px;height:44px;border:1px solid var(--callout-edge);
  border-radius:50%;background:var(--panel);color:var(--ink);font-size:20px;line-height:1;cursor:pointer;
  box-shadow:var(--shadow-hover);opacity:0;pointer-events:none;transform:translateY(8px);
  transition:opacity .18s ease,transform .18s ease;display:flex;align-items:center;justify-content:center}
.totop.show{opacity:1;transform:translateY(0);pointer-events:auto}
.totop:hover{border-color:var(--ink);color:var(--ink);background:rgba(127,127,127,.12)}
@media print{.totop{display:none}}
/* phone popup: facts as a 2x2 grid instead of 3 + a lonely 1 */
@media (max-width:600px){
  .facts{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:var(--rule)}
  .facts div{border-right:0;background:var(--panel)}
  .facts div:last-child:nth-child(odd){grid-column:1/-1}
  /* three facts fit on one row; only four or more go 2x2 */
  .facts:has(>div:nth-child(3):last-child){grid-template-columns:repeat(3,1fr)}
  .facts:has(>div:nth-child(3):last-child) div:last-child{grid-column:auto}
}
/* phone popup header: badges may wrap, Instructions becomes its icon, so Close always fits */
@media (max-width:600px){
  .sheet-top{align-items:flex-start}
  .sheet-top-left{flex-wrap:wrap;gap:4px;min-width:0}
  .sheet-top-actions{flex-shrink:0}
  .sheet-top .instrlink span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  /* tap targets at least 44px (36px for filter chips), with the same text sizes */
  .x,.sheet-top .instrlink{width:44px;height:44px;padding:0;justify-content:center}
  .back{height:44px}
  .chip,.chipmore,.viewswitch button{min-height:36px}
  .sheet-top-left{min-height:44px;align-items:center}
  /* bar charts: label and value on one line, the bar full width under them, so long names don't squeeze it */
  .hb li{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"l v" "b b";row-gap:4px;padding:4px 0}
  .hb .hl{grid-area:l}.hb .hv{grid-area:v}.hb .hbar{grid-area:b}
  .settable td.rownum:last-child{white-space:normal;min-width:64px}
  .settable td.rownum .faint{white-space:nowrap}
  .rowthumb{width:34px}.rowplate{width:30px;height:30px}
}

/* ---- Toybox fills: a filled button and a picked chip are ink, as in the toolbar and the filter panel; Remove alone
   stays red, the one button that loses something ---- */
.reset.primary{background:var(--ink);border-color:var(--ink);color:var(--paper)}
.reset.primary:hover:not(:disabled){filter:none;opacity:.9;border-color:var(--ink);color:var(--paper)}
.reset.primary#rmGo{background:var(--accent-fill);border-color:var(--accent-fill);color:#fff}
.chip[aria-pressed="true"]{background:var(--ink);border-color:var(--ink);color:var(--paper)}
.viewbtn[aria-pressed="true"]{background:var(--ink);color:var(--paper)}
.locpick .chip{height:36px;padding:0 12px;border-radius:10px;font-size:13px;font-weight:600;border-color:var(--field-edge);color:var(--ink)}
/* Change, Done and Review are underlined ink, not red */
.linkbtn{color:var(--ink)}
.locpick .chip[aria-pressed="true"]{border-color:var(--ink);color:var(--paper)}

/* ---- Toybox small popups: Review, the access token, Remove and What's new are rounded like the set's popup, with
   44px buttons and the same quiet × ---- */
.tokenacts .reset,.savebar .reset.primary{min-height:44px;border-radius:12px}
.sheet-panel:not(.setsheet) .sheet-top{padding:12px 12px 12px 22px}
.sheet-panel:not(.setsheet) .sheet-top .x{width:44px;height:44px;border:0;border-radius:12px;background:none;color:var(--ink-soft);font-size:26px;font-weight:300}
.sheet-panel:not(.setsheet) .sheet-top b{font-family:var(--font-brand);font-weight:800;font-size:20px;letter-spacing:-.01em}
.sheet-panel:not(.setsheet) .sheet-top .x:hover{background:rgba(127,127,127,.15);color:var(--ink)}
.sheet-panel .find{border-radius:12px}

/* ---- Toybox minifig shelves ("By set"): two shelves a row, each on its set's theme colour; the set on the left, its
   minifigs cut out on lighter tiles, the rest fanned out on a dashed tile that opens the shelf. An open shelf takes
   the whole row ---- */
.shelves{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-flow:dense;gap:16px;align-items:start}
.shelf{display:flex;gap:14px;border-radius:24px;background:var(--c-bg);color:var(--ink);padding:16px;min-width:0}
.shelf.open{grid-column:1/-1}
.shelf.open .shelf-side{align-self:flex-start}
.shelf.open .shelf-set{flex:none}
.shelf.open .shelf-name{margin-top:0}
.shelf-less{all:unset;cursor:pointer;margin-top:10px;font-size:14px;font-weight:600;text-decoration:underline;text-underline-offset:3px;width:max-content}
.shelf-less:focus-visible{outline:2.5px solid var(--accent);outline-offset:3px;border-radius:4px}
:root:not([data-theme="dark"]) .shelf.fam-grey{box-shadow:inset 0 0 0 1px rgba(133,134,141,.28)}
.shelf-side{flex:none;width:168px;display:flex;flex-direction:column}
.shelf-set{all:unset;box-sizing:border-box;flex:1;width:168px;display:flex;flex-direction:column;gap:2px;cursor:pointer;border-radius:12px}
div.shelf-set{cursor:default;justify-content:flex-end}
.shelf-set img{width:168px;height:120px;object-fit:contain;margin-bottom:10px}
.shelf-set img.cut{filter:drop-shadow(0 10px 12px rgba(0,0,0,.45))}
:root:not([data-theme="dark"]) .shelf-set img.cut{filter:drop-shadow(0 10px 12px rgba(40,30,0,.28))}
/* no cut-out: the whole picture, rounded and shadowed on the shelf's colour, as on the set cards */
.shelf-set img.photo{width:auto;height:auto;max-width:168px;max-height:120px;align-self:flex-start;border-radius:10px;
  mix-blend-mode:normal;box-shadow:0 10px 18px -10px rgba(0,0,0,.6)}
:root:not([data-theme="dark"]) .shelf-set img.photo{box-shadow:0 10px 18px -10px rgba(40,30,0,.35)}
.shelf-name{margin-top:auto;font-family:var(--font-brand);font-weight:800;font-size:20px;line-height:1.1;letter-spacing:-.02em;
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;-webkit-hyphens:auto;hyphens:auto}
.shelf-n{font-size:14px;color:var(--c-meta)}
.shelf-set:focus-visible,.sfig:focus-visible,.sfan:focus-visible{outline:2.5px solid var(--accent);outline-offset:3px}
@media (hover:hover){.shelf-set:hover .shelf-name{text-decoration:underline;text-underline-offset:3px}}
.shelf-figs{flex:1;min-width:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;align-content:start}
.shelf.open .shelf-figs{grid-template-columns:repeat(auto-fill,minmax(128px,1fr))}
.sfig,.sfan{all:unset;box-sizing:border-box;position:relative;cursor:pointer;border-radius:16px;padding:10px 8px;min-width:0;
  display:flex;flex-direction:column;align-items:center;text-align:center;color:var(--ink)}
.sfig{background:color-mix(in srgb,var(--c-bg) 86%,#fff)}
:root:not([data-theme="dark"]) .sfig{background:color-mix(in srgb,var(--c-bg) 45%,#fff)}
.sfig img{height:118px;width:100%;object-fit:contain;filter:drop-shadow(0 6px 6px rgba(0,0,0,.35))}
.sfig img.photo,.sfan img.photo{filter:none;background:var(--plate);border-radius:10px}
.sfan{border:1.5px dashed var(--c-meta)}
.sfan .faces{display:flex;align-items:flex-end;justify-content:center;height:118px;width:100%}
.sfan .faces img{flex:none;height:100px;width:auto;max-width:none;filter:drop-shadow(0 6px 6px rgba(0,0,0,.35))}
.sfan .faces img+img{margin-left:-30px}
.sfan .faces img:nth-child(2){height:118px;position:relative;z-index:1}
/* a word too long for a phone's tile ("Harbormaster's") is hyphenated, not cut anywhere ("Harbormaster' / s") */
.sname{margin-top:6px;font-size:14px;font-weight:600;line-height:1.25;max-width:100%;overflow:hidden;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow-wrap:anywhere;-webkit-hyphens:auto;hyphens:auto}
/* a pill on the photo tile, white on near-black in both modes (the tint's text colour on black was unreadable) */
.sfig .qty2{position:absolute;top:8px;right:8px;font-size:12px;font-weight:700;color:#fff}
@media (hover:hover){.sfig:hover,.sfan:hover{transform:translateY(-2px);transition:transform .2s cubic-bezier(.2,.7,.2,1)}
  .sfan:hover{border-style:solid}}
@media (max-width:1100px){.shelves{grid-template-columns:minmax(0,1fr)}}
@media (max-width:600px){
  .shelf{flex-direction:column;gap:12px;padding:14px;border-radius:20px}
  .shelf-side{width:auto}
  .shelf-set{width:auto;display:grid;grid-template-columns:72px 1fr;grid-template-rows:auto auto;column-gap:12px;align-items:center}
  .shelf-set img{grid-row:1/3;width:72px;height:56px;margin:0}
  .shelf-set img.photo{width:auto;height:auto;max-width:72px;max-height:56px;align-self:center;justify-self:center;border-radius:6px}
  .shelf-name{margin-top:0;font-size:18px;align-self:end}
  .shelf-n{align-self:start}
  div.shelf-set{display:flex}
  .sfig img,.sfan .faces{height:92px}
  .sfan .faces img{height:80px}.sfan .faces img:nth-child(2){height:92px}
  .sfan .faces img+img{margin-left:-24px}
  .shelf.open .shelf-figs{grid-template-columns:repeat(3,minmax(0,1fr))}
}
/* the set popup's × stays in its corner while the popup scrolls (it scrolled away with a long one, as a set's note
   being written scrolls the box into view): fixed to the screen at the panel's corner, on a backing of the page
   colour so text scrolling under it doesn't show through */
.setsheet .xfloat{position:fixed;z-index:60;top:calc(var(--sp) + 18px);right:calc(max(var(--sp), (100vw - 1120px) / 2) + 26px);
  background:var(--paper)}
.setsheet .xfloat:hover{background:color-mix(in srgb,var(--paper) 80%,#7f7f7f)}
@media (max-width:740px){.setsheet .xfloat{top:calc(10px + env(safe-area-inset-top));right:10px;
  background:color-mix(in srgb,var(--paper) 72%,transparent);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}}

/* ---- the set popup's More menu: a fourth button like the links, opening a small panel with the other three ---- */
.setsheet .linkrow{flex-wrap:nowrap}
.linkmore{position:relative;flex:1 1 0;min-width:0;display:flex}
.linkmore>summary{list-style:none;cursor:pointer;flex:1;height:64px;padding:0 2px;display:flex;flex-direction:column;align-items:center;
  justify-content:center;gap:6px;border:1px solid var(--field-edge);border-radius:14px;font-size:12px;font-weight:600;color:var(--ink)}
.linkmore>summary::-webkit-details-marker{display:none}
.linkmore>summary:hover,.linkmore[open]>summary{border-color:var(--ink);background:rgba(127,127,127,.12)}
.linkmore>summary:focus-visible{outline:2.5px solid var(--accent);outline-offset:2px}
.linkmenu{position:absolute;z-index:8;top:calc(100% + 6px);right:0;min-width:190px;padding:6px;border-radius:14px;background:var(--panel);
  border:1px solid var(--field-edge);box-shadow:0 18px 40px -16px rgba(0,0,0,.55);display:flex;flex-direction:column}
.setsheet .linkmenu a{flex:none;height:44px;flex-direction:row;justify-content:flex-start;gap:10px;padding:0 12px;border:0;border-radius:10px;font-size:14px}
.setsheet .linkmenu a:hover{background:rgba(127,127,127,.14)}

/* ---- the Status popup (⋯ menu): the What's new popup's size, its lines as the popups' tables; what needs a look in
   the warning colour, what's fine plain ---- */
.sheet-panel.statussheet{max-width:560px}
/* ⋯ → Links: a box to paste into with Add beside it, then the links as rows: the site's icon on a white plate,
   its name and its host. Edit turns each row into its name and address boxes, with ↑ ↓ and a bin */
.sheet-panel.lnksheet{max-width:560px}
.lnkadd{display:flex;gap:8px;margin-top:4px}
.lnkadd .find{flex:1 1 auto;min-width:0;height:44px;border-radius:12px;border-color:var(--field-edge);font-size:16px}
.lnkadd .reset{width:auto;margin:0;padding:0 18px;height:44px;border-radius:12px}
.lnknote{margin:6px 0 0;font-size:13px;min-height:1em}
.lnkhead{display:flex;justify-content:space-between;align-items:center;margin:10px 0 4px;font-size:13px}
.lnkhead .linkbtn{font-size:14px}
@media (max-width:600px){.lnkhead .linkbtn{min-height:44px}}
.lnklist{list-style:none;margin:0;padding:0}
.lnkrow{border-top:1px solid var(--rule)}
.lnkrow>a{display:flex;align-items:center;gap:12px;min-height:56px;padding:6px 4px;color:var(--ink);text-decoration:none;border-radius:10px}
.lnkrow>a:hover{background:rgba(127,127,127,.1)}
.lnktext{min-width:0;display:flex;flex-direction:column}
.lnktext b{font-weight:600;font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lnktext .faint{font-size:12px;margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lnkico{flex:none;width:36px;height:36px;display:grid;place-items:center;border-radius:9px;background:#FFFFFF;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.08);overflow:hidden}
.lnkico img{width:24px;height:24px;object-fit:contain}
.lnkico b{font-family:var(--font-brand);font-weight:800;font-size:17px;color:#1B1A17}
.lnkempty{padding:16px 4px;font-size:14px;border-top:1px solid var(--rule)}
.lnklist.editing .lnkrow{display:flex;align-items:center;gap:10px;padding:10px 0}
.lnkfields{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:6px}
.lnkfields .find{height:38px;border-radius:10px;border-color:var(--field-edge);font-size:16px;width:100%;box-sizing:border-box}
.lnkfields .find+.find{font-size:13px;color:var(--ink-soft)}
.lnkacts{flex:none;display:flex;gap:4px}
.lnkacts button{width:40px;height:40px;display:grid;place-items:center;border:1px solid var(--callout-edge);border-radius:10px;
  background:var(--panel);color:var(--ink);font-size:16px;cursor:pointer}
.lnkacts button:hover:not(:disabled){border-color:var(--ink)}
.lnkacts button:disabled{opacity:.35;cursor:default}
.lnkacts .lnkdel:hover{color:var(--brick);border-color:var(--brick)}
@media (max-width:600px){.lnklist.editing .lnkrow{flex-wrap:wrap}.lnkfields{flex-basis:calc(100% - 46px)}.lnkacts{margin-left:46px}}
.statussheet .spec-h:first-child{margin-top:4px}
/* Status's "Sync now": the popups' outlined button, its own width, 44px tall to tap */
.statussheet .stsync{width:auto;margin-top:8px;padding:0 16px;min-height:44px;border-radius:12px}
.st-good{font-weight:600}
.st-bad{font-weight:700;color:var(--warn)}
/* Status's Usage tab: a table of the free limits like the popups' tables, each with a still bar in the Stats bars'
   look (the warning colour from half a limit): today solid, the busiest day this week a lighter stretch of it, as the
   key over the table says. A tick for the busiest day was tried first and didn't explain itself (24 Nov 2026) */
.statussheet .mtabs{margin-top:0}
.usage{width:100%;border-collapse:collapse;font-size:14px}
.usage thead th{font-size:12px;font-weight:600;color:var(--ink-faint);text-align:left;padding:0 0 8px}
.usage tbody tr{border-top:1px solid var(--rule)}
/* each service's section: its name as the Overview's section headings, what it's for and when it starts again */
.usage tr.ugroup{border-top:0}
.usage tr.ugroup th{width:auto;padding:22px 0 8px;font-size:14px;font-weight:700;color:var(--ink)}
.usage tbody:first-of-type tr.ugroup th{padding-top:10px}
.usage tbody th,.usage td{padding:12px 0;vertical-align:top;text-align:left}
.usage tbody th{width:30%;padding-right:12px;font-weight:600}
.usage th:last-child,.usage td:last-child{width:5.5em;padding-left:12px}
.usage .sub{display:block;font-size:12px;font-weight:400;margin-top:3px}
.uline{display:flex;gap:8px;align-items:baseline;margin-bottom:6px}
.uline b{font-variant-numeric:tabular-nums}
.ubar{position:relative;background:var(--callout);height:8px;border-radius:var(--r-sm)}
.ubar i,.ubar b{display:block;height:100%;min-width:2px;background:var(--data);border-radius:var(--r-sm)}
.ubar i{position:relative}
.ubar b{position:absolute;left:0;top:0;opacity:.35}
.ubar.warn i,.ubar.warn b{background:var(--warn)}
.ukey{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:12px;margin:0 0 12px}
.ukey .ubar{width:18px;flex:none}
.ukey .ubar:last-of-type{margin-left:10px}
.ukey .ubar b{position:static;width:100%}
.ufoot{margin-top:14px;font-size:12px}
/* Status's Activity tab: a day's heading as the Overview's, then a line each, the time in its own narrow column;
   a run that failed in the warning colour, as elsewhere in Status */
.actlist{list-style:none;margin:0;padding:0}
.actlist li{display:flex;gap:12px;padding:9px 0;border-top:1px solid var(--rule);font-size:14px;line-height:1.45}
.actlist time{flex:none;width:3.1em;color:var(--ink-faint);font-variant-numeric:tabular-nums}
.actlist li.bad span{color:var(--warn);font-weight:600}
.actlist a{white-space:nowrap}
.actmore{display:block;margin:14px 0 0}
