:root {
  --bg: #f7f4ee; --surface: #ffffff; --surface-2: #f3efe8; --line: #e4dfd5; --track: #ebe6dc;
  --text: #1d1e22; --dim: #6a7180; --accent: #ff6a33; --accent-ink: #2a1206; --accent-text: #c2410c;
  --ok: #0f8f82; --warn: #a97800; --bad: #d42a3f;
  --shadow: 0 1px 2px rgba(60, 50, 30, 0.05), 0 6px 20px -12px rgba(60, 50, 30, 0.18);
  --shadow-up: 0 2px 4px rgba(60, 50, 30, 0.06), 0 16px 32px -14px rgba(60, 50, 30, 0.3);
  /* chart colours for materials: fixed order, checked for colour-blind safety */
  --m1: #eb6834; --m2: #1baf7a; --m3: #eda100; --m4: #e87ba4; --m5: #008300; --m6: #6250d6; --m7: #e34948; --m8: #2a78d6; --m9: #8a8f99;
  --sans: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #17140f; --surface: #211d17; --surface-2: #2b261e; --line: #3b342a; --track: #383127;
  --text: #f3eee4; --dim: #a9a091; --accent: #ff7a45; --accent-ink: #2a1206; --accent-text: #ff9c6e;
  --ok: #3cc7b6; --warn: #e2b23c; --bad: #ff6b7a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3); --shadow-up: 0 14px 30px -12px rgba(0, 0, 0, 0.7);
  --m1: #d95926; --m2: #199e70; --m3: #c98500; --m4: #d55181; --m5: #0ca30c; --m6: #9085e9; --m7: #e66767; --m8: #3987e5; --m9: #8e8a82;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font: 500 16px/1.45 var(--sans); display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; transition: background-color 0.3s, color 0.3s; }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1 { font-size: 35px; letter-spacing: -0.02em; line-height: 1.1; }
h3 { font-size: 18px; letter-spacing: -0.01em; }
h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); font-weight: 500; margin: 16px 0 6px; }
button { font: inherit; color: inherit; cursor: pointer; }
.dim { color: var(--dim); font-size: 14px; }
.mono { font-family: var(--mono); font-size: 14px; font-variant-numeric: tabular-nums; }
.strong { font-weight: 700; color: var(--text); }
.grow { flex: 1; min-width: 0; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.only-phone { display: none; }

/* sidebar */
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 22px 14px 16px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; overflow-y: auto; transition: background-color 0.3s; }
.brand { display: flex; gap: 12px; align-items: center; padding-left: 4px; }
.logo { width: 44px; height: 44px; border-radius: 12px; flex: none; transition: transform 0.5s var(--ease); }
.brand:hover .logo { transform: rotate(-8deg) scale(1.06); }
.brand b { display: block; font-size: 20px; letter-spacing: 0.08em; color: var(--text); }
.brand span { font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.12em; }
nav { display: flex; flex-direction: column; gap: 4px; }
nav button { position: relative; background: none; border: 0; text-align: left; padding: 10px 12px; border-radius: 12px; font-weight: 500; color: var(--dim); display: flex; align-items: center; gap: 12px; transition: background-color 0.2s, color 0.2s, transform 0.15s; }
nav button > span { flex: 1; }
nav button:hover { color: var(--text); background: var(--surface-2); }
nav button:active { transform: scale(0.97); }
nav button.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; box-shadow: 0 6px 14px -8px var(--accent); }
nav em { font: 700 12px var(--mono); background: var(--surface-2); color: var(--text); padding: 2px 7px; border-radius: 99px; }
nav em:empty { display: none; }
nav em.hot { background: var(--bad); color: #fff; }
nav button.on em { background: var(--accent-ink); color: #fff; }
.nav-more { display: none; }
.sysbox { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.side-foot { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; align-items: start; justify-items: start; }

/* main */
main { padding-block: 28px 60px; padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.status { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 8px; color: var(--dim); }
.sync { font-size: 14px; } .sync.ok { color: var(--ok); } .sync.bad { color: var(--bad); }
#cfm p { font-size: 17px; }
.sys { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; color: var(--ok); }
.sys::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 22%, transparent); flex: none; animation: pulse 2.4s ease-in-out infinite; }
.sys.attn { color: var(--warn); }
.top-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.alert-chip { display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 12px; padding: 7px 8px 7px 11px; font-size: 14px; font-weight: 500; background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: var(--text); transition: transform 0.15s, box-shadow 0.2s; animation: rise 0.4s var(--ease) both; }
.alert-chip .ic { width: 16px; height: 16px; color: var(--c); }
.alert-chip b { background: var(--c); color: #fff; font: 700 12px var(--mono); min-width: 20px; padding: 2px 6px; border-radius: 99px; text-align: center; }
.alert-chip.warn { --c: var(--warn); } .alert-chip.bad { --c: var(--bad); }
.alert-chip:hover { transform: translateY(-1px); box-shadow: var(--shadow-up); }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); padding: 10px 16px; border-radius: 12px; font-weight: 700; transition: transform 0.12s, filter 0.2s, border-color 0.2s, box-shadow 0.2s; }
.btn:hover { filter: brightness(1.08); box-shadow: 0 8px 16px -10px var(--accent); }
.btn:active { transform: scale(0.96); }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--dim); box-shadow: none; }
.btn.sm { padding: 6px 12px; font-size: 14px; border-radius: 9px; }
.btn.round { padding: 10px; display: inline-grid; place-items: center; }
.btn.round .ic { transition: transform 0.5s var(--ease); } .btn.round:hover .ic { transform: rotate(40deg); }
.link { background: none; border: 0; padding: 2px 0; color: var(--accent-text); font-size: 14px; font-weight: 500; text-align: left; }
.link:hover { text-decoration: underline; }
.row > .link, .alerts .link { white-space: nowrap; flex: none; }
.link.danger { color: var(--bad); }
.link.more { display: block; margin-top: 10px; }
.icon { background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; width: 28px; height: 28px; transition: transform 0.12s; }
.icon:active:not(:disabled) { transform: scale(0.9); }
.icon:disabled { opacity: 0.3; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* tiles (the row of headline numbers) */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow); transition: transform 0.25s var(--ease), box-shadow 0.25s; min-width: 0; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-up); }
.tile > div { display: flex; flex-direction: column; min-width: 0; }
.tile-ic { width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 6px 14px -6px var(--accent); }
.tile-ic .ic { width: 22px; height: 22px; }
.tile-label { font-size: 14px; font-weight: 500; }
.tile-value { font-size: 31px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile-sub { font-size: 13px; color: var(--dim); }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); transition: background-color 0.3s, border-color 0.3s, transform 0.25s var(--ease), box-shadow 0.25s; min-width: 0; }
.card > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.card > header h3 { display: flex; align-items: center; gap: 8px; }
.count { background: var(--bad); color: #fff; font: 700 12px var(--mono); padding: 2px 8px; border-radius: 99px; }
.dash { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
.duo { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.duo.wide { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.duo > .card { margin-bottom: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; margin-bottom: 4px; }

/* dashboard: little printer tiles */
.ptiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.ptile { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; transition: transform 0.25s var(--ease), box-shadow 0.25s; min-width: 0; }
.ptile:hover { transform: translateY(-3px); box-shadow: var(--shadow-up); }
.ptile > header { display: flex; align-items: center; gap: 7px; min-width: 0; }
.ptile > header .dim { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dim); flex: none; }
.st-printing .dot { background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: ping 1.8s ease-out infinite; }
.st-idle .dot { background: var(--ok); }
.ptile.st-offline { opacity: 0.7; }
.ptile-info { display: flex; gap: 10px; align-items: center; min-height: 58px; }
.ptile-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.ptile-info .dim { font-size: 12.5px; line-height: 1.35; }
.ptile > footer { margin-top: auto; } .ptile > footer .btn { width: 100%; }
.art { width: 100%; height: auto; display: block; }
.a-shell { fill: var(--surface); stroke: var(--line); stroke-width: 2; }
.a-room { fill: color-mix(in srgb, var(--text) 7%, var(--surface)); }
.a-bed { fill: color-mix(in srgb, var(--text) 78%, var(--surface)); }
.a-rail { fill: color-mix(in srgb, var(--text) 35%, var(--surface)); }
.a-head { fill: color-mix(in srgb, var(--text) 82%, var(--surface)); }
.a-ghost { fill: none; stroke: color-mix(in srgb, var(--text) 22%, transparent); stroke-width: 1; stroke-dasharray: 2 2; }
.a-part { stroke: rgba(0, 0, 0, 0.22); stroke-width: 0.8; }
.art.on .a-head { animation: sweep 1.7s ease-in-out infinite alternate; }
.ring { width: 52px; height: 52px; flex: none; }
.ring-track { fill: none; stroke: var(--track); stroke-width: 5; }
.ring-fill { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; transition: stroke-dasharray 0.8s var(--ease); }
.ring.done .ring-fill { stroke: var(--ok); } .ring.idle .ring-fill { stroke: none; }
.ring text { font: 700 11px var(--mono); fill: var(--text); }

/* filament reels */
.reel { width: 54px; height: 54px; flex: none; display: block; }
.reel.big { width: 72px; height: 72px; }
.r-flange { fill: var(--surface-2); stroke: var(--line); stroke-width: 2; }
.r-fil { stroke: rgba(0, 0, 0, 0.18); stroke-width: 1; }
.r-wind { fill: none; stroke: rgba(0, 0, 0, 0.13); stroke-width: 1; }
.r-hub { fill: var(--surface); stroke: rgba(0, 0, 0, 0.2); stroke-width: 1; }
.r-hole { fill: color-mix(in srgb, var(--text) 30%, var(--surface)); }
.r-spin { transform-box: view-box; transform-origin: center; }
.stock-item:hover .r-spin, .spool:hover .r-spin, .reel.spin .r-spin { animation: spin 4s linear infinite; }
.stock { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 12px 6px; }
.stock-item { background: none; border: 0; padding: 4px 0; border-radius: 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 14px; transition: transform 0.2s var(--ease); }
.stock-item:hover { transform: translateY(-3px); }
.wt { font: 700 12px var(--mono); padding: 2px 7px; border-radius: 6px; background: var(--surface-2); }
.wt.low { background: color-mix(in srgb, var(--bad) 16%, var(--surface)); color: var(--bad); }

/* upcoming jobs timeline */
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ''; position: absolute; left: 4px; top: 16px; bottom: 16px; width: 2px; background: color-mix(in srgb, var(--accent) 55%, var(--surface)); border-radius: 2px; }
.timeline li { position: relative; display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.timeline li::before { content: ''; position: absolute; left: -18px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.timeline li.live::before { background: var(--accent); animation: ping 1.8s ease-out infinite; }
.t-name { display: flex; flex-direction: column; min-width: 0; }
.t-name > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-time { color: var(--dim); font-size: 13px; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; background: color-mix(in srgb, var(--c, var(--dim)) 16%, var(--surface)); color: color-mix(in srgb, var(--c, var(--dim)) 70%, var(--text)); vertical-align: 1px; }
.tag.queued { --c: var(--m8); } .tag.printing { --c: var(--accent); } .tag.ok { --c: var(--ok); } .tag.bad, .tag.p-high { --c: var(--bad); } .tag.p-low { --c: var(--dim); }

/* needs attention / reorder lists */
.alerts li { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: 15px; }
.alerts li:first-child { border-top: 0; padding-top: 0; }
.alerts li:last-child { padding-bottom: 0; }
.alerts .link { white-space: nowrap; }
.a-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--c) 15%, var(--surface)); color: var(--c); }
.a-ic .ic { width: 17px; height: 17px; }
.alerts .bad { --c: var(--bad); } .alerts .warn { --c: var(--warn); } .alerts .ok { --c: var(--ok); }
.shop { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }

/* printer cards */
.printer { display: flex; flex-direction: column; gap: 14px; margin: 0; border-top: 4px solid var(--line); }
.printer:hover, .spool:hover { transform: translateY(-3px); box-shadow: var(--shadow-up); }
.printer > header { margin: 0; align-items: flex-start; }
.printer.st-printing { border-top-color: var(--accent); }
.printer.st-idle { border-top-color: var(--ok); }
.printer.st-offline { opacity: 0.72; }
.pill { font: 700 12px var(--mono); text-transform: uppercase; letter-spacing: 0.08em; padding: 4px 9px; border-radius: 99px; border: 1px solid currentColor; white-space: nowrap; }
.pill.printing { color: var(--accent-text); } .pill.idle { color: var(--ok); } .pill.offline { color: var(--dim); }
.pill.printing::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; animation: pulse 1.4s ease-in-out infinite; }
.job-now { background: var(--surface-2); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.job-now strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 8px; background: var(--track); border-radius: 99px; overflow: hidden; }
.bar.thin { height: 5px; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; min-width: 2px; transition: width 0.6s var(--ease); }
.bar.live i { background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.28) 25%, transparent 25% 50%, rgba(255, 255, 255, 0.28) 50% 75%, transparent 75%); background-size: 16px 16px; animation: stripes 0.9s linear infinite; }
.spool-line { display: flex; gap: 12px; align-items: center; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--c); border: 2px solid rgba(0, 0, 0, 0.16); vertical-align: -2px; flex: none; }
.swatch.lg { width: 38px; height: 38px; border-width: 3px; box-shadow: inset 0 0 0 9px var(--c), inset 0 0 0 12px rgba(0, 0, 0, 0.22); }
.swatch.empty { background: repeating-linear-gradient(45deg, var(--line) 0 4px, transparent 4px 8px); box-shadow: none; }
.maint .bar i { background: var(--ok); }
.maint.warn .bar i, .maint-row.warn .bar i { background: var(--warn); }
.maint.bad .bar i, .maint-row.bad .bar i { background: var(--bad); }
.maint.warn .row > span:first-child, .maint-row.warn .row > span:first-child, p.maint.warn > span { color: var(--warn); }
.maint.bad .row > span:first-child, .maint-row.bad .row > span:first-child, p.maint.bad > span { color: var(--bad); font-weight: 700; }
.maint { font-size: 14px; }
.pnote { font-size: 14px; background: color-mix(in srgb, var(--warn) 10%, var(--surface)); border-left: 3px solid color-mix(in srgb, var(--warn) 60%, var(--surface)); padding: 7px 10px; border-radius: 0 8px 8px 0; }
.printer footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; margin-top: auto; }
.printer footer .link { margin-left: 12px; }
.net { font-size: 13px; color: var(--ok); margin-top: 2px; }
.net::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; }

