/* ============================================================================
   P23D — "Build Plate" design system
   Millimeter-grid plates, layer-by-layer motion, slicer-style readouts,
   bounding-box selection marks. No framework, no web fonts.
   ========================================================================== */
:root {
  --bg: #e9e6df;
  --grid: rgba(40, 36, 30, 0.055);
  --grid-major: rgba(40, 36, 30, 0.09);
  --surface: #fbfaf7;
  --surface-2: #f3f1ec;
  --sunken: #e2dfd7;
  --border: #d6d2c8;
  --border-strong: #bfbab0;
  --text: #161513;
  --text-2: #55524c;
  --text-3: #8b877f;
  --accent: #ff4f12;
  --accent-2: #e04209;
  --accent-ink: #ffffff;
  --accent-soft: #ffe7dc;
  --accent-text: #c23a07;
  --ok: #17864c;
  --ok-soft: #dff2e6;
  --warn: #a35d00;
  --warn-soft: #fbeed4;
  --bad: #c42b2b;
  --bad-soft: #fbe3e1;
  --info: #2457e6;
  --info-soft: #e2e9fd;
  --free: #0f8a83;
  --free-soft: #d9f2ef;
  --shadow-1: 0 1px 0 rgba(22, 21, 19, 0.06);
  --shadow-2: 0 2px 0 rgba(22, 21, 19, 0.06), 0 8px 22px -12px rgba(22, 21, 19, 0.35);
  --shadow-3: 0 24px 60px -18px rgba(22, 21, 19, 0.5), 0 2px 0 rgba(22, 21, 19, 0.05);
  --r-xs: 5px;
  --r-sm: 7px;
  --r: 10px;
  --r-lg: 12px;
  --r-xl: 16px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.45, 0.64, 1);
  --header-h: 58px;
  --tabbar-h: 62px;
  --rail-w: 236px;
  --pad: clamp(14px, 2.2vw, 32px);
  --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #121211;
    --grid: rgba(255, 255, 255, 0.03);
    --grid-major: rgba(255, 255, 255, 0.055);
    --surface: #1b1b19;
    --surface-2: #222220;
    --sunken: #0e0e0d;
    --border: #2f2e2b;
    --border-strong: #45433f;
    --text: #f1efea;
    --text-2: #b5b1a9;
    --text-3: #807c75;
    --accent: #ff5a1f;
    --accent-2: #ff7440;
    --accent-soft: #3a1a0c;
    --accent-text: #ff9466;
    --ok: #4ad189;
    --ok-soft: #10291b;
    --warn: #f2b33d;
    --warn-soft: #2e2410;
    --bad: #ff7b72;
    --bad-soft: #351716;
    --info: #85a8ff;
    --info-soft: #172241;
    --free: #45d1c6;
    --free-soft: #0f2a28;
    --shadow-1: 0 1px 0 rgba(0, 0, 0, 0.4);
    --shadow-2: 0 2px 0 rgba(0, 0, 0, 0.35), 0 10px 26px -12px rgba(0, 0, 0, 0.8);
    --shadow-3: 0 24px 60px -18px rgba(0, 0, 0, 0.9);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #121211;
  --grid: rgba(255, 255, 255, 0.03);
  --grid-major: rgba(255, 255, 255, 0.055);
  --surface: #1b1b19;
  --surface-2: #222220;
  --sunken: #0e0e0d;
  --border: #2f2e2b;
  --border-strong: #45433f;
  --text: #f1efea;
  --text-2: #b5b1a9;
  --text-3: #807c75;
  --accent: #ff5a1f;
  --accent-2: #ff7440;
  --accent-soft: #3a1a0c;
  --accent-text: #ff9466;
  --ok: #4ad189;
  --ok-soft: #10291b;
  --warn: #f2b33d;
  --warn-soft: #2e2410;
  --bad: #ff7b72;
  --bad-soft: #351716;
  --info: #85a8ff;
  --info-soft: #172241;
  --free: #45d1c6;
  --free-soft: #0f2a28;
  --shadow-1: 0 1px 0 rgba(0, 0, 0, 0.4);
  --shadow-2: 0 2px 0 rgba(0, 0, 0, 0.35), 0 10px 26px -12px rgba(0, 0, 0, 0.8);
  --shadow-3: 0 24px 60px -18px rgba(0, 0, 0, 0.9);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  background-color: var(--bg);
  /* build plate: 4 mm minor / 20 mm major grid */
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-attachment: fixed;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: clamp(24px, 2.6vw, 34px); font-weight: 800; }
h2 { font-size: 19px; font-weight: 750; }
h3 { font-size: 15.5px; font-weight: 700; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent); color: #fff; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); }
.readout { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.02em; text-transform: uppercase; color: var(--text-3); }
.readout b { color: var(--text-2); font-weight: 600; }

/* ============================ App shell ============================ */
.shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; }
.shell.rail-collapsed { --rail-w: 76px; }
.rail {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px;
  padding: 14px 12px calc(14px + env(safe-area-inset-bottom)); border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 94%, transparent); z-index: 30; overflow: hidden;
}
.rail .logo { padding: 4px 8px 14px; }
.rail-nav { display: flex; flex-direction: column; gap: 2px; }
.rail-link {
  display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 600; font-size: 14.5px; position: relative; white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.rail-link svg { width: 20px; height: 20px; flex-shrink: 0; }
.rail-link:hover { background: var(--surface-2); color: var(--text); }
.rail-link.active { color: var(--text); background: var(--sunken); }
.rail-link.active::before { content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.rail-link .dot-badge { position: static; margin-left: auto; border: 0; }
/* The badge wrapper must not take up space (or a flex gap) itself, or it nudges the icon off-centre in the narrow rail. */
.rail-link b[data-badge] { display: contents; }
.rail-link b[data-badge]:empty { display: none; }
.rail-sep { height: 1px; background: var(--border); margin: 10px 4px; }
.rail-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.rail-new { margin: 6px 0 10px; }
.rail-collapse { margin-top: 4px; }
/* '>' so only the label hides, not the count bubble (also a span) */
.shell.rail-collapsed .rail-link > span:not(.avatar), .shell.rail-collapsed .logo-word, .shell.rail-collapsed .rail-new span { display: none; }
.shell.rail-collapsed .rail-link { justify-content: center; padding: 0; }
.shell.rail-collapsed .rail-link .dot-badge { position: absolute; top: 3px; right: 6px; margin: 0; }
.shell.rail-collapsed .rail-new { padding: 0; }
.shell.rail-collapsed .rail .logo { justify-content: center; padding: 4px 0 14px; }
.shell.rail-collapsed .rail-collapse svg { transform: rotate(180deg); }

.app-header {
  position: sticky; top: 0; z-index: 25; height: calc(var(--header-h) + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px) saturate(1.3); -webkit-backdrop-filter: blur(12px) saturate(1.3);
  border-bottom: 1px solid var(--border); transition: transform 0.28s var(--ease);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 10px; padding: 0 var(--pad); }
.header-search { flex: 1; max-width: 720px; position: relative; }
.header-search input[type='search'] { padding-left: 40px; padding-right: 56px; height: 40px; background: var(--surface); }
.header-search > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-3); pointer-events: none; }
.header-search .kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.search-pill {
  flex: 1; height: 38px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-3);
  display: none; align-items: center; gap: 8px; padding: 0 14px; font-size: 14.5px; text-align: left;
}
.search-pill svg { width: 17px; height: 17px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 850; font-size: 19px; letter-spacing: -0.03em; flex-shrink: 0; }
.logo-mark { width: 32px; height: 32px; flex-shrink: 0; color: var(--accent); }
.logo-mark svg { width: 32px; height: 32px; }
.logo-word { font-family: var(--mono); font-weight: 800; letter-spacing: -0.04em; }
.logo-word i { font-style: normal; color: var(--accent); }

