/* U1 Control — iOS-flavoured, system font, grouped lists. The four toolhead colours are the one loud thing. */

@font-face { font-family: "Figtree"; font-weight: 500; font-display: swap; src: url("/fonts/figtree-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 600; font-display: swap; src: url("/fonts/figtree-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 700; font-display: swap; src: url("/fonts/figtree-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 800; font-display: swap; src: url("/fonts/figtree-latin-800-normal.woff2") format("woff2"); }

/* Snapmaker U1 materials: off-white matte panels on studio grey, a graphite frame (top rail, door bezel),
   one signal yellow (the carriage button), and the four filament colours as the only other colour. */
:root {
  --bg: #e6e6e2;            /* studio backdrop */
  --card: #f9f9f7;          /* body panel */
  --card2: #efefeb;         /* recessed panel */
  --raise: #ffffff;
  --graphite: #1c1e21;      /* top frame / door bezel */
  --graphite2: #2b2e32;
  --on-graphite: #f2f2ef;
  --on-graphite2: rgba(242, 242, 239, 0.58);
  --label: #17181a;
  --label2: rgba(23, 24, 26, 0.6);
  --label3: rgba(23, 24, 26, 0.32);
  --sep: rgba(23, 24, 26, 0.12);
  --fill: rgba(23, 24, 26, 0.06);
  --fill2: rgba(23, 24, 26, 0.12);
  --accent: #f5b400;        /* Snapmaker yellow: primary actions, selections, progress */
  --accent-press: #dfa300;
  --on-accent: #17181a;      /* graphite text on yellow, never white */
  --signal: #f5b400;        /* Snapmaker yellow: only for what is happening right now */
  --link: #17181a;
  --green: #2fa85a;
  --orange: #f07d00;
  --red: #e5423a;
  --pink: #e8456b;
  --bar: rgba(28, 30, 33, 0.94);
  --shadow: 0 1px 1px rgba(23, 24, 26, 0.04), 0 10px 28px rgba(23, 24, 26, 0.07);
  --sheet-shadow: 0 -8px 40px rgba(0, 0, 0, 0.2);
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 10px;
  --display: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

/* Dark: the U1 touchscreen and the inside of the frame */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0f11;
    --card: #1b1d20;
    --card2: #25282c;
    --raise: #30343a;
    --graphite: #08090a;
    --graphite2: #1f2226;
    --on-graphite: #f2f2ef;
    --on-graphite2: rgba(242, 242, 239, 0.55);
    --label: #f2f2ef;
    --label2: rgba(242, 242, 239, 0.62);
    --label3: rgba(242, 242, 239, 0.3);
    --sep: rgba(242, 242, 239, 0.1);
    --fill: rgba(242, 242, 239, 0.07);
    --fill2: rgba(242, 242, 239, 0.14);
    --accent: #ffc21a;
    --accent-press: #f0b000;
    --on-accent: #17181a;
    --signal: #ffc21a;
    --link: #f2f2ef;
    --green: #3ccf72;
    --orange: #ff9a2e;
    --red: #ff5a50;
    --pink: #ff5c80;
    --bar: rgba(8, 9, 10, 0.92);
    --shadow: none;
    --sheet-shadow: 0 -8px 40px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0f11;
  --card: #1b1d20;
  --card2: #25282c;
  --raise: #30343a;
  --graphite: #08090a;
  --graphite2: #1f2226;
  --on-graphite: #f2f2ef;
  --on-graphite2: rgba(242, 242, 239, 0.55);
  --label: #f2f2ef;
  --label2: rgba(242, 242, 239, 0.62);
  --label3: rgba(242, 242, 239, 0.3);
  --sep: rgba(242, 242, 239, 0.1);
  --fill: rgba(242, 242, 239, 0.07);
  --fill2: rgba(242, 242, 239, 0.14);
  --accent: #ffc21a;
  --accent-press: #f0b000;
  --on-accent: #17181a;
  --signal: #ffc21a;
  --link: #f2f2ef;
  --green: #3ccf72;
  --orange: #ff9a2e;
  --red: #ff5a50;
  --pink: #ff5c80;
  --bar: rgba(8, 9, 10, 0.92);
  --shadow: none;
  --sheet-shadow: 0 -8px 40px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font: 17px/1.35 var(--font);
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
body.locked { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; border-radius: 8px; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.fill { fill: currentColor; stroke: none; }
[hidden] { display: none !important; }
.muted { color: var(--label2); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */

.app { min-height: 100dvh; }
.main { padding: calc(var(--safe-t) + 8px) 16px calc(96px + var(--safe-b)); max-width: 1180px; margin: 0 auto; }

.sidebar { display: none; }
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px calc(6px + var(--safe-b));
  background: var(--bar);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid rgba(255, 255, 255, 0.06);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0 7px; font-size: 10.5px; font-weight: 600; font-family: var(--display); color: var(--on-graphite2); letter-spacing: 0; position: relative; }
.tab svg.i { width: 26px; height: 26px; }
.tab[aria-current="page"] { color: var(--on-graphite); }
.tab[aria-current="page"]::after { content: ""; position: absolute; bottom: -1px; width: 5px; height: 5px; border-radius: 50%; background: var(--signal); }
.tab .badge, .nav .badge { position: absolute; top: 2px; left: calc(50% + 8px); min-width: 9px; height: 9px; border-radius: 9px; background: var(--red); }

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 250px 1fr; }
  .tabbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px;
    position: sticky; top: 0; height: 100dvh; padding: 22px 12px;
    background: var(--graphite); color: var(--on-graphite); border-right: 0;
  }
  .main { padding: 28px 36px 48px; width: 100%; }
  .brand { padding: 4px 12px 18px; }
  .brand b { display: block; font-family: var(--display); font-size: 23px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 6px; }
  .nav { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; font-size: 15px; font-weight: 500; position: relative; text-align: left; }
  .nav { color: var(--on-graphite2); font-family: var(--display); font-weight: 600; }
  .nav:hover { background: rgba(255, 255, 255, 0.06); color: var(--on-graphite); }
  .nav[aria-current="page"] { background: var(--graphite2); color: var(--on-graphite); }
  .nav[aria-current="page"]::after { content: ""; position: absolute; right: 14px; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); }
  .nav .badge { top: 8px; left: 30px; }
  .sidebar .spacer { flex: 1; }
}

/* ---------- headings ---------- */

.titlebar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 12px 4px 14px; }
.titlebar h1 { margin: 0; font-family: var(--display); font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
.titlebar p { margin: 4px 0 0; color: var(--label2); font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.titlebar .actions { display: flex; gap: 8px; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--label); position: relative; }
.icon-btn .badge { position: absolute; top: 4px; right: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
.section-h { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 4px 8px; }
.section-h h2 { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -0.015em; }
.section-h .link { color: var(--link); font-weight: 600; font-size: 15px; }
.group-h { margin: 22px 16px 7px; font-size: 13px; color: var(--label2); letter-spacing: 0; }
.group-f { margin: 7px 16px 0; font-size: 13px; color: var(--label2); line-height: 1.4; letter-spacing: 0; }

/* ---------- status pill ---------- */

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--fill); color: var(--label2); letter-spacing: 0; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.blue { color: var(--on-graphite); background: var(--graphite); }
.pill.blue::before { background: var(--signal); }
.pill.green { color: var(--green); background: color-mix(in srgb, var(--green) 15%, transparent); }
.pill.orange { color: var(--orange); background: color-mix(in srgb, var(--orange) 15%, transparent); }
.pill.red { color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); }
.pill.blue::before { animation: beacon 2.4s ease-out infinite; }
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes beacon { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--signal) 70%, transparent); } 70%, 100% { box-shadow: 0 0 0 6px transparent; } }

/* ---------- cards & grouped lists ---------- */

