/* The shared components, one implementation each. Sizes, colours and radii come from tokens.css. */

/* ── select: a button and its list (core/select.js); the native select stays, hidden, for the code ── */
.select { position: relative; display: block; min-width: 0; }
.select > select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.sel-btn { display: flex; align-items: center; gap: var(--s-2); width: 100%; height: var(--h-md); padding: 0 var(--s-3) 0 14px; border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--surface-1); color: var(--text); font: var(--t-label); text-align: left; transition: border-color var(--d-2) var(--ease), background var(--d-2) var(--ease); }
.sel-btn:hover { border-color: var(--line-3); background: var(--surface-2); }
.sel-btn.open { border-color: var(--accent-line); }
.sel-btn:disabled { opacity: .5; cursor: default; }
.sel-val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-chev { flex: none; width: 16px; height: 16px; color: var(--dim); transition: transform var(--d-2) var(--ease), color var(--d-2) var(--ease); }
.sel-btn.open .sel-chev { transform: rotate(180deg); color: var(--accent-text); }
/* a colour picked from a list (the garage's palettes): its dot in the button */
.select.swatched > i { position: absolute; z-index: 1; left: 13px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); pointer-events: none; }
.select.swatched .sel-btn { padding-left: 36px; }
/* where it sits */
.tools .select { flex: 0 1 auto; min-width: 180px; max-width: 300px; }
.tools .sel-btn { height: var(--h-lg); padding-left: var(--s-4); }
@media (max-width: 900px) { .tools .select { flex: 1 1 140px; min-width: 0; max-width: none; } .tools .sel-btn { height: var(--h-md); } }
.pctl .sel-btn { height: 36px; background: rgba(10, 10, 15, .6); backdrop-filter: blur(8px); font-size: 12.5px; }
.acontrols .select { width: 96px; }

.sel-pop { position: fixed; z-index: var(--z-popover); display: flex; flex-direction: column; border-radius: var(--r-2); background: var(--surface-2); box-shadow: var(--e-3); overflow: hidden; animation: sel-in var(--d-1) var(--ease); }
.sel-pop.up { animation-name: sel-in-up; }
@keyframes sel-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes sel-in-up { from { opacity: 0; transform: translateY(4px); } }
.sel-search { flex: none; display: flex; align-items: center; gap: var(--s-2); height: var(--h-md); padding: 0 var(--s-3); border-bottom: 1px solid var(--line); }
.sel-search svg { width: 15px; height: 15px; flex: none; color: var(--dim); }
.sel-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font: 500 13.5px var(--body); }
.sel-search input::placeholder { color: var(--faint); }
.sel-list { overflow-y: auto; overscroll-behavior: contain; padding: 6px; }
.sel-group { padding: 10px 10px var(--s-1); font: var(--t-small); color: var(--faint); }
.sel-opt { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 6px 10px; border-radius: var(--r-1); color: var(--muted); font: 500 13.5px/1.35 var(--body); cursor: pointer; }
.sel-opt span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sel-opt.active { background: var(--hover-2); color: var(--text); }
.sel-opt.on { color: var(--white); }
.sel-opt svg { flex: none; width: 15px; height: 15px; color: var(--accent-text); }
.sel-opt.off { opacity: .45; cursor: default; }
.sel-swatch { flex: none; width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.sel-none { margin: 0; padding: 14px 10px; font: var(--t-small); color: var(--faint); }

/* ── buttons: primary (the main action of a view), secondary, ghost; .sm, .icon; .on when it toggles ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); height: var(--h-md); padding: 0 var(--s-4); border: 1px solid transparent; border-radius: var(--r-2); background: var(--grad); color: var(--white); font: 700 13.5px/1 var(--body); white-space: nowrap; text-decoration: none; transition: filter var(--d-2) var(--ease), background var(--d-2) var(--ease), border-color var(--d-2) var(--ease), color var(--d-2) var(--ease); }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; filter: none; transform: none; }
.btn svg { flex: none; width: 16px; height: 16px; }
.btn.secondary, .close, .garage-foot button { background: var(--surface-1); border: 1px solid var(--line-2); color: var(--text); font-weight: 600; }
.btn.secondary:hover, .close:hover, .garage-foot button:hover { filter: none; background: var(--surface-2); border-color: var(--line-3); color: var(--white); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); font-weight: 600; }
.btn.ghost:hover { filter: none; background: var(--hover-2); color: var(--text); }
.btn.on { background: var(--accent-bg); border-color: var(--accent-line); color: var(--white); }
.btn.sm { height: var(--h-sm); padding: 0 var(--s-3); font-size: 12.5px; }
.btn.icon, .close { width: var(--h-md); padding: 0; }
.btn.icon.sm { width: var(--h-sm); }
.close { display: inline-grid; place-items: center; height: var(--h-md); margin-left: auto; border-radius: var(--r-2); color: var(--muted); transition: background var(--d-2) var(--ease), border-color var(--d-2) var(--ease), color var(--d-2) var(--ease); }
.garage-foot button { flex: 1; height: 38px; border-radius: var(--r-2); font: var(--t-label); transition: background var(--d-2) var(--ease), border-color var(--d-2) var(--ease); }
pre + .btn { margin-top: var(--s-3); }

/* the floating toolbar over a 3D stage, a map or a preview */
.float { position: absolute; left: var(--s-3); bottom: var(--s-3); z-index: 2; display: flex; gap: 2px; padding: var(--s-1); border-radius: var(--r-2); background: rgba(10, 10, 15, .66); backdrop-filter: blur(10px); box-shadow: inset 0 0 0 1px var(--line-2); }
.float button { height: var(--h-sm); padding: 0 var(--s-3); border: 0; border-radius: var(--r-1); background: none; color: var(--muted); font: var(--t-label); font-size: 12.5px; transition: background var(--d-2) var(--ease), color var(--d-2) var(--ease); }
.float button:hover { background: var(--hover-2); color: var(--text); }
.float button.on { background: var(--accent-bg-strong); color: var(--white); }

/* ── tabs: the views of one thing (a sheet's 3D / stats / image) ── */
.tabs { display: flex; flex-wrap: wrap; align-self: stretch; gap: var(--s-1); padding: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
.tabs button { position: relative; flex: none; white-space: nowrap; height: var(--h-md); padding: 0 var(--s-3); border: 0; border-radius: 0; background: none; color: var(--dim); font: var(--t-label); font-size: 13.5px; transition: color var(--d-2) var(--ease); }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--white); }
.tabs button.on::after { content: ''; position: absolute; left: var(--s-3); right: var(--s-3); bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }

/* ── segmented control: one of a few modes (2D / 3D, man / woman) ── */
.seg, .tabs:is(.small, .hsex, .maptoggle) { display: inline-flex; flex-wrap: nowrap; align-self: flex-start; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--sunken); }
.seg button, .tabs:is(.small, .hsex, .maptoggle) button { height: 30px; padding: 0 var(--s-3); border: 0; border-radius: 9px; background: none; color: var(--dim); font: var(--t-label); font-size: 12.5px; white-space: nowrap; transition: background var(--d-2) var(--ease), color var(--d-2) var(--ease); }
.seg button:hover, .tabs:is(.small, .hsex, .maptoggle) button:hover { color: var(--text); }
.seg button.on, .tabs:is(.small, .hsex, .maptoggle) button.on { background: var(--surface-3); color: var(--white); box-shadow: inset 0 0 0 1px var(--line-3); }
.tabs:is(.small, .hsex, .maptoggle) button.on::after { content: none; }
.maptoggle { background: rgba(10, 10, 15, .66); backdrop-filter: blur(10px); }

/* ── chips: quick searches and filters (pills); a name in code is a chip in mono ── */
.chip, .tags button, .aclips button, .lchips span { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 30px; padding: 0 var(--s-3); border: 1px solid var(--line-2); border-radius: var(--r-pill); background: none; color: var(--muted); font: 500 13px var(--body); white-space: nowrap; transition: color var(--d-2) var(--ease), border-color var(--d-2) var(--ease), background var(--d-2) var(--ease); }
.chip:hover, .tags button:hover, .aclips button:hover { color: var(--text); border-color: var(--line-3); }
.chip.on, .tags button.on, .aclips button.on { background: var(--accent-bg); border-color: var(--accent-line); color: var(--white); }
.aclips button, .lchips span { height: auto; min-height: 28px; padding: 4px 10px; border-radius: var(--r-1); font: var(--t-code-small); white-space: normal; text-align: left; }
.tags { display: flex; gap: 6px; overflow-x: auto; margin-bottom: var(--s-5); padding-bottom: 2px; scrollbar-width: none; }

/* ── toggle: a checkbox drawn as a switch ── */
/* (its size held: a row's rule for its inputs must not stretch it into a long pill) */
input[type=checkbox] { appearance: none; position: relative; flex: none; width: 34px; min-width: 34px; max-width: 34px; height: 20px; margin: 0; padding: 0; border: 0; border-radius: var(--r-pill); background: var(--line-3); cursor: pointer; vertical-align: middle; transition: background var(--d-2) var(--ease); }
input[type=checkbox]::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform var(--d-2) var(--ease), background var(--d-2) var(--ease); }
input[type=checkbox]:checked { background: var(--accent); }
input[type=checkbox]:checked::after { transform: translateX(14px); background: var(--white); }
input[type=checkbox]:hover:not(:disabled) { filter: brightness(1.18); }
input[type=checkbox]:focus-visible { outline: none; box-shadow: var(--focus); }
input[type=checkbox]:disabled { opacity: .45; cursor: default; }
/* a toggle and its words: the whole line toggles it */
.fset:has(> input[type=checkbox]), label:has(> input[type=checkbox]) { cursor: pointer; }
.check { display: flex; align-items: center; gap: 10px; min-height: 34px; color: var(--text); font: 500 13.5px var(--body); cursor: pointer; }
.check small { color: var(--faint); font: var(--t-small); }

/* ── slider: the filled part in the accent (core/controls.js keeps --p), its value beside it ── */
input[type=range] { --p: 50%; appearance: none; height: 20px; margin: 0; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--accent) var(--p), var(--line-3) var(--p)); }
input[type=range]::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: var(--white); box-shadow: 0 0 0 4px rgba(168, 85, 247, .28), var(--e-1); transition: box-shadow var(--d-2) var(--ease); }
input[type=range]:hover::-webkit-slider-thumb { box-shadow: 0 0 0 6px rgba(168, 85, 247, .3), var(--e-1); }
input[type=range]:focus-visible { box-shadow: none; }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: var(--focus); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--line-3); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--accent); }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--white); box-shadow: 0 0 0 4px rgba(168, 85, 247, .28); }
/* a slider with its label and value: <label class="fset">Label <input type=range><b>value</b></label> */
.fset { display: flex; align-items: center; gap: 10px; color: var(--muted); font: var(--t-label); font-size: 12.5px; }
.fset input[type=range] { flex: 1 1 110px; width: auto; min-width: 80px; }
.fset b, .pctl b, .readout { min-width: 44px; color: var(--text); font: var(--t-code-small); font-variant-numeric: tabular-nums; text-align: right; }

/* ── text inputs; .search has its icon inside ── */
:where(input:not([type]), input[type=text], input[type=number], input[type=search], textarea) { height: var(--h-md); padding: 0 var(--s-3); border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--surface-1); color: var(--text); font: 500 13.5px var(--body); transition: border-color var(--d-2) var(--ease), box-shadow var(--d-2) var(--ease); }
:where(input:not([type]), input[type=text], input[type=number], input[type=search], textarea):hover { border-color: var(--line-3); }
:where(input:not([type]), input[type=text], input[type=number], input[type=search], textarea):focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px rgba(168, 85, 247, .14); }
:where(input, textarea)::placeholder { color: var(--faint); }
input[type=color] { width: 34px; height: 34px; padding: 0; border: 0; border-radius: var(--r-1); background: none; cursor: pointer; }
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color]::-webkit-color-swatch { border: 1px solid var(--line-3); border-radius: var(--r-1); }
.search { flex: 1 1 360px; display: flex; align-items: center; gap: var(--s-3); height: var(--h-lg); padding: 0 var(--s-4); border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--surface-1); transition: border-color var(--d-2) var(--ease), box-shadow var(--d-2) var(--ease); }
.search:hover { border-color: var(--line-3); }
.search:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px rgba(168, 85, 247, .14); }
.search svg { flex: none; width: 18px; height: 18px; color: var(--dim); }
.search input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; border-radius: 0; outline: 0; background: none; font: 400 15px var(--body); }
.search input:focus { box-shadow: none; }
.search kbd { flex: none; padding: 2px 7px; border: 1px solid var(--line-2); border-radius: 6px; color: var(--faint); font: 500 11px var(--code); }
@media (max-width: 900px) { .search { height: var(--h-md); } .search input { font-size: 14px; } }