main#view { padding: 20px var(--pad) 48px; min-height: calc(100vh - var(--header-h)); min-width: 0; }
.view-enter { animation: viewIn 0.26s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(5px); } }
::view-transition-old(root) { animation: 0.12s ease both fadeOut; }
::view-transition-new(root) { animation: 0.22s var(--ease) both viewIn; }
@keyframes fadeOut { to { opacity: 0; } }

.icon-btn {
  width: 40px; height: 40px; border-radius: var(--r-sm); border: 0; background: transparent; display: grid; place-items: center;
  color: var(--text-2); position: relative; transition: background 0.15s, color 0.15s, transform 0.15s var(--ease); flex-shrink: 0;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(0.9); }
.icon-btn svg { width: 21px; height: 21px; }
.dot-badge {
  position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent);
  color: #fff; font: 700 10.5px/18px var(--mono); text-align: center; border: 2px solid var(--bg); animation: pop 0.35s var(--ease-spring);
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; display: grid; place-items: center; font-weight: 750; font-size: 13px;
  color: #fff; background: var(--accent); overflow: hidden;
}
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.avatar.lg { width: 64px; height: 64px; font-size: 24px; }
.avatar.xl { width: 92px; height: 92px; font-size: 34px; }

.tabbar { display: none; }

/* Tablet: icon rail */
@media (max-width: 1100px) and (min-width: 700px) {
  .shell { --rail-w: 76px; }
  .rail-link > span:not(.avatar), .logo-word, .rail-new span, .rail-collapse { display: none !important; }
  .rail-link { justify-content: center; padding: 0; }
  .rail-link .dot-badge { position: absolute; top: 3px; right: 6px; margin: 0; }
  .rail .logo { justify-content: center; padding: 4px 0 14px; }
  .rail-new { padding: 0 !important; }
}
/* Phone */
@media (max-width: 699px) {
  .shell { display: block; }
  .rail, .header-search, .hide-mobile { display: none !important; }
  .search-pill { display: flex; }
  .header-inner { gap: 8px; padding: 0 12px; height: 54px; }
  :root { --header-h: 54px; }
  .app-header.hidden { transform: translateY(-100%); }
  main#view { padding: 12px 12px calc(var(--tabbar-h) + 26px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 40;
    height: var(--tabbar-h); border-radius: 18px; background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); border: 1px solid var(--border); box-shadow: var(--shadow-2);
    transition: transform 0.3s var(--ease), opacity 0.3s;
  }
  .tabbar.hidden { transform: translateY(calc(100% + 20px)); opacity: 0; }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10.5px; font-weight: 650; color: var(--text-3); position: relative; background: none; border: 0; padding: 0; }
  .tab svg { width: 23px; height: 23px; transition: transform 0.25s var(--ease-spring); }
  .tab.active { color: var(--text); }
  .tab.active::after { content: ''; position: absolute; top: 5px; width: 18px; height: 3px; border-radius: 2px; background: var(--accent); animation: tabLine 0.3s var(--ease); }
  .tab.active svg { transform: translateY(2px); }
  .tab .dot-badge { top: 4px; right: calc(50% - 22px); }
  .tab-create span { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--text); color: var(--bg); transition: transform 0.2s var(--ease-spring); }
  .tab-create span svg { width: 24px; height: 24px; }
  .tab-create:active span { transform: scale(0.88) rotate(90deg); }
}
@media (min-width: 700px) { .hide-desktop { display: none !important; } }

/* ============================ Layout helpers ============================ */
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.sm { gap: 6px; }
.stack.lg { gap: 20px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 650; }
.center { text-align: center; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mt { margin-top: 16px; }
.mt-lg { margin-top: 28px; }
.mb { margin-bottom: 16px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; border: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { color: var(--text-2); margin-top: 4px; }
.page-head .eyebrow { margin-bottom: 6px; }
.eyebrow { font: 600 11.5px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text); display: inline-flex; align-items: center; gap: 6px; }
.eyebrow::before { content: ''; width: 14px; height: 2px; background: var(--accent); }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 380px); gap: 22px; align-items: start; }
.cols.wide-side { grid-template-columns: minmax(0, 1fr) minmax(340px, 440px); }
@media (max-width: 1000px) { .cols, .cols.wide-side { grid-template-columns: minmax(0, 1fr); } }
.sticky-side { position: sticky; top: calc(var(--header-h) + 16px); }
@media (max-width: 1000px) { .sticky-side { position: static; } }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } .grid-2.keep { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ============================ Surfaces ============================ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card.pad { padding: 16px; }
.card.pad-lg { padding: 22px; }
@media (max-width: 640px) { .card.pad-lg { padding: 16px; } }
.section-title { font: 650 11.5px/1.2 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); margin: 0 0 10px; }
.callout { border-radius: var(--r); padding: 11px 13px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; border: 1px solid transparent; }
.callout svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.callout.info { background: var(--info-soft); color: var(--info); }
.callout.warn { background: var(--warn-soft); color: var(--warn); }
.callout.ok { background: var(--ok-soft); color: var(--ok); }
.callout.bad { background: var(--bad-soft); color: var(--bad); }
.callout.free { background: var(--free-soft); color: var(--free); }
.callout.accent { background: var(--accent-soft); color: var(--accent-text); }
.callout:not(.info):not(.warn):not(.ok):not(.bad):not(.accent):not(.free) { background: var(--surface-2); border-color: var(--border); }
.callout .callout-body { color: var(--text); }
.callout .callout-body a { text-decoration: underline; }