.card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 16px; }
.card + .card { margin-top: 14px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-h h3 { margin: 0; font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: -0.005em; }
.card-h .sub { font-size: 13px; color: var(--label2); letter-spacing: 0; }

.group { background: var(--card); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow); }
.row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 16px; position: relative; width: 100%; text-align: left; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 0.5px solid var(--sep); }
.row.with-icon + .row::before, .row + .row.with-icon::before { left: 58px; }
button.row:active, .row.tap:active { background: var(--fill); }
.row .grow { flex: 1; min-width: 0; }
.row .title { display: block; }
.row .sub { display: block; font-size: 13px; color: var(--label2); letter-spacing: 0; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; }
.row .value { color: var(--label2); font-variant-numeric: tabular-nums; }
.row .chev { color: var(--label3); width: 16px; height: 16px; stroke-width: 2.4; }
.row-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex: none; }
.row-icon svg.i { width: 18px; height: 18px; stroke-width: 2; }
.row input[type="text"], .row input[type="password"], .row input[type="number"], .row input[type="url"], .row select {
  border: 0; background: transparent; text-align: right; color: var(--label2); min-width: 0; flex: 1; padding: 4px 0; outline: none;
}
.row input:focus { color: var(--label); }
.row select { appearance: none; -webkit-appearance: none; cursor: pointer; text-align-last: right; }
.row textarea { width: 100%; }
.row input[type="color"] { width: 32px; height: 32px; border: 0; padding: 0; border-radius: 50%; background: none; cursor: pointer; }
.row input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.row input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 50%; }

/* switch */
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--fill2); transition: background 0.2s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22); transition: transform 0.22s cubic-bezier(.3,.7,.4,1); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { background: var(--on-accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--signal); outline-offset: 2px; }

