:root {
  color-scheme: dark;
  --bg: #07080c;
  --bg-2: #10131a;
  --panel: #141821;
  --line: #262b36;
  --muted: #93a0b3;
  --ink: #f3f6fb;
  --mint: #8eebc8;
  --red: #ff9b96;
  --amber: #f0c56e;
  --brass: #8eebc8;
  --felt: #07080c;
  --studio: hub11;
  --serif: "Instrument Serif", Palatino, "Times New Roman", serif;
  --sans: "Instrument Sans", "Avenir Next", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-family: var(--sans);
  font-size: 15px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; overflow-x: clip; overflow-y: auto; }
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  overflow-x: clip;
  overflow-y: auto;
}
body:before {
  content: "";
  position: fixed;
  inset: -22%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(84vw 60vh at 16% 20%, color-mix(in srgb, var(--p0-c, #8eebc8) 40%, transparent), transparent 64%),
    radial-gradient(84vw 58vh at 84% 16%, color-mix(in srgb, var(--p1-c, #7aa2ff) 36%, transparent), transparent 64%),
    radial-gradient(70vw 48vh at 50% 88%, color-mix(in srgb, var(--p2-c, transparent) 28%, transparent), transparent 70%);
  animation: drift 32s ease-in-out infinite;
}
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { touch-action: manipulation; }
button {
  cursor: pointer;
  border: 1px solid #2d3544;
  background: #1b2130;
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 15px;
  min-height: 44px;
  font-weight: 500;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
button:hover:enabled { background: #262d3d; }
button:active:enabled { transform: translateY(1px); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
a { color: var(--brass); text-underline-offset: 4px; }
a:hover { color: #fff; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}
.quiet { background: transparent; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

.skip { position: absolute; top: -50px; }
.skip:focus { top: 4px; left: 4px; z-index: 30; background: #111; padding: 12px; }

h1, h2, h3, p { margin-top: 0; }
h1, h2, .identity strong { font-family: var(--serif); font-weight: 400; }
h1 { font-size: clamp(2.1rem, 4vw, 3.4rem); letter-spacing: -0.035em; line-height: 0.95; margin-bottom: 0; }
h2 { font-size: 1.7rem; letter-spacing: -0.03em; margin-bottom: 0; }
h3 { font-size: 16px; line-height: 1.3; margin: 0; }
.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.22em;
  font-size: 10px;
  color: var(--brass);
  font-weight: 500;
  font-family: var(--mono);
}

.masthead {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 20px;
  padding: 10px 40px 0;
  border-bottom: 0;
  background: transparent;
}
.identity { display: flex; align-items: center; gap: 10px; }
.identity strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 1.15rem; letter-spacing: -0.03em; }
.identity span:not(.brand-mark) { font-size: 9px; color: var(--muted); letter-spacing: 0.18em; font-family: var(--mono); }
.brand-mark { color: var(--brass); width: 28px; height: 28px; display: grid; place-items: center; }
.brand-mark img { width: 28px; height: 28px; display: block; }
nav { display: flex; gap: 16px; margin-left: auto; }
nav a {
  color: #8b97a8;
  text-decoration: none;
  font-size: 11px;
  position: relative;
}
nav a[aria-current="page"] { color: var(--ink); }
nav a:hover, nav a:focus-visible { color: var(--ink); }
nav a[aria-current="page"]::after { content: none; }
.connection {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #8b97a8;
  border: 0;
  padding: 0;
  white-space: nowrap;
  font-family: var(--mono);
}
.connection:before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 1px;
}
.connection[data-state="online"] { animation: live 2.8s ease-in-out infinite; }
.connection[data-state="offline"] { color: var(--amber); animation: none; }

.stop-strip {
  margin: 0 0 0 auto;
  background: transparent;
  border: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.7;
}
.stop-strip:hover, .stop-strip:focus-within { opacity: 1; }
.stop-strip > div:first-child { display: none; }
.stop-buttons { display: flex; gap: 4px; }
.stop-buttons button {
  background: transparent;
  border: 0;
  color: #c4a8a4;
  min-height: 28px;
  padding: 0 6px;
  font-size: 10px;
}
.stop-buttons button:last-child { background: transparent; color: #ff9b96; border: 0; }
.stop-buttons button:hover:enabled { background: transparent; color: #fff; }
.strip-actions { display: flex; align-items: center; gap: 6px; }
#focus-toggle { font-size: 10px; padding: 0 6px; min-height: 28px; white-space: nowrap; border: 0; }

main { max-width: 1760px; padding: 4px 40px 0; margin: auto; }
section { margin-bottom: 64px; }
#printers > .section-heading { margin-bottom: 10px; align-items: baseline; }
#fleet-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.fleet-tools { opacity: 1; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 22px; }
.summary { font-size: 13px; color: var(--muted); text-align: right; font-family: var(--mono); opacity: 0.7; }
.notice { font-size: 12px; color: var(--muted); border-left: 2px solid #3a4658; padding: 6px 12px; margin-bottom: 18px; }
.notice[data-warning="true"] { border-color: var(--amber); color: var(--amber); }
#service-message:not([data-warning="true"]) { display: none; }
.fleet-tools { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.focus-spoolman { display: none; font-size: 12px; }

.printer-grid, .workspace-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 28px; }
.printer.skeleton { pointer-events: none; }
.skel-line, .skel-camera, .skel-slot {
  background: linear-gradient(90deg, #1a2030, #2a3344, #1a2030);
  background-size: 200% 100%;
  animation: sheen 1.6s linear infinite;
  border-radius: 6px;
}
.skel-line { height: 14px; width: 42%; margin: 6px 0; }
.skel-camera { aspect-ratio: 16 / 9.2; width: 100%; }
.skel-slot { height: 48px; }
.printer, .printer-body, .job-more, .cfs-more, .cfs-stack, .slots { min-width: 0; }
.printer, .panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
  animation: rise 0.7s ease both;
}
.printer { animation-delay: calc(var(--i, 0) * 0.1s); }
.printer .eyebrow { display: none; }
.printer-address { opacity: 0.55; }
.printer[data-phase="printing"] { box-shadow: none; }
.printer[data-phase="printing"] .camera {
  box-shadow: 0 28px 70px color-mix(in srgb, var(--job-c, var(--brass)) 28%, #0008);
}
.printer-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 2px 12px; position: relative; }
.printer-head h2 { font-size: 1.7rem; letter-spacing: -0.03em; }
.printer-address { font-size: 11px; color: var(--muted); text-decoration: none; font-family: var(--mono); }
.badge, .tag {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mint);
  white-space: nowrap;
  font-family: var(--mono);
}
.printer-head .badge { opacity: 0.7; }
.badge[data-state="printing"] { animation: live 2.4s ease-in-out infinite; }
.badge[data-state="stale"], .badge[data-state="error"], .badge[data-state="unknown"],
.badge[data-state="disconnected"], .badge[data-state="unavailable"] { color: var(--amber); background: transparent; }
.badge[data-state="shutdown"] { color: var(--red); background: transparent; }

.camera {
  aspect-ratio: 16 / 9.2;
  background:
    radial-gradient(circle at 50% 58%, color-mix(in srgb, var(--job-c, #1a2230) 22%, #10141c), #07080c);
  position: relative;
  overflow: hidden;
  border-radius: 6px;
}
.camera video:not([controls])::-webkit-media-controls-enclosure { display: none !important; }
.camera:not([data-live="true"]) video:not([controls]) { opacity: 0; }
.camera::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--job-c, #8eebc8) 35%, transparent);
}
.camera video { width: 100%; height: 100%; display: block; object-fit: cover; }
.camera-overlay {
  position: absolute; left: 14px; top: 14px;
  font-size: 10px;
  letter-spacing: 0.14em;
  font-family: var(--mono);
  text-transform: uppercase;
  background: none;
  padding: 0;
  pointer-events: none;
  color: #c5d0df;
}
.camera-hint { display: none; }
.camera:not([data-live="true"]) .camera-overlay {
  background: none;
  opacity: 0.4;
  letter-spacing: 0.16em;
}
.camera[data-live="true"] .camera-overlay { color: var(--mint); }
.camera[data-live="true"] .camera-overlay::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px; margin-right: 7px;
  border-radius: 50%;
  background: #ff5a4a;
  box-shadow: 0 0 0 0 #ff5a4a;
  animation: rec 1.6s ease-out infinite;
  vertical-align: 1px;
}
.camera-hint { display: none; }
.camera-expand { position: absolute; right: 12px; top: 12px; min-height: 28px; padding: 0 8px; font-size: 14px; background: #111920b8; border: 0; opacity: 0.55; }
.camera-hud {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 36px 16px 14px;
  background: linear-gradient(180deg, transparent, #07080cf2);
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "temps pct" "bar bar";
  gap: 8px 16px;
  align-items: end;
  pointer-events: none;
}
.camera-hud .percentage { grid-area: pct; font-size: 34px; line-height: 0.9; }
.camera-hud .progress { grid-area: bar; margin: 0; }
.camera-hud .temperatures { grid-area: temps; margin: 0; opacity: 0.95; }
.printer[data-job="no"] .camera-hud { grid-template-areas: "temps temps" "bar bar"; }
.printer[data-job="no"] .camera-hud .percentage,
.printer[data-job="no"] .camera-hud .progress { visibility: hidden; }

.printer-body { padding: 16px 2px 8px; display: flex; flex-direction: column; gap: 12px; }
.job-row { display: flex; gap: 15px; align-items: center; justify-content: space-between; }
.job-more { border: 0; }
.job-more > summary {
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  color: #c5d0df;
  min-height: 36px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #1a1e27;
}
.job-more > summary::-webkit-details-marker { display: none; }
.job-more > summary:after { content: "+"; margin-left: 8px; color: var(--brass); }
.job-more[open] > summary:after { content: "−"; }
.job-more[open]:has(.job-preview:not([hidden])) { display: grid; grid-template-columns: minmax(96px, 28%) 1fr; gap: 4px 16px; align-items: start; }
.job-more > summary { grid-column: 1 / -1; }
.job-more a { display: inline-flex; min-height: 36px; align-items: center; font-size: 12px; }
.job-preview { display: block; width: 100%; max-width: 160px; aspect-ratio: 1; object-fit: contain; border-radius: 6px; margin: 8px 0 4px; background: #10141c; grid-column: 1; grid-row: 2 / 6; }
.job-preview[hidden] { display: none !important; }
.job-object { font-family: var(--serif); font-size: 1.15rem; margin: 8px 0 6px; }
.job-object-meta { margin: 0 0 8px; font-size: 12px; color: #c5d0df; font-family: var(--mono); }
.job-more[open]:has(.job-preview:not([hidden])) .job-object,
.job-more[open]:has(.job-preview:not([hidden])) .job-object-meta,
.job-more[open]:has(.job-preview:not([hidden])) .filename,
.job-more[open]:has(.job-preview:not([hidden])) .job-details,
.job-more[open]:has(.job-preview:not([hidden])) a { grid-column: 2; }
.filename { font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; min-width: 0; margin-bottom: 7px; color: #8b97a8; font-family: var(--mono); }
.percentage { font-size: 28px; font-variant-numeric: tabular-nums; letter-spacing: -0.05em; white-space: nowrap; font-family: var(--serif); }
.progress { height: 4px; background: #1d2330; overflow: hidden; margin: 7px 0 10px; border-radius: 999px; }
.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--job-c, var(--brass)) 70%, #d7fff0), color-mix(in srgb, var(--job-c, var(--brass)) 42%, #fff));
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}
.printer[data-phase="printing"] .progress-fill::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, #fff6, transparent);
  animation: shimmer 2.8s linear infinite;
}
.job-details { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; font-family: var(--mono); min-width: 0; flex-wrap: wrap; }
.temperatures { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; margin: 0; padding-bottom: 0; border-bottom: 0; }
.temperature span { display: block; color: var(--muted); font-size: 9px; margin-bottom: 3px; letter-spacing: 0.08em; text-transform: uppercase; }
.temperature strong { font-size: 17px; font-weight: 400; letter-spacing: -0.04em; font-family: var(--serif); }
.temperature small { font-size: 11px; color: var(--muted); margin-left: 4px; }
.temperature[data-stale="true"] strong { color: var(--amber); }

.cfs-more { border: 0; }
.cfs-more > summary {
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  color: #c5d0df;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #1a1e27;
}
.cfs-more > summary::-webkit-details-marker { display: none; }
.cfs-more > summary:after { content: "+"; margin-left: auto; color: var(--brass); }
.cfs-more[open] > summary:after { content: "−"; }
.cfs-more[open] .cfs-dots { display: none; }
.cfs-more:not([open]) .cfs-label { color: var(--muted); font-size: 11px; font-family: var(--mono); letter-spacing: 0.08em; }
.cfs-dots { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.cfs-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid #ffffff55;
  box-shadow: inset 0 0 0 1px #0005;
  flex: 0 0 auto;
}
.cfs-dot[data-active="true"] { box-shadow: 0 0 0 2px color-mix(in srgb, var(--mint) 70%, transparent), inset 0 0 0 1px #0005; }
.cfs-stack { display: grid; gap: 14px; padding-top: 10px; }
.cfs-head { display: flex; justify-content: space-between; align-items: center; font-size: 10px; margin: 0 0 8px; font-family: var(--mono); letter-spacing: 0.08em; opacity: 0.55; }
.cfs-head span { color: var(--muted); font-size: 10px; }
.slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.slot {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "top remain" "mat remain" "map remain" "bar bar";
  align-items: center;
  gap: 2px 8px;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  min-height: 0;
  background: #10141c;
  color: var(--ink);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  box-shadow: none;
  text-align: left;
  transition: transform 0.2s ease;
}
.slot-top { display: flex; align-items: center; gap: 7px; font-size: 10px; color: #8b97a8; font-family: var(--mono); grid-area: top; justify-content: flex-start; padding: 0; }
.swatch { height: 12px; width: 12px; border-radius: 50%; border: 1px solid #ffffff66; flex-shrink: 0; background: repeating-linear-gradient(45deg, #68717b 0 3px, #252e38 3px 6px); }
.slot-fill {
  grid-area: bar;
  position: relative;
  width: 100%;
  height: 8px;
  aspect-ratio: auto;
  margin: 4px 0 0;
  border-radius: 999px;
  background: #1a1e27;
  padding: 0;
  z-index: 0;
  pointer-events: none;
  box-shadow: none;
}
.slot:hover .slot-fill { transform: none; }
.slot-fill::after {
  content: "";
  display: block;
  width: calc(var(--remain, 0) * 100%);
  height: 100%;
  border-radius: inherit;
  background: var(--slot-c, #3a4250);
}
.slot:not([data-pigment="true"]) .slot-fill { background: #1a1e27; box-shadow: none; }
.slot:not([data-pigment="true"]) .slot-fill::after { background: #3a4250; }
.slot:not([data-pigment="true"]) .swatch { opacity: 0.35; }
.slot[data-remain="unknown"] .slot-fill::after { width: 0; }
.slot:before { display: none; }
.slot[data-pigment="true"] .swatch { display: block; }
.slot[data-active="true"] { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--slot-c, var(--mint)) 55%, transparent); }
.slot[data-active="true"] .slot-fill { box-shadow: none; animation: none; }
.slot[data-active="true"]::after { display: none; }
.slot strong { display: block; font-size: 12px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--sans); font-weight: 500; grid-area: mat; padding: 0; }
.slot small { display: none; }
.slot .slot-remain { display: block; grid-area: remain; font-size: 11px; color: #c5d0df; font-family: var(--mono); text-align: right; }
.slot .slot-map { display: block; grid-area: map; font-size: 10px; color: #8b97a8; }
.slot .active { color: var(--mint); }
.slot[data-stale="true"] { opacity: 0.88; }
.source-row { display: flex; flex-wrap: wrap; gap: 10px 14px; font-size: 10px; font-family: var(--mono); opacity: 0.7; }
.source-row [data-state="fresh"] { color: #aac8b6; }
.source-row [data-state="stale"], .source-row [data-state="disconnected"], .source-row [data-state="error"] { color: var(--amber); }
.printer-warning {
  font-size: 10px;
  color: var(--amber);
  margin: 4px 0 0;
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.printer-controls { display: flex; align-items: center; gap: 8px; border-top: 0; padding: 4px 2px 0; opacity: 0.7; }
.printer-controls button { min-height: 37px; font-size: 12px; padding: 7px 14px; }
.printer-controls button:disabled { display: none; }
.printer-controls a { margin-left: auto; font-size: 11px; }

.panel { padding: 23px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.panel p { font-size: 13px; }
.panel button { font-size: 12px; }
.tag { background: #26303b; border-color: #435160; color: #c3d0df; }
.link-group { display: flex; align-items: center; gap: 18px; font-size: 12px; }
.list-row { padding: 13px 0; border-top: 1px solid var(--line); font-size: 12px; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.list-row:first-child { margin-top: 16px; }
.list-row strong { display: block; font-size: 12px; }
.list-row small { color: var(--muted); display: block; }
.list-row button { font-size: 11px; }
.empty { color: var(--muted); font-size: 13px; padding: 20px 0; }
.activity-list { display: grid; gap: 10px; }
.action { border: 1px solid var(--line); background: var(--panel); border-radius: 18px; padding: 17px 20px; animation: rise 0.45s ease both; }
.action-head { display: flex; justify-content: space-between; gap: 20px; font-size: 13px; }
.action-id { font-size: 10px; color: var(--muted); overflow-wrap: anywhere; margin: 4px 0 10px; font-family: var(--mono); }
.action-result { font-size: 12px; margin: 6px 0; }
.action-result[data-state="outcome_unknown"] { color: var(--amber); }
.action-result small { display: block; color: var(--muted); font-size: 11px; }
.action button { font-size: 11px; padding: 5px 10px; min-height: 35px; margin-top: 8px; }
footer { padding: 25px 0 30px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; gap: 20px; font-family: var(--mono); }

.pairing { max-width: 520px; margin: 60px auto; padding: 32px !important; animation: rise 0.6s ease both; }
.pairing h1 { margin-bottom: 22px; }
.pairing .muted { margin: 20px 0; }
.pairing form { margin-top: 25px; }
#pairing-code { font-size: 25px; letter-spacing: 6px; font-variant-numeric: tabular-nums; font-family: var(--mono); }
.pair-code { font-size: 40px; letter-spacing: 6px; font-variant-numeric: tabular-nums; text-align: center; color: var(--brass); font-family: var(--mono); }
#pair-device { font-size: 11px; }

dialog {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid #536372;
  border-radius: 20px;
  padding: 25px;
  width: min(640px, calc(100% - 28px));
  max-height: 85vh;
  box-shadow: 0 30px 120px #0009;
}
dialog::backdrop { background: #03080cbb; backdrop-filter: blur(8px); }
.dialog-heading, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.dialog-heading { margin-bottom: 20px; }
.dialog-actions { justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 15px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; margin-bottom: 14px; }
.field input, .field select, .field textarea {
  border: 1px solid #45515f;
  background: #11171e;
  color: var(--ink);
  border-radius: 12px;
  padding: 10px;
  width: 100%;
  min-width: 0;
}
.field textarea { min-height: 85px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 12px; margin: 16px 0; }
.check input { margin-top: 4px; accent-color: #a6eabd; }
.dialog-note { font-size: 12px; color: var(--muted); }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; max-height: 290px; overflow: auto; background: #11171e; padding: 14px; border-radius: 12px; }
.error { font-size: 12px; color: var(--red); white-space: pre-wrap; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #e8fff6; color: #102018;
  padding: 12px 20px; max-width: 90vw; border-radius: 999px; z-index: 12; font-size: 13px;
  box-shadow: 0 8px 40px #0008;
  animation: rise 0.35s ease both;
}

.materials-compact {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 4px 0 10px;
  margin-bottom: 8px;
}
.materials-bar, .materials-heading, .materials-actions { display: flex; align-items: center; gap: 18px; }
.materials-bar { justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.materials-heading { gap: 12px; }
.materials-symbol {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid #2d3a44; border-radius: 50%; font-size: 20px; color: var(--brass); background: #1a2430;
}
.materials-heading h2 {
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.5;
}
.inventory-count { font-size: 11px; color: var(--muted); margin: 3px 0 0; }
.materials-actions { gap: 16px; flex-wrap: wrap; font-size: 11px; }
.materials-actions a { text-decoration: none; color: #c6d6d0; min-height: 36px; display: inline-flex; align-items: center; }
.materials-actions a:hover { color: var(--brass); }
.materials-actions button { min-height: 36px; font-size: 11px; padding: 7px 11px; }
.materials-actions .label-action { background: transparent; color: var(--ink); }
.materials-actions .refresh-icon { font-size: 21px; padding: 0; width: 36px; min-height: 36px; color: #adc3b7; border-color: #3d4b45; }
.materials-health { display: none; }
.materials-health[data-warning="true"] {
  display: flex; align-items: center; gap: 7px;
  font-size: 10px; color: var(--amber); margin: 8px 0 0; padding: 8px 0 0; border-top: 1px solid #34403b;
}
.materials-health:before { content: ""; width: 5px; height: 5px; flex-shrink: 0; border-radius: 50%; background: #a5d9b8; }
.materials-health[data-warning="true"] { color: var(--amber); }
.materials-health[data-warning="true"]:before { background: var(--amber); }
#inventory-summary .error { margin: 4px 0 0; }
.material-records { border-top: 1px solid #34403b; margin-top: 10px; font-size: 11px; }
.material-records > summary { padding-top: 10px; cursor: pointer; }
.material-records summary span { margin-left: 5px; color: var(--muted); }
.material-record-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.material-record-grid .list-row:first-child { margin-top: 8px; }
.material-record-grid .list-row { padding: 8px 0; }

#colors {
  margin-inline: -40px;
  padding: 48px 40px 72px;
  background:
    radial-gradient(1000px 280px at 50% 0, rgba(142, 235, 200, 0.08), transparent 55%),
    var(--felt);
}
.library-heading { margin-bottom: 18px; align-items: end; }
.library-heading h2 { font-size: clamp(2.6rem, 6vw, 5rem); }
.library-meta { text-align: right; }
.library-meta .summary, .library-meta #color-status { color: #c5d0df; }
.library-meta #color-status { font-size: 10px; margin: 3px 0 0; }
.library-meta #color-status[data-warning="true"] { color: var(--amber); max-width: 420px; }
.color-filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  margin-bottom: 18px;
}
.color-filters .field { margin: 0; min-width: 0; }
.color-filters input, .color-filters select {
  min-height: 32px; font-size: 11px; border: 0; border-bottom: 1px solid #262b36; background: transparent; border-radius: 0; padding: 6px 2px; color: var(--ink);
}
.color-search { position: relative; }
.color-search:before { content: ""; position: absolute; width: 9px; height: 9px; border: 1.5px solid #9eafa5; border-radius: 50%; left: 12px; top: 10px; pointer-events: none; }
.color-search:after { content: ""; position: absolute; width: 5px; height: 1.5px; background: #9eafa5; transform: rotate(45deg); left: 21px; top: 21px; pointer-events: none; }
.color-search input { padding-left: 32px; }

.hue {
  display: flex;
  flex-wrap: wrap;
  height: auto;
  gap: 8px;
  margin: 0 0 28px;
  overflow: visible;
  border: 0;
  justify-content: center;
}
.hue button {
  flex: 0 0 22px;
  width: 22px;
  min-height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 1px #ffffff22;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hue button:hover { transform: scale(1.35); }
.hue button[aria-pressed="true"] { box-shadow: 0 0 0 3px #fff; z-index: 1; }

.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 40px 28px;
}
.color-card {
  overflow: visible;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  text-align: center;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), filter 0.35s ease;
}
.color-grid:hover .color-card { filter: saturate(0.86) brightness(0.9); }
.color-grid .color-card:hover, .color-grid .color-card:focus-within {
  transform: translateY(-8px);
  filter: none;
  z-index: 2;
}
.color-sample {
  position: relative;
  isolation: isolate;
  width: 86%;
  margin: 0 auto;
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 7px;
  background: conic-gradient(from 210deg, var(--c, #5b6570) calc(var(--remain, 0.5) * 1turn), #161a22 0);
  overflow: hidden;
  box-shadow: 0 16px 40px color-mix(in srgb, var(--c, #000) 32%, transparent);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.55s ease;
}
.color-card:hover .color-sample,
.color-card:focus-within .color-sample { transform: rotate(-7deg) scale(1.03); }
.color-card.spotlight { animation: spotlight 1.1s ease; }
.color-card.spotlight .color-sample { box-shadow: 0 0 0 3px #fff, 0 22px 44px color-mix(in srgb, var(--c, #8eebc8) 40%, transparent); }
.color-level {
  position: absolute;
  inset: 7px;
  height: auto;
  border-radius: 50%;
  background: var(--c, #68717b);
  animation: spin-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i, 0) * 35ms);
}
.color-level:before {
  content: "";
  position: absolute;
  inset: 31%;
  border-radius: 50%;
  background: #07080c;
  box-shadow: inset 0 2px 10px #0009;
  z-index: 1;
}
.color-level::after { display: none; }
.color-face {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  pointer-events: none;
}
.color-face:after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(160deg, #fff5, transparent 36%, transparent 60%, #0005);
}
.color-sample[data-finish="silk"] .color-face:before,
.color-sample[data-finish="metallic"] .color-face:before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(115deg, transparent 20%, #fff8 42%, transparent 58%);
  mix-blend-mode: soft-light;
  animation: sheen 7s ease-in-out infinite;
}
.color-sample[data-finish="starlight"] .color-face:before,
.color-sample[data-finish="glow"] .color-face:before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, #d4f7ff 0 0.7px, transparent 1.3px) 0 0 / 17px 19px;
  opacity: 0.45;
}
.color-sample[data-finish="transparent"] .color-level { opacity: 0.72; }
.color-sample[data-unknown="true"] {
  background: repeating-conic-gradient(#2a3340 0 12deg, #1a202a 12deg 24deg);
}
.sample-meta {
  position: static;
  display: block;
  margin: 6px 0 0;
  font-size: 10px;
  line-height: 1.45;
  color: #8b97a8;
  font-family: var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sample-meta > * { display: inline; }
.sample-meta > *:not(:last-child):after {
  content: " · ";
  opacity: 0.45;
}
.sample-material, .sample-basis, .color-info .sample-finish, .color-hex {
  font-size: 10px;
  letter-spacing: 0.02em;
  text-transform: none;
  color: inherit;
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  font-family: inherit;
}
.color-info {
  position: static;
  padding: 14px 4px 0;
  color: var(--ink);
}
.color-maker {
  display: inline;
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: none;
  opacity: 1;
  font-family: inherit;
}
.color-info h3 {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.color-stock { display: flex; justify-content: center; gap: 8px; font-size: 10px; margin-top: 4px; color: #8b97a8; font-family: var(--mono); }
.color-loaded { font-size: 9px; color: var(--mint); }
.color-loaded:before { content: "● "; font-size: 7px; }
.color-details { border-top: 0; background: transparent; font-size: 10px; margin-inline: 0; }
.color-details > summary {
  list-style: none;
  cursor: pointer;
  padding: 4px 0;
  color: transparent;
  font-size: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 28px;
}
.color-details > summary::-webkit-details-marker { display: none; }
.color-details > summary:after { content: "+"; font-size: 16px; line-height: 12px; color: var(--brass); }
.color-details[open] > summary:after { content: "−"; }
.color-details > summary:hover { background: transparent; color: #fff; }
.color-details > summary:focus-visible, .material-records > summary:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
.color-detail-body { padding: 0 4px 8px; text-align: left; }
.color-detail-body p { font-size: 10px; line-height: 1.5; margin: 6px 0; }
.color-detail-body > a { display: block; padding: 8px 0; min-height: 34px; overflow-wrap: anywhere; }
.color-links { display: flex; flex-wrap: wrap; gap: 5px 12px; border-top: 1px solid #262b36; margin-top: 5px; }
.color-links a { display: inline-flex; align-items: center; min-height: 36px; }
.swatch-basis { color: #c5d0df; font-size: 10px; }
.palette-note { color: #7d8b9c; font-size: 10px; margin: 16px 0 0; }
.color-grid > .empty { grid-column: 1 / -1; padding: 24px 12px; text-align: center; border: 1px dashed #3a4658; border-radius: 18px; color: #c5d0df; }

@keyframes drift { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(-2%, 1.5%, 0) scale(1.04); } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes spin-in { from { transform: scale(0.72); opacity: 0; } }
@keyframes spotlight { 0%, 100% { transform: none; } 40% { transform: translateY(-8px) scale(1.03); } }
@keyframes sheen { 0%, 100% { opacity: 0.55; transform: translateX(-8%); } 50% { opacity: 1; transform: translateX(8%); } }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes live { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@keyframes rec { 0% { box-shadow: 0 0 0 0 #ff5a4a88; } 100% { box-shadow: 0 0 0 8px transparent; } }
@keyframes live-glow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.14); }
}

@media (min-width: 1400px) {
  .camera { aspect-ratio: 16 / 8.4; }
  .printer-body { padding: 22px 26px; }
  .slot { min-height: 0; padding: 10px 12px; }
  .slot strong { font-size: 14px; }
  .slot small { font-size: 10px; }
  .source-row { font-size: 11px; }
}
@media (min-width: 1000px) {
  .focus-view .focus-spoolman { display: inline; }
  .focus-view .masthead { display: none; }
  .focus-view main { padding-top: 12px; }
  .focus-view #printers > .section-heading { margin-bottom: 7px; }
  .focus-view #printers .eyebrow { display: none; }
  .focus-view h1 { font-size: 21px; letter-spacing: -0.5px; }
  .focus-view #service-message { margin-bottom: 10px; padding-top: 2px; padding-bottom: 2px; font-size: 10px; }
  .focus-view .printer-head { padding: 12px 16px; }
  .focus-view .printer-head h2 { font-size: 17px; }
  .focus-view .camera { height: auto; aspect-ratio: 16 / 9; }
  .focus-view .camera-hud { padding: 22px 12px 10px; }
  .focus-view .camera-hud .percentage { font-size: 22px; }
  .focus-view .printer-body { padding: 11px 16px; }
  .focus-view .filename { font-size: 12px; margin-bottom: 0; }
  .focus-view .percentage { font-size: 21px; }
  .focus-view .progress { margin: 0; }
  .focus-view .camera-hud .temperatures { margin: 0; padding: 0; }
  .focus-view .temperature strong { font-size: 16px; }
  .focus-view .cfs-more > summary { min-height: 28px; font-size: 12px; }
  .focus-view .cfs-head { margin: 7px 0 5px; font-size: 10px; }
  .focus-view .slot { min-height: 0; padding: 8px 10px; }
  .focus-view .slot-fill { width: 100%; height: 7px; margin: 3px 0 0; }
  .focus-view .slot strong { font-size: 11px; margin-top: 3px; }
  .focus-view .slot small { font-size: 9px; line-height: 1.3; }
  .focus-view .swatch { height: 11px; width: 11px; }
  .focus-view .source-row { margin-top: 9px; font-size: 9px; }
  .focus-view .printer-controls { padding: 8px 16px; }
  .focus-view .printer-controls button { min-height: 32px; padding: 4px 12px; }
  .focus-view .printer-warning { font-size: 10px; margin-top: 6px; }
  .focus-view #colors, .focus-view #materials, .focus-view #projects, .focus-view #activity, .focus-view footer { display: none; }
}
@media (max-width: 950px) {
  .masthead { padding: 10px 22px 0; }
  nav { gap: 14px; }
  .connection { display: none; }
  .stop-strip { position: static; margin: 0 0 0 auto; padding: 0; }
  .stop-strip > div > span { display: none; }
  main { padding: 28px 22px 0; }
  #colors { margin-inline: -22px; padding: 28px 22px 40px; }
  .printer-grid, .workspace-grid { gap: 16px; }
  .printer-head { padding: 0 2px 10px; }
  .printer-body { padding: 14px 2px 8px; }
  .printer-controls { padding: 10px 2px 0; }
  .slots { gap: 5px; }
  .slot { padding: 8px 10px; }
  .filename { max-width: 100%; }
  .job-details { font-size: 10px; }
  .source-row { gap: 8px; }
  .link-group { gap: 10px; }
}
@media (max-width: 850px) {
  .materials-actions { gap: 12px; }
  .color-filters { grid-template-columns: 2fr 1fr 1fr; }
  .color-search { grid-column: 1 / -1; }
  .masthead nav { flex-wrap: wrap; gap: 12px; }
}
@media (max-width: 690px) {
  html { scroll-padding-top: 100px; }
  .masthead { padding: 8px 14px 0; flex-wrap: wrap; }
  .masthead .identity { flex-shrink: 0; }
  .masthead .identity strong { white-space: nowrap; }
  .masthead nav { flex-basis: 100%; margin-left: 0; }
  .masthead .stop-strip { width: 100%; margin-left: 0; }
  .masthead .strip-actions, .masthead .stop-buttons { flex-wrap: wrap; }
  .identity strong { font-size: 1.15rem; }
  .identity span:not(.brand-mark) { font-size: 8px; }
  nav { position: static; width: auto; max-width: 100%; overflow-x: auto; clip: auto; }
  nav a { font-size: 11px; }
  .stop-strip strong { font-size: 10px; width: 58px; }
  .stop-buttons { gap: 4px; flex: 0 0 auto; width: auto; }
  .stop-buttons button { font-size: 10px; flex: 0 0 auto; padding: 0 6px; min-height: 28px; }
  main { padding: 25px 14px 0; }
  #colors { margin-inline: -14px; padding: 22px 14px 36px; }
  .section-heading { align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 17px; }
  h1 { font-size: 26px; }
  h2 { font-size: 22px; }
  .summary { font-size: 11px; text-align: left; }
  .eyebrow { font-size: 9px; }
  .printer-grid, .workspace-grid { grid-template-columns: minmax(0, 1fr); }
  .slots { grid-template-columns: 1fr; }
  .job-more[open]:has(.job-preview:not([hidden])) { grid-template-columns: 1fr; }
  .job-more[open]:has(.job-preview:not([hidden])) .job-preview { grid-column: 1; grid-row: auto; max-width: 140px; }
  .job-more[open]:has(.job-preview:not([hidden])) .job-object,
  .job-more[open]:has(.job-preview:not([hidden])) .job-object-meta,
  .job-more[open]:has(.job-preview:not([hidden])) .filename,
  .job-more[open]:has(.job-preview:not([hidden])) .job-details,
  .job-more[open]:has(.job-preview:not([hidden])) a { grid-column: 1; }
  .printer-head, .printer-body { padding: 18px; }
  .slots { gap: 7px; }
  .slot { padding: 8px 10px; }
  .panel { padding: 19px; }
  .field-grid { grid-template-columns: 1fr; }
  .link-group { flex-wrap: wrap; font-size: 11px; }
  footer { font-size: 10px; flex-direction: column; gap: 7px; }
  dialog { padding: 20px; }
  #focus-toggle { display: none; }
  .strip-actions { flex: 1; gap: 0; }
  .pairing { margin: 26px 14px; padding: 24px !important; }
  .pair-code { font-size: 32px; letter-spacing: 4px; }
}
@media (max-width: 540px) {
  .materials-compact { padding: 4px 0 10px; }
  .color-filters { gap: 8px; padding: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .color-filters input, .color-filters select { min-width: 0; }
  .color-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
  .material-record-grid { grid-template-columns: 1fr; }
  .stop-strip, .strip-actions, .stop-buttons { width: auto; max-width: 100%; min-width: 0; }
  .stop-buttons { flex-wrap: nowrap; }
  .stop-buttons button { flex: 0 0 auto; min-width: 0; }
  .identity, .identity strong { min-width: 0; }
  .printer-head, .printer-body { padding: 8px 0; }
}
@media (max-width: 380px) {
  nav { width: 100%; justify-content: space-between; }
  .stop-buttons button { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .progress-fill, .slot-fill, .color-level { transition: none; }
  dialog::backdrop { backdrop-filter: none; }
  body:before, .printer, .color-card, .color-level, .slot-fill, .action, .pairing, .toast, .connection, .badge[data-state="printing"],
  .camera[data-live="true"] .camera-overlay::before, .color-sample[data-finish="silk"] .color-face:before,
  .color-sample[data-finish="metallic"] .color-face:before,
  .printer[data-phase="printing"] .progress-fill::after, .slot[data-active="true"]::after,
  .slot[data-active="true"] .slot-fill, .color-card.spotlight { animation: none; }
  .color-grid:hover .color-card, .color-grid .color-card:hover, .color-grid .color-card:focus-within,
  .color-card:hover .color-sample, .color-card:focus-within .color-sample,
  .hue button:hover, .slot[data-active="true"], .slot:hover .slot-fill { transform: none; filter: none; }
}

/* Printer management shares the dashboard palette and typography. */
.settings-page .masthead { justify-content: space-between; }
.settings-page .identity { color: var(--ink); text-decoration: none; }
.settings-main { max-width: 1200px; margin: 0 auto; padding-bottom: 48px; }
.settings-heading { margin: 30px 0 36px; }
.settings-heading h1 { max-width: 780px; margin-bottom: 14px; }
.settings-page section { scroll-margin-top: 80px; }
.settings-page h3 { margin: 0 0 8px; }
.settings-page p { line-height: 1.65; }
.settings-search { max-width: 460px; margin-bottom: 18px; }
.settings-printers { display: grid; gap: 12px; }
.configured-printer { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: #ffffff03; }
.configured-printer p { margin: 4px 0; overflow-wrap: anywhere; }
.settings-row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.settings-row-actions button { min-height: 40px; }
.discovery-form { display: flex; align-items: start; flex-wrap: wrap; gap: 16px; margin-top: 22px; }
.discovery-form .field { flex: 1 1 180px; }
.discovery-form button { margin-top: 25px; }
.settings-page progress { width: 100%; height: 8px; accent-color: var(--mint); }
.discovery-result { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.discovery-result p { margin: 4px 0 0; }
.compatibility-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.compatibility-item { padding: 22px; border: 1px solid var(--line); border-radius: 10px; }
.support-level { display: inline-block; color: var(--mint); font-family: var(--mono); font-size: 11px; margin: 4px 0; }
.settings-page dialog { width: min(760px, calc(100vw - 32px)); max-height: 90vh; overflow: auto; }
.settings-page dialog .field-grid { gap: 18px; }
.settings-page .check { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.settings-page .check input { width: auto; }
.settings-page .field small { color: var(--muted); line-height: 1.5; font-size: 11px; }
.settings-page [hidden] { display: none !important; }
.fleet-filter { max-width: 420px; margin-bottom: 20px; }
@media (max-width: 690px) {
  .configured-printer, .discovery-result { align-items: stretch; flex-direction: column; }
  .compatibility-list { grid-template-columns: 1fr; }
  .settings-main { padding-inline: 16px; }
  .settings-page .settings-heading h1 { font-size: 36px; }
  .settings-page .masthead { flex-wrap: wrap; gap: 14px; }
  .settings-page .masthead nav { flex-wrap: wrap; }
  .discovery-form button { margin-top: 0; }
}
.camera[data-configured="false"] { aspect-ratio: auto; min-height: 150px; }
.printer[hidden], .fleet-filter[hidden] { display: none !important; }
/* Keep the mode exit and Settings navigation reachable in focus view. */
@media (min-width: 1000px) { .focus-view .masthead { display: flex; } }