/* Bounding-box corner marks (slicer selection) */
.bbox { position: relative; }
.bbox::before, .bbox::after {
  content: ''; position: absolute; inset: -5px; pointer-events: none; opacity: 0; transition: opacity 0.18s, inset 0.25s var(--ease);
  border: 2px solid var(--accent);
  -webkit-mask: conic-gradient(at 12px 12px, #0000 75%, #000 0) 0 0 / calc(100% - 12px) calc(100% - 12px);
  mask: conic-gradient(at 12px 12px, #0000 75%, #000 0) 0 0 / calc(100% - 12px) calc(100% - 12px);
  border-radius: calc(var(--r-lg) + 3px);
}
.bbox::after { display: none; }

/* ============================ Buttons ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 15px; border-radius: var(--r-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 650; font-size: 14px; white-space: nowrap;
  user-select: none; position: relative; overflow: hidden; box-shadow: 0 1px 0 var(--border);
  transition: transform 0.12s var(--ease), background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 0 var(--accent-2); }
.btn.primary::after, .btn.dark::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.2s;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.14) 0 1px, transparent 1px 4px);
}
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.primary:hover::after, .btn.dark:hover::after { opacity: 1; animation: layerScroll 1.2s linear infinite; }
@keyframes layerScroll { to { background-position: 0 -8px; } }
.btn.dark { background: var(--text); border-color: var(--text); color: var(--bg); box-shadow: none; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; box-shadow: none; }
.btn.ok.solid { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.free { background: var(--free); border-color: var(--free); color: #fff; box-shadow: none; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn.xs { height: 28px; padding: 0 9px; font-size: 12.5px; gap: 5px; border-radius: var(--r-xs); }
.btn.xs svg, .btn.sm svg { width: 16px; height: 16px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15.5px; }
.btn.block { width: 100%; }
.btn[disabled], .btn.loading { opacity: 0.6; pointer-events: none; }
.btn.loading::before {
  content: ''; width: 14px; height: 14px; border-radius: 2px; background: repeating-linear-gradient(0deg, currentColor 0 2px, transparent 2px 4px);
  animation: layerBuild 0.9s steps(5) infinite; flex-shrink: 0;
}
@keyframes layerBuild { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
.btn-group { display: inline-flex; background: var(--sunken); border-radius: var(--r-sm); padding: 3px; gap: 2px; border: 1px solid var(--border); }
.btn-group button {
  border: 0; background: transparent; height: 32px; min-width: 34px; padding: 0 10px; border-radius: 5px; color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 650; font-size: 13.5px; transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn-group button svg { width: 17px; height: 17px; }
.btn-group button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 0 var(--border-strong); }

/* ============================ Forms ============================ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 650; color: var(--text-2); }
.field .hint { font-size: 12.5px; color: var(--text-3); }
.input, input:not([type]), input[type='text'], input[type='email'], input[type='password'], input[type='number'], input[type='search'],
input[type='url'], input[type='datetime-local'], input[type='date'], input[type='tel'], select, textarea {
  width: 100%; height: 42px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s; font-size: 15px; outline: none; -webkit-appearance: none; appearance: none;
}
textarea { height: auto; min-height: 92px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select {
  padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238b877f' stroke-width='2'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
.input-group { display: flex; align-items: stretch; }
.input-group .addon { display: grid; place-items: center; padding: 0 11px; background: var(--sunken); border: 1px solid var(--border-strong); color: var(--text-2); font: 600 13px var(--mono); }
.input-group .addon:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); border-right: 0; }
.input-group .addon:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; border-left: 0; }
.input-group input { border-radius: 0; }
.input-group input:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.input-group input:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.input-group .addon:first-child + input:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14.5px; user-select: none; }
.check input { width: 19px; height: 19px; margin: 1px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 42px; height: 24px; border-radius: 6px; background: var(--sunken); border: 1px solid var(--border-strong); position: relative; transition: background 0.2s; flex-shrink: 0; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 4px; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); transition: transform 0.25s var(--ease-spring); }
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.form-error { color: var(--bad); font-size: 13.5px; font-weight: 600; }
.form-error:empty { display: none; }
input[type='range'].range { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; }
input[type='range'].range::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: repeating-linear-gradient(90deg, var(--border-strong) 0 1px, var(--sunken) 1px 8px); border: 1px solid var(--border); }
input[type='range'].range::-moz-range-track { height: 6px; border-radius: 3px; background: var(--sunken); border: 1px solid var(--border); }
input[type='range'].range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 5px; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--accent); margin-top: -8px; transition: transform 0.15s var(--ease-spring); }
input[type='range'].range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 4px; background: var(--accent); border: 3px solid var(--surface); }
input[type='range'].range:active::-webkit-slider-thumb { transform: scale(1.15); }
.code-input { max-width: 170px; font-family: var(--mono); font-size: 20px !important; text-align: center; letter-spacing: 0.3em; }
.code-input::placeholder { letter-spacing: normal; font-family: var(--font); font-size: 15px; }

/* ============================ Chips, badges ============================ */
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; scroll-behavior: smooth; overscroll-behavior-x: contain; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip {
  height: 32px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--surface); display: inline-flex; align-items: center;
  gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; flex-shrink: 0; transition: all 0.15s var(--ease); user-select: none;
}
.chip:hover { border-color: var(--text-3); color: var(--text); }
.chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip.accent.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip svg { width: 15px; height: 15px; }
.chip .x { opacity: 0.7; margin-right: -4px; }
.chip .swatch-dot { width: 9px; height: 9px; border-radius: 2px; }
select.chip { padding-right: 30px; width: auto; height: 32px; background-position: right 10px center; font-size: 13.5px; }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 5px; font: 600 11.5px/1 var(--mono); letter-spacing: 0.01em; background: var(--sunken); color: var(--text-2); white-space: nowrap; }
.badge svg { width: 13px; height: 13px; }
.badge.accent { background: var(--accent-soft); color: var(--accent-text); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.free { background: var(--free-soft); color: var(--free); }
.swatch { width: 16px; height: 16px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.2); flex-shrink: 0; display: inline-block; }
.swatch.lg { width: 26px; height: 26px; border-radius: 6px; }
.swatches { display: flex; flex-wrap: wrap; gap: 4px; }
.spool { width: 18px; height: 18px; border-radius: 50%; position: relative; flex-shrink: 0; display: inline-block; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2); }
.spool::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); }
.color-opt { display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px 5px 6px; border-radius: var(--r-sm); border: 1.5px solid var(--border-strong); background: var(--surface); font-size: 13.5px; font-weight: 600; transition: all 0.15s; cursor: pointer; }
.color-opt.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.color-opt .swatch { width: 22px; height: 22px; }
.stars { display: inline-flex; gap: 1px; color: #f0a020; align-items: center; }
.stars svg { width: 15px; height: 15px; }
.stars .off { color: var(--border-strong); }
.rating-line { display: inline-flex; align-items: center; gap: 5px; font: 600 12.5px var(--mono); }
.rating-line svg { width: 14px; height: 14px; color: #f0a020; }

/* Horizontal scrollers with wheel + arrow buttons */
.hs-wrap { position: relative; min-width: 0; }
.hs-wrap .hs-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); display: grid; place-items: center; box-shadow: var(--shadow-2); opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
.hs-wrap .hs-btn svg { width: 16px; height: 16px; }
.hs-wrap .hs-btn.l { left: -4px; }
.hs-wrap .hs-btn.r { right: -4px; }
.hs-wrap.can-l .hs-btn.l, .hs-wrap.can-r .hs-btn.r { opacity: 1; pointer-events: auto; }
.hs-wrap.can-l > .hscroll { -webkit-mask: linear-gradient(90deg, transparent, #000 40px); mask: linear-gradient(90deg, transparent, #000 40px); }
.hs-wrap.can-r > .hscroll { -webkit-mask: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
.hs-wrap.can-l.can-r > .hscroll { -webkit-mask: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent); mask: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
@media (hover: none) { .hs-wrap .hs-btn { display: none; } }
.hscroll.dragging { cursor: grabbing; user-select: none; scroll-behavior: auto; }
.hscroll.dragging * { pointer-events: none; }

/* ============================ Project tiles ============================ */
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; min-width: 0; }
.toolbar .search { flex: 1; min-width: 180px; position: relative; }
.toolbar .search input { padding-left: 38px; }
.toolbar .search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-3); }
.toolbar .hs-wrap { flex: 1; }
.filterbar { position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top)); z-index: 12; margin: -6px calc(var(--pad) * -1) 12px; padding: 8px var(--pad); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: top 0.28s var(--ease); border-bottom: 1px solid transparent; }
.filterbar.stuck { border-bottom-color: var(--border); }
.header-hidden .filterbar { top: env(safe-area-inset-top); }
@media (max-width: 699px) { .filterbar { margin: -12px -12px 10px; padding: 8px 12px; } }
.gallery { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.gallery.compact { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gallery.list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 10px; }
@media (min-width: 1700px) { .gallery { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); } }
@media (max-width: 699px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .gallery.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .gallery.list { grid-template-columns: 1fr; gap: 8px; }
}
.pcard {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); position: relative;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), border-color 0.2s; animation: printIn 0.5s steps(9, end) backwards; animation-delay: calc(var(--i, 0) * 35ms);
}
/* Cards "print" in layer by layer from the bed up */
@keyframes printIn { from { clip-path: inset(100% 0 0 0 round var(--r-lg)); } to { clip-path: inset(0 0 0 0 round var(--r-lg)); } }
.pcard::before {
  content: ''; position: absolute; inset: -5px; pointer-events: none; opacity: 0; border: 2px solid var(--accent); border-radius: 15px;
  -webkit-mask: conic-gradient(at 16px 16px, #0000 75%, #000 0) 0 0 / calc(100% - 16px) calc(100% - 16px);
  mask: conic-gradient(at 16px 16px, #0000 75%, #000 0) 0 0 / calc(100% - 16px) calc(100% - 16px);
  transition: opacity 0.15s, inset 0.2s var(--ease); z-index: 2;
}
.pcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--border-strong); }
.pcard:hover::before { opacity: 1; inset: -6px; }
.pcard:active { transform: scale(0.985); }
.pcard .thumb {
  aspect-ratio: 1 / 1; position: relative; overflow: hidden; border-radius: calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px) 0 0;
  background-color: var(--surface-2);
  background-image: linear-gradient(var(--grid-major) 1px, transparent 1px), linear-gradient(90deg, var(--grid-major) 1px, transparent 1px);
  background-size: 16px 16px; background-position: center;
}
.pcard .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease), opacity 0.3s; opacity: 0; }
.pcard .thumb img.loaded { opacity: 1; }
.pcard:hover .thumb img { transform: scale(1.04); }
.pcard .thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); }
.pcard .thumb .ph svg { width: 36%; height: 36%; opacity: 0.45; }
.pcard .over { position: absolute; top: 7px; left: 7px; right: 7px; display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; pointer-events: none; }
.pcard .over .badge { background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(6px); box-shadow: 0 1px 0 var(--border); }
.pcard .over .badge.free { background: var(--free); color: #fff; }
.pcard .src { position: absolute; left: 7px; bottom: 7px; pointer-events: none; }
.pcard .src .badge { background: rgba(22, 21, 19, 0.78); color: #fff; backdrop-filter: blur(6px); }
.like-btn {
  pointer-events: auto; width: 32px; height: 32px; border-radius: 8px; border: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(6px); color: var(--text-2); box-shadow: 0 1px 0 var(--border); transition: transform 0.2s var(--ease-spring), color 0.15s;
}
.like-btn svg { width: 17px; height: 17px; }
.like-btn.on { color: #ef3b3b; }
.like-btn.on svg { fill: currentColor; animation: pop 0.4s var(--ease-spring); }
.like-btn:active { transform: scale(0.82); }
@keyframes pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }
.pcard .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pcard .title { font-weight: 700; font-size: 14.5px; line-height: 1.25; letter-spacing: -0.01em; }
.pcard .meta { display: flex; align-items: center; gap: 8px; font: 600 11.5px/1 var(--mono); color: var(--text-3); flex-wrap: wrap; text-transform: uppercase; letter-spacing: 0.01em; }
.pcard .meta span { display: inline-flex; align-items: center; gap: 4px; }
.pcard .meta svg { width: 12px; height: 12px; }
.pcard .author { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); min-width: 0; }
.gallery.compact .pcard .body { padding: 7px 8px 9px; gap: 3px; }
.gallery.compact .pcard .title { font-size: 12.5px; }
.gallery.compact .pcard .author, .gallery.compact .pcard .meta .hide-compact, .gallery.compact .pcard .src { display: none; }
.gallery.compact .like-btn { width: 26px; height: 26px; }
.gallery.list .pcard { flex-direction: row; }
.gallery.list .pcard .thumb { width: 132px; aspect-ratio: 1; flex-shrink: 0; border-radius: calc(var(--r-lg) - 1px) 0 0 calc(var(--r-lg) - 1px); }
.gallery.list .pcard .body { flex: 1; justify-content: center; padding: 10px 14px; }
@media (max-width: 699px) {
  .pcard .body { padding: 8px 9px 10px; gap: 4px; }
  .pcard .title { font-size: 13.5px; }
  .pcard .author { display: none; }
  .gallery.list .pcard .author { display: flex; }
  .gallery.list .pcard .thumb { width: 104px; }
}
.success-pill { display: inline-flex; align-items: center; gap: 5px; }
.success-bar { width: 30px; height: 6px; background: var(--sunken); overflow: hidden; display: inline-flex; gap: 1px; border-radius: 1px; }
.success-bar i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--ok) 0 4px, transparent 4px 5px); }