/* buttons */
.btn { font-family: var(--display); display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 13px; font-weight: 600; font-size: 16px; background: var(--fill); color: var(--label); white-space: nowrap; transition: transform 0.12s, opacity 0.12s; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.danger { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.btn.solid-danger { background: var(--red); color: #fff; }
.btn.warn { background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--orange); }
.btn.small { height: 34px; padding: 0 14px; font-size: 15px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn svg.i { width: 19px; height: 19px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row .btn { flex: 1 1 auto; }
.link-btn { color: var(--link); font-size: 15px; font-weight: 600; text-decoration: underline; text-decoration-color: var(--label3); text-underline-offset: 3px; }

/* segmented control */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 2px; border-radius: 10px; background: var(--fill); position: relative; }
.seg button { font-family: var(--display); height: 32px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--label); position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 6px; letter-spacing: 0; }
.seg button[aria-pressed="true"] { background: var(--raise); font-weight: 600; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04); }
.seg button svg.i { width: 16px; height: 16px; }
.seg.big button { height: 44px; font-size: 15px; }
.seg.seg-2l button { height: 54px; flex-direction: column; gap: 1px; line-height: 1.15; }

/* ---------- slicing preview ---------- */
.slice-view { position: relative; height: clamp(240px, 62vw, 380px); border-radius: 18px; overflow: hidden; background: radial-gradient(120% 90% at 50% 20%, color-mix(in srgb, var(--card) 70%, #fff 6%), var(--card)); }
.slice-view canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.slice-view canvas:active { cursor: grabbing; }
.sv-msg { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; color: var(--label2); font-size: 14px; pointer-events: none; }
.sv-msg[hidden] { display: none; }
.sv-hint { position: absolute; top: 10px; left: 12px; font-size: 12px; color: var(--label3); pointer-events: none; letter-spacing: 0; }
.sv-plates { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 4px; border-radius: 99px; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-weight: 600; font-size: 14px; white-space: nowrap; }
.sv-plates .icon-btn { width: 36px; height: 36px; }
.sv-size { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.sv-size input[type="range"] { flex: 1; min-width: 0; accent-color: var(--accent); }
.sv-size .icon-btn { width: 38px; height: 38px; flex: none; }
.sv-pct { min-width: 60px; height: 38px; border-radius: 10px; background: var(--fill); font-weight: 700; font-size: 15px; color: var(--label); }
.sv-place { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; }
.sv-ctl { display: flex; align-items: center; gap: 6px; }
.sv-ctl .icon-btn { width: 38px; height: 38px; flex: none; }
.sv-ctl .sv-pct { min-width: 52px; display: inline-flex; align-items: center; justify-content: center; }
.sv-lbl { font-size: 13px; font-weight: 600; color: var(--label-2); margin-right: 2px; }
.sv-orient { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.sv-orient .btn { flex: none; }
.sv-orient-msg { margin: 8px 4px 0; }
.sv-dims { flex: 1 1 150px; margin: 0 4px 0 auto; text-align: right; font-size: 13px; color: var(--label2); line-height: 1.35; }
.sv-dims .sv-over { display: block; }

/* Phones: the slice screen drops its explanations and packs the controls tighter */
@media (max-width: 520px) {
  #sl-edit .sl-explain { display: none; }
  #sl-edit .sv-orient .btn { width: 34px; height: 34px; padding: 0; justify-content: center; }
  #sl-edit .sv-orient .btn .bt { display: none; }
  #sl-edit .sv-orient .btn svg.i { margin: 0; }
  #sl-edit .sv-place { gap: 8px 10px; justify-content: space-between; }
  #sl-edit .sv-ctl { gap: 4px; }
  #sl-edit .sv-ctl .icon-btn { width: 34px; height: 34px; }
  #sl-edit .sv-ctl .sv-pct { min-width: 42px; height: 34px; font-size: 14px; }
  #sl-edit .sv-lbl { font-size: 12px; }
  #sl-edit .sv-place, #sl-edit .sv-orient { margin-top: 8px; }
  #sl-edit .group-h { margin-top: 16px; }
  #sl-edit .sl-main-opts { margin-top: 12px !important; }
  #sl-edit .map-row.one .map-from { display: none; }
  #sl-edit .map-row.one { padding: 10px; }
}
.setup-steps { list-style: none; margin: 4px 0 14px; padding: 0; display: grid; gap: 14px; }
.setup-steps li { display: flex; gap: 12px; align-items: flex-start; }
.setup-steps li.todo { opacity: 0.55; }
.setup-steps b { display: block; margin-top: 3px; }
.setup-steps .bar { margin-top: 8px; height: 8px; }
.setup-dot { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--fill); font-weight: 700; font-size: 14px; }
.setup-dot .i { width: 17px; height: 17px; }
.setup-steps li.done .setup-dot, .setup-dot.ok { background: var(--green); color: #fff; }
.setup-steps li.fail .setup-dot { background: var(--red); color: #fff; }
.setup-ok { margin-top: 4px; }
.sv-over { display: block; color: var(--red); font-weight: 600; margin-top: 2px; }
#sl-result { margin-top: 12px; }
.sr-status { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.sr-status b { display: block; }
.sr-layer { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.sr-layer input[type="range"] { flex: 1; min-width: 0; accent-color: var(--accent); }
.sr-layer span { flex: none; min-width: 112px; text-align: right; font-size: 13.5px; color: var(--label2); letter-spacing: 0; }
.sr-grams { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 12px; }
.sr-grams span { display: inline-flex; align-items: center; gap: 5px; }
.sr-grams .swatch { width: 12px; height: 12px; }
.sr-buttons { margin-top: 14px; }
.sl-fil { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--label2); letter-spacing: 0; }
.sl-fil span { flex: none; }
.sl-fil select { flex: 1; min-width: 0; height: 38px; padding: 0 10px; border: 0; border-radius: 10px; background: var(--fill); color: var(--label); font: inherit; font-size: 14px; }
.sl-more { margin-top: 6px; }
.sl-more summary.group-h { margin-top: 22px; }
.sl-range { flex-wrap: wrap; row-gap: 4px; }
.sl-range input[type="range"] { flex: 1 0 100%; accent-color: var(--accent); margin: 0 0 6px; }
.sl-step { display: flex; align-items: center; gap: 8px; flex: none; }
.sl-step .icon-btn { width: 34px; height: 34px; }
.sl-step b { min-width: 44px; text-align: center; font-size: 16px; }
.seg.seg-2l button small { font-size: 11.5px; font-weight: 500; opacity: 0.7; }

/* ---------- home ---------- */

.home-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.home-grid > div { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.home-grid .card + .card { margin-top: 0; }
@media (min-width: 1100px) {
  .home-grid { grid-template-columns: minmax(0, 1.55fr) minmax(330px, 1fr); align-items: start; }
}

/* camera */
.cam { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden; background: #0b0c0e; border: 7px solid var(--graphite); box-shadow: var(--shadow); color: #fff; isolation: isolate; user-select: none; -webkit-user-select: none; }
.cam-stage { position: absolute; inset: 0; touch-action: pan-y; cursor: zoom-in; }
.cam.zoomed .cam-stage { touch-action: none; cursor: grab; }
.cam-orient { position: absolute; inset: 0; }
.cam img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transform-origin: 0 0; will-change: transform; -webkit-user-drag: none; pointer-events: none; }
.cam-top, .cam-ctrl { position: absolute; display: flex; gap: 6px; align-items: center; z-index: 2; }
.cam-top { top: 12px; left: 12px; right: 12px; justify-content: space-between; pointer-events: none; }
.cam-ctrl { right: 10px; bottom: 10px; }
.glass { background: rgba(30, 30, 32, 0.55); backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%); color: #fff; border-radius: 99px; }
.cam-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; font-size: 12px; font-weight: 600; letter-spacing: 0; }
.cam-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: #ff453a; animation: beacon-red 2.4s ease-out infinite; transition: background 0.4s; }
@keyframes beacon-red { 0% { box-shadow: 0 0 0 0 rgba(255, 69, 58, 0.7); } 70%, 100% { box-shadow: 0 0 0 6px rgba(255, 69, 58, 0); } }
.cam-badge.stale .dot { background: #8e8e93; animation: none; }
.cam-ctrl button { width: 36px; height: 36px; display: grid; place-items: center; font-size: 13px; font-weight: 600; letter-spacing: 0; }
.cam-ctrl button svg.i { width: 18px; height: 18px; stroke-width: 2.2; }
.cam-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: rgba(255, 255, 255, 0.7); font-size: 15px; z-index: 1; }
.cam-empty svg.i { width: 34px; height: 34px; margin-bottom: 8px; opacity: 0.7; }
.cam-empty b { display: block; color: #fff; margin-bottom: 4px; }
.cam.full { position: fixed; inset: 0; z-index: 90; aspect-ratio: auto; border-radius: 0; border: 0; padding-top: var(--safe-t); }
.cam.full .cam-top { top: calc(12px + var(--safe-t)); }
.cam.full .cam-ctrl { bottom: calc(16px + var(--safe-b)); right: 16px; }
.cam.full .cam-ctrl button { width: 44px; height: 44px; }
.cam-hint { position: absolute; left: 12px; bottom: 12px; z-index: 2; font-size: 12px; padding: 5px 10px; opacity: 0; transition: opacity 0.3s; pointer-events: none; letter-spacing: 0; }
.cam.zoomed .cam-hint { opacity: 1; }

/* job */
.job-top { display: flex; gap: 14px; align-items: center; }
.thumb { width: 64px; height: 64px; border-radius: 14px; background: var(--card2); flex: none; object-fit: contain; display: grid; place-items: center; color: var(--label3); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb.lg { width: 100%; height: auto; aspect-ratio: 1; border-radius: 18px; }
.job-name { font-family: var(--display); font-size: 19px; font-weight: 700; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-meta { color: var(--label2); font-size: 14px; letter-spacing: 0; margin-top: 2px; }
.progress-wrap { margin: 18px 0 16px; }
.progress-nums { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.progress-nums .pct { font-family: var(--display); font-size: 42px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.progress-nums .pct small { font-size: 20px; font-weight: 600; color: var(--label2); margin-left: 1px; }
.progress-nums .eta { text-align: right; font-size: 15px; color: var(--label2); letter-spacing: 0; }
.progress-nums .eta b { display: block; color: var(--label); font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.bar { height: 10px; border-radius: 99px; background: var(--fill); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--tool, var(--signal)); transition: width 0.6s cubic-bezier(.2,.7,.3,1); }
.bar.paused > i { background: var(--orange); }
.job-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.stat { background: var(--card2); border-radius: 12px; padding: 9px 11px; min-width: 0; }
.stat span { display: block; font-size: 12px; color: var(--label2); letter-spacing: 0; }
.stat b { display: block; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { text-align: center; padding: 18px 8px 6px; }
.empty h3 { margin: 10px 0 4px; font-size: 19px; }
.empty p { margin: 0 auto 16px; color: var(--label2); font-size: 15px; max-width: 34ch; letter-spacing: 0; }
.empty .glyph { width: 56px; height: 56px; border-radius: 16px; display: inline-grid; place-items: center; background: var(--fill); color: var(--label2); }
.empty .glyph svg.i { width: 28px; height: 28px; }

/* toolheads — the signature */
.tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tool { --c: var(--label3); background: var(--card2); border-radius: 16px; padding: 10px 6px 9px; text-align: center; position: relative; min-width: 0; }
.tool .ring { width: 46px; height: 46px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--heat, 0) * 1%), color-mix(in srgb, var(--c) 18%, transparent) 0); position: relative; }
.tool .ring::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--card2); }
.tool .ring { box-shadow: inset 0 0 0 1px var(--sep); }
.tool .ring b { position: relative; z-index: 1; font-size: 13px; font-weight: 700; color: var(--label); letter-spacing: 0; }
.tool.empty .ring { background: repeating-linear-gradient(-45deg, var(--fill2) 0 3px, transparent 3px 6px); }
.tool .mat { margin-top: 5px; font-size: 12px; font-weight: 600; letter-spacing: 0; display: flex; justify-content: center; gap: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool .mat span { color: var(--label2); font-weight: 500; }
.tool.empty .mat { color: var(--red); }
.tool .mat.busy { color: var(--label); }
.swatch, .swatch-lg { flex: none; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18), 0 0 0 1px var(--sep); }
.swatch { width: 24px; height: 24px; }
.swatch-lg { width: 52px; height: 52px; }
.swatch.none, .swatch-lg.none { background: repeating-linear-gradient(-45deg, var(--fill2) 0 3px, transparent 3px 6px); }
.fil-head { display: flex; gap: 14px; align-items: center; background: var(--card); border-radius: 16px; padding: 14px; margin-bottom: 14px; }
.fil-head b { display: block; font-size: 18px; }
.fil-head span:not(.swatch-lg) { display: block; font-size: 14px; letter-spacing: 0; }
.fil-list .row + .row::before { left: 52px; }
.fil-row { padding-top: 0; padding-bottom: 0; padding-right: 8px; }
.fil-row-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; min-height: 48px; padding: 10px 0; text-align: left; color: inherit; background: none; border: 0; font: inherit; }
.fil-row-main:active { opacity: 0.7; }
.fil-edit-btn { flex: none; }
.fil-head .grow { flex: 1; min-width: 0; }
.fil-head-edit { flex: none; align-self: center; }
svg.i.inline-i { width: 14px; height: 14px; vertical-align: -2px; }
.fil-check { width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--label3); color: #fff; }
.fil-check.on { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.fil-check svg.i { width: 15px; height: 15px; stroke-width: 3; }
.fil-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 12px 2px; flex-wrap: wrap; }
.link-btn:disabled { opacity: 0.4; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--fill2); border-top-color: var(--label); animation: spin 0.8s linear infinite; flex: none; }
.tool .t { font-family: var(--display); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.tool .tg { font-size: 12px; color: var(--label2); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.tool.active { background: color-mix(in srgb, var(--c) 13%, var(--card2)); box-shadow: inset 0 0 0 2px var(--c); }
.tool .fil { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.tool .fil.out { background: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 25%, transparent); }
.chips { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 12px; background: var(--card2); font-size: 14px; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.chip .k { color: var(--label2); }

/* plate */
.plate { display: block; width: 100%; height: auto; max-height: 340px; touch-action: manipulation; }
.plate .bed { fill: var(--card2); }
.plate .gridl { stroke: var(--sep); stroke-width: 0.6; }
.plate .obj { fill: var(--fill2); stroke: var(--label2); stroke-width: 1.4; cursor: pointer; transition: fill 0.2s; }
.plate .obj:hover { fill: color-mix(in srgb, var(--red) 22%, transparent); stroke: var(--red); }
.plate .obj.cur { fill: color-mix(in srgb, var(--signal) 45%, transparent); stroke: var(--signal); stroke-width: 2.2; }
.plate .obj.ex { fill: var(--fill); stroke: var(--label3); stroke-dasharray: 3 3; cursor: default; }
.plate .lbl { font: 700 11px var(--font); fill: var(--label); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.plate .lbl-bg { fill: var(--card); pointer-events: none; }
.plate .ex-x { stroke: var(--label3); stroke-width: 1.5; pointer-events: none; }
.plate .nozzle { fill: var(--signal); stroke: var(--graphite); stroke-width: 1.5; transition: cx 0.9s linear, cy 0.9s linear; }
.obj-list { margin-top: 10px; }
.obj-list .row { min-height: 42px; padding: 8px 4px; }
.obj-list .row + .row::before { left: 40px; }
.obj-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--fill2); color: var(--label); flex: none; letter-spacing: 0; }
.obj-n.cur { background: var(--signal); color: #17181a; }
.obj-n.ex { background: var(--fill); color: var(--label3); }
.obj-list .ex .title { text-decoration: line-through; color: var(--label3); }

/* alerts */
.alert { border-radius: var(--r-lg); padding: 16px; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin-bottom: 14px; }
.alert .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; grid-row: span 2; }
.alert h3 { margin: 0; font-size: 17px; font-weight: 600; align-self: end; }
.alert p { margin: 0; font-size: 15px; color: var(--label2); letter-spacing: 0; }
.alert ul { grid-column: 2; margin: 8px 0 0; padding-left: 18px; font-size: 15px; letter-spacing: 0; }
.alert li { margin: 3px 0; }
.alert details { grid-column: 2; margin-top: 6px; font-size: 13px; color: var(--label2); }
.alert details pre { white-space: pre-wrap; word-break: break-word; font: 12px/1.45 var(--mono); background: var(--fill); padding: 8px 10px; border-radius: 8px; margin: 6px 0 0; color: var(--label); }
/* filament breakdown (Home → Filament) */
.fb-head { display: flex; flex-direction: column; gap: 10px; background: var(--card); border-radius: 16px; padding: 14px; margin-bottom: 14px; }
.fb-head b { font-size: 28px; font-weight: 700; }
.fb-head span { margin-left: 6px; color: var(--label2); font-size: 14px; }
.fb-row { align-items: flex-start; }
.fb-row > .swatch { margin-top: 2px; }
.fb-row .sub { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.fb-arrow { width: 13px; height: 13px; color: var(--label3); }
.swatch.fb-spool { width: 13px; height: 13px; }
.fb-share { height: 5px; margin-top: 8px; }
.fb-now { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--accent); color: var(--on-accent); vertical-align: 2px; margin-left: 4px; letter-spacing: 0; }
/* toolhead filament editor */
.fe-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fe-chips .chip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.fe-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 10px; }
.fe-color { aspect-ratio: 1; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18), 0 0 0 1px var(--sep); position: relative; display: grid; place-items: center; cursor: pointer; }
.fe-color[aria-pressed="true"] { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18), 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }
.fe-custom { background: var(--fill); color: var(--label2); }
.fe-custom input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.err-more { margin-top: 6px; font-size: 13px; color: var(--label2); }
.err-more summary { cursor: pointer; }
.err-more ul { margin: 6px 0 0; padding-left: 18px; }
.err-more pre { white-space: pre-wrap; word-break: break-word; font: 12px/1.45 var(--mono); background: var(--fill); padding: 8px 10px; border-radius: 8px; margin: 6px 0 0; color: var(--label); }
.alert .btn-row { grid-column: 2; margin-top: 12px; }
.alert.error { background: color-mix(in srgb, var(--red) 11%, var(--card)); }
.alert.error .ic { background: var(--red); }
.alert.warning { background: color-mix(in srgb, var(--orange) 13%, var(--card)); }
.alert.warning .ic { background: var(--orange); }
.alert.info { background: var(--card); }
.alert.info .ic { background: var(--label3); }

/* ---------- control ---------- */

.ctl-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.ctl-grid > div { min-width: 0; }
@media (min-width: 1000px) { .ctl-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } .ctl-grid > div { display: flex; flex-direction: column; gap: 14px; } .ctl-grid .card + .card { margin-top: 0; } }
.chart { width: 100%; height: 150px; display: block; margin-top: 4px; }
.chart path { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.chart path.tg { stroke-dasharray: 3 4; stroke-width: 1.2; opacity: 0.55; }
.chart .gl { stroke: var(--sep); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart text { font: 10px var(--font); fill: var(--label2); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--label2); margin-top: 6px; letter-spacing: 0; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }

.jog { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
.dpad { position: relative; width: 190px; height: 190px; margin: 0 auto; border-radius: 50%; background: var(--card2); }
.dpad button { position: absolute; width: 58px; height: 58px; display: grid; place-items: center; color: var(--label); border-radius: 50%; }
.dpad button:active { background: var(--fill2); }
.dpad .up { top: 4px; left: 66px; } .dpad .down { bottom: 4px; left: 66px; }
.dpad .left { left: 4px; top: 66px; } .dpad .right { right: 4px; top: 66px; }
.dpad .mid { top: 62px; left: 62px; width: 66px; height: 66px; background: var(--card); box-shadow: var(--shadow); color: var(--label); font-size: 13px; font-weight: 700; letter-spacing: 0; }
.zcol { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.zcol button { width: 58px; height: 58px; border-radius: 18px; background: var(--card2); display: grid; place-items: center; }
.zcol button:active { background: var(--fill2); }
.zcol span { font-size: 13px; font-weight: 600; color: var(--label2); }
.pos { display: flex; justify-content: space-around; margin: 14px 0 12px; font-variant-numeric: tabular-nums; }
.pos div { text-align: center; }
.pos span { display: block; font-size: 12px; color: var(--label2); }
.pos b { font-size: 17px; font-weight: 600; }
.lockout { position: relative; }
.lockout.locked > :not(.lock-msg) { opacity: 0.35; pointer-events: none; }
.lock-msg { display: none; }
.lockout.locked .lock-msg { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--label2); margin-bottom: 10px; letter-spacing: 0; }

.slider-row { padding: 10px 0; }
.slider-row + .slider-row { border-top: 0.5px solid var(--sep); }
.slider-row label { display: flex; justify-content: space-between; font-size: 15px; margin-bottom: 8px; }
.slider-row label b { font-variant-numeric: tabular-nums; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: linear-gradient(to right, var(--accent) var(--p, 50%), var(--fill2) var(--p, 50%)); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 99px; background: var(--fill2); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 99px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -11px; border-radius: 50%; background: #fff; box-shadow: 0 0.5px 4px rgba(0, 0, 0, 0.12), 0 6px 13px rgba(0, 0, 0, 0.12); }
input[type="range"]::-moz-range-thumb { width: 28px; height: 28px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 6px 13px rgba(0, 0, 0, 0.18); }

/* ---------- files ---------- */

.search { min-width: 0; display: flex; align-items: center; gap: 8px; background: var(--fill); border-radius: 11px; padding: 0 10px; height: 38px; color: var(--label2); flex: 1; }
.search svg.i { width: 18px; height: 18px; }
.search input { border: 0; background: none; outline: none; flex: 1; min-width: 0; font-size: 16px; color: var(--label); }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.file-row .thumb { width: 54px; height: 54px; border-radius: 12px; }
.file-row .title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row + .file-row::before { left: 82px !important; }
.recent { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 170px); gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.recent::-webkit-scrollbar { display: none; }
.recent .card { padding: 10px; text-align: left; margin-top: 0; }
.recent .thumb { width: 100%; height: auto; aspect-ratio: 1; margin-bottom: 8px; }
.recent .nm { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent .st { font-size: 12px; color: var(--label2); letter-spacing: 0; display: flex; gap: 5px; align-items: center; }
.recent .st i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
/* printer stats */
.stats-fold { margin-top: 14px; padding: 0; }
.stats-fold > summary { display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; list-style: none; font-family: var(--display); font-size: 17px; font-weight: 700; }
.stats-fold > summary::-webkit-details-marker { display: none; }
.stats-fold > summary .grow { flex: 1; }
.stats-fold > summary .sub { font-family: inherit; font-size: 13px; font-weight: 400; color: var(--label2); }
.stats-fold > summary svg.i { width: 16px; height: 16px; color: var(--label3); transition: transform 0.2s; }
.stats-fold[open] > summary svg.i { transform: rotate(90deg); }
.stats-body { padding: 0 16px 16px; }
.stat-totals { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 700px) { .stat-totals { grid-template-columns: repeat(4, 1fr); } }
.stat-q { display: block; text-align: left; cursor: pointer; color: inherit; font: inherit; width: 100%; }
.stat-q span { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--label2); letter-spacing: 0; }
.stat-q span svg.i { width: 12px; height: 12px; flex: none; color: var(--label3); }
.stat-q[aria-expanded="true"] span, .stat-q[aria-expanded="true"] span svg.i { color: var(--accent); }
.stat-tip { margin: 8px 0 0; padding: 9px 11px; border-radius: 10px; background: var(--fill); font-size: 13px; line-height: 1.4; letter-spacing: 0; }
.stat-tip p { margin: 0; }
.stat-tip-h { display: block; margin-top: 8px; }
.stat-tip ul { margin: 3px 0 0; padding-left: 18px; }
.stat-tip li + li { margin-top: 4px; }
.stat-tip a { display: flex; align-items: center; gap: 6px; margin-top: 8px; min-height: 24px; color: var(--accent); font-weight: 600; }
.stat-tip a svg.i { width: 15px; height: 15px; flex: none; }
.swap-h { margin: 18px 0 6px; font-size: 13px; color: var(--label2); letter-spacing: 0; }
.swap-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.swap-table th, .swap-table td { padding: 8px 0 8px 6px; text-align: right; border-top: 1px solid var(--sep); font-weight: 400; }
.swap-table thead th { border-top: 0; padding-top: 0; vertical-align: bottom; }
.swap-table thead .stat-q { text-align: right; }
.swap-table thead .stat-q span { justify-content: flex-end; line-height: 1.2; }
.swap-table th:first-child { padding-left: 0; text-align: left; white-space: nowrap; font-weight: 600; }
.swap-table tbody th i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; }
.swap-err { color: var(--accent); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; min-width: 32px; min-height: 28px; text-align: right; cursor: pointer; }
.swap-maint { margin-top: 14px; }
.swap-maint .stat-q { width: auto; }
.stat-log { margin-top: 14px; }
.stat-hint { margin: 8px 0 0; }
/* timelapses */
.files-seg { margin-bottom: 14px; }
.tl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.tl-grid .tl-card { padding: 0; margin-top: 0; overflow: hidden; text-align: left; display: flex; flex-direction: column; }
.tl-img { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; background: var(--card2); color: var(--label3); }
.tl-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tl-img svg.i { width: 30px; height: 30px; }
.tl-play { position: absolute; right: 8px; bottom: 8px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.5); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.tl-play svg.i { width: 14px; height: 14px; margin-left: 2px; }
.tl-card .nm { padding: 9px 11px 0; font-size: 14px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tl-card .st { padding: 3px 11px 11px; font-size: 12px; color: var(--label2); letter-spacing: 0; }
.tl-player { border-radius: 16px; overflow: hidden; background: #000; }
.tl-player video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.tl-start { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; background: #000; }
.tl-start img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tl-start:disabled img { opacity: 0.55; }
.tl-start .tl-play { right: 50%; bottom: 50%; width: 60px; height: 60px; transform: translate(50%, 50%); }
.tl-start .tl-play svg.i { width: 26px; height: 26px; margin-left: 3px; }
.tl-load { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.tl-load[hidden] { display: none; }
a.btn { text-decoration: none; }
a.btn .muted { font-weight: 500; font-size: 14px; color: inherit; opacity: 0.7; }
.recent .st i.cancelled, .recent .st i.error, .recent .st i.klippy_shutdown { background: var(--red); }
.upload-bar { margin-bottom: 14px; }
.drop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(0, 0, 0, 0.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.drop div { background: var(--card); border-radius: 24px; padding: 34px 40px; font-size: 19px; font-weight: 600; box-shadow: var(--sheet-shadow); border: 2px dashed var(--label3); }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.swatches { display: inline-flex; gap: 4px; vertical-align: middle; }
.swatches i { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 0.5px rgba(0,0,0,.25); }

/* ---------- tools ---------- */

.cmd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }
.cmd { background: var(--card); box-shadow: var(--shadow); border-radius: 18px; padding: 14px; text-align: left; display: flex; flex-direction: column; gap: 10px; min-height: 124px; position: relative; transition: transform 0.12s; }
.cmd:active { transform: scale(0.98); }
.cmd .row-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--graphite) !important; color: var(--on-graphite); }
.cmd b { font-size: 15px; font-weight: 600; display: block; }
.cmd span { font-size: 13px; color: var(--label2); letter-spacing: 0; line-height: 1.3; }
.cmd.running::after { content: ""; position: absolute; top: 16px; right: 16px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--fill2); border-top-color: var(--label); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.console { background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow); overflow: hidden; }
.console-log { height: 300px; overflow-y: auto; padding: 10px 14px; font: 12.5px/1.55 var(--mono); letter-spacing: 0; }
.console-log div { white-space: pre-wrap; word-break: break-word; }
.console-log .cmd-l { color: var(--label); font-weight: 600; }
.console-log .cmd-l::before { content: "› "; }
.console-log .err { color: var(--red); }
.console-log .t { color: var(--label3); margin-right: 8px; }
.console-in { display: flex; gap: 8px; border-top: 0.5px solid var(--sep); padding: 8px; }
.console-in input { flex: 1; border: 0; background: var(--fill); border-radius: 10px; padding: 0 12px; height: 38px; font: 14px var(--mono); outline: none; min-width: 0; }
.macro-list { max-height: 360px; overflow-y: auto; }
.mode-hero { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; margin-bottom: 14px; }
.mode-hero .row-icon { width: 46px; height: 46px; border-radius: 14px; }
.mode-hero .row-icon svg.i { width: 26px; height: 26px; }
.mode-hero h3 { margin: 0; font-size: 19px; }
.mode-hero p { margin: 2px 0 0; color: var(--label2); font-size: 14px; letter-spacing: 0; }
.limits { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin-top: 12px; }

/* ---------- sheets, toasts ---------- */

.scrim { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, 0.32); display: flex; align-items: flex-end; justify-content: center; animation: fade 0.22s ease; }
.scrim.closing { animation: fade 0.2s ease reverse forwards; }
@keyframes fade { from { opacity: 0; } }
.sheet { background: var(--bg); width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; border-radius: 14px 14px 0 0; padding: 8px 16px calc(20px + var(--safe-b)); box-shadow: var(--sheet-shadow); animation: up 0.34s cubic-bezier(.2,.9,.25,1); overscroll-behavior: contain; }
.scrim.closing .sheet { animation: up 0.22s ease-in reverse forwards; }
@keyframes up { from { transform: translateY(100%); } }
.grabber { width: 36px; height: 5px; border-radius: 9px; background: var(--fill2); margin: 0 auto 10px; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 14px; }
.sheet-h h2 { margin: 0; font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.sheet-h .close { width: 30px; height: 30px; border-radius: 50%; background: var(--fill); color: var(--label2); display: grid; place-items: center; }
.sheet-h .close svg.i { width: 15px; height: 15px; stroke-width: 2.6; }
.sheet p.lead { margin: 0 0 16px; color: var(--label2); font-size: 15px; letter-spacing: 0; }
.sheet .actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
@media (min-width: 700px) {
  .scrim { align-items: center; }
  .sheet { border-radius: 18px; padding: 16px 22px 22px; animation: pop 0.26s cubic-bezier(.2,.9,.25,1); }
  .scrim.closing .sheet { animation: pop 0.18s ease-in reverse forwards; }
  .grabber { display: none; }
}
@keyframes pop { from { transform: scale(0.94); opacity: 0; } }

.big-temp { text-align: center; margin: 4px 0 16px; }
.big-temp b { font-family: var(--display); font-size: 58px; font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.big-temp span { display: block; color: var(--label2); font-size: 15px; letter-spacing: 0; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 16px; }
.stepper button { width: 48px; height: 48px; border-radius: 50%; background: var(--fill); color: var(--label); display: grid; place-items: center; }
.stepper input { width: 120px; text-align: center; font-size: 28px; font-weight: 600; border: 0; background: var(--card); border-radius: 14px; height: 56px; font-variant-numeric: tabular-nums; outline: none; }
.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.presets button { height: 48px; border-radius: 12px; background: var(--card); font-weight: 600; font-size: 15px; letter-spacing: 0; }
.presets button small { display: block; font-size: 11px; font-weight: 500; color: var(--label2); }
.form .group { margin-bottom: 4px; }
textarea.code { width: 100%; min-height: 150px; border: 0; background: var(--card); border-radius: 12px; padding: 12px; font: 12.5px/1.5 var(--mono); letter-spacing: 0; resize: vertical; outline: none; }
pre.code { font: 12px/1.5 var(--mono); background: var(--card); border-radius: 12px; padding: 12px; overflow-x: auto; margin: 0; letter-spacing: 0; white-space: pre-wrap; }

.toasts { position: fixed; top: calc(10px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 420px); }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: center; padding: 11px 16px 11px 12px; border-radius: 99px; background: var(--raise); color: var(--label); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18), 0 0 0 0.5px var(--sep); font-size: 15px; font-weight: 500; animation: drop 0.4s cubic-bezier(.2,.9,.25,1.15); max-width: 100%; letter-spacing: 0; }
.toast.out { animation: drop 0.25s ease-in reverse forwards; }
.toast .ti { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: var(--on-graphite); background: var(--graphite2); flex: none; }
.toast .ti svg.i { width: 15px; height: 15px; stroke-width: 2.6; }
.toast.success .ti { background: var(--green); } .toast.error .ti { background: var(--red); } .toast.warning .ti { background: var(--orange); }
@keyframes drop { from { transform: translateY(-30px) scale(0.9); opacity: 0; } }

.conn-banner { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(92px + var(--safe-b)); z-index: 50; padding: 8px 14px; font-size: 13px; font-weight: 600; letter-spacing: 0; }
@media (min-width: 900px) { .conn-banner { bottom: 24px; } }

.ev-row .row-icon { width: 30px; height: 30px; border-radius: 50%; }
.ev-row .time { font-size: 12px; color: var(--label3); flex: none; align-self: flex-start; margin-top: 3px; letter-spacing: 0; }

/* login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login .card { width: min(100%, 360px); text-align: center; padding: 30px 22px 22px; }
.login img { width: 72px; height: 72px; border-radius: 18px; }
.login h1 { font-size: 24px; margin: 14px 0 4px; }
.login input { width: 100%; height: 48px; border-radius: 12px; border: 0; background: var(--fill); padding: 0 14px; margin: 18px 0 12px; outline: none; font-size: 17px; }

.demo-note { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); font-size: 14px; margin-bottom: 14px; letter-spacing: 0; }
.demo-note svg.i { color: var(--label2); }
.demo-note button { margin-left: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- floating camera (picture in picture) ---------- */
.pip-ui, .pip-prog { display: none; }
.cam.pip {
  --pip-w: min(46vw, 210px);
  --pip-x: 12px;
  --pip-top: calc(var(--safe-t) + 12px);
  --pip-bottom: calc(82px + var(--safe-b));
  position: fixed; z-index: 45; width: var(--pip-w); aspect-ratio: 16 / 9; border-radius: 14px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.32), 0 0 0 0.5px rgba(255, 255, 255, 0.12);
  cursor: grab; touch-action: none;
  transition: top 0.32s cubic-bezier(.2,.9,.25,1), bottom 0.32s cubic-bezier(.2,.9,.25,1), left 0.32s cubic-bezier(.2,.9,.25,1), right 0.32s cubic-bezier(.2,.9,.25,1), width 0.28s cubic-bezier(.2,.9,.25,1);
}
.cam.pip.pip-lg { --pip-w: min(72vw, 340px); }
.cam.pip.pip-drag { transition: none; cursor: grabbing; }
.cam.pip.pip-in { animation: pip-in 0.34s cubic-bezier(.2,.9,.25,1); }
@keyframes pip-in { from { opacity: 0; transform: scale(0.85); } }
.cam.pip-tl { top: var(--pip-top); left: var(--pip-x); }
.cam.pip-tr { top: var(--pip-top); right: var(--pip-x); }
.cam.pip-bl { bottom: var(--pip-bottom); left: var(--pip-x); }
.cam.pip-br { bottom: var(--pip-bottom); right: var(--pip-x); }
.cam.pip { border-width: 4px; }
.cam.pip .cam-stage { cursor: inherit; touch-action: none; }
.cam.pip .cam-ctrl, .cam.pip .cam-hint, .cam.pip #cam-info { display: none; }
.cam.pip .cam-top { top: 7px; left: 7px; right: auto; }
.cam.pip .cam-badge { padding: 3px 7px; font-size: 10px; }
.cam.pip .cam-empty { font-size: 11px; padding: 8px; }
.cam.pip .cam-empty svg.i { width: 20px; height: 20px; margin-bottom: 2px; }
.cam.pip .pip-ui { display: flex; gap: 5px; position: absolute; top: 6px; right: 6px; z-index: 3; }
.cam.pip .pip-ui button { width: 28px; height: 28px; display: grid; place-items: center; }
.cam.pip .pip-ui svg.i { width: 14px; height: 14px; stroke-width: 2.4; }
.cam.pip .pip-prog { display: block; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, 0.18); z-index: 3; }
.cam.pip .pip-prog[hidden] { display: none; }
.cam.pip .pip-prog i { display: block; height: 100%; background: var(--signal); transition: width 0.6s; }
.cam.pip .pip-prog.paused i { background: #ff9f0a; }
@media (min-width: 900px) {
  .cam.pip { --pip-w: 320px; --pip-x: 24px; --pip-top: 24px; --pip-bottom: 24px; }
  .cam.pip.pip-lg { --pip-w: 480px; }
  .cam.pip-tl, .cam.pip-bl { left: calc(250px + var(--pip-x)); }
}
@media (prefers-reduced-motion: reduce) { .cam.pip { transition: none; } }

/* ---------- alerts on every tab, decoded error codes ---------- */
.alerts { display: flex; flex-direction: column; gap: 12px; }
.alerts:not(:empty) { margin-bottom: 14px; }
.alerts .alert { margin-bottom: 0; }
.alert > :not(.ic) { grid-column: 2; min-width: 0; }
.alert > .ic { grid-row: 1 / span 2; }
.alert .code-line { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 2px 0 4px; font-size: 13px; color: var(--label2); letter-spacing: 0; }
.code-chip { font: 600 13px/1 var(--mono); letter-spacing: 0.02em; padding: 5px 8px; border-radius: 7px; background: var(--graphite); color: var(--on-graphite); cursor: copy; white-space: nowrap; }
.code-chip.sm { display: inline-block; font-size: 11.5px; padding: 3px 6px; margin: 3px 0 2px; cursor: inherit; }
.glossary { margin-top: 12px; padding: 0; }
.glossary summary { padding: 13px 16px; font-size: 15px; font-weight: 600; cursor: pointer; }
.glossary dl { margin: 0; padding: 0 16px 6px; }
.glossary dl > div { padding: 10px 0; border-top: 1px solid var(--sep); }
.glossary dt { font-size: 13px; color: var(--label2); letter-spacing: 0; }
.glossary dd { margin: 2px 0 0; display: flex; flex-direction: column; gap: 2px; }
.glossary dd b { font-size: 15px; font-weight: 600; }
.glossary dd span { font-size: 13px; color: var(--label2); letter-spacing: 0; line-height: 1.4; }
.alert .wiki-links { grid-column: 2; display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.alert .wiki-link { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 11px; background: var(--fill); color: var(--label); text-decoration: none; min-width: 0; }
.alert .wiki-link:active { background: var(--fill2); }
.alert .wiki-link svg { width: 18px; height: 18px; flex: none; color: var(--link); }
.alert .wiki-link span { display: flex; flex-direction: column; min-width: 0; }
.alert .wiki-link b { font-size: 14px; font-weight: 600; color: var(--link); }
.alert .wiki-link small { font-size: 12.5px; color: var(--label2); letter-spacing: 0; line-height: 1.3; }
.alert .wiki-link.also b { color: var(--label); }
.lookup { display: flex; flex-direction: column; gap: 10px; }
.lookup-row { display: flex; gap: 8px; }
.lookup-row input { flex: 1; min-width: 0; height: 40px; border: 0; border-radius: 10px; background: var(--fill); padding: 0 12px; font: 15px var(--mono); letter-spacing: 0.02em; outline: none; color: var(--label); }
.lookup .alert { margin: 4px 0 0; }
.ev-row.with-icon { text-align: left; }


/* =================================================================
   Snapmaker yellow, used the standard way:
   primary actions, the current selection, progress, and feedback when you touch something.
   Text on yellow is always graphite.
   ================================================================= */

/* the brand mark: the yellow fan on the carriage */
.brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.brand-row b { margin-bottom: 0 !important; }
.brand-mark { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--card); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.brand-mark::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.12); }

/* primary buttons */
.btn.primary { background: var(--accent); color: var(--on-accent); font-weight: 700; box-shadow: 0 1px 0 rgba(0,0,0,.06), inset 0 -2px 0 rgba(0,0,0,.08); }
.btn.primary:active { background: var(--accent-press); }
.btn.primary:disabled { background: color-mix(in srgb, var(--accent) 45%, var(--fill2)); opacity: 0.7; }

/* navigation: the active place is yellow, like the button on the dark rail */
.tab[aria-current="page"] { color: var(--accent); }
.tab[aria-current="page"]::after { background: var(--accent); width: 18px; height: 3px; border-radius: 3px; bottom: 0; z-index: 2; }
@media (min-width: 900px) {
  .nav[aria-current="page"] { background: var(--graphite2); color: var(--on-graphite); box-shadow: inset 3px 0 0 var(--accent); }
  .nav[aria-current="page"] svg.i { color: var(--accent); }
  .nav[aria-current="page"]::after { display: none; }
}

/* selections */
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); font-weight: 700; box-shadow: 0 2px 6px color-mix(in srgb, var(--accent) 35%, transparent); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { background: #fff; }
.fil-check.on { background: var(--accent); color: var(--on-accent); }
.tool.active { box-shadow: inset 0 0 0 2px var(--accent); }
.stepper button { color: var(--label); }
.presets button:active { background: var(--accent); color: var(--on-accent); }
input[type="range"]::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--accent), 0 4px 10px rgba(0, 0, 0, 0.18); }
input[type="range"]::-moz-range-thumb { box-shadow: 0 0 0 3px var(--accent), 0 4px 10px rgba(0, 0, 0, 0.18); }

/* progress and activity */
.bar > i { background: var(--accent); }
.bar.paused > i { background: var(--orange); }
.spin, .cmd.running::after { border-top-color: var(--accent); }
.cmd.running { box-shadow: var(--shadow), inset 0 0 0 2px var(--accent); }
.mode-hero .row-icon { background: var(--accent) !important; color: var(--on-accent) !important; }
.link-btn, .alert .wiki-link, .section-h .link { text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

/* ---------- touch feedback: a yellow ripple from where you tap ---------- */
.fx { position: relative; overflow: hidden; isolation: isolate; }
.ripple { position: absolute; border-radius: 50%; pointer-events: none; z-index: 0; transform: translate(-50%, -50%) scale(0); background: radial-gradient(circle, color-mix(in srgb, var(--accent) 55%, transparent) 0%, color-mix(in srgb, var(--accent) 22%, transparent) 55%, transparent 70%); animation: ripple 0.55s cubic-bezier(.2,.7,.3,1) forwards; }
.btn.primary .ripple { background: radial-gradient(circle, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.15) 55%, transparent 70%); }
@keyframes ripple { to { transform: translate(-50%, -50%) scale(1); opacity: 0; } }
.fx > :not(.ripple):not(.badge) { position: relative; z-index: 1; }
.fx > .badge { z-index: 2; }

/* selections confirm with a yellow ring that settles */
.ring-pulse { animation: ring-pulse 0.5s ease-out; }
@keyframes ring-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 80%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }

/* ---------- hover (mouse and trackpad only) ---------- */
@media (hover: hover) and (pointer: fine) {
  .btn, .cmd, .tool, .recent .card, .chip, .icon-btn, .seg button, button.row, .presets button, .obj-list .row { transition: box-shadow 0.18s, background-color 0.18s, transform 0.12s, color 0.18s; }
  .btn:hover:not(:disabled) { box-shadow: inset 0 0 0 2px var(--accent); }
  .btn.primary:hover:not(:disabled) { background: var(--accent-press); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent); }
  .btn.danger:hover, .btn.solid-danger:hover { box-shadow: inset 0 0 0 2px var(--red); }
  .cmd[aria-disabled]:hover { box-shadow: var(--shadow); transform: none; cursor: not-allowed; }
  .cmd:not([aria-disabled]):hover, .tool:hover, .recent .card:hover, .presets button:hover { box-shadow: var(--shadow), 0 0 0 2px var(--accent); transform: translateY(-1px); }
  .tool.active:hover { box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 2px var(--accent); }
  .icon-btn:hover, .chip:hover { box-shadow: 0 0 0 2px var(--accent); }
  .seg button:not([aria-pressed="true"]):hover { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 70%, transparent); }
  button.row:hover, .obj-list button.row:hover { background: color-mix(in srgb, var(--accent) 9%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
  .tab:hover, .nav:hover svg.i { color: var(--accent); }
  .plate g[data-act]:hover .obj { stroke-width: 2.4; }
}

/* camera overlays: solid instead of blurred glass, so they never shimmer over the moving picture */
.cam .glass { background: rgba(18, 19, 21, 0.72); backdrop-filter: none; -webkit-backdrop-filter: none; }
.cam-ctrl button:hover { box-shadow: 0 0 0 2px var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .ripple, .ring-pulse, .pill.blue::before, .cam-badge .dot { animation: none !important; }
}

/* speed tile is a button */
.stat-btn { text-align: left; cursor: pointer; position: relative; }
.stat-btn span { display: flex; align-items: center; justify-content: space-between; }
.stat-btn .stat-chev { width: 13px; height: 13px; stroke-width: 2.6; color: var(--label3); }
.stat-flag { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); vertical-align: 2px; margin-left: 2px; }
.presets button.on { background: var(--accent); color: var(--on-accent); }
.presets button.on small { color: inherit; opacity: 0.75; }

/* colours in this print; the one printing now has a slowly turning yellow ring */
.print-swatches { display: flex; gap: 5px; margin-top: 6px; flex-wrap: wrap; }
.ps { position: relative; width: 20px; height: 20px; display: grid; place-items: center; flex: none; }
.ps-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18), 0 0 0 1px var(--sep); }
.ps.on .ps-dot { width: 12px; height: 12px; }
.ps-ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(var(--accent) 0 62%, transparent 62% 100%); -webkit-mask: radial-gradient(circle, transparent 7.5px, #000 8px); mask: radial-gradient(circle, transparent 7.5px, #000 8px); animation: ps-spin 4s linear infinite; }
@keyframes ps-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ps-ring { animation: none; background: var(--accent); } }
.stat-btn { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; }
/* inside the Filament stat button, `.stat-btn span` would make each swatch a space-between flex row and push the dot off-centre */
.stat .print-swatches .ps { display: grid; place-content: center; font-size: 0; }
.ps-dot, .ps-ring { display: block; }