/* search + filter row */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.search { position: relative; flex: 1 1 220px; max-width: 340px; }
.search .ic { position: absolute; left: 12px; top: 50%; margin-top: -9px; width: 18px; height: 18px; color: var(--dim); pointer-events: none; }
.search input { padding-left: 38px; background: var(--surface); border-radius: 12px; }
.toolbar select { width: auto; background: var(--surface); border-radius: 12px; }
.chipset { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 7px 13px; font-size: 14px; font-weight: 500; color: var(--dim); transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.12s; }
.chip:hover { color: var(--text); border-color: var(--dim); }
.chip:active { transform: scale(0.95); }
.chip.on { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
:root[data-theme="dark"] .chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* charts */
.chart { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; height: 220px; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; padding: 9px 0 15px; font: 12px var(--mono); color: var(--dim); text-align: right; }
.chart-plot { position: relative; display: flex; gap: 0; padding-top: 16px; background:
  linear-gradient(var(--line), var(--line)) 0 16px / 100% 1px no-repeat,
  linear-gradient(var(--line), var(--line)) 0 calc(16px + (100% - 38px) / 2) / 100% 1px no-repeat,
  linear-gradient(var(--dim), var(--dim)) 0 calc(100% - 22px) / 100% 1px no-repeat; }
.col { flex: 1; min-width: 0; display: flex; flex-direction: column; border-radius: 6px; }
.col-bar { flex: 1; position: relative; }
.col-bar i { position: absolute; left: 16%; right: 16%; bottom: 0; background: color-mix(in srgb, var(--accent) 50%, var(--surface)); border-radius: 4px 4px 0 0; transform-origin: bottom; transition: background-color 0.2s; }
.chart.many .col-bar i { left: 1px; right: 1px; border-radius: 3px 3px 0 0; }
.col.hi .col-bar i, .col:hover .col-bar i, .col:focus-visible .col-bar i { background: var(--accent); }
.col-bar b { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font: 400 11px var(--mono); color: var(--dim); padding-bottom: 2px; white-space: nowrap; }
.col.hi .col-bar b { color: var(--text); font-weight: 700; }
.col-lab { height: 22px; line-height: 24px; font-size: 12px; color: var(--dim); text-align: center; white-space: nowrap; }
.chart.many .col-lab { overflow: visible; text-align: left; font-size: 11px; }
.donut-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; justify-content: center; }
.donut { width: 150px; height: 150px; flex: none; }
.seg { fill: none; stroke-width: 5.5; transition: stroke-width 0.2s; outline: none; }
.seg:hover, .seg:focus-visible { stroke-width: 7; }
.d-top { font: 400 3.6px var(--sans); fill: var(--dim); } .d-main { font: 700 4.7px var(--sans); fill: var(--text); }
.legend { flex: 1 1 120px; display: grid; gap: 7px; font-size: 14px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.legend span { flex: 1; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: 110px 1fr 70px 70px; gap: 12px; align-items: center; }
.hbar .mono { text-align: right; }
.hbar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 16px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.hbar-track i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; transform-origin: left; }
.hbar.total { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; font-weight: 700; }
.toplist li { display: flex; gap: 12px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--line); }
.toplist li:first-child { border-top: 0; padding-top: 0; }
#tip { position: fixed; z-index: 50; background: var(--text); color: var(--bg); font-size: 13px; padding: 6px 10px; border-radius: 8px; pointer-events: none; max-width: 260px; box-shadow: var(--shadow-up); }