/* ============================ Loaders ============================ */
.skel { background: var(--sunken); position: relative; overflow: hidden; border-radius: 6px; }
.skel::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent 0 3px, color-mix(in srgb, var(--surface) 50%, transparent) 3px 4px); animation: layerUp 1.1s linear infinite; }
@keyframes layerUp { from { transform: translateY(0); } to { transform: translateY(-8px); } }
.skel-card { border-radius: var(--r-lg); overflow: hidden; background: var(--surface); border: 1px solid var(--border); }
.skel-card .skel:first-child { aspect-ratio: 1; border-radius: 0; }
.skel-line { height: 11px; margin: 10px 12px; }
/* Printing-stack spinner */
.spinner { width: 44px; height: 40px; margin: 36px auto; position: relative; }
.spinner::before {
  content: ''; position: absolute; left: 4px; right: 4px; bottom: 0; height: 30px; border-radius: 2px;
  background: repeating-linear-gradient(0deg, var(--accent) 0 4px, transparent 4px 6px); animation: layerBuild 1.2s steps(5) infinite;
}
.spinner::after { content: ''; position: absolute; top: 0; left: 0; width: 12px; height: 8px; background: var(--text); clip-path: polygon(0 0, 100% 0, 70% 100%, 30% 100%); animation: nozzle 0.6s ease-in-out infinite alternate; }
@keyframes nozzle { to { transform: translateX(32px); } }