/* ---------- speed note ---------- */
.speed-note { margin: 12px 4px 0; font-size: 13px; color: var(--label2); letter-spacing: 0; line-height: 1.4; }
.speed-note.warn { color: var(--label); background: color-mix(in srgb, var(--orange) 14%, var(--card)); padding: 10px 12px; border-radius: 12px; }

/* ---------- speed modes: locked while printing, explained, acknowledged ---------- */
.seg.locked { opacity: 0.55; }
.seg button:disabled { cursor: not-allowed; }
.mode-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 10px 2px 0; flex-wrap: wrap; }
.mode-foot .muted { display: inline-flex; align-items: center; gap: 6px; }
.mode-foot svg.i { width: 15px; height: 15px; }
.link-btn.small { font-size: 14px; }
.cmp { overflow-x: auto; background: var(--card); border-radius: 14px; }
.cmp table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.cmp th, .cmp td { padding: 10px 12px; text-align: right; border-bottom: 0.5px solid var(--sep); white-space: nowrap; }
.cmp th:first-child { text-align: left; font-weight: 500; color: var(--label2); }
.cmp thead th { font-size: 12px; color: var(--label2); font-weight: 600; }
.cmp tbody tr:last-child th, .cmp tbody tr:last-child td { border-bottom: 0; }
.cmp tr.changed td:last-child { font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.what-list { margin: 14px 0 0; padding-left: 18px; font-size: 14px; line-height: 1.45; letter-spacing: 0; color: var(--label2); }
.what-list li { margin: 6px 0; }
.what-list b { color: var(--label); }
.what-list code { font: 12.5px var(--mono); }
.risk { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: color-mix(in srgb, var(--orange) 12%, var(--card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--orange) 35%, transparent); font-size: 13.5px; line-height: 1.45; letter-spacing: 0; cursor: pointer; margin-top: 4px; }
.risk input { width: 22px; height: 22px; flex: none; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; }
.risk b { display: block; margin-top: 6px; font-size: 14px; }

/* ---------- colour mapping at print start ---------- */
.map-list { display: flex; flex-direction: column; gap: 10px; }
.map-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; background: var(--card); border-radius: 16px; padding: 12px; }
.map-from { display: flex; gap: 10px; align-items: center; min-width: 0; }
.map-from b { display: block; font-size: 15px; }
.map-from span:not(.swatch) { display: block; font-size: 12.5px; color: var(--label2); letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-from .swatch { width: 30px; height: 30px; }
.map-arrow { color: var(--label3); }
.map-arrow svg.i { width: 18px; height: 18px; }
.map-to { display: flex; gap: 6px; }
.map-tool { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 5px 4px; border-radius: 12px; background: var(--card2); min-width: 44px; transition: box-shadow 0.15s, background 0.15s; }
.map-tool small { font-size: 11px; font-weight: 700; color: var(--label2); letter-spacing: 0; }
.map-tool.on { background: color-mix(in srgb, var(--accent) 22%, var(--card)); box-shadow: inset 0 0 0 2px var(--accent); }
.map-tool.on small { color: var(--label); }
.map-tool.empty .swatch { opacity: 0.6; }
.map-warn { display: flex; gap: 10px; margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--orange) 13%, var(--card)); font-size: 13.5px; line-height: 1.4; letter-spacing: 0; }
.map-warn svg.i { color: var(--orange); width: 20px; height: 20px; flex: none; }
.map-warn ul { margin: 0; padding-left: 16px; }
.print-opt-sub { white-space: normal; line-height: 1.35; }
.print-prefs summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; }
.print-prefs summary::-webkit-details-marker { display: none; }
.print-prefs summary svg.i { width: 15px; height: 15px; transition: transform 0.2s; }
.print-prefs[open] summary svg.i { transform: rotate(90deg); }
@media (max-width: 520px) {
  .map-row { grid-template-columns: 1fr; gap: 8px; }
  .map-arrow { display: none; }
  .map-to { justify-content: space-between; }
  .map-tool { flex: 1; }
}
@media (hover: hover) and (pointer: fine) { .map-tool:hover { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 70%, transparent); } }
.cmp table { table-layout: auto; }
.cmp th, .cmp td { padding: 9px 10px; }
.cmp tbody th { white-space: normal; line-height: 1.25; }
@media (max-width: 520px) { .cmp table { font-size: 13px; } .cmp th, .cmp td { padding: 8px 8px; } }