/* ── list row: a name, a line about it, a badge (where it comes from) ── */
.lrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: var(--s-3); row-gap: 2px; align-items: center; width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface-1); color: var(--text); text-align: left; transition: border-color var(--d-2) var(--ease), background var(--d-2) var(--ease); }
.lrow:hover { border-color: var(--line-3); background: var(--surface-2); }
.lrow.on { border-color: var(--accent-line); background: var(--accent-bg); }
.lrow code { font: var(--t-code); color: var(--white); overflow-wrap: anywhere; }
.lrow > span:not([class]) { grid-column: 1; font: var(--t-small); color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .dlc { position: static; grid-column: 2; grid-row: 1 / span 2; justify-self: end; max-width: 170px; padding: 3px 9px; border-radius: var(--r-pill); background: var(--hover-2); color: var(--muted); font: 500 11.5px/1.4 var(--body); font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the base game is the default: only a DLC gets a badge */
.lrow .dlc.base, .card .dlc.base { display: none; }
/* a phone: the badge beside the name only, so the line under it gets the whole width */
@media (max-width: 600px) { .lrow > span:not([class]) { grid-column: 1 / -1; } .lrow .dlc { grid-row: 1; align-self: start; max-width: 46vw; } }

/* ── grid card: a picture, a title, a line about it ── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: var(--s-3); }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface-1); overflow: hidden; cursor: pointer; transition: border-color var(--d-2) var(--ease), box-shadow var(--d-2) var(--ease); }
.card:hover { border-color: var(--line-3); box-shadow: var(--e-2); }
/* the card's button covers it (keyboard and screen readers open the card with it); the copy button sits above */
.card-open { position: absolute; inset: 0; z-index: 1; padding: 0; border: 0; border-radius: inherit; background: none; cursor: pointer; }
.card-open:focus-visible { box-shadow: none; }
.card:has(.card-open:focus-visible) { box-shadow: var(--focus); }
.card .art { position: relative; aspect-ratio: 4 / 3; background: var(--art); }
.card img { position: absolute; inset: 0; width: 100%; height: 100%; padding: 4%; object-fit: contain; transition: transform var(--d-3) var(--ease); }
.card:hover img { transform: scale(1.03); }
/* a picture still being made: the art shimmers softly (no spinner per card) */
.card .wait { position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(196, 181, 253, .07) 50%, transparent 70%) 0 0 / 250% 100%; animation: sk 1.6s linear infinite; }
.card .wait i { display: none; }
/* the picture shows once it has loaded (an image with no source yet draws a frame) */
.card img { transition: transform var(--d-3) var(--ease), opacity var(--d-3) var(--ease); }
.card .art:has(.wait) img { opacity: 0; }
.card .dlc { position: absolute; top: 10px; left: 10px; max-width: calc(100% - 60px); padding: 3px 9px; overflow: hidden; border: 1px solid var(--line-2); border-radius: var(--r-pill); background: rgba(10, 10, 15, .6); backdrop-filter: blur(8px); color: var(--lilac-2); font: 600 11px/1.4 var(--body); text-overflow: ellipsis; white-space: nowrap; }
.card .copy { position: absolute; z-index: 2; top: 8px; right: 8px; display: grid; place-items: center; width: var(--h-sm); height: var(--h-sm); border: 0; border-radius: var(--r-1); background: rgba(10, 10, 15, .6); backdrop-filter: blur(8px); color: var(--text); opacity: 0; transition: opacity var(--d-2) var(--ease), background var(--d-2) var(--ease); }
.card:hover .copy, .card:focus-within .copy, .card:has(.card-open:focus-visible) .copy { opacity: 1; }
.card .copy:hover { background: rgba(10, 10, 15, .85); }
.card .copy svg { width: 15px; height: 15px; }
.card .copy.done { color: var(--success); opacity: 1; }
.card .meta { padding: var(--s-3) 14px 14px; border-top: 1px solid var(--line); }
.card .meta b { display: block; overflow: hidden; color: var(--white); font: var(--t-code); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.card .meta b.title { font: 600 15px/1.3 var(--display); letter-spacing: -.01em; }
.card .meta span { display: block; margin-top: 2px; overflow: hidden; color: var(--dim); font: var(--t-small); text-overflow: ellipsis; white-space: nowrap; }
.card .meta code { color: var(--muted); font: var(--t-code-small); }

/* similar models under a sheet's stage: a row that scrolls and snaps */
.similar .row { display: flex; gap: var(--s-3); padding-bottom: var(--s-1); overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
.similar .card { flex: 0 0 178px; scroll-snap-align: start; }
.similar .card .meta { padding: 9px 12px 10px; }
.similar .card .meta b { font-size: 12px; }
.similar .card .meta span, .similar .card .dlc { display: none; }

/* a stage's picture, and a stage for a list (textures) */
.stage > img, .stage > canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.stage.plain { background: var(--sunken); overflow-y: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }

/* ── skeletons: the shape of what is coming, shimmering ── */
.sk { display: block; border-radius: var(--r-1); background: linear-gradient(90deg, var(--surface-1) 0%, var(--surface-3) 45%, var(--surface-1) 90%) 0 0 / 220% 100%; animation: sk 1.3s linear infinite; }
@keyframes sk { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.sk-line { height: 11px; margin: 5px 0; width: 80%; font-style: normal; }
.sk-line.short { width: 45%; }
.sk-card { cursor: default; pointer-events: none; }
.sk-card .art { aspect-ratio: 4 / 3; border-radius: 0; }
.sk-row { display: block; pointer-events: none; }
.sk-detail { display: grid; gap: var(--s-2); }
.sk-title { height: 26px; width: 55%; }
.sk-block { height: 280px; margin: var(--s-3) 0; border-radius: var(--r-3); }

/* ── states: nothing found, not loaded, still reading, pick one ── */
.state { display: grid; justify-items: center; gap: 6px; padding: 72px var(--s-4); text-align: center; }
.state-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 6px; border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--surface-1); color: var(--accent-text); }
.state-icon svg { width: 20px; height: 20px; }
.state.error .state-icon { color: var(--danger); }
.state.loading .state-icon svg { animation: spin .9s linear infinite; }
.state b { font: var(--t-section); letter-spacing: var(--ls-section); color: var(--text); }
.state p { max-width: 46ch; margin: 0; color: var(--dim); }
.state .btn { margin-top: 10px; }
.ldetail > .state { padding: 64px var(--s-4); }
/* on a phone the detail sits above the list: nothing there until a row is picked */
@media (max-width: 1000px) { .ldetail:has(> .state.pick) { display: none; } .ldetail { max-height: none; overflow: visible; } }
p.empty { padding: 40px var(--s-4); text-align: center; color: var(--dim); }
@keyframes spin { to { transform: rotate(360deg); } }
/* a 3D model on its way */
.stage .loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted); font: var(--t-small); }
.stage .loading.failed { color: var(--dim); }
/* a list's stage with no model to show: just the message, on the plain sunken ground */
#ldetail .stage.nomodel { height: 64px; background: var(--sunken); }
#ldetail .stage.nomodel canvas { display: none; }
.stage .loading.failed::before { content: none; }
.stage .loading::before { content: ''; width: 22px; height: 22px; border: 2px solid var(--line-3); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }

/* ── toast: "Copied adder" ── */
/* across the whole width, centred (at left: 50% a toast could only use half the screen) */
.toasts { position: fixed; z-index: var(--z-toast); left: 0; right: 0; bottom: var(--s-5); display: grid; justify-items: center; gap: var(--s-2); padding: 0 var(--s-4); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: min(92vw, 460px); padding: 10px 16px 10px 12px; border-radius: var(--r-2); background: var(--surface-3); box-shadow: var(--e-3); color: var(--text); font: var(--t-label); animation: toast-in var(--d-2) var(--ease); }
.toast span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast svg { flex: none; width: 16px; height: 16px; color: var(--success); }
.toast.error svg { align-self: flex-start; margin-top: 2px; color: var(--danger); }
/* a word that went wrong is read in full: it wraps (a "Copied" stays on one line) */
.toast.error span { white-space: normal; }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity var(--d-2) var(--ease), transform var(--d-2) var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ── detail panel: header, media, facts, code, more details ── */
.ldetail { padding: var(--s-5) var(--s-5) 28px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface-1); max-height: calc(100vh - 40px); overflow-y: auto; }
.ldetail > h2, .sheet-head h2 { margin: 0; font: var(--t-title); letter-spacing: var(--ls-title); color: var(--white); overflow-wrap: anywhere; }
.ldetail > h2 { font-size: 24px; }
@media (max-width: 600px) { .ldetail > h2 { font-size: 20px; } .ldetail { padding: var(--s-4); } }
.ldetail .lsub { margin: 6px 0 var(--s-4); color: var(--dim); font: var(--t-small); font-size: 13px; }
/* a block inside a detail ("Use it", "Effects"): a section title, not a label */
.ldetail h3.eyebrow, .facts h3.eyebrow { margin: 28px 0 10px; font: 600 15px/1.3 var(--display); letter-spacing: -.01em; color: var(--text); }
.ldetail .stage { margin-top: var(--s-1); }

/* facts: a label, a value, a copy button; in a list's detail they sit in a grid */
.fact { position: relative; padding: 10px 40px 10px 0; border-bottom: 1px solid var(--line); }
.fact small { display: block; margin-bottom: 2px; font: var(--t-small); color: var(--dim); }
.fact p { margin: 0; font: var(--t-body); color: var(--text); overflow-wrap: anywhere; word-break: normal; }
.fact p.code { font: var(--t-code); }
.fact .cp { position: absolute; right: 0; top: 50%; width: var(--h-sm); height: var(--h-sm); display: grid; place-items: center; border: 0; border-radius: var(--r-1); background: none; color: var(--faint); transform: translateY(-50%); transition: background var(--d-2) var(--ease), color var(--d-2) var(--ease); }
.fact .cp:hover { background: var(--hover-2); color: var(--white); }
.fact .cp svg { width: 15px; height: 15px; }
.fact .cp.done { color: var(--success); }
.facts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); column-gap: var(--s-5); margin: var(--s-1) 0 var(--s-2); }

/* code block: its language, a Copy button, the code wrapped and coloured */
.codeblock { margin-top: var(--s-2); border: 1px solid var(--line); border-radius: var(--r-2); background: var(--sunken); overflow: hidden; }
.code-head { display: flex; align-items: center; justify-content: space-between; height: 36px; padding: 0 6px 0 14px; border-bottom: 1px solid var(--line); color: var(--faint); font: var(--t-small); }
.code-copy { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 0; border-radius: var(--r-1); background: none; color: var(--muted); font: var(--t-label); font-size: 12px; transition: background var(--d-2) var(--ease), color var(--d-2) var(--ease); }
.code-copy:hover { background: var(--hover-2); color: var(--white); }
.code-copy svg { width: 14px; height: 14px; }
.code-copy.done { color: var(--success); }
.codeblock pre, pre { margin: 0; padding: 14px 16px; border: 0; border-radius: 0; background: none; color: #d9d4ee; font: var(--t-code); font-size: 12.5px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; tab-size: 2; }
.codeblock pre { max-height: 440px; overflow: auto; }
.c-com { color: var(--faint); font-style: italic; }
.c-str { color: #b8e3c8; }
.c-num { color: #f2c38f; }
.c-key { color: var(--lilac); }
.c-fn { color: var(--white); }
.code-old { display: none !important; }

/* "More details": folded away until asked for */
details.more { margin-top: var(--s-4); border-top: 1px solid var(--line); }
details.more summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: 14px 0; list-style: none; color: var(--muted); font: var(--t-label); cursor: pointer; transition: color var(--d-2) var(--ease); }
details.more summary:hover { color: var(--text); }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: ''; flex: none; width: 7px; height: 7px; margin-right: 4px; border: solid currentColor; border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); transition: transform var(--d-2) var(--ease); }
details.more[open] summary::after { transform: rotate(225deg); }

/* one frame for every 3D stage, map and preview */
.stage { position: relative; flex: 1; min-width: 0; min-height: 0; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--art); overflow: hidden; }

/* ── the sheet: one item over its section (vehicles, peds, weapons, clothes, objects) ── */
.modal { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; padding: var(--s-5); background: rgba(5, 5, 8, .72); backdrop-filter: blur(8px); animation: fade var(--d-2) var(--ease); }
.sheet { display: grid; grid-template-columns: 360px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); width: min(1360px, 100%); height: min(860px, 100%); border: 1px solid var(--line-2); border-radius: var(--r-3); background: var(--surface-2); box-shadow: var(--e-3); overflow: hidden; animation: pop var(--d-3) var(--ease); }
.sheet-head { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--s-3); min-width: 0; padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--line); }
.sheet-head h2:not(.title) { font: 600 19px var(--code); letter-spacing: 0; }
.sheet-head .sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); font: var(--t-code); }
.origin { flex: none; padding: 3px 10px; border: 1px solid var(--line-2); border-radius: var(--r-pill); background: var(--hover-2); color: var(--muted); font: 600 12px/1.4 var(--body); letter-spacing: 0; }
.origin.dlc { background: var(--accent-bg); border-color: var(--accent-line); color: var(--lilac-2); }
.facts { overflow-y: auto; padding: var(--s-2) var(--s-5) var(--s-5); border-right: 1px solid var(--line); background: var(--surface-1); }
.side { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; min-height: 0; padding: var(--s-3) var(--s-5) var(--s-5); }
.side > .tabs { margin: 0 calc(-1 * var(--s-2)); }
@media (max-width: 960px) {
  .modal { padding: 0; place-items: stretch; }
  .sheet { display: flex; flex-direction: column; width: 100%; height: 100%; border: 0; border-radius: 0; overflow-y: auto; overscroll-behavior: contain; }
  .sheet-head { position: sticky; top: 0; z-index: 3; padding: var(--s-3) var(--s-4); background: rgba(21, 18, 31, .92); backdrop-filter: blur(10px); }
  .side { order: 2; flex: none; padding: var(--s-3) var(--s-4) var(--s-4); }
  .side > .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .work { flex: none; flex-direction: column; }
  .work > .stage, .side > .stage { flex: none; height: 52vh; min-height: 280px; }
  .work > .stage:has(> .hpanel), .work > .stage.plain { height: auto; min-height: 0; }
  .hpanel { height: auto; overflow: visible; }
  .garage { flex: none; max-height: none; }
  .facts { order: 3; overflow: visible; max-height: none; padding: var(--s-2) var(--s-4) var(--s-6); border: 0; border-top: 1px solid var(--line); }
}