/* ============================ Empty & hero ============================ */
.empty { text-align: center; padding: 48px 20px; color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: 10px; grid-column: 1 / -1; }
.empty .empty-icon { width: 64px; height: 64px; border-radius: 14px; border: 1.5px dashed var(--border-strong); color: var(--accent); display: grid; place-items: center; margin-bottom: 6px; background: var(--surface); }
.empty .empty-icon svg { width: 28px; height: 28px; }
.empty h3 { color: var(--text); font-size: 18px; }
.empty p { max-width: 400px; }
.hero {
  border-radius: var(--r-xl); padding: 26px 28px; margin-bottom: 18px; position: relative; overflow: hidden;
  background: var(--text); color: var(--bg); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center;
}
.hero::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.12;
  background-image: linear-gradient(var(--bg) 1px, transparent 1px), linear-gradient(90deg, var(--bg) 1px, transparent 1px); background-size: 28px 28px; }
.hero > * { position: relative; }
.hero h1 { max-width: 640px; color: var(--bg); }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { color: color-mix(in srgb, var(--bg) 72%, transparent); max-width: 560px; margin-top: 8px; font-size: 15.5px; }
.hero .row { margin-top: 16px; }
.hero .btn:not(.primary) { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 35%, transparent); box-shadow: none; }
.hero .btn:not(.primary):hover { background: color-mix(in srgb, var(--bg) 10%, transparent); }
.hero .close { position: absolute; top: 10px; right: 10px; color: var(--bg); opacity: 0.6; }
.hero-art { width: 200px; height: 170px; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; padding: 18px; } .hero-art { display: none; } .hero h1 { font-size: 21px; padding-right: 28px; } .hero p { font-size: 14px; } .hero .btn { height: 36px; font-size: 13.5px; padding: 0 12px; } }
/* Animated "print" illustration */
.print-art { position: relative; width: 200px; height: 170px; }
.print-art .bed { position: absolute; left: 10px; right: 10px; bottom: 8px; height: 8px; background: color-mix(in srgb, var(--bg) 30%, transparent); border-radius: 2px; }
.print-art .part { position: absolute; left: 50px; width: 100px; bottom: 16px; height: 96px; clip-path: polygon(10% 100%, 90% 100%, 78% 0, 22% 0);
  background: repeating-linear-gradient(0deg, var(--accent) 0 5px, color-mix(in srgb, var(--accent) 70%, #000) 5px 6px); animation: partBuild 4.8s steps(16) infinite; }
@keyframes partBuild { 0% { clip-path: polygon(10% 100%, 90% 100%, 90% 100%, 10% 100%); } 85%, 100% { clip-path: polygon(10% 100%, 90% 100%, 78% 0, 22% 0); } }
.print-art .gantry { position: absolute; left: 0; right: 0; height: 4px; background: color-mix(in srgb, var(--bg) 45%, transparent); animation: gantry 4.8s steps(16) infinite; bottom: 112px; }
.print-art .head { position: absolute; width: 22px; height: 22px; bottom: 112px; background: var(--bg); clip-path: polygon(0 0, 100% 0, 100% 55%, 65% 55%, 50% 100%, 35% 55%, 0 55%); animation: gantry 4.8s steps(16) infinite, sweep 0.3s ease-in-out infinite alternate; }
@keyframes gantry { 0% { bottom: 16px; } 85%, 100% { bottom: 112px; } }
@keyframes sweep { from { left: 50px; } to { left: 128px; } }

.stat-row { display: flex; gap: 22px; flex-wrap: wrap; }
.stat b { display: block; font: 750 22px var(--mono); letter-spacing: -0.03em; }
.stat span { font-size: 12.5px; color: var(--text-3); font-weight: 600; }

/* ============================ Project page ============================ */
.viewer-wrap {
  position: relative; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); aspect-ratio: 4 / 3; touch-action: none;
  background-color: var(--surface-2); background-image: linear-gradient(var(--grid-major) 1px, transparent 1px), linear-gradient(90deg, var(--grid-major) 1px, transparent 1px); background-size: 20px 20px;
}
.viewer-wrap canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.viewer-wrap canvas:active { cursor: grabbing; }
.viewer-wrap > img { width: 100%; height: 100%; object-fit: contain; }
.viewer-ui { position: absolute; left: 10px; bottom: 10px; right: 10px; display: flex; gap: 6px; justify-content: space-between; align-items: flex-end; pointer-events: none; }
.viewer-ui > * { pointer-events: auto; }
.viewer-ui .btn { background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); }
.viewer-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-2); font: 600 12px var(--mono); text-transform: uppercase; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.thumbs-strip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.thumbs-strip::-webkit-scrollbar { display: none; }
.thumbs-strip button { border: 2px solid transparent; border-radius: var(--r-sm); padding: 0; overflow: hidden; width: 72px; height: 56px; flex-shrink: 0; background: var(--sunken); }
.thumbs-strip button.on { border-color: var(--accent); }
.thumbs-strip img { width: 100%; height: 100%; object-fit: cover; }
.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.spec { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 9px 11px; position: relative; }
.spec span { display: block; font: 600 10.5px/1.3 var(--mono); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
.spec b { font: 700 15px/1.35 var(--mono); letter-spacing: -0.02em; }
.prose { white-space: pre-wrap; word-wrap: break-word; color: var(--text); line-height: 1.6; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; margin: 0; }
.kv dt { color: var(--text-3); font: 600 11.5px/1.7 var(--mono); text-transform: uppercase; letter-spacing: 0.04em; }
.kv dd { margin: 0; text-align: right; font-weight: 600; min-width: 0; }
.attribution { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px dashed var(--border-strong); border-radius: var(--r); background: var(--surface-2); }
.attribution .site-ico { width: 38px; height: 38px; border-radius: 8px; background: var(--text); color: var(--bg); display: grid; place-items: center; font: 800 13px var(--mono); flex-shrink: 0; }
.lane-card { border-radius: var(--r); padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.lane-card svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.lane-card.paid { background: var(--ok-soft); color: var(--ok); }
.lane-card.free { background: var(--free-soft); color: var(--free); }
.lane-card.none { background: var(--bad-soft); color: var(--bad); }
.lane-card .callout-body { color: var(--text); }

/* ============================ Maker cards ============================ */
.mcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px; display: flex; flex-direction: column; gap: 11px; position: relative;
  transition: box-shadow 0.22s var(--ease), border-color 0.2s, transform 0.22s var(--ease); animation: printIn 0.45s steps(8, end) backwards; animation-delay: calc(var(--i, 0) * 35ms);
}
.mcard:hover { box-shadow: var(--shadow-2); border-color: var(--border-strong); }
a.mcard:hover { transform: translateY(-2px); }
.mcard.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.mcard .price { font: 750 21px var(--mono); letter-spacing: -0.04em; }
.makers-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.filters-panel { display: flex; flex-direction: column; gap: 16px; }
.filters-panel .field > label { display: flex; justify-content: space-between; }

/* ============================ Tabs ============================ */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.hs-wrap:has(> .tabs) { margin-bottom: 18px; }
.hs-wrap > .tabs { margin-bottom: 0; }
.tabs a, .tabs button { border: 0; background: none; padding: 10px 13px; font-weight: 650; color: var(--text-2); position: relative; white-space: nowrap; font-size: 14px; display: inline-flex; align-items: center; gap: 7px; }
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs a.on, .tabs button.on { color: var(--text); }
.tabs a.on::after, .tabs button.on::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 3px; background: var(--accent); animation: tabLine 0.3s var(--ease); }
@keyframes tabLine { from { transform: scaleX(0.2); opacity: 0; } }
.tabs .count { background: var(--sunken); border-radius: 4px; padding: 0 6px; font: 600 11.5px/1.6 var(--mono); }