/* next-24-hours plan */
.gantt { overflow: hidden; }
.g-row { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; align-items: center; margin-bottom: 8px; }
.g-name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-track { position: relative; height: 28px; background: var(--surface-2); border-radius: 8px; overflow: hidden; }
.g-track i { position: absolute; top: 3px; bottom: 3px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 42%, var(--surface)); box-shadow: 0 0 0 1.5px var(--surface-2); overflow: hidden; font-style: normal; transition: filter 0.2s; }
.g-track i.live { background: var(--accent); }
.g-track i.p-high { background-image: linear-gradient(90deg, var(--bad) 0 4px, transparent 4px); }
.g-track i:hover { filter: brightness(1.1); }
.g-track i span { display: block; padding: 0 8px; font-size: 12px; font-weight: 500; line-height: 22px; color: var(--accent-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root[data-theme="dark"] .g-track i:not(.live) span { color: var(--text); }
.g-axis { margin: 0; } .g-axis .g-track { background: none; height: 16px; overflow: visible; }
.g-axis em { position: absolute; top: 0; font: 11px var(--mono); color: var(--dim); font-style: normal; white-space: nowrap; border-left: 1px solid var(--line); padding-left: 4px; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); font-weight: 500; padding: 0 10px 8px 0; }
td { padding: 11px 10px 11px 0; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr { transition: background-color 0.15s; }
tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
td.state { min-width: 170px; } td.state .bar { margin-bottom: 4px; }
td.actions { text-align: right; white-space: nowrap; } td.actions > * { margin-left: 8px; }
.empty { color: var(--dim); padding: 8px 0; }
.note { color: var(--dim); margin: 0 0 18px; }
.empty-state { text-align: center; padding: 56px 20px; display: grid; justify-items: center; gap: 10px; }
.empty-state p { max-width: 420px; font-size: 16px; } .empty-state .btn { margin-top: 8px; }
.empty-art { animation: float 3.2s ease-in-out infinite; } .empty-art .reel { width: 96px; height: 96px; }

/* filament */
.spools { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; margin-bottom: 14px; }
.spool { display: flex; gap: 16px; align-items: center; margin: 0; }
.spool p { margin-top: 3px; }
.loaded { color: var(--ok); font-size: 14px; }
.spool p.dim .low, .loaded .low, .low { color: var(--bad); }

/* maintenance */
.maint-row { display: grid; grid-template-columns: 180px 1fr 190px auto; gap: 20px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.maint-row:first-child { border-top: 0; padding-top: 0; }
.maint-row .bar { margin-top: 8px; } .maint-row .bar i { background: var(--ok); }
.since .mono { font-size: 17px; }

/* dialog */
dialog { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 20px; padding: 24px; width: min(480px, calc(100vw - 32px)); box-shadow: var(--shadow-up); }
dialog[open] { animation: pop 0.24s var(--ease); }
dialog::backdrop { background: rgba(40, 34, 24, 0.45); animation: fade 0.24s; }
dialog h2 { font-size: 23px; margin-bottom: 16px; }
dialog form { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
dialog form > * { grid-column: 1 / -1; min-width: 0; }
dialog form > label.half { grid-column: auto; }
dialog label { display: block; margin-bottom: 12px; }
dialog label span { display: block; font-size: 13px; color: var(--dim); margin-bottom: 5px; }
input, select, textarea { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; transition: border-color 0.2s, box-shadow 0.2s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
textarea { resize: vertical; min-height: 64px; }
input[type=color] { padding: 3px; height: 42px; }
.form-err { color: var(--bad); font-size: 14px; margin-bottom: 10px; }
.form-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }
.form-actions .btn { margin-left: 8px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.stat-grid div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.stat-grid b { display: block; font-size: 21px; letter-spacing: -0.02em; } .stat-grid span { font-size: 13px; color: var(--dim); }
.mini li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); font-size: 15px; }
.mini li:first-child { border-top: 0; }
kbd { font: 700 13px var(--mono); background: var(--surface-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 2px 7px; min-width: 52px; text-align: center; }

/* toasts */
#toasts { position: fixed; z-index: 40; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(520px, calc(100vw - 24px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: var(--text); color: var(--bg); padding: 11px 12px 11px 16px; border-radius: 14px; box-shadow: var(--shadow-up); font-size: 15px; max-width: 100%; animation: toast-in 0.32s var(--ease) both; }
.toast.good { background: var(--ok); color: #fff; }
.toast.out { animation: toast-out 0.25s ease-in forwards; }
.toast .link { color: var(--accent); font-weight: 700; font-size: 15px; padding: 0; white-space: nowrap; }
.toast.good .link { color: #fff; }
.toast .x { background: none; border: 0; color: inherit; opacity: 0.6; font-size: 19px; line-height: 1; padding: 2px 4px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i { position: absolute; left: 50%; top: 38%; width: 9px; height: 14px; border-radius: 2px; animation: confetti 1.4s cubic-bezier(0.1, 0.7, 0.3, 1) var(--d) both; }

/* install-on-phone dialog */
.qr-box { width: 230px; max-width: 100%; aspect-ratio: 1; margin: 0 auto 10px; display: grid; place-items: center; text-align: center; background: #fff; color: #1d1e22; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; padding: 4px; font-size: 14px; }
.qr { width: 100%; height: 100%; display: block; }
.phone .addr { text-align: center; word-break: break-all; color: var(--dim); }
.phone ol { margin: 14px 0 10px; padding-left: 20px; display: grid; gap: 6px; list-style: decimal; }

/* account dialogs */
.auth-intro { margin: -8px 0 14px; }
.auth-links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.96); } }
@keyframes growx { from { transform: scaleX(0); } }
@keyframes growy { from { transform: scaleY(0); } }
@keyframes ringin { from { stroke-dasharray: 0.01 100; } }
@keyframes reelin { from { transform: scale(0.4); opacity: 0; } }
@keyframes stripes { to { background-position: 16px 0; } }
@keyframes pulse { 50% { opacity: 0.45; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 100% { box-shadow: 0 0 0 9px transparent; } }
@keyframes sweep { from { transform: translateX(-20px); } to { transform: translateX(20px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 50% { transform: translateY(-8px); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }
@keyframes confetti { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(calc(var(--x) * 42vw), 46vh) rotate(var(--r)); } }
/* things glide in when you open a page (not on the quiet 30-second refresh) */
.enter > *, .enter .tiles > *, .enter .grid > *, .enter .spools > *, .enter .ptiles > *, .enter .dash-main > *, .enter .dash-side > *, .enter .duo > * { animation: rise 0.5s var(--ease) both; }
.enter > :nth-child(2), .enter .tiles > :nth-child(2), .enter .grid > :nth-child(2), .enter .spools > :nth-child(2), .enter .ptiles > :nth-child(2), .enter .dash-side > :nth-child(1), .enter .duo > :nth-child(2) { animation-delay: 0.06s; }
.enter > :nth-child(3), .enter .tiles > :nth-child(3), .enter .grid > :nth-child(3), .enter .spools > :nth-child(3), .enter .ptiles > :nth-child(3), .enter .dash-side > :nth-child(2) { animation-delay: 0.12s; }
.enter > :nth-child(4), .enter .tiles > :nth-child(4), .enter .grid > :nth-child(4), .enter .spools > :nth-child(4), .enter .ptiles > :nth-child(4), .enter .dash-side > :nth-child(3) { animation-delay: 0.18s; }
.enter > :nth-child(n+5), .enter .grid > :nth-child(n+5), .enter .spools > :nth-child(n+5), .enter .ptiles > :nth-child(n+5) { animation-delay: 0.24s; }
.enter .bar i, .enter .hbar-track i { transform-origin: left; animation: growx 0.9s var(--ease) 0.15s both; }
.enter .bar.live i { animation: growx 0.9s var(--ease) 0.15s both, stripes 0.9s linear infinite; }
.enter .col-bar i { animation: growy 0.8s var(--ease) 0.2s both; }
.enter .ring-fill, .enter .seg { animation: ringin 1.1s var(--ease) 0.2s both; }
.enter .r-fil { transform-box: fill-box; transform-origin: center; animation: reelin 0.7s var(--ease) 0.2s both; }
.enter .timeline li, .enter .alerts li { animation: rise 0.45s var(--ease) both; }
.enter .timeline li:nth-child(2), .enter .alerts li:nth-child(2) { animation-delay: 0.26s; } .enter .timeline li:nth-child(3), .enter .alerts li:nth-child(3) { animation-delay: 0.32s; }
.enter .timeline li:nth-child(n+4), .enter .alerts li:nth-child(n+4) { animation-delay: 0.38s; } .enter .timeline li:first-child, .enter .alerts li:first-child { animation-delay: 0.2s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- smaller screens ---------- */
@media (max-width: 1250px) { .dash { grid-template-columns: 1fr; } .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 800px) {
  body { display: block; }
  .only-phone { display: block; } .no-phone { display: none; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; gap: 12px; padding-block: max(10px, env(safe-area-inset-top, 0px)) 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .logo { width: 36px; height: 36px; } .sysbox { display: none; }
  /* the sections become a tab bar along the bottom, like a phone app */
  nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; flex-direction: row; gap: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 6px max(6px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px)); box-shadow: 0 -8px 24px -18px rgba(60, 50, 30, 0.5); }
  nav button { flex: 1; flex-direction: column; gap: 3px; padding: 7px 2px 5px; font-size: 12px; text-align: center; min-width: 0; }
  nav button > span { flex: none; }
  nav button.on { background: none; box-shadow: none; color: var(--accent-text); }
  nav button.on .ic { background: var(--accent); color: var(--accent-ink); }
  nav .ic { width: 44px; height: 28px; padding: 4px 12px; border-radius: 99px; transition: background-color 0.25s; }
  nav em { position: absolute; top: 2px; left: calc(50% + 8px); padding: 1px 5px; font-size: 11px; }
  nav button.on em { background: var(--accent-ink); }
  .nav-x { display: none; } .nav-more { display: flex; }
  .nav-more.has-dot::after { content: ''; position: absolute; top: 5px; left: calc(50% + 12px); width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
  /* "More" opens the rest of the menu as a sheet above the tab bar */
  .side-foot { display: none; position: fixed; z-index: 29; left: 10px; right: 10px; bottom: calc(74px + env(safe-area-inset-bottom, 0px)); margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 10px 18px; box-shadow: var(--shadow-up); grid-template-columns: 1fr 1fr; gap: 0 16px; }
  body.more-open .side-foot { display: grid; animation: rise 0.25s var(--ease); }
  main { padding-block: 18px calc(96px + env(safe-area-inset-bottom, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  #toasts { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .link { padding: 9px 0; font-size: 15px; } .icon { width: 38px; height: 38px; } .btn.sm { padding: 9px 14px; }
  input, select, textarea { font-size: 17px; }
  .topbar { align-items: stretch; } .top-right { width: 100%; align-items: stretch; } .chips { justify-content: flex-start; }
  .top-actions .btn:not(.round) { flex: 1; padding-inline: 8px; white-space: nowrap; }
  h1 { font-size: 29px; }
  .tiles { gap: 10px; } .tile { padding: 12px; gap: 10px; flex-direction: column; align-items: flex-start; } .tile-ic { width: 38px; height: 38px; } .tile-value { font-size: 25px; }
  .duo, .duo.wide { grid-template-columns: 1fr; gap: 0; }
  .card { padding: 16px; }
  .ptiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .ptile { padding: 10px; }
  .ptile-info { flex-direction: column; align-items: flex-start; }
  .hbar { grid-template-columns: 76px 1fr 58px 60px; gap: 8px; }
  .maint-row { grid-template-columns: 1fr; gap: 10px; }
  .spools, .grid { grid-template-columns: 1fr; }
  .search { max-width: none; flex-basis: 100%; }
  .timeline li { grid-template-columns: 62px minmax(0, 1fr) auto; }
  .g-row { grid-template-columns: 58px minmax(0, 1fr); }
  .g-axis em:nth-child(even) { display: none; }
  .chart { height: 190px; }
}

/* phones: tables turn into stacked cards, so nothing needs sideways scrolling */
@media (max-width: 800px) {
  .table-wrap { overflow: visible; }
  table { min-width: 0; display: block; } thead { display: none; } tbody { display: block; }
  tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
  tbody tr:first-child { border-top: 0; padding-top: 0; }
  td { display: block; border: 0; padding: 0; min-width: 0; }
  td:first-child, td.state, td.actions { grid-column: 1 / -1; }
  td:first-child { font-size: 17px; }
  td.state { min-width: 0; }
  td.actions { text-align: left; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; white-space: normal; }
  td.actions > * { margin-left: 0; }
  td.actions:empty { display: none; }
  dialog { padding: 20px; max-height: calc(100dvh - 24px); overflow-y: auto; }
  .form-actions { position: sticky; bottom: -20px; background: var(--surface); padding: 10px 0 0; margin-bottom: 0; }
}

/* live status from the printer */
.slots { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.slots > .dim, .pqueue > .dim { font-size: 13px; width: 100%; }
.slot { display: inline-flex; align-items: center; gap: 6px; font: 13px var(--mono); padding: 3px 9px 3px 6px; border: 1px solid var(--line); border-radius: 99px; }
.slot.out { opacity: 0.5; text-decoration: line-through; }
.pqueue { display: grid; gap: 4px; font-size: 14px; }
.live-note { font-size: 13px; color: var(--dim); }
.details .live-job, .details .slots, .details .pqueue { margin-bottom: 12px; }

/* printer drawings by model */
.a-frame { fill: none; stroke: color-mix(in srgb, var(--text) 62%, var(--surface)); stroke-width: 3.5; }
.a-room.open { fill: color-mix(in srgb, var(--text) 3%, var(--surface)); }
.a-spool { fill: color-mix(in srgb, var(--text) 30%, var(--surface)); stroke: rgba(0, 0, 0, 0.28); stroke-width: 0.9; }
.a-hub { fill: var(--surface); stroke: rgba(0, 0, 0, 0.18); stroke-width: 0.6; }
.a-tool { fill: color-mix(in srgb, var(--text) 45%, var(--surface)); stroke: rgba(0, 0, 0, 0.3); stroke-width: 0.6; }
.a-glare { fill: none; stroke: color-mix(in srgb, var(--surface) 75%, transparent); stroke-width: 2.4; stroke-linecap: round; }
.p-icon { width: 76px; flex: none; }
.printer > header > .grow { min-width: 0; }
.scanbar { margin: 4px 0 14px; }
.scanbox .mini { margin: 0 0 6px; }

/* Dashboard fits one screen: on a wide screen the dashboard fills the window exactly and nothing scrolls off the bottom.
   (render() puts .fit on <body> while the dashboard is showing.) */
@media (min-width: 1251px) and (min-height: 600px) {
  body.fit { height: 100vh; overflow: hidden; }
  body.fit main { height: 100vh; display: flex; flex-direction: column; padding-block: 16px 14px; overflow: hidden; }
  body.fit .topbar { flex: none; margin-bottom: 12px; }
  body.fit #view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  body.fit .tiles { flex: none; gap: 12px; margin-bottom: 12px; }
  body.fit .tile { padding: 10px 14px; }
  body.fit .card { padding: 12px 16px; margin: 0; }
  body.fit .card > header { flex: none; margin-bottom: 8px; }
  body.fit .dash { flex: 1; min-height: 0; gap: 12px; align-items: stretch; grid-template-rows: minmax(0, 1fr); }
  body.fit .dash-main { display: flex; flex-direction: column; gap: 12px; min-height: 0; min-width: 0; }
  body.fit .dash-main > .card { flex: 1.3 1 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
  body.fit .duo { flex: 1 1 0; min-height: 0; gap: 12px; }
  body.fit .duo > .card { min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
  body.fit .chart { flex: 1; min-height: 0; height: auto; }
  body.fit .donut-wrap { flex: 1; min-height: 0; flex-wrap: nowrap; }
  body.fit .donut { height: 100%; max-height: 150px; width: auto; aspect-ratio: 1; }
  body.fit .ptiles { flex: 1; min-height: 0; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); grid-auto-rows: minmax(190px, 1fr); overflow-y: auto; gap: 10px; }
  body.fit .ptile { min-height: 0; padding: 8px 10px; gap: 6px; overflow: hidden; }
  body.fit .ptile .art { flex: 1 1 0; min-height: 36px; height: 0; }
  body.fit .ptile-info { flex: none; min-height: 0; }
  body.fit .ptile > footer:empty { display: none; }
  body.fit .dash-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; }
  body.fit .dash-side > .card { flex: none; }
  body.fit .dash-side > .card:last-child { flex: 1 0 auto; }
}

/* touch screens: a finger drag should scroll, never select text or bounce the page */
@media (pointer: coarse), (hover: none) {
  body { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
  input, textarea, select, .addr { -webkit-user-select: text; user-select: text; }
  .dash-side, .ptiles, .sidebar, .table-wrap, dialog { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; }
  .table-wrap { touch-action: pan-x pan-y; }
}

/* Continue with Google */
.gbtn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #1f1f1f; border-color: #dadce0; font-weight: 500; }
.auth-or { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 13px; margin: 14px 0 10px; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* temperatures on a printer card */
.temps { font-size: 13px; color: var(--dim); }

/* ---------- Display mode (wall / bench screen) ---------- */
body.kiosk { display: block; height: 100vh; overflow: hidden; }
body.kiosk .sidebar, body.kiosk .topbar, body.kiosk #chips { display: none; }
body.kiosk main { height: 100vh; padding: 14px 18px 10px; display: flex; flex-direction: column; overflow: hidden; }
body.kiosk #view { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; position: relative; }
.dhead { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.d-brand { display: flex; align-items: center; gap: 12px; } .d-brand img { border-radius: 11px; } .d-brand b { font-size: 21px; letter-spacing: 0.08em; }
.d-clock { text-align: center; display: flex; flex-direction: column; line-height: 1.1; } .d-clock b { font-size: clamp(34px, 5vw, 56px); letter-spacing: -0.03em; }
.d-status { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; }
.dpage { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.dtiles { flex: 1; min-height: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); grid-auto-rows: minmax(0, 1fr); }
.dtiles.n1 { grid-template-columns: minmax(0, 720px); justify-content: center; }
.dtile { background: var(--surface); border: 1px solid var(--line); border-top: 6px solid var(--line); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-height: 0; min-width: 0; overflow: hidden; box-shadow: var(--shadow); }
.dtile.printing { border-top-color: var(--accent); } .dtile.ok { border-top-color: var(--ok); } .dtile.warn { border-top-color: var(--warn); } .dtile.bad { border-top-color: var(--bad); }
.dtile > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; } .dtile > header strong { font-size: clamp(20px, 2.4vw, 30px); letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dtile .pill.ok { color: var(--ok); } .dtile .pill.warn { color: var(--warn); } .dtile .pill.bad { color: var(--bad); }
.d-art { flex: 1 1 0; min-height: 40px; display: flex; } .d-art .art { height: 100%; width: 100%; }
.d-job { display: flex; flex-direction: column; gap: 8px; } .d-job .bar { height: 12px; }
.d-job b { font-size: clamp(20px, 2.2vw, 28px); } .d-file { font-size: clamp(15px, 1.5vw, 19px); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.d-job.idle { min-height: 34px; justify-content: center; font-size: 18px; }
.dtile > footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 22px; }
.d-slots { display: inline-flex; gap: 6px; } .d-slots .swatch { width: 20px; height: 20px; } .d-slots .swatch.out { opacity: 0.35; }
.d-two { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; }
.d-two > .card { margin: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; } .d-two .chart { flex: 1; min-height: 0; height: auto; }
.d-two .donut-wrap { flex: 1; min-height: 0; } .d-two .donut { height: 100%; max-height: 220px; width: auto; aspect-ratio: 1; }
.d-list li { font-size: 18px; padding-block: 9px; }
body.kiosk .tiles { margin: 0; flex: none; }
.d-empty { flex: 1; display: grid; place-content: center; text-align: center; gap: 8px; }
.ddots { flex: none; display: flex; justify-content: center; gap: 8px; }
.ddots button { border: 1px solid var(--line); background: var(--surface); color: var(--dim); border-radius: 99px; padding: 6px 16px; font: 500 14px var(--sans); }
.ddots button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.dim-veil { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity 1.2s; z-index: 40; }
body.kiosk.night .dim-veil { opacity: 0.78; }
.dalert { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; text-align: center; padding: 24px; background: color-mix(in srgb, var(--ok) 92%, #000); color: #fff; cursor: pointer; }
.dalert[hidden] { display: none; }
.dalert.bad { background: color-mix(in srgb, var(--bad) 92%, #000); } .dalert.warn { background: color-mix(in srgb, var(--warn) 85%, #000); }
.dalert h2 { font-size: clamp(36px, 6vw, 76px); line-height: 1.05; letter-spacing: -0.03em; margin-bottom: 12px; }
.dalert p { font-size: clamp(18px, 2.4vw, 28px); } .dalert .dim { color: rgba(255, 255, 255, 0.75); font-size: 17px; margin-top: 18px; }
@media (max-width: 800px) { body.kiosk { height: auto; overflow: auto; } body.kiosk main { height: auto; overflow: visible; } .dhead { grid-template-columns: 1fr; text-align: center; justify-items: center; } .d-status { justify-content: center; } .d-two { grid-template-columns: 1fr; } .dtiles { grid-auto-rows: minmax(300px, auto); } }

/* ---------- tidier side panel: sections on top, Account + Settings at the bottom, everything else in one grouped menu ---------- */
.side-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.navlike { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: none; color: var(--dim); font: 500 16px var(--sans); text-align: left; cursor: pointer; }
.navlike:hover { background: var(--surface-2); color: var(--text); }
.navlike .ic { width: 20px; height: 20px; flex: none; }
.navlike > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; padding: 10px 0; border-top: 1px solid var(--line); justify-items: start; }
.mg:first-child, .mg.only-phone + .mg { border-top: 0; }
.mg h4 { grid-column: 1 / -1; margin: 0 0 4px; font: 400 12px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.mg .link { text-align: left; }
@media (min-width: 801px) {
  .mg.only-phone { display: none; }
  .sidebar { z-index: 30; } /* so the Settings menu sits above the charts */
  .side-foot { display: none; position: fixed; z-index: 45; left: 222px; bottom: 16px; width: 320px; margin: 0; padding: 6px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-up, 0 14px 30px -12px rgba(60, 50, 30, 0.45)); }
  body.more-open .side-foot { display: block; animation: rise 0.2s var(--ease); }
  body.more-open .navlike[data-act="more"] { background: var(--surface-2); color: var(--text); }
}
@media (max-width: 800px) {
  .side-bottom { display: none; }
  .side-foot { grid-template-columns: 1fr; gap: 0; max-height: 70vh; overflow-y: auto; }
  body.more-open .side-foot { display: block; }
  .mg.only-phone { display: grid; }
}

/* receipts */
.rcpt textarea { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; font: inherit; resize: vertical; }
.rcpt .form-err.working { color: var(--dim); }
.rc-list { list-style: none; margin: 0 0 12px; padding: 0; }
.rc-list li { border-top: 1px solid var(--line); } .rc-list li:first-child { border-top: 0; }
.rc-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; margin: 0; cursor: pointer; }
.rc-row input { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.rc-row .grow { display: flex; flex-direction: column; min-width: 0; }
.rc-mail .addr { text-align: left; user-select: all; }
html.nocursor, html.nocursor * { cursor: none !important; }
/* night light */
.warm-veil { position: fixed; inset: 0; background: #ff9a3c; mix-blend-mode: multiply; opacity: 0; pointer-events: none; transition: opacity 0.8s; z-index: 60; }
input[type=range] { width: 100%; padding: 0; accent-color: var(--accent); }

/* connecting a display */
body.screen .navlike[data-act="account"], body.screen #syncbtn, body.screen #phonebtn, body.screen #install, body.screen #mg-account [data-act="finder"] { display: none !important; }
#pairscreen { position: fixed; inset: 0; z-index: 55; background: var(--bg); display: grid; place-items: center; padding: 24px; overflow: auto; }
.pair-card { width: min(980px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: clamp(22px, 4vw, 44px); box-shadow: var(--shadow-up); }
.pair-brand { display: flex; align-items: center; gap: 14px; font: 700 20px var(--mono); letter-spacing: 0.14em; }
.pair-brand img { border-radius: 14px; }
.pair-card h1 { font-size: clamp(30px, 5vw, 46px); margin: 18px 0 22px; }
.pair-row { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: clamp(20px, 4vw, 44px); align-items: center; }
.pair-qr { aspect-ratio: 1; background: #fff; border-radius: 18px; border: 1px solid var(--line); padding: 10px; }
.pair-how ol { margin: 0 0 18px; padding-left: 22px; font-size: 19px; line-height: 1.6; }
.pair-code { font: 700 clamp(44px, 9vw, 84px)/1 var(--mono); letter-spacing: 0.12em; color: var(--accent-text); margin-bottom: 12px; white-space: nowrap; }
@media (max-width: 640px) { .pair-row { grid-template-columns: 1fr; } .pair-qr { max-width: 240px; } }
.pair-in { font: 700 26px var(--mono) !important; letter-spacing: 0.18em; text-transform: uppercase; text-align: center; }
.pair-h { margin: 6px 0 2px; font: 500 13px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.pair-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.pairdlg .form-err.working { color: var(--dim); }
.pair-how ol { list-style: decimal; } .pair-how li { padding-left: 4px; }

/* AI helpers */
.ai-open { gap: 6px; font-weight: 700; } .ai-spark { color: var(--accent-text); }
body.screen .ai-open { display: none; }
dialog:has(.ai) { width: min(640px, calc(100vw - 24px)); }
.ai h2 { margin-bottom: 12px; }
.ai-tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.ai-tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 8px 10px; font: 500 15px var(--sans); color: var(--dim); cursor: pointer; margin-bottom: -1px; }
.ai-tabs button.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 700; }
.ai-body { min-height: 230px; max-height: min(62vh, 560px); overflow-y: auto; padding-right: 4px; }
.ai-head { font-size: 21px; line-height: 1.25; margin: 0 0 12px; text-wrap: balance; }
.ai-sub { margin: 18px 0 8px; font: 500 12.5px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.ai-foot { font-size: 13px; margin-top: 12px; }
.ai-wait { color: var(--dim); display: flex; align-items: center; gap: 10px; }
.ai-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); display: inline-block; margin-right: 8px; animation: aipulse 1s ease-in-out infinite; flex: none; }
@keyframes aipulse { 50% { opacity: 0.25; transform: scale(0.7); } }
.ai-points { list-style: none; margin: 0; padding: 0; }
.ai-points li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); line-height: 1.45; }
.ai-mark { width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--dim); }
.ai-points .good .ai-mark { background: var(--ok); } .ai-points .watch .ai-mark { background: var(--accent); }
.ai-chat { display: flex; flex-direction: column; gap: 8px; max-height: 44vh; overflow-y: auto; margin-bottom: 12px; }
.ai-q { align-self: flex-end; background: var(--accent); color: #2a1206; padding: 8px 12px; border-radius: 14px 14px 4px 14px; max-width: 85%; font-weight: 500; }
.ai-a { align-self: flex-start; background: var(--surface-2); padding: 10px 14px; border-radius: 14px 14px 14px 4px; max-width: 92%; white-space: pre-wrap; line-height: 1.5; }
.ai-tips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; font: 500 14px var(--sans); color: var(--text); cursor: pointer; text-align: left; }
.chip-btn:hover { border-color: var(--accent); }
.ai-ask { display: flex !important; gap: 8px; } .ai-ask input { flex: 1; min-width: 0; }
.ai-doc-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.ai-diag { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: start; margin-top: 8px; }
.ai-photo { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.ai-causes { list-style: none; margin: 0; padding: 0; } .ai-causes li { padding: 6px 0; display: flex; gap: 10px; align-items: baseline; }
.ai-causes .tag { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: 0.06em; border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; color: var(--dim); flex: none; }
.ai-causes .tag.hot { border-color: var(--accent); color: var(--accent-text); }
.ai-fixes { margin: 0; padding-left: 22px; } .ai-fixes li { margin-bottom: 8px; line-height: 1.45; }
.ai-set { width: 100%; border-collapse: collapse; font-size: 15px; }
.ai-set th { text-align: left; font-weight: 700; padding: 7px 12px 7px 0; vertical-align: top; white-space: nowrap; } .ai-set td { padding: 7px 0; color: var(--dim); }
.ai-set tr { border-top: 1px solid var(--line); } .ai-set .num { text-align: right; color: var(--text); font-family: var(--mono); white-space: nowrap; }
.ai-set .tot th, .ai-set .tot .num { font-size: 17px; color: var(--accent-text); }
.ai-quote { display: grid !important; grid-template-columns: 1fr 1fr; column-gap: 12px; } .ai-quote > * { grid-column: auto !important; min-width: 0; } .ai-quote > .wide { grid-column: 1 / -1 !important; }
.ai textarea { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; font: inherit; resize: vertical; }
@media (max-width: 560px) { .ai-diag { grid-template-columns: 1fr; } .ai-photo { max-width: 180px; } .ai-doc-pick { grid-template-columns: 1fr; } }

/* send a print */
body.screen .send-open { display: none; }
.send-prog { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 4px 0 10px; }
.send-prog i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.send-state { font-weight: 500; margin: 0 0 12px; } .send-state.ok { color: var(--ok); } .send-state.bad { color: var(--bad); }
.sendf .rc-row { align-items: flex-start; } .sendf .rc-row input { margin-top: 4px; }

/* ---------- printer drawings, high detail ---------- */
.art { overflow: visible; shape-rendering: geometricPrecision; }
.a-shell { fill: var(--surface); stroke: color-mix(in srgb, var(--text) 26%, var(--surface)); stroke-width: 1.3; }
.a-over { pointer-events: none; }
.a-ground { fill: #000; opacity: 0.09; }
.a-foot { fill: color-mix(in srgb, var(--text) 55%, var(--surface)); }
.a-handle { fill: color-mix(in srgb, var(--text) 42%, var(--surface)); }
.a-room { fill: color-mix(in srgb, var(--text) 13%, var(--surface)); stroke: color-mix(in srgb, var(--text) 20%, var(--surface)); stroke-width: 0.7; }
.a-room.open { fill: color-mix(in srgb, var(--text) 4%, var(--surface)); stroke: none; }
.a-lit { animation: glow 2.6s ease-in-out infinite; }
.a-ledbar { fill: color-mix(in srgb, var(--text) 22%, var(--surface)); }
.art.on .a-ledbar { fill: #fff3dc; }
.a-rod { fill: color-mix(in srgb, var(--text) 30%, var(--surface)); }
.a-rail { fill: color-mix(in srgb, var(--text) 46%, var(--surface)); }
.a-railhi { fill: #fff; opacity: 0.45; }
.a-belt { stroke: color-mix(in srgb, var(--text) 70%, var(--surface)); stroke-width: 0.7; stroke-dasharray: 1.1 0.9; }
.art.on .a-belt { animation: belt 0.5s linear infinite; }
.a-bed { fill: color-mix(in srgb, var(--text) 80%, var(--surface)); }
.a-plate { fill: #fff; opacity: 0.3; }
.a-frame { fill: none; stroke: color-mix(in srgb, var(--text) 64%, var(--surface)); stroke-width: 3.6; }
.a-frame.hi { stroke: #fff; stroke-width: 0.8; opacity: 0.28; }
.a-head { fill: none; }
.a-headbody { fill: color-mix(in srgb, var(--text) 84%, var(--surface)); stroke: rgba(0, 0, 0, 0.35); stroke-width: 0.5; }
.a-headhi { fill: #fff; opacity: 0.22; }
.a-fanring { fill: color-mix(in srgb, var(--text) 55%, var(--surface)); stroke: rgba(255, 255, 255, 0.35); stroke-width: 0.5; }
.a-fanblade { stroke: rgba(255, 255, 255, 0.75); stroke-width: 0.7; stroke-linecap: round; }
.a-fan { transform-box: fill-box; transform-origin: center; }
.art.on .a-fan { animation: spin 0.55s linear infinite; }
.a-nozzle { fill: #c9a24a; stroke: rgba(0, 0, 0, 0.3); stroke-width: 0.35; }
.a-hot { animation: glow 1.1s ease-in-out infinite; }
.art.on .a-head { animation: sweep 1.9s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate; }
.a-ghost { fill: color-mix(in srgb, var(--text) 5%, transparent); stroke: color-mix(in srgb, var(--text) 30%, transparent); stroke-width: 0.8; stroke-dasharray: 2 1.6; }
.a-part { stroke: none; }
.a-edge { fill: none; stroke: rgba(0, 0, 0, 0.3); stroke-width: 0.9; }
.a-layer { fill: #fff; opacity: 0.85; animation: glow 0.9s ease-in-out infinite; }
.a-flange { fill: color-mix(in srgb, var(--text) 16%, var(--surface)); stroke: color-mix(in srgb, var(--text) 38%, var(--surface)); stroke-width: 0.7; }
.a-spool { fill: color-mix(in srgb, var(--text) 30%, var(--surface)); stroke: rgba(0, 0, 0, 0.22); stroke-width: 0.5; }
.a-wind { fill: none; stroke: rgba(0, 0, 0, 0.16); stroke-width: 0.45; } .a-wind.b { stroke: rgba(255, 255, 255, 0.3); }
.a-sheen { fill: none; stroke: rgba(255, 255, 255, 0.55); stroke-width: 0.9; stroke-linecap: round; }
.a-hub { fill: var(--surface); stroke: rgba(0, 0, 0, 0.28); stroke-width: 0.5; }
.a-spoke line { stroke: color-mix(in srgb, var(--text) 50%, var(--surface)); stroke-width: 0.7; stroke-linecap: round; }
.a-axle { fill: color-mix(in srgb, var(--text) 60%, var(--surface)); }
.a-reel { transform-box: fill-box; transform-origin: center; }
.a-reel.spin { animation: spin 7s linear infinite; }
.a-tool { fill: color-mix(in srgb, var(--text) 45%, var(--surface)); stroke: rgba(0, 0, 0, 0.35); stroke-width: 0.5; }
.a-glare { fill: none; stroke: #fff; opacity: 0.32; stroke-width: 2; stroke-linecap: round; }
.a-screen { fill: #1d1e22; stroke: rgba(0, 0, 0, 0.4); stroke-width: 0.4; }
.a-screenbar { fill: var(--accent); } .a-screenline { fill: #fff; opacity: 0.35; }
.a-led { stroke: rgba(0, 0, 0, 0.25); stroke-width: 0.4; }
.a-led.s-idle { fill: #2bbf8a; } .a-led.s-done { fill: #2bbf8a; animation: glow 1.4s ease-in-out infinite; } .a-led.s-off { fill: color-mix(in srgb, var(--text) 30%, var(--surface)); }
.a-led.s-on { fill: var(--accent); animation: glow 1s ease-in-out infinite; }
@keyframes glow { 50% { opacity: 0.45; } }
@keyframes belt { to { stroke-dashoffset: -2; } }
@media (prefers-reduced-motion: reduce) { .art * { animation: none !important; } }
.p-icon { width: 112px; }
.ptile .art { max-height: 150px; }
@media (min-width: 801px) { body.fit .ptile .art { min-height: 58px; } }
@media (max-width: 800px) { .p-icon { width: 92px; } }
.a-detail { fill: none; stroke: rgba(0, 0, 0, 0.34); stroke-width: 0.9; stroke-linecap: round; stroke-linejoin: round; }
.a-ghostx { fill: none; stroke: color-mix(in srgb, var(--text) 16%, transparent); stroke-width: 0.6; stroke-dasharray: 1.6 1.4; }
.spool-acts { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; }

/* recent prints on each printer tile, with a little face on every print */
.ptile-recent { border-top: 1px dashed var(--line); padding-top: 8px; min-height: 0; }
.ptile-recent h4 { margin: 0 0 4px; font: 500 10.5px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.ptile-recent ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.ptile-recent li { display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 3px 0; }
.ptile-recent li .pi { grid-row: 1 / 3; }
.rp-name { font-weight: 500; font-size: 13.5px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-meta { font-size: 11.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptile-recent.none p { display: flex; gap: 8px; align-items: center; margin: 0; font-size: 12.5px; line-height: 1.3; }
.ptile-recent.none .pi { flex: none; }
.pi { width: 44px; height: 36px; display: block; padding: 3px 4px; background: var(--surface); border-radius: 11px; box-shadow: 0 1px 2px rgba(60, 30, 10, 0.08); box-sizing: border-box; }
.pi-body { stroke: rgba(0, 0, 0, 0.34); stroke-width: 1.2; stroke-linejoin: round; }
.pi-shade { fill: none; stroke: rgba(255, 255, 255, 0.45); stroke-width: 1.6; stroke-dasharray: 9 200; stroke-dashoffset: -4; stroke-linecap: round; }
.pi-eye { fill: #2a1206; } .pi-blush { fill: #ff5a7a; opacity: 0.45; }
.pi-line { fill: none; stroke: #2a1206; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.pi.bad { opacity: 0.6; filter: grayscale(0.7); }
.ptile:hover .pi { animation: wiggle 0.6s ease-in-out; }
@keyframes wiggle { 25% { transform: rotate(-7deg); } 75% { transform: rotate(7deg); } }
@media (min-width: 801px) {
  body.fit .ptile-recent { flex: 1 1 0; overflow: hidden; }
  body.fit .ptile .art { flex: 0 1 auto; height: auto; max-height: 34%; }
}
@media (max-width: 800px) { .ptile-recent li:nth-child(n+3) { display: none; } }

/* a sliced file attached to a queued job */
.jobfile { grid-column: 1 / -1; border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; margin: 2px 0 6px; }
.jobfile .jf-l { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.jobfile p { margin: 0 0 4px; } .jobfile #jf-note { font-size: 12.5px; }
.jfile { display: flex; align-items: center; gap: 5px; font-size: 12.5px; margin: 2px 0 0; }
.jfile svg { width: 13px; height: 13px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-linejoin: round; }

/* long print names wrap onto a second line instead of being cut off; times and prices never break in the middle */
.nb { white-space: nowrap; }
.ptile-info strong, .rp-name { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; line-height: 1.2; }
.ptile-info .grow { min-width: 0; }
.sep { font-style: normal; }
@media (max-width: 800px) {
  .ptile-info .sep, .ptile-recent .wide { display: none; }
  .ptile-info .nb { display: block; }
  .ptile header strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; max-width: 72%; }
  .ptile header .dim { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
/* on the fit-to-screen dashboard a recent print that does not fully fit is left out, not cut in half */
@media (min-width: 801px) {
  body.fit .ptile-recent { display: flex; flex-direction: column; }
  body.fit .ptile-recent ul { flex: 1 1 0; min-height: 0; flex-flow: column wrap; align-content: flex-start; overflow: hidden; column-gap: 40px; }
  body.fit .ptile-recent li { width: 100%; }
}
/* phone: everything on a printer card sits on the centre line, and a lone last card takes the full width */
@media (max-width: 800px) {
  .ptile > header { justify-content: center; }
  .ptile header .dim { flex: 0 1 auto; }
  .ptile-info { align-items: center; text-align: center; }
  .ptile-info .grow { width: 100%; }
  .ptile-recent h4 { text-align: center; }
  .ptile-recent ul { width: fit-content; max-width: 100%; margin-inline: auto; }
  .ptile-recent.none p { justify-content: center; }
  .ptile > footer { display: flex; justify-content: center; }
  .ptiles > .ptile:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 800px) {
  .ptile > header { flex-wrap: wrap; row-gap: 0; }
  .ptile header strong { flex: 0 1 auto; max-width: calc(100% - 24px); }
  .ptile header .dim { flex: 1 0 100%; text-align: center; }
}

/* narrow printer cards (three or more across on a small wall screen): the model goes under the name, and the time
   left and finish time each get their own line, so nothing is cut off at the card's edge */
.ptile { container-type: inline-size; }
@container (max-width: 215px) {
  .ptile > header { flex-wrap: wrap; row-gap: 0; }
  .ptile > header strong { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ptile > header .dim { flex: 0 0 100%; padding-left: 16px; font-size: 11.5px; }
  .ptile-info { gap: 8px; }
  .ptile-info .sep { display: none; }
  .ptile-info .nb { display: block; white-space: normal; }
}
/* a short wall screen has no height for the recent-prints strip under each printer: leave it out, so the current
   print's own lines are never cut off at the bottom of the card */
@media (min-width: 1251px) and (max-height: 800px) {
  body.fit .ptile-recent { display: none; }
  body.fit .dash-main > .card { flex-grow: 1.65; }
  body.fit .ptile .art { min-height: 46px; }
}
/* a connected display is looked at, not scrolled with a mouse: no scrollbars drawn (a finger drag still scrolls) */
body.screen * { scrollbar-width: none; }
body.screen *::-webkit-scrollbar { display: none; }

/* profit: green when a print made money, red when it lost money; the summary tiles sit inside their card */
td.pos { color: var(--ok); } td.neg, .tile.neg .tile-value { color: var(--bad); }
.tiles.inner { margin: 0; } .tiles.inner .tile { background: var(--bg); box-shadow: none; }

/* Connect your email: the numbered steps */
.steps { margin: 6px 0 12px; padding-left: 22px; display: grid; gap: 7px; font-size: 14px; line-height: 1.45; }
.rcpt h4 { margin: 14px 0 0; font-size: 14px; }

/* a helper on someone else's farm: what only the owner can open is not offered */
body.helper :is([data-act="prices"], [data-act="order-page"], [data-act="inbox"], [data-act="receipt"], [data-act="clear"], [data-act="restore"], [data-act="add-printer"], [data-act="edit-printer"], [data-act="sold"], [data-act="ai"], [data-act="csv"], [data-act="phone"], [data-act="sync-setup"]) { display: none !important; }

/* orders board: one column per stage, scrolls sideways when it does not fit. Each stage has its own colour (--st). */
.st-new { --st: var(--m8); } .st-quoted { --st: var(--m3); } .st-accepted { --st: var(--accent); } .st-making { --st: var(--m6); }
.st-made { --st: var(--m2); } .st-shipped { --st: var(--ok); } .st-paid { --st: var(--m9); }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(272px, 1fr); gap: 14px; overflow-x: auto; padding: 2px 2px 12px; align-items: start; scroll-snap-type: x proximity; }
.bcol { background: color-mix(in srgb, var(--st) 5%, var(--surface-2)); border-radius: 20px; padding: 12px; scroll-snap-align: start; min-width: 0; }
.bcol > header { display: flex; align-items: center; gap: 10px; margin: 2px 2px 12px; }
.bcol > header h3 { font-size: 16px; margin: 0; }
.bic { width: 34px; height: 34px; border-radius: 50%; background: var(--st); color: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 6px 14px -6px var(--st); }
.bic .ic { width: 17px; height: 17px; }
.bsum { font: 500 12px var(--mono); color: var(--dim); }
.bcount { min-width: 26px; height: 26px; padding: 0 8px; border-radius: 99px; display: grid; place-items: center; font: 700 13px var(--mono); background: color-mix(in srgb, var(--st) 16%, var(--surface)); color: color-mix(in srgb, var(--st) 70%, var(--text)); }
.bempty { font-size: 14px; color: var(--dim); text-align: center; padding: 22px 10px; border: 1.5px dashed var(--line); border-radius: 14px; }
.ocard { position: relative; background: var(--surface); border-radius: 16px; padding: 14px 14px 12px; margin-bottom: 10px; font-size: 14px; box-shadow: var(--shadow); overflow: hidden; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.ocard::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--st); }
.ocard:hover { transform: translateY(-2px); box-shadow: var(--shadow-up); }
.ocard:last-child { margin-bottom: 0; }
.ocard p { margin: 0; overflow-wrap: anywhere; }
.ohead { display: flex; align-items: flex-start; gap: 10px; }
.oava { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 14px; letter-spacing: 0.02em; background: color-mix(in srgb, var(--c) 18%, var(--surface)); color: color-mix(in srgb, var(--c) 72%, var(--text)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 30%, transparent); }
.otitle { display: block; font-size: 15.5px; line-height: 1.25; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.owho { font-size: 13.5px; color: var(--dim); }
.owho .link { font-size: inherit; }
.oprice { flex: none; text-align: right; font: 700 15px var(--mono); padding: 5px 9px; border-radius: 10px; background: var(--surface-2); line-height: 1.15; }
.oprice small { display: block; font: 500 10.5px var(--sans); color: var(--dim); text-transform: uppercase; letter-spacing: 0.06em; }
.oprice.none { font: 600 12px var(--sans); color: var(--dim); }
.ochips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px !important; }
.osrc, .odue { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; background: var(--surface-2); color: var(--dim); }
.osrc.src-etsy { background: color-mix(in srgb, var(--m1) 15%, var(--surface)); color: color-mix(in srgb, var(--m1) 75%, var(--text)); }
.osrc.src-orderpage { background: color-mix(in srgb, var(--m8) 14%, var(--surface)); color: color-mix(in srgb, var(--m8) 75%, var(--text)); }
.odue .ic, .ofil-say .ic, .omake .ic { width: 13px; height: 13px; flex: none; }
.odue.soon { background: color-mix(in srgb, var(--warn) 18%, var(--surface)); color: color-mix(in srgb, var(--warn) 80%, var(--text)); }
.odue.late { background: color-mix(in srgb, var(--bad) 15%, var(--surface)); color: var(--bad); }
.onote { margin-top: 10px !important; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border-left: 3px solid color-mix(in srgb, var(--st) 55%, var(--line)); font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.card .onote { display: block; margin-top: 8px !important; }
.ofil, .omake { margin-top: 10px; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--line); }
.ofil { display: flex; gap: 10px; align-items: flex-start; }
.ofil .swatch { margin-top: 2px; }
.ofil p:first-child, .omake p { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.ofil p:first-child span, .omake p span:last-child { font: 500 12px var(--mono); color: var(--dim); white-space: nowrap; }
.omake p span:first-child { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.ofil.ok .bar i { background: var(--ok); } .ofil.short .bar i { background: var(--bad); } .omake .bar i { background: var(--st); }
.ofil.short { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); background: color-mix(in srgb, var(--bad) 5%, var(--surface)); }
.ofil-say { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; margin-top: 6px !important; }
.ofil.ok .ofil-say { color: var(--ok); } .ofil.short .ofil-say { color: var(--bad); }
.osteps { display: flex; gap: 4px; margin-top: 12px; }
.osteps i { flex: 1; height: 4px; border-radius: 4px; background: var(--track); }
.osteps i.done { background: color-mix(in srgb, var(--st) 45%, var(--track)); } .osteps i.now { background: var(--st); }
.oacts { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; margin-top: 12px; }
.oacts .btn { flex: 1 1 auto; justify-content: center; }
.olinks { display: inline-flex; gap: 12px; flex-wrap: wrap; }
.fil-ok { color: var(--ok); }
@media (prefers-reduced-motion: reduce) { .ocard { transition: none; } .ocard:hover { transform: none; } }
body.helper [data-act="ord-quote"] { display: none !important; }