/* Chamber (top cover) */
.chamber-modes button { font-size: 13px; padding: 0 4px; white-space: nowrap; }
.chamber-modes button:disabled { opacity: 0.4; }
.chamber-fans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--sep); }
.chamber-fans > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chamber-fans > div:nth-child(3) { grid-column: 1 / -1; flex-direction: row; align-items: baseline; gap: 8px; }
.chamber-fans span { font-size: 12.5px; color: var(--label2); }
.chamber-fans > div:nth-child(3) span { flex: 1; }
.chamber-fans b { font-size: 16px; font-weight: 600; }
.chamber-fans small { font-size: 12px; font-weight: 500; color: var(--label2); }

/* Jog: arrows at the edge of travel, or before homing, are greyed out */
.dpad button:disabled, .zcol button:disabled { color: var(--label3); opacity: 0.45; cursor: not-allowed; }
.dpad button:disabled:active, .zcol button:disabled:active { background: transparent; }
.zcol button:disabled:active { background: var(--card2); }
.jog-hint { min-height: 18px; margin: 10px 2px 0; text-align: center; font-size: 13px; color: var(--label2); }
.jog-hint:empty { display: none; }

/* Home: what the printer unloads when the print finishes */
.job-foot { margin: 10px 2px 0; font-size: 13px; color: var(--label2); line-height: 1.4; }

/* Tools: macros with what each does */
.macro-list { max-height: 560px; }
.macro-row { align-items: center; }
.macro-row .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.macro-name { font: 14px var(--mono); letter-spacing: 0; overflow-wrap: anywhere; }
.macro-row .sub { white-space: normal; line-height: 1.35; }
.macro-caution { color: var(--orange, #ff9500); }
.macro-inside summary { list-style: none; cursor: pointer; }
.macro-inside summary::-webkit-details-marker { display: none; }
.macro-inside[open] summary .chev { transform: rotate(90deg); }