/* ============================ Orders ============================ */
.olist { display: flex; flex-direction: column; gap: 8px; }
.orow {
  display: flex; gap: 14px; align-items: center; padding: 11px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  transition: box-shadow 0.2s, border-color 0.2s; animation: printIn 0.4s steps(7, end) backwards; animation-delay: calc(var(--i, 0) * 30ms);
}
.orow:hover { box-shadow: var(--shadow-2); border-color: var(--border-strong); }
.othumb, .orow .othumb { width: 60px; height: 60px; border-radius: var(--r-sm); object-fit: cover; background: var(--sunken); flex-shrink: 0; display: grid; place-items: center; color: var(--text-3); overflow: hidden; }
.othumb svg, .orow .othumb svg { width: 24px; height: 24px; }
.status { display: inline-flex; align-items: center; gap: 6px; font: 650 11.5px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.03em; padding: 5px 9px; border-radius: 5px; white-space: nowrap; }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 2px; background: currentColor; }
.status.requested, .status.open { background: var(--info-soft); color: var(--info); }
.status.accepted, .status.printing, .status.assigned { background: var(--accent-soft); color: var(--accent-text); }
.status.printing::before, .status.ready::before { animation: pulse 1.2s infinite; }
.status.ready, .status.completed { background: var(--ok-soft); color: var(--ok); }
.status.failed, .status.disputed { background: var(--bad-soft); color: var(--bad); }
.status.declined, .status.cancelled, .status.closed, .status.withdrawn { background: var(--sunken); color: var(--text-3); }
.status.pending { background: var(--warn-soft); color: var(--warn); }
@keyframes pulse { 50% { opacity: 0.3; } }
.stepper { display: flex; align-items: flex-start; margin: 4px 0 2px; }
.stepper .st { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; position: relative; font: 600 10.5px/1.2 var(--mono); text-transform: uppercase; color: var(--text-3); text-align: center; }
.stepper .st i { width: 28px; height: 28px; border-radius: 7px; background: var(--surface); border: 2px solid var(--border-strong); display: grid; place-items: center; z-index: 1; transition: all 0.3s var(--ease); }
.stepper .st i svg { width: 14px; height: 14px; }
.stepper .st::before { content: ''; position: absolute; top: 13px; left: -50%; right: 50%; height: 2px; background: repeating-linear-gradient(90deg, var(--border-strong) 0 4px, transparent 4px 7px); }
.stepper .st:first-child::before { display: none; }
.stepper .st.done { color: var(--text-2); }
.stepper .st.done i { background: var(--accent); border-color: var(--accent); color: #fff; }
.stepper .st.done::before, .stepper .st.cur::before { background: var(--accent); }
.stepper .st.cur { color: var(--text); }
.stepper .st.cur i { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.progress { height: 10px; background: var(--sunken); border-radius: 3px; overflow: hidden; border: 1px solid var(--border); }
.progress i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--accent) 0 6px, color-mix(in srgb, var(--accent) 75%, #000) 6px 7px); transition: width 0.6s var(--ease); }
.code-box { font: 800 36px var(--mono); letter-spacing: 0.35em; text-align: center; padding: 14px 0 14px 0.35em; background: var(--surface-2); border: 2px dashed var(--border-strong); border-radius: var(--r); }
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.tl-item::before { content: ''; position: absolute; left: 6px; top: 16px; bottom: 0; width: 2px; background: repeating-linear-gradient(0deg, var(--border-strong) 0 3px, transparent 3px 6px); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 14px; height: 14px; border-radius: 3px; background: var(--accent); flex-shrink: 0; margin-top: 3px; z-index: 1; }
.tl-item.muted .tl-dot { background: var(--border-strong); }
.tl-body { font-size: 13.5px; }
.tl-body time { display: block; font: 500 11.5px var(--mono); color: var(--text-3); }

/* ============================ Chat ============================ */
.chat { display: flex; flex-direction: column; height: min(520px, 62vh); }
.chat-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 4px; background: var(--surface-2); border-radius: var(--r) var(--r) 0 0; border: 1px solid var(--border); border-bottom: 0; overscroll-behavior: contain; }
.bubble { max-width: 82%; padding: 8px 12px; border-radius: 12px; font-size: 14.5px; line-height: 1.4; animation: bubbleIn 0.22s var(--ease-spring) both; word-wrap: break-word; white-space: pre-wrap; }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(6px) scale(0.96); } }
.bubble.me { align-self: flex-end; background: var(--text); color: var(--bg); border-bottom-right-radius: 3px; }
.bubble.them { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 3px; }
.bubble img { border-radius: 8px; max-height: 220px; margin: 2px 0; }
.bubble-time { font: 500 10.5px var(--mono); color: var(--text-3); margin: 2px 4px 4px; }
.bubble-time.me { align-self: flex-end; }
.chat-input { display: flex; gap: 6px; padding: 8px; border: 1px solid var(--border); border-radius: 0 0 var(--r) var(--r); background: var(--surface); align-items: flex-end; }
.chat-input textarea { min-height: 40px; height: 40px; max-height: 120px; resize: none; padding: 9px 12px; }