/* ── helper note and its info tooltip ── */
p.none, .note { margin: var(--s-2) 0; color: var(--dim); font: var(--t-small); font-size: 13px; }
.tip { display: inline-grid; place-items: center; width: 20px; height: 20px; margin: -2px 0 0 4px; padding: 0; vertical-align: middle; border: 0; border-radius: 50%; background: none; color: var(--faint); cursor: help; transition: color var(--d-2) var(--ease); }
.tip svg { width: 15px; height: 15px; }
.tip:hover, .tip:focus-visible { color: var(--accent-text); }
.tipbox { position: fixed; z-index: var(--z-toast); max-width: 300px; padding: 8px 12px; border-radius: var(--r-1); background: var(--surface-3); box-shadow: var(--e-3); color: var(--text); font: var(--t-small); font-size: 12.5px; line-height: 1.5; pointer-events: none; opacity: 0; transition: opacity var(--d-1) var(--ease); }
.tipbox.on { opacity: 1; }

/* ── key / value table (a timecycle's values, a train's carriages) ── */
.ltable { display: grid; gap: 2px; }
.ltable > div { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); padding: 7px 12px; border-radius: var(--r-1); background: var(--sunken); }
.ltable code { min-width: 0; font: var(--t-code-small); color: var(--text); overflow-wrap: anywhere; }
.ltable span { flex: none; max-width: 60%; font: var(--t-code-small); color: var(--dim); text-align: right; overflow-wrap: anywhere; }

/* ── maps inside a detail, and the map's look (Leaflet) ── */
.lmap { position: relative; height: 280px; margin-top: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-3); background: #0b1a26; overflow: hidden; }
.lmap.tall { height: 380px; }
.leaflet-container { background: #0b1a26; font: inherit; }
.leaflet-bar { border: 1px solid var(--line-2) !important; border-radius: var(--r-1) !important; overflow: hidden; box-shadow: var(--e-1) !important; }
.leaflet-bar a, .leaflet-bar a:hover { background: rgba(18, 18, 26, .9); color: var(--text); border-color: var(--line-2); }
.leaflet-bar a:hover { background: var(--surface-3); }
.leaflet-tooltip { padding: 4px 8px; border: 0; border-radius: 6px; background: var(--surface-3); box-shadow: var(--e-2); color: var(--text); font: var(--t-code-small); }
.leaflet-tooltip::before { display: none; }
.pin i { position: absolute; left: 3px; top: 0; width: 16px; height: 16px; border-radius: 50% 50% 50% 0; background: var(--grad); transform: rotate(-45deg); box-shadow: 0 0 0 2px var(--white), 0 6px 14px rgba(0, 0, 0, .5); }
.pin.big i { left: 1px; width: 20px; height: 20px; }

/* a 3D stage inside a detail, with its "Load it in 3D" button */
.lstage { display: grid; place-items: center; height: 420px; margin: var(--s-1) 0; }
.l3dgo { margin: 0; }
.lcut { margin: var(--s-2) 0 var(--s-3); max-width: 360px; }
/* a sound to hear */
.lsound { margin: var(--s-1) 0 var(--s-3); }
.lsound audio { width: 100%; height: 40px; }

/* ── the control panel beside a 3D stage (the garage, the wardrobe, a weapon's parts) ── */
.work { flex: 1; min-height: 0; display: flex; gap: var(--s-3); }
.garage { flex: 0 0 300px; display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface-1); overflow: hidden; }
.garage-in { flex: 1; overflow-y: auto; padding: var(--s-4); }
.garage h4, .hpanel h4, .rigside h4 { display: flex; align-items: baseline; gap: var(--s-2); margin: 0 0 10px; font: 600 14px/1.3 var(--display); letter-spacing: -.005em; text-transform: none; color: var(--text); }
.garage h4:not(:first-child), .rigside h4:not(:first-child) { margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.garage h4 small, .rigside h4 small, .hpanel h4 small { color: var(--faint); font: var(--t-code-small); }
.garage .none { color: var(--dim); font: var(--t-small); }
.garage-foot { display: flex; gap: var(--s-2); padding: var(--s-3) var(--s-4); border-top: 1px solid var(--line); }
.mod { margin-bottom: 10px; }
.mod > label { display: block; margin-bottom: 6px; color: var(--muted); font: var(--t-small); font-weight: 600; }
.garage .mod .fset.fm { margin: 6px 0 4px; }
/* a colour: its name, its code, a picker */
.paint { display: flex; align-items: center; gap: 10px; margin-bottom: var(--s-2); padding: var(--s-2) 10px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface-2); }
.paint b { flex: 1; font: var(--t-label); font-size: 13.5px; }
.paint code { color: var(--dim); font: var(--t-code-small); text-align: right; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 var(--s-2); }
.swatches button { width: 22px; height: 22px; padding: 0; border: 1px solid rgba(255, 255, 255, .15); border-radius: 6px; transition: transform var(--d-1) var(--ease); }
.swatches button:hover { transform: scale(1.12); }
.swatches.hair { display: grid; grid-template-columns: repeat(16, 1fr); gap: 3px; }
.swatches.hair button { width: auto; height: auto; aspect-ratio: 1; border-radius: 4px; border-color: rgba(255, 255, 255, .08); }
.swatches.hair button.on { outline: 2px solid var(--white); outline-offset: 1px; }
.garage .mod .swatches.hair { margin: 6px 0 var(--s-2); }
/* toggles in a row (a vehicle's extras, its neon sides) */
.extras { display: flex; flex-wrap: wrap; gap: 6px; }
.extras button { min-width: 36px; height: var(--h-sm); padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r-1); background: var(--surface-2); color: var(--muted); font: var(--t-label); font-size: 12.5px; transition: background var(--d-2) var(--ease), border-color var(--d-2) var(--ease), color var(--d-2) var(--ease); }
.extras button:hover { border-color: var(--line-3); color: var(--text); }
.extras button.on { border-color: var(--accent-line); background: var(--accent-bg); color: var(--white); }
.neon { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: var(--s-2); }
.plate-in { width: 100%; height: var(--h-md); margin-bottom: var(--s-2); padding: 0 var(--s-3); border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--surface-2); color: var(--text); font: 700 15px var(--code); letter-spacing: .12em; text-transform: uppercase; }
@media (max-width: 1100px) and (min-width: 961px) { .work { flex-direction: column; } .garage { flex: 0 0 auto; max-height: 280px; } }