/* ============================ Modal / sheet ============================ */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(14, 13, 12, 0.5); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn 0.18s ease both; }
.overlay.closing { animation: fadeOutO 0.18s ease both; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOutO { to { opacity: 0; } }
.modal { background: var(--surface); border-radius: var(--r-xl); width: 100%; max-width: 540px; max-height: min(90vh, 920px, 100%); display: flex; flex-direction: column; box-shadow: var(--shadow-3); animation: modalIn 0.3s var(--ease-spring) both; overflow: hidden; border: 1px solid var(--border); }
.modal.wide { max-width: 800px; }
.overlay.closing .modal { animation: modalOut 0.16s ease both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(0.97); } }
@keyframes modalOut { to { opacity: 0; transform: translateY(8px) scale(0.98); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 8px; }
.modal-body { padding: 6px 18px 18px; overflow-y: auto; overscroll-behavior: contain; }
.modal-foot { padding: 12px 18px 16px; display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--border); background: var(--surface-2); }
@media (max-width: 699px) {
  .overlay { align-items: flex-end; padding: 0; }
  .modal, .modal.wide { max-width: none; border-radius: 18px 18px 0 0; max-height: min(92vh, calc(100% - 16px)); animation: sheetIn 0.34s var(--ease) both; padding-bottom: env(safe-area-inset-bottom); border-bottom: 0; }
  .overlay.closing .modal { animation: sheetOut 0.2s ease both; }
  .modal-head { position: relative; padding-top: 20px; }
  .modal-head::before { content: ''; position: absolute; left: 50%; top: 7px; width: 38px; height: 4px; border-radius: 2px; background: var(--border-strong); transform: translateX(-50%); }
  .modal-foot .btn { flex: 1; }
}
@keyframes sheetIn { from { transform: translateY(100%); } }
@keyframes sheetOut { to { transform: translateY(100%); } }

/* ============================ Menus, toasts ============================ */
.menu { position: fixed; z-index: 90; min-width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-3); padding: 6px; animation: menuIn 0.16s var(--ease) both; transform-origin: top right; }
@keyframes menuIn { from { opacity: 0; transform: scale(0.96) translateY(-4px); } }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: var(--r-sm); border: 0; background: none; text-align: left; font-size: 14.5px; font-weight: 550; }
.menu a:hover, .menu button:hover { background: var(--surface-2); }
.menu svg { width: 18px; height: 18px; color: var(--text-2); }
.menu hr { border: 0; height: 1px; background: var(--border); margin: 6px 4px; }
.menu .menu-head { padding: 8px 10px 10px; }
.toasts { position: fixed; z-index: 200; left: 50%; transform: translateX(-50%); bottom: 22px; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 440px); }
@media (max-width: 699px) { .toasts { bottom: calc(var(--tabbar-h) + 22px + env(safe-area-inset-bottom)); } }
.toast { pointer-events: auto; background: var(--text); color: var(--bg); padding: 11px 15px; border-radius: var(--r); font-size: 14px; font-weight: 550; box-shadow: var(--shadow-3); display: flex; align-items: center; gap: 10px; animation: toastIn 0.32s var(--ease-spring) both; max-width: 100%; position: relative; overflow: hidden; }
.toast::after { content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--accent); transform-origin: left; animation: toastTimer var(--t, 2.8s) linear both; }
@keyframes toastTimer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.toast.ok svg { color: #4ad189; }
.toast.bad svg { color: #ff7b72; }
.toast.bad::after { background: #ff7b72; }
.toast.out { animation: toastOut 0.22s ease both; }
.toast a { text-decoration: underline; font-weight: 700; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(0.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(0.97); } }

/* ============================ Upload ============================ */
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--r-lg); padding: 30px 20px; text-align: center; background: var(--surface-2); transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.over { transform: scale(1.01); }
.dropzone .dz-icon { width: 54px; height: 54px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--accent); display: grid; place-items: center; }
.dropzone .dz-icon svg { width: 26px; height: 26px; }
.upload-progress { display: flex; flex-direction: column; gap: 6px; }
.image-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.image-tile { position: relative; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; background: var(--sunken); border: 1px solid var(--border); }
.image-tile img { width: 100%; height: 100%; object-fit: cover; }
.image-tile button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 6px; border: 0; background: rgba(0, 0, 0, 0.65); color: #fff; display: grid; place-items: center; }
.image-tile button svg { width: 14px; height: 14px; }
.image-tile.add { display: grid; place-items: center; color: var(--text-3); cursor: pointer; border-style: dashed; border-width: 2px; }
.image-tile.add svg { width: 24px; height: 24px; }
.image-tile .tag { position: absolute; left: 4px; bottom: 4px; }

/* ============================ Map ============================ */
.map-box { height: 300px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--border); background: var(--sunken); position: relative; z-index: 0; }
.map-box.tall { height: min(460px, 60vh); }
.map-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); font-size: 13.5px; text-align: center; padding: 20px; }
.place-results { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow-y: auto; }
.place-result { text-align: left; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); font-size: 13.5px; transition: border-color 0.15s, background 0.15s; }
.place-result:hover { border-color: var(--accent); background: var(--accent-soft); }
.place-result b { display: block; font-size: 14px; }
.dir-links { display: flex; gap: 8px; flex-wrap: wrap; }
.spot-card { display: flex; gap: 12px; align-items: flex-start; padding: 11px; border: 1.5px solid var(--border); border-radius: var(--r); background: var(--surface); text-align: left; width: 100%; transition: border-color 0.15s, box-shadow 0.15s; }
.spot-card.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.spot-ico { width: 38px; height: 38px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.spot-ico svg { width: 20px; height: 20px; }

/* ============================ Notifications ============================ */
.nlist { display: flex; flex-direction: column; }
.nitem { display: flex; gap: 12px; padding: 13px 12px; border-radius: var(--r); transition: background 0.15s; position: relative; }
.nitem:hover { background: var(--surface-2); }
.nitem.unread::after { content: ''; position: absolute; right: 12px; top: 50%; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); transform: translateY(-50%); }
.nitem .nico { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: var(--sunken); color: var(--text-2); flex-shrink: 0; }
.nitem.unread .nico { background: var(--accent-soft); color: var(--accent); }
.nitem .nico svg { width: 19px; height: 19px; }

/* ============================ Bars ============================ */
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 44px; gap: 10px; align-items: center; font-size: 13.5px; }
.bar-row .bar { height: 14px; background: var(--sunken); border-radius: 3px; overflow: hidden; }
.bar-row .bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); transform-origin: left; animation: grow 0.7s steps(12) both; }
@keyframes grow { from { transform: scaleX(0); } }
.bar-row b { text-align: right; font: 650 13px var(--mono); }
@media (max-width: 520px) { .bar-row { grid-template-columns: 104px 1fr 36px; } }

/* ============================ Tables & lists ============================ */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th { text-align: left; font: 650 11px var(--mono); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; padding: 8px 10px; border-bottom: 1px solid var(--border); }
table.tbl td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }

/* ============================ Auth / onboarding ============================ */
.auth-wrap { min-height: calc(100vh - var(--header-h) - 80px); display: grid; place-items: center; }
.auth-card { width: 100%; max-width: 430px; }
.auth-card h1 { font-size: 26px; }
.onboard { position: fixed; inset: 0; z-index: 150; background: var(--bg); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; animation: fadeIn 0.25s ease both;
  background-image: linear-gradient(var(--grid-major) 1px, transparent 1px), linear-gradient(90deg, var(--grid-major) 1px, transparent 1px); background-size: 40px 40px; }
.onboard.closing { animation: fadeOutO 0.25s ease both; }
.onboard-top { display: flex; align-items: center; justify-content: space-between; padding: calc(14px + env(safe-area-inset-top)) var(--pad) 10px; gap: 16px; }
.layers-progress { display: flex; flex-direction: column-reverse; gap: 3px; width: 120px; }
.layers-progress i { display: block; height: 5px; border-radius: 2px; background: var(--border); transition: background 0.3s, width 0.3s; margin: 0 auto; }
.layers-progress i.on { background: var(--accent); }
.onboard-body { overflow-y: auto; padding: 10px var(--pad) 24px; display: flex; justify-content: center; align-items: flex-start; }
.onboard-step { width: 100%; max-width: 720px; display: flex; flex-direction: column; gap: 18px; animation: stepIn 0.4s var(--ease) both; }
@keyframes stepIn { from { opacity: 0; transform: translateY(12px); } }
.onboard-step h1 { font-size: clamp(26px, 4vw, 40px); }
.onboard-foot { display: flex; justify-content: space-between; gap: 10px; padding: 12px var(--pad) calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(8px); }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.choice { position: relative; text-align: left; padding: 16px; border-radius: var(--r-lg); border: 1.5px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: 8px; transition: border-color 0.15s, transform 0.15s var(--ease), box-shadow 0.15s; }
.choice:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.choice.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.choice .choice-ico { width: 42px; height: 42px; border-radius: 10px; background: var(--sunken); display: grid; place-items: center; color: var(--text); }
.choice.on .choice-ico { background: var(--accent); color: #fff; }
.choice .choice-ico svg { width: 22px; height: 22px; }
.choice b { font-size: 15.5px; }
.choice .tick { position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--border-strong); background: transparent; display: grid; place-items: center; color: #fff; transition: background 0.18s var(--ease), border-color 0.18s var(--ease); }
.choice.on .tick { background: var(--accent); border-color: var(--accent); }
/* Empty box until chosen; then the check pops in. */
.choice .tick svg { width: 14px; height: 14px; opacity: 0; transform: scale(0.4); transition: opacity 0.15s, transform 0.22s cubic-bezier(0.3, 1.6, 0.5, 1); }
.choice.on .tick svg { opacity: 1; transform: scale(1); }

/* ============================ Search overlay (phone) ============================ */
.search-overlay { position: fixed; inset: 0; z-index: 120; background: var(--bg); display: flex; flex-direction: column; animation: fadeIn 0.15s ease both; }
.search-overlay .so-top { display: flex; gap: 8px; align-items: center; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; border-bottom: 1px solid var(--border); }
.search-overlay .so-top input { height: 42px; }
.search-overlay .so-body { padding: 14px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }

/* ============================ Misc ============================ */
.kbd { font: 600 11px var(--mono); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-3); }
.sentinel { height: 1px; }
.price-break { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.price-break .row { justify-content: space-between; }
.price-break .row span:last-child { font-family: var(--mono); }
.price-break .total { font-size: 18px; font-weight: 750; padding-top: 8px; border-top: 1px dashed var(--border-strong); }
.option-card { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1.5px solid var(--border); border-radius: var(--r); background: var(--surface); cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.option-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.option-card input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--r-sm); overflow: hidden; }
.qty button { width: 40px; height: 40px; border: 0; background: var(--surface); font-size: 18px; font-weight: 600; }
.qty button:hover { background: var(--surface-2); }
.qty input { width: 52px; border: 0; border-radius: 0; text-align: center; height: 40px; padding: 0; box-shadow: none !important; font-family: var(--mono); }
.offline-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 300; background: var(--warn); color: #fff; text-align: center; font: 600 12px var(--mono); padding: calc(4px + env(safe-area-inset-top)) 10px 4px; transform: translateY(-110%); visibility: hidden; transition: transform 0.3s var(--ease), visibility 0.3s; }
.offline-bar.show { transform: none; visibility: visible; }
.import-result { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; }
@media (max-width: 640px) { .import-result { grid-template-columns: 1fr; } }
.import-result .thumb { aspect-ratio: 1; border-radius: var(--r); overflow: hidden; background: var(--sunken); border: 1px solid var(--border); }
.import-result .thumb img { width: 100%; height: 100%; object-fit: cover; }
.source-logos { display: flex; flex-wrap: wrap; gap: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
@media (max-width: 1000px) { .desc-wide { display: none !important; } }
@media (min-width: 1001px) { .desc-narrow { display: none !important; } }
.choice { padding-right: 40px; }
@media (max-width: 699px) {
  .choice-grid { grid-template-columns: 1fr; gap: 8px; }
  .choice { flex-direction: row; align-items: center; gap: 12px; padding: 12px 44px 12px 12px; }
  .choice .choice-ico { width: 38px; height: 38px; flex-shrink: 0; }
  .choice > b + span, .choice > b + .readout { margin-left: auto; }
  .choice-grid[style] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .choice-grid[style] .choice { flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 34px 10px 10px; }
  .choice .tick { top: 50%; transform: translateY(-50%); }
  .choice-grid[style] .choice .tick { top: 10px; transform: none; right: 8px; width: 18px; height: 18px; }
  .onboard-step h1 { font-size: 26px; }
}

.place-result.on { border-color: var(--accent) !important; background: var(--accent-soft); }
.checklist-head { all: unset; display: flex; align-items: center; justify-content: space-between; cursor: pointer; width: 100%; }
.checklist-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.checklist-caret { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--text-2); transition: transform 0.2s var(--ease), background 0.15s; }
.checklist-head:hover .checklist-caret { background: var(--bg-2); }
.checklist-caret svg { width: 18px; height: 18px; }
.checklist.collapsed .checklist-caret { transform: rotate(-90deg); }
.checklist.collapsed .checklist-body { display: none; }
[hidden] { display: none !important; }
/* Feature-request ranking */
.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rank-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 10px 10px 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); position: relative; }
.rank-item.dragging { box-shadow: var(--shadow-lg, 0 10px 30px rgba(0,0,0,.18)); border-color: var(--accent); z-index: 2; }
.rank-num { font-family: var(--mono); font-weight: 700; color: var(--accent-text); min-width: 18px; text-align: center; padding-top: 6px; }
.rank-grip { all: unset; cursor: grab; touch-action: none; color: var(--text-3); display: grid; place-items: center; width: 28px; height: 32px; border-radius: 8px; }
.rank-grip:hover { background: var(--bg-2); color: var(--text-2); }
.rank-item.dragging .rank-grip { cursor: grabbing; }
.rank-grip svg { width: 18px; height: 18px; }
.rank-arrows { display: flex; flex-direction: column; gap: 2px; }
.rank-arrows .icon-btn { width: 30px; height: 28px; }
.rank-arrows .icon-btn:disabled { opacity: .3; }
.rank-item details summary { cursor: pointer; margin-top: 4px; }
.fr-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.fr-stats b { color: var(--text); }
/* Small "opens more" arrow on clickable admin cards */
.card-caret { display: inline-grid; place-items: center; width: 24px; height: 24px; color: var(--text-3); flex-shrink: 0; }
.card-caret svg { width: 18px; height: 18px; }
a.card:hover .card-caret { color: var(--accent-text); }