/* ── sound player (core/audio.js) ── */
.player { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 var(--s-3) 0 6px; border: 1px solid var(--line-2); border-radius: var(--r-pill); background: var(--surface-2); }
.player[hidden] { display: none; }
.player-play { flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: var(--grad); color: var(--white); transition: filter var(--d-2) var(--ease); }
.player-play:hover { filter: brightness(1.12); }
.player-play svg { width: 14px; height: 14px; }
.player input[type=range] { flex: 1; min-width: 60px; }
.player-t, .player-d { flex: none; min-width: 40px; color: var(--muted); font: var(--t-code-small); font-variant-numeric: tabular-nums; }
.player-d { color: var(--faint); text-align: right; }
.player.err { opacity: .5; }
.player.err .player-play { background: var(--surface-3); cursor: default; }

/* ── texture grid: a model's textures on a checkerboard (objects, clothes) ── */
.texgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--s-4); padding: var(--s-4); }
.tex img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; border: 1px solid var(--line); border-radius: var(--r-2); background: repeating-conic-gradient(#15131c 0 25%, #1c1926 0 50%) 0 0 / 16px 16px; }
.tex b { display: block; margin-top: var(--s-2); color: var(--white); font: var(--t-code-small); overflow-wrap: anywhere; }
.tex span { color: var(--dim); font: var(--t-small); }
@media (max-width: 600px) { .texgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); padding: var(--s-3); } }

/* ── on a phone, two cards a row ── */
@media (max-width: 600px) {
  .grid, .grid.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card .meta { padding: 10px 12px 12px; }
  .card .meta b.title { font-size: 14px; }
  .card .dlc { top: 8px; left: 8px; max-width: calc(100% - 16px); font-size: 10.5px; }
  .card .copy { display: none; }
}

/* ── the search over everything, and its results ── */
.gsearch { position: relative; z-index: var(--z-sticky); margin: -14px 0 22px; }
.gsearch .search { height: 44px; background: var(--surface-2); }
.gresults { position: absolute; left: 0; right: 0; top: calc(100% + 6px); max-height: 72vh; overflow-y: auto; border-radius: var(--r-3); background: var(--surface-2); box-shadow: var(--e-3); animation: sel-in var(--d-1) var(--ease); }
.hero .gresults { right: auto; width: min(960px, calc(100vw - var(--side) - 2 * var(--gutter))); }
.gcols { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0 var(--s-2); padding: var(--s-2); }
.ggroup { padding: var(--s-2) 0 var(--s-1); }
.ggroup h5 { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-2); margin: 0 10px 4px; color: var(--text); font: 600 13.5px var(--display); letter-spacing: -.005em; }
.ggroup h5 button { padding: 2px 6px; border: 0; border-radius: 6px; background: none; color: var(--dim); font: var(--t-small); font-size: 12px; transition: color var(--d-2) var(--ease), background var(--d-2) var(--ease); }
.ggroup h5 button:hover { background: var(--hover-2); color: var(--white); }
.gitem { display: flex; align-items: center; gap: var(--s-2); width: 100%; padding: 7px 10px; border: 0; border-radius: var(--r-1); background: none; text-align: left; }
.gitem:hover, .gitem.active { background: var(--hover-2); }
.gitem.active { box-shadow: inset 2px 0 0 var(--accent); }
.gitem b { flex: 1 1 auto; min-width: 0; overflow: hidden; color: var(--text); font: 500 13.5px var(--body); text-overflow: ellipsis; white-space: nowrap; }
.gitem small { flex: 0 1 auto; max-width: 45%; margin-left: auto; overflow: hidden; color: var(--faint); font: var(--t-code-small); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.gitem .bicon { width: 22px; height: 22px; }
.gresults > .state { padding: 40px var(--s-4); }
.gfoot { position: sticky; bottom: 0; display: flex; gap: var(--s-4); padding: 8px var(--s-4); border-top: 1px solid var(--line); background: var(--surface-2); color: var(--faint); font: var(--t-small); font-size: 12px; }
.gfoot kbd { margin-right: 3px; padding: 0 5px; border: 1px solid var(--line-2); border-radius: 4px; font: 500 10.5px var(--code); }
@media (max-width: 900px) { .hero .gresults { width: auto; right: 0; } .gfoot { display: none; } .gcols { grid-template-columns: minmax(0, 1fr); } }

/* ── phones: the sheet's header on two lines: the name, the arrows and close; then where it comes from ── */
.sheet-head .close { flex: none; }
@media (max-width: 600px) {
  .sheet-head { flex-wrap: wrap; gap: 6px var(--s-2); }
  .sheet-head h2 { flex: 1 1 0; order: 0; min-width: 0; font-size: 17px; overflow-wrap: anywhere; }
  .sheet-head h2:not(.title) { font-size: 15px; }
  .sheet-head .sheet-step { order: 1; margin-left: 0; }
  .sheet-head .close { order: 2; }
  /* a line break: what follows goes under the name */
  .sheet-head::after { content: ''; order: 3; flex-basis: 100%; height: 0; }
  .sheet-head .origin { order: 4; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ── touch: bigger targets for the small controls (the look stays the same) ── */
@media (pointer: coarse) {
  input[type=range] { height: 32px; }
  .tip { position: relative; }
  .tip::after { content: ''; position: absolute; inset: -8px; }
  .swatches button { width: 28px; height: 28px; }
  .swatches { gap: 8px; }
  input[type=checkbox] { width: 40px; min-width: 40px; max-width: 40px; height: 24px; }
  input[type=checkbox]::after { width: 18px; height: 18px; }
  input[type=checkbox]:checked::after { transform: translateX(16px); }
}

/* ── pages: previous, numbers, next; "Page 5 of 20" on a phone ── */
.pages { display: flex; justify-content: center; align-items: center; gap: 4px; margin-top: var(--s-6); }
.pages:empty { display: none; }
.pages button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: var(--h-md); height: var(--h-md); padding: 0 10px; border: 1px solid transparent; border-radius: var(--r-2); background: none; color: var(--muted); font: var(--t-label); font-size: 14px; font-variant-numeric: tabular-nums; transition: background var(--d-2) var(--ease), color var(--d-2) var(--ease), border-color var(--d-2) var(--ease); }
.pages button svg { width: 16px; height: 16px; }
.pages button:hover:not(:disabled) { background: var(--hover-2); color: var(--white); }
.pages button[aria-current] { border-color: var(--accent-line); background: var(--accent-bg); color: var(--white); cursor: default; }
.pages button:disabled { opacity: .35; cursor: default; }
.pages .step { padding: 0 14px; border-color: var(--line-2); }
.pages .step:first-child { margin-right: var(--s-2); }
.pages .step:last-child { margin-left: var(--s-2); }
.pages .gap { min-width: 24px; color: var(--faint); text-align: center; }
.pages .where { display: none; color: var(--muted); font: var(--t-label); font-size: 14px; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  .pages { justify-content: space-between; }
  .pages .num, .pages .gap { display: none; }
  .pages .where { display: block; }
  .pages .step:first-child, .pages .step:last-child { margin: 0; }
}
/* the same pages at the top, small, at the end of the title's line */
.pagetop { display: flex; align-items: center; gap: 2px; margin-left: auto; align-self: center; }
.pagetop:empty { display: none; }
.pagetop button { display: inline-flex; align-items: center; justify-content: center; width: var(--h-sm, 32px); height: var(--h-sm, 32px); border: 1px solid var(--line-2); border-radius: var(--r-2); background: none; color: var(--muted); transition: background var(--d-2) var(--ease), color var(--d-2) var(--ease); }
.pagetop button svg { width: 16px; height: 16px; }
.pagetop button:hover:not(:disabled) { background: var(--hover-2); color: var(--white); }
.pagetop button:disabled { opacity: .35; cursor: default; }
.pagetop .where { min-width: 64px; padding: 0 6px; color: var(--muted); font: var(--t-label); font-size: 13px; font-variant-numeric: tabular-nums; text-align: center; }
/* under a list beside its detail: the pages sit under the list */
@media (min-width: 1001px) { :is(#listview, #anims):not([hidden]) ~ .pages { max-width: 460px; } }
@media (min-width: 1001px) { #listview.cards-mode:not([hidden]) ~ .pages { max-width: none; } }

/* ── a list shown as cards (IPLs, interiors, zones…): the grid's cards, each item's details in a sheet ── */
#listview.cards-mode { grid-template-columns: minmax(0, 1fr); }
#listview.cards-mode > #ldetail { display: none; }
.llist.cards { position: static; display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: var(--s-3); max-height: none; padding: 0; overflow: visible; }
.card .mapart { position: absolute; inset: 0; display: block; width: 100%; height: 100%; background: #1d2633; transition: transform var(--d-3) var(--ease); }
.card:hover .mapart { transform: scale(1.03); }
.mapart image { opacity: .92; }
.mapart .zone { fill: rgba(168, 85, 247, .24); stroke: #d8b4fe; stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.mapart .road { fill: none; stroke: #d8b4fe; stroke-width: 2.5px; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.mapart .dot { fill: #e9d5ff; stroke: rgba(10, 10, 15, .75); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.mapart .ring { fill: rgba(168, 85, 247, .28); stroke: #d8b4fe; stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.card .noart.pending svg { width: 34px; height: 34px; color: var(--line-3); }
.card .noart { position: absolute; inset: 0; display: grid; place-items: center; padding: var(--s-4); color: var(--faint); font: var(--t-small); text-align: center; }
.lsheet { display: flex; flex-direction: column; width: min(940px, 100%); }
.lsheet .sheet-head .close { margin-left: auto; }
.lsheet .sheet-step + .close { margin-left: var(--s-2); }
.lsheet-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.lsheet #ldetail { max-height: none; overflow: visible; border: 0; border-radius: 0; background: none; }
/* the name is the sheet's title already */
.lsheet #ldetail > h2 { display: none; }
.lsheet #ldetail > .lsub { margin-top: 0; }
.llist.cards.compact { grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); }
/* ── the controls: one table (header kept in view), each number and name copied with a click ── */
.llist.table { position: static; display: block; max-height: none; padding: 0; overflow: visible; }
.ctable { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface-1); font: var(--t-small); font-size: 13.5px; }
.ctable th { position: sticky; top: 0; z-index: 2; padding: 10px 14px; border-bottom: 1px solid var(--line-2); background: var(--surface-2); color: var(--dim); font: var(--t-label); font-size: 12px; text-align: left; }
.ctable th:first-child { border-top-left-radius: var(--r-3); } .ctable th:last-child { border-top-right-radius: var(--r-3); }
.ctable td { padding: 6px 14px; border-bottom: 1px solid var(--line); color: var(--text); vertical-align: middle; }
.ctable tbody tr:last-child td { border-bottom: 0; }
.ctable tbody tr { cursor: pointer; transition: background var(--d-2) var(--ease); }
.ctable tbody tr:hover { background: var(--hover-1, rgba(255, 255, 255, .03)); }
.ctable .cidx { width: 84px; } .ctable .copen { width: 1%; text-align: right; }
.ctable [data-copy] { display: inline-flex; align-items: center; gap: 8px; padding: 3px 6px; margin: 0 -6px; border: 0; border-radius: var(--r-1); background: none; color: var(--white); font: var(--t-code); font-size: 13px; text-align: left; cursor: copy; }
.ctable .cidx [data-copy] { color: var(--accent-text); font-variant-numeric: tabular-nums; }
.ctable [data-copy] svg { width: 13px; height: 13px; flex: none; color: var(--dim); opacity: 0; transition: opacity var(--d-2) var(--ease); }
.ctable [data-copy]:hover { background: var(--hover-2); } .ctable [data-copy]:hover svg, .ctable [data-copy]:focus-visible svg { opacity: 1; }
.ctable kbd { display: inline-block; min-width: 24px; padding: 2px 7px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; background: var(--sunken); color: var(--text); font: 500 12px var(--code); text-align: center; white-space: nowrap; }
.ctable .none { color: var(--faint); }
.ctable .copen-b { display: inline-flex; align-items: center; gap: 2px; padding: 4px 6px 4px 10px; border: 1px solid var(--line-2); border-radius: var(--r-pill); background: none; color: var(--muted); font: var(--t-label); font-size: 12px; white-space: nowrap; }
.ctable .copen-b svg { width: 14px; height: 14px; }
.ctable tr:hover .copen-b, .ctable .copen-b:focus-visible { border-color: var(--accent-line); color: var(--white); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* a phone: each control on two lines (number and name; its keys and the code) */
@media (max-width: 700px) {
  .ctable, .ctable tbody { display: block; } .ctable thead { display: none; }
  .ctable tbody tr { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .ctable td { padding: 0; border: 0; } .ctable .cidx { width: auto; }
  .ctable .cname { grid-column: 2 / 4; min-width: 0; } .ctable .cname [data-copy] { max-width: 100%; overflow-wrap: anywhere; }
  .ctable .cpc { grid-column: 1 / 3; grid-row: 2; } .ctable .cpad { grid-row: 2; grid-column: 3; text-align: right; }
  .ctable .copen { display: none; }
  .ctable [data-copy] svg { opacity: 1; }
}
/* a picture of its own: a texture, a portrait, a font's letters (a small one kept at its size, not blown up) */
.card .art > .pic { padding: 8%; object-fit: contain; }
/* a picture with its own background (an effect mid-play): the whole picture area */
.card .art > img.fill { padding: 0; object-fit: cover; }
.card .art > .pic.fit { padding: 12%; }
.card .art > .pic.portrait { padding: 4% 4% 0; object-position: bottom; }
.card .art > .pic.font { padding: 10% 6%; filter: invert(1) brightness(.92); }
.card .mosaic { position: absolute; inset: 0; display: grid; gap: 6px; padding: 10%; }
.card .mosaic.n2 { grid-template-columns: 1fr 1fr; }
.card .mosaic.n3, .card .mosaic.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.card .mosaic img { position: static; width: 100%; height: 100%; min-height: 0; padding: 0; object-fit: contain; }
/* before and after: the original, the filtered picture over it cut at the divider (--x), the divider and its knob */
.card .cmp { position: absolute; inset: 0; overflow: hidden; --x: 50%; }
.card .cmp img { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; object-fit: cover; }
.card:hover .cmp img { transform: none; }
.card .cmp .cmp-b { clip-path: inset(0 0 0 var(--x)); }
.cmp-line { position: absolute; z-index: 2; top: 0; bottom: 0; left: var(--x); width: 28px; margin-left: -14px; cursor: ew-resize; touch-action: none; }
.cmp-line::before { content: ''; position: absolute; top: 0; bottom: 0; left: 13px; width: 2px; background: var(--white); box-shadow: 0 0 6px rgba(0, 0, 0, .55); }
.cmp-knob { position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: var(--white); color: #15121f; box-shadow: 0 2px 10px rgba(0, 0, 0, .45); transition: transform var(--d-2) var(--ease); }
.cmp-knob svg { width: 18px; height: 18px; }
.cmp-line:hover .cmp-knob, .cmp.dragging .cmp-knob { transform: scale(1.1); }
.cmp-line:focus-visible { outline: none; } .cmp-line:focus-visible .cmp-knob { box-shadow: var(--focus); }
.cmp-tag { position: absolute; bottom: 8px; padding: 2px 7px; border-radius: var(--r-pill); background: rgba(10, 10, 15, .62); color: var(--text); font: 500 10.5px var(--body); pointer-events: none; }
.cmp-tag.a { left: 8px; } .cmp-tag.b { right: 8px; }
.card .swatchart { position: absolute; inset: 0; display: grid; place-items: center; }
/* a see-through colour shows on a checkerboard */
.card .swatchart i { width: 56%; aspect-ratio: 1; border-radius: var(--r-3); background-color: transparent; box-shadow: 0 0 0 1px var(--line-2), var(--e-2); }
.card .swatchart::before { content: ''; position: absolute; width: 56%; aspect-ratio: 1; border-radius: var(--r-3); background: repeating-conic-gradient(#2a2638 0 25%, #1c1928 0 50%) 0 0 / 16px 16px; }
.card .swatchart i { position: relative; }
.card .svgart { position: absolute; inset: 0; display: grid; place-items: center; }
.card .svgart svg { width: 42%; height: auto; max-height: 64%; }
/* a sound: its waveform, ▶ in the middle, its length; while it plays the bars fill up to where it is */
.card .wave { position: absolute; inset: 0; display: grid; place-items: center; padding: 18% 8%; --p: 0%; }
.wave .peaks { position: absolute; inset: 18% 8%; width: 84%; height: 64%; fill: var(--line-3); }
.wave:not(.drawn) .peaks:not(.top) { background: linear-gradient(var(--line-2), var(--line-2)) center / 100% 2px no-repeat; }
.wave .peaks.top { fill: var(--accent-text); clip-path: inset(0 calc(100% - var(--p)) 0 0); }
.wave .play { position: relative; z-index: 2; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 1px solid var(--accent-line); border-radius: 50%; background: rgba(21, 18, 31, .82); backdrop-filter: blur(6px); color: var(--white); transition: transform var(--d-2) var(--ease), background var(--d-2) var(--ease); }
.wave .play svg { width: 20px; height: 20px; }
.wave .play:hover { transform: scale(1.06); background: var(--accent); }
.wave.playing .play { background: var(--accent); border-color: transparent; }
.wave .dur { position: absolute; right: 10px; bottom: 8px; color: var(--dim); font: var(--t-code-small); font-variant-numeric: tabular-nums; }
.wave.none, .wave .why { color: var(--faint); font: var(--t-small); text-align: center; }
.wave .why { position: absolute; inset: auto 8px 10px; }
.card.sounding { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line); }
@media (max-width: 600px) { .llist.cards, .llist.cards.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .lsheet-body { overflow: visible; } .wave .play { width: 42px; height: 42px; } }

/* hair colour picker, two controls side by side, a small segmented control's gap, a slider row in a detail */
.hairpick { margin-bottom: 12px; }
.hairpick label { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.hairpick label code { color: var(--dim); font: 500 11px var(--code); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tabs.small { margin-bottom: 10px; }
.ldetail .fset { margin: 10px 0; }
.ldetail .fset input:not([type]) { width: auto; flex: 1; height: 34px; padding: 0 10px; border-radius: var(--r-1); border: 1px solid var(--line-2); background: var(--sunken); color: var(--text); font: 500 13px var(--body); }

/* ── stepping through the grid from the sheet: ‹ 3 of 48 › before the close button ── */
.sheet-step { flex: none; display: flex; align-items: center; gap: 2px; margin-left: auto; }
.sheet-step + .close { margin-left: var(--s-2); }
.sheet-step button { display: grid; place-items: center; width: var(--h-sm); height: var(--h-sm); padding: 0; border: 0; border-radius: var(--r-1); background: none; color: var(--muted); transition: background var(--d-2) var(--ease), color var(--d-2) var(--ease); }
.sheet-step button:hover:not(:disabled) { background: var(--hover-2); color: var(--white); }
.sheet-step button:disabled { opacity: .35; cursor: default; }
.sheet-step svg { width: 16px; height: 16px; }
.sheet-step span { min-width: 64px; color: var(--dim); font: var(--t-small); font-variant-numeric: tabular-nums; text-align: center; }
@media (max-width: 600px) { .sheet-step span { display: none; } }
