/* Farbvarianten: jede Familie hat Grund, Navigation, einen Akzent und Zustandsfarben in ähnlicher Helligkeit */
:root {
  --ground: #111317;
  --surface: #181b20;
  --surface-2: #1f2329;
  --surface-3: #282d34;
  --line: #2a2f36;
  --line-strong: #3a4049;
  --text: #eceef1;
  --text-2: #a9b0b9;
  --text-3: #858d97;
  --mat: #15181c;
  --mat-edge: #22262c;
  --mat-grid: rgba(150, 215, 230, 0.025);
  --mat-grid-strong: rgba(150, 215, 230, 0.06);
  --mat-text: #c8cfd7;
  --rule: #5ec4d4;
  --rule-ink: #062227;
  --ok: #5cc4a2;
  --pause: #dcb35f;
  --fail: #e17c70;
  --done: #78a8e2;
  --idle: #8a929c;
  --on-fail: #2a0d09;
}
:root {
  --radius: 12px;
  --radius-s: 8px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --rail-w: 236px;
  --tab-h: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 400 15px/1.45 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--rule); color: var(--rule-ink); }
:focus-visible { outline: 2px solid var(--rule); outline-offset: 2px; border-radius: 4px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg.i { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Schneidematte (Navigation) ---------- */
.mat {
  background-color: var(--mat);
  color: var(--mat-text);
}

.app { min-height: 100dvh; }
.rail {
  position: fixed; inset: 0 auto 0 0; width: var(--rail-w);
  display: flex; flex-direction: column; padding: 20px 14px;
  border-right: 1px solid var(--mat-edge);
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--rule); display: grid; place-items: center; color: var(--rule-ink); }
.brand-mark svg { width: 18px; height: 18px; stroke-width: 2.2; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px;
  color: var(--mat-text); text-decoration: none; font-weight: 500;
  transition: background-color 160ms ease;
}
.nav a:hover { background: rgba(255,255,255,0.06); }
.nav a[aria-current="page"] { background: color-mix(in srgb, var(--rule) 14%, transparent); color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rule) 38%, transparent); }
.nav a[aria-current="page"] svg { color: var(--rule); }
.nav .count { margin-left: auto; font-size: 0.78rem; font-weight: 600; background: rgba(0,0,0,0.3); padding: 1px 8px; border-radius: 999px; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding: 12px 8px 0; border-top: 1px solid var(--mat-grid-strong); font-size: 0.86rem; }
.fleet { display: flex; flex-direction: column; gap: 6px; }
.fleet-row { display: flex; align-items: center; gap: 8px; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 38px; height: 22px; border-radius: 999px; background: rgba(0,0,0,0.35); position: relative; transition: background-color 200ms ease; flex-shrink: 0; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--mat-text); transition: transform 240ms var(--ease-out); }
.switch input:checked + .track { background: var(--rule); }
.switch input:checked + .track::after { transform: translateX(16px); background: var(--rule-ink); }
.switch input:focus-visible + .track { outline: 2px solid var(--rule); outline-offset: 2px; }

.tabbar { display: none; }
.saver-mobile { display: none; }

/* ---------- Hauptbereich ---------- */
.main { margin-left: var(--rail-w); padding: 24px clamp(16px, 3vw, 36px) 48px; max-width: 1680px; }
.draft-note { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--text-2); border: 1px dashed var(--line-strong); border-radius: 999px; padding: 3px 12px; margin-bottom: 14px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 22px; }
.page-head h1 { margin: 0; font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.2rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.page-sub { color: var(--text-2); margin-top: 6px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.view { display: none; }
.view.is-active { display: block; animation: view-in 320ms var(--ease-out); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Knöpfe ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--surface-2); font-weight: 600; white-space: nowrap; text-decoration: none; color: var(--text);
  transition: background-color 160ms ease, border-color 160ms ease, transform 120ms ease;
}
.btn:hover { background: var(--surface-3); border-color: var(--text-3); }
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--rule); border-color: var(--rule); color: var(--rule-ink); }
.btn-primary:hover { background: var(--rule); border-color: var(--rule); filter: brightness(1.08); }
.btn-danger { background: transparent; border-color: color-mix(in srgb, var(--fail) 50%, transparent); color: var(--fail); }
.btn-danger:hover { background: color-mix(in srgb, var(--fail) 12%, transparent); border-color: var(--fail); }
.btn-danger-solid { background: var(--fail); border-color: var(--fail); color: var(--on-fail); }
.btn-danger-solid:hover { background: var(--fail); border-color: var(--fail); filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-s { min-height: 36px; padding: 0 12px; font-size: 0.88rem; border-radius: 8px; }
.icon-btn { width: 40px; min-height: 40px; padding: 0; }

/* ---------- Zustände ---------- */
.state { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 0.88rem; padding: 4px 11px 4px 9px; border-radius: 999px; background: var(--surface-3); color: var(--idle); white-space: nowrap; }
.state svg { width: 16px; height: 16px; stroke-width: 2; }
.state[data-s="printing"] { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.state[data-s="paused"] { color: var(--pause); background: color-mix(in srgb, var(--pause) 14%, transparent); }
.state[data-s="error"] { color: var(--fail); background: color-mix(in srgb, var(--fail) 14%, transparent); }
.state[data-s="finished"] { color: var(--done); background: color-mix(in srgb, var(--done) 14%, transparent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.state[data-s="printing"] .dot { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 60% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok) 0%, transparent); } }

/* ---------- Druckerkarten ---------- */
.fleet-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.printer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 18px; }
.pcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  opacity: 0; transform: translateY(10px);
  animation: card-in 520ms var(--ease-out) forwards; animation-delay: calc(var(--i, 0) * 70ms);
  box-shadow: 0 10px 30px -18px rgba(0,0,0,0.7);
}
@keyframes card-in { to { opacity: 1; transform: none; } }
.no-anim .pcard { animation: none; opacity: 1; transform: none; }
.cam-live { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--ground); }
.tag-real { color: var(--ground); background: var(--rule); }
.pcard[data-s="error"] { border-color: color-mix(in srgb, var(--fail) 55%, transparent); }
.cam { position: relative; aspect-ratio: 16 / 9; background: var(--ground); cursor: pointer; border: 0; padding: 0; display: block; width: 100%; }
.cam canvas { width: 100%; height: 100%; display: block; }
.cam-tag { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.tag { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; padding: 3px 8px; border-radius: 6px; background: rgba(8,10,10,0.72); color: var(--text-2); backdrop-filter: blur(6px); }
.tag-live { color: #fff; display: inline-flex; align-items: center; gap: 6px; }
.tag-live .dot { background: var(--fail); width: 6px; height: 6px; }
.cam-test { position: absolute; bottom: 8px; left: 10px; font-size: 0.7rem; color: rgba(255,255,255,0.45); }
.tower { position: absolute; top: 10px; right: 10px; bottom: 10px; width: 16px; display: flex; flex-direction: column-reverse; gap: 1px; padding: 2px; border-radius: 4px; background: rgba(8,10,10,0.62); backdrop-filter: blur(6px); }
.tower i { display: block; height: 3px; border-radius: 1px; background: rgba(255,255,255,0.08); flex-shrink: 0; transition: background-color 400ms ease; }
.tower i.on { background: var(--layer, var(--ok)); }
.tower i.now { background: #fff; animation: lay 1.6s ease-in-out infinite; }
@keyframes lay { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.pbody { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.phead { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pname { margin: 0; font-size: 1.08rem; font-weight: 700; letter-spacing: -0.01em; }
.pname button { background: none; border: 0; padding: 0; font-weight: inherit; text-align: left; }
.pname button:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.pmodel { color: var(--text-3); font-size: 0.85rem; }
.pjob { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pct { font-stretch: 72%; font-weight: 700; font-size: 2.7rem; line-height: 0.95; letter-spacing: -0.02em; }
.pct small { font-size: 1.1rem; font-weight: 600; color: var(--text-2); margin-left: 2px; }
.eta { text-align: right; }
.eta strong { display: block; font-size: 1.05rem; }
.eta span { color: var(--text-2); font-size: 0.85rem; }
.jobname { color: var(--text-2); font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--layer, var(--ok)); transition: width 900ms var(--ease-out); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.22); }
.pcard[data-s="paused"] .bar > span { background: var(--pause); }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.metric { background: var(--surface-2); border-radius: var(--radius-s); padding: 7px 10px; }
.metric dt { font-size: 0.74rem; color: var(--text-3); }
.metric dd { margin: 0; font-weight: 600; font-size: 0.95rem; }
.metric dd span { color: var(--text-3); font-weight: 500; }
.ams { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--text-3); }
.slots { display: flex; gap: 6px; }
.slot { width: 22px; height: 22px; border-radius: 6px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18); position: relative; }
.slot.active::after { content: ""; position: absolute; inset: -4px; border-radius: 9px; border: 2px solid var(--text); }
.slot.slot-empty { background: repeating-linear-gradient(45deg, var(--surface-3) 0 3px, var(--surface-2) 3px 6px); }
.hms { display: flex; gap: 10px; align-items: flex-start; background: color-mix(in srgb, var(--fail) 10%, transparent); border: 1px solid color-mix(in srgb, var(--fail) 35%, transparent); border-radius: var(--radius-s); padding: 10px 12px; font-size: 0.9rem; }
.hms svg { color: var(--fail); margin-top: 1px; }
.hms strong { display: block; }
.hms span { color: var(--text-2); }
.notice { display: flex; gap: 10px; align-items: flex-start; background: color-mix(in srgb, var(--done) 10%, transparent); border: 1px solid color-mix(in srgb, var(--done) 30%, transparent); border-radius: var(--radius-s); padding: 10px 12px; font-size: 0.9rem; }
.notice svg { color: var(--done); margin-top: 1px; }
.pactions { display: flex; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.pactions .btn { flex: 1; }
.done-pop { animation: done-pop 700ms var(--ease-out); }
@keyframes done-pop { 0% { transform: scale(0.85); } 50% { transform: scale(1.08); } 100% { transform: scale(1); } }

/* ---------- Tabellen, Listen, Formulare ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.field { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; }
.field:focus-within { border-color: var(--rule); }
.field input, .field select { background: transparent; border: 0; outline: none; min-width: 0; flex: 1; }
.field select option { background: var(--surface); }
.search { flex: 1 1 240px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 0 12px; min-height: 36px; border-radius: 7px; color: var(--text-2); font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }
.seg button[disabled] { opacity: 0.4; cursor: not-allowed; }
.crumbs { display: flex; gap: 6px; align-items: center; color: var(--text-2); font-size: 0.9rem; margin-bottom: 14px; flex-wrap: wrap; }
.crumbs button { background: none; border: 0; padding: 4px 6px; border-radius: 6px; color: var(--text-2); }
.crumbs button:hover { background: var(--surface-2); color: var(--text); }
.crumbs .here { color: var(--text); font-weight: 600; }

.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.file { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; text-align: left; padding: 0; transition: border-color 160ms ease, transform 200ms var(--ease-out); }
.file:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.thumb { aspect-ratio: 4 / 3; background: radial-gradient(120% 90% at 50% 100%, var(--surface-3), var(--surface-2)); display: grid; place-items: center; }
.thumb svg { width: 70%; height: 70%; }
.file-meta { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.file-meta strong { font-size: 0.95rem; font-weight: 600; line-height: 1.25; }
.file-meta span { color: var(--text-2); font-size: 0.82rem; display: flex; gap: 10px; flex-wrap: wrap; }
.folder { flex-direction: row; align-items: center; gap: 12px; padding: 14px; }
.folder svg { width: 28px; height: 28px; color: var(--rule); }
.empty { color: var(--text-2); padding: 32px; text-align: center; grid-column: 1 / -1; }

.queue-group { margin-bottom: 18px; }
.queue-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.queue-head h2 { margin: 0; font-size: 1.02rem; display: flex; align-items: center; gap: 10px; }
.qlist { list-style: none; margin: 0; padding: 6px; }
.qitem { display: grid; grid-template-columns: auto 48px 1fr auto auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 9px; transition: background-color 160ms ease; }
.qitem:hover { background: var(--surface-2); }
.qitem.dragging { opacity: 0.4; }
.qitem.over { box-shadow: inset 0 2px 0 var(--rule); }
.grip { color: var(--text-3); cursor: grab; display: grid; place-items: center; background: none; border: 0; padding: 4px; }
.qthumb { width: 48px; height: 36px; border-radius: 6px; background: var(--surface-2); display: grid; place-items: center; }
.qthumb svg { width: 80%; height: 80%; }
.qname strong { display: block; font-weight: 600; }
.qname span { color: var(--text-2); font-size: 0.84rem; }
.qwhen { color: var(--text-2); font-size: 0.86rem; text-align: right; }
.qbtns { display: flex; gap: 2px; }
.qempty { color: var(--text-3); padding: 14px 16px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th { text-align: left; font-weight: 600; color: var(--text-2); font-size: 0.8rem; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th button { background: none; border: 0; padding: 0; color: inherit; font-weight: inherit; display: inline-flex; align-items: center; gap: 4px; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { transition: background-color 140ms ease; }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; }
.cell-name { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.cell-name .qthumb { flex-shrink: 0; }
.cost { position: relative; }
.cost-btn { background: none; border: 0; padding: 2px 0; font-weight: 600; border-bottom: 1px dotted var(--text-3); }
.cost-break { display: none; position: absolute; right: 0; top: 100%; margin-top: 6px; z-index: 5; background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; min-width: 210px; text-align: left; box-shadow: 0 14px 30px -10px rgba(0,0,0,0.7); font-size: 0.86rem; }
.cost-break.open { display: block; animation: view-in 200ms var(--ease-out); }
.cost-break div { display: flex; justify-content: space-between; gap: 16px; padding: 2px 0; }
.cost-break div:last-child { border-top: 1px solid var(--line-strong); margin-top: 4px; padding-top: 6px; font-weight: 700; }
.sum-line { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 12px 14px; color: var(--text-2); font-size: 0.9rem; }
.sum-line strong { color: var(--text); }

.two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.section-title { margin: 0 0 12px; font-size: 1.1rem; font-weight: 700; }
.ams-block { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ams-block:last-child { border-bottom: 0; }
.ams-block h3 { margin: 0 0 10px; font-size: 0.95rem; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.spools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.spool { background: var(--surface-2); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px; font-size: 0.84rem; }
.spool-head { display: flex; align-items: center; gap: 8px; }
.spool-head .slot { width: 18px; height: 18px; border-radius: 5px; }
.spool-head strong { font-size: 0.86rem; }
.spool small { color: var(--text-3); }
.spool .bar { height: 5px; }
.spool .bar > span { background: var(--c); }
.spool.low small.rest { color: var(--pause); }
.rates { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.rates label { display: flex; flex-direction: column; gap: 6px; font-size: 0.86rem; color: var(--text-2); }
.rates .field { min-height: 42px; }
.rates .unit { color: var(--text-3); font-size: 0.85rem; }
.rate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rates h3 { margin: 6px 0 0; font-size: 0.95rem; color: var(--text); }
.hint { color: var(--text-3); font-size: 0.82rem; margin: 0; }

/* ---------- Steuerungsseite je Drucker ---------- */
.pp-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.pp-head .pimg { width: 64px; height: 64px; }
.pp-head h1 { margin: 0; font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); letter-spacing: -0.02em; }
.pp-head .state { margin-left: auto; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 0.9rem; padding: 6px 10px 6px 4px; border-radius: 8px; }
.back:hover { color: var(--text); background: var(--surface-2); }
.back svg { transform: rotate(180deg); }
.pp-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.pp-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pp-cam { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.box > h2 { margin: 0; font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.box > h2 svg { color: var(--text-2); }
.box > h2 small { font-weight: 500; color: var(--text-3); font-size: 0.82rem; margin-left: auto; }
.box-note { margin: 0; font-size: 0.84rem; color: var(--text-2); display: flex; gap: 8px; align-items: flex-start; }
.box-note svg { width: 16px; height: 16px; color: var(--pause); margin-top: 2px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; }
.ctl-tabs { width: 100%; overflow-x: auto; }
.ctl-tabs button { flex: 1; white-space: nowrap; }
.ctl-panel { display: none; flex-direction: column; gap: 16px; }
.ctl-panel.is-active { display: flex; animation: view-in 240ms var(--ease-out); }

.trow { display: grid; grid-template-columns: minmax(84px, auto) 1fr; gap: 10px 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.trow:first-of-type { border-top: 0; padding-top: 0; }
.trow .tname { font-weight: 600; }
.trow .tname small { display: block; color: var(--text-3); font-weight: 500; font-size: 0.78rem; }
.tnow { font-stretch: 80%; font-weight: 700; font-size: 1.5rem; line-height: 1; }
.tnow span { font-size: 0.9rem; color: var(--text-2); font-weight: 600; }
.tset { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tset .field { min-height: 40px; width: 112px; }
.chip-btn { min-height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-strong); background: transparent; font-size: 0.84rem; font-weight: 600; color: var(--text-2); }
.chip-btn:hover { color: var(--text); background: var(--surface-2); }
.chip-btn[disabled] { opacity: 0.4; cursor: not-allowed; }

.fan { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.fan label { font-weight: 600; }
.fan output { font-weight: 700; min-width: 3.5ch; text-align: right; }
.fan input[type="range"] { grid-column: 1 / -1; width: 100%; accent-color: var(--rule); height: 28px; }
.fan.off { opacity: 0.45; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.switch-row:first-of-type { border-top: 0; padding-top: 0; }
.switch-row > div strong { display: block; font-weight: 600; }
.switch-row > div small { color: var(--text-3); font-size: 0.8rem; }
.switch-row .switch { gap: 0; }
.switch-row .switch .track { background: var(--surface-3); }
.switch-row .switch input:checked + .track::after { background: var(--rule-ink); }
.switch-row .switch .track::after { background: var(--text-2); }
.switch-row.na { opacity: 0.45; }
.halt { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-2); margin-right: 12px; }
.halt input { accent-color: var(--rule); }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset[disabled] .jog, fieldset[disabled] .zcol, fieldset[disabled] .btn-row, fieldset[disabled].move-ctl .seg { opacity: 0.4; pointer-events: none; }
.posview svg * { vector-effect: non-scaling-stroke; }
.pv-zoom { border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text-2); border-radius: 7px; font-size: 0.76rem; font-weight: 700; padding: 3px 9px; }
.pv-zoom:hover { color: var(--text); }
.jog-wrap { display: flex; gap: 14px; align-items: center; }

/* Bewegung: Steuerung links, Positionsansicht rechts; bei wenig Platz untereinander */
.move-box { container-type: inline-size; }
.move-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px 20px; align-items: start; }
.move-ctl { display: flex; flex-direction: column; gap: 14px; }
@container (max-width: 560px) { .move-grid { grid-template-columns: 1fr; } }

.homed { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 0.8rem; font-weight: 700; }
.homed-lbl { color: var(--text-3); font-weight: 600; margin-right: 2px; }
.homed span.ok, .homed span.no { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px 3px 6px; border-radius: 6px; }
.homed span.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.homed span.no { color: var(--pause); background: color-mix(in srgb, var(--pause) 14%, transparent); }
.homed svg { width: 14px; height: 14px; stroke-width: 2.2; }
.posview { background: var(--ground); border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px 10px; display: flex; flex-direction: column; gap: 8px; animation: view-in 280ms var(--ease-out); min-width: 0; }
.posview-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.posview-coords { display: flex; gap: 6px; flex-wrap: wrap; }
.posview-coords span { font-size: 0.8rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); color: var(--text); }
.posview-coords span b { color: var(--rule); font-weight: 800; margin-right: 4px; }
.posview-title { font-size: 0.78rem; color: var(--text-3); font-weight: 600; }
.posview-stage { display: grid; grid-template-columns: minmax(0, 1fr) 46px; gap: 8px; align-items: stretch; }
.posview > svg { width: 100%; height: auto; display: block; overflow: visible; }
.posview text { font-family: var(--font); fill: var(--text-3); font-weight: 600; }
.pv-bed { fill: var(--surface-2); stroke: var(--line-strong); stroke-width: 1.5; }
.pv-grid { stroke: var(--line); stroke-width: 1; }
.pv-tick { stroke: var(--text-3); stroke-width: 1; }
.pv-guide { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 3 4; opacity: 0.55; }
.pv-origin { fill: var(--text-3); }
.pv-move { transition: transform 320ms var(--ease-out); }
.pv-body { fill: var(--surface-3); stroke: var(--text-2); stroke-width: 1.5; }
.pv-rear { fill: color-mix(in srgb, var(--text-2) 30%, var(--surface-3)); }
.pv-fan { fill: var(--surface-2); stroke: var(--text-3); stroke-width: 1.2; }
.pv-blade { stroke: var(--text-3); stroke-width: 1.2; stroke-linecap: round; }
.pv-nozzle { fill: var(--surface-2); stroke: var(--text-3); stroke-width: 1.5; }
.pv-nozzle.on { fill: var(--rule); stroke: var(--rule); }
.pv-ring { fill: none; stroke: var(--rule); stroke-width: 1.5; }
.pv-axislabel { fill: var(--text-2); font-weight: 700; }
.pv-val { fill: var(--rule); font-weight: 800; }
.pv-zrail { stroke: var(--line-strong); stroke-width: 1.5; }
.pv-zplate { fill: var(--rule); transition: transform 320ms var(--ease-out); }
.posview-src { font-size: 0.72rem; color: var(--text-3); line-height: 1.35; }
.pv-path { fill: none; stroke: var(--text-3); stroke-width: 1.2; stroke-linejoin: round; stroke-linecap: round; opacity: 0.75; }
.pv-area { fill: color-mix(in srgb, var(--rule) 18%, transparent); stroke: var(--rule); stroke-width: 1.5; stroke-dasharray: 5 3; }
@media (prefers-reduced-motion: reduce) { .pv-move, .pv-zplate { transition: none; } }
.jog { display: grid; grid-template-columns: repeat(3, 52px); grid-template-rows: repeat(3, 52px); gap: 6px; }
.jog button, .zcol button { border: 1px solid var(--line-strong); background: var(--surface-2); border-radius: 10px; font-weight: 700; font-size: 0.8rem; display: grid; place-items: center; }
.jog button:hover, .zcol button:hover { background: var(--surface-3); }
.jog .home { color: var(--rule); }
.zcol { display: grid; grid-template-rows: repeat(3, 52px); gap: 6px; width: 64px; }
.zcol span { display: grid; place-items: center; font-weight: 700; color: var(--text-3); font-size: 0.8rem; }

.objs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.obj { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line-strong); font-size: 0.86rem; cursor: pointer; }
.obj input { accent-color: var(--fail); }
.obj.skipped { opacity: 0.5; text-decoration: line-through; cursor: default; }
.obj:has(input:checked) { border-color: var(--fail); background: color-mix(in srgb, var(--fail) 8%, transparent); }

.console { background: var(--ground); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 92px; max-height: 180px; overflow: auto; font-size: 0.84rem; color: var(--text-2); }
.console div { padding: 1px 0; }
.console .cmd { color: var(--text); }
.console .ok { color: var(--ok); }
textarea.gcode { width: 100%; min-height: 72px; resize: vertical; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; color: var(--text); font: inherit; }
textarea.gcode:focus { outline: none; border-color: var(--rule); }
.kv { display: grid; grid-template-columns: auto 1fr auto; gap: 8px 14px; font-size: 0.9rem; align-items: center; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; font-weight: 600; }
.badge-new { font-size: 0.74rem; font-weight: 700; color: var(--rule-ink); background: var(--rule); border-radius: 999px; padding: 2px 8px; }
.macro-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.fleet-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 1100px) { .pp-grid { grid-template-columns: 1fr; } }

/* ---------- Ersatzteile und Düsenverschleiß ---------- */
.nz-wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; align-items: start; }
.nz-wrap > .wide { grid-column: 1 / -1; }
.nz-printer h2 img { width: 34px; height: 34px; object-fit: contain; }
.nz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px; }
.nzc { background: var(--surface-2); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; border: 1px solid transparent; }
.nzc[data-w="warn"] { border-color: color-mix(in srgb, var(--pause) 45%, transparent); }
.nzc[data-w="due"] { border-color: color-mix(in srgb, var(--fail) 55%, transparent); }
.nzc.empty-slot { background: transparent; border: 1px dashed var(--line-strong); color: var(--text-3); }
.nzc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.nzc-head strong { font-size: 0.95rem; }
.nzc-spec { font-size: 0.84rem; color: var(--text-2); }
.wear { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.wear > span { display: block; height: 100%; border-radius: inherit; background: var(--ok); transition: width 700ms var(--ease-out); }
.nzc[data-w="warn"] .wear > span { background: var(--pause); }
.nzc[data-w="due"] .wear > span { background: var(--fail); }
.nzc-nums { display: flex; justify-content: space-between; gap: 8px; font-size: 0.82rem; color: var(--text-2); flex-wrap: wrap; }
.nzc-nums strong { color: var(--text); }
.src-line { font-size: 0.74rem; color: var(--text-3); display: flex; gap: 10px; flex-wrap: wrap; }
.qty { display: inline-flex; align-items: center; gap: 4px; }
.qty button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface-2); font-weight: 700; }
.qty strong { min-width: 2.2ch; text-align: center; }
.fits { display: flex; gap: 4px; flex-wrap: wrap; }
.fits span { font-size: 0.74rem; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.cat { font-size: 0.78rem; color: var(--text-3); }

/* ---------- Druckerbild ---------- */
.ptitle { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pimg { width: 56px; height: 56px; object-fit: contain; flex-shrink: 0; padding: 4px; border-radius: 12px; background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--text) 22%, transparent), color-mix(in srgb, var(--text) 5%, transparent) 72%); }

/* ---------- AMS im Bambu-Studio-Stil ---------- */
.spoolv { position: relative; width: 100%; aspect-ratio: 5 / 7; border-radius: 7px; background: var(--surface); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line-strong); }
.spoolv::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--lvl, 0%); background: var(--c); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.22), inset 0 2px 0 rgba(255,255,255,0.3); transition: height 700ms var(--ease-out); }
.spoolv::after { content: ""; position: absolute; left: 50%; top: 18%; bottom: 18%; width: 18%; transform: translateX(-50%); border-radius: 3px; background: color-mix(in srgb, var(--ground) 55%, transparent); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08); }
.spoolv.is-empty { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); border: 1px dashed var(--line-strong); }
.spoolv.is-empty::after { display: none; }

.amsu { background: var(--surface-2); border-radius: 12px; padding: 12px; }
.amsu-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.amsu-head strong { font-size: 0.92rem; }
.amsu-type { color: var(--text-3); font-size: 0.8rem; }
.amsu-env { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--text-2); }
.amsu-env svg { width: 16px; height: 16px; color: var(--ok); }
.amsu-env.humid svg { color: var(--pause); }
.amsu-slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tray { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 8px; border-radius: 10px; border: 1px solid transparent; background: var(--surface); text-align: center; min-width: 0; transition: border-color 160ms ease, transform 200ms var(--ease-out); }
.tray:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.tray.active { border-color: var(--rule); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rule) 16%, transparent); }
.tray-top { display: flex; justify-content: space-between; align-items: center; font-size: 0.72rem; font-weight: 700; color: var(--text-3); }
.tray-top svg { width: 14px; height: 14px; }
.tray-mat { font-weight: 700; font-size: 0.86rem; line-height: 1.1; }
.tray-sub { font-size: 0.74rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tray-pct { font-size: 0.8rem; font-weight: 600; }
.tray.low .tray-pct { color: var(--pause); }
.amsu-ext { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 0.84rem; color: var(--text-2); }
.amsu-ext .spoolv { width: 22px; flex-shrink: 0; }

.ams-stack, .nozzle-group { display: flex; flex-direction: column; gap: 10px; }
.nozzle-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.nozzle-group { border: 1px solid var(--line-strong); border-radius: 14px; padding: 10px; }
.nozzle-group > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nz-temp { font-size: 0.85rem; color: var(--text-2); font-weight: 600; }
.nz { display: inline-flex; align-items: center; gap: 7px; font-size: 0.85rem; font-weight: 700; color: var(--text); }
.nz b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--text); color: var(--ground); font-size: 0.75rem; }
.nz[data-n="R"] b { background: transparent; color: var(--text); box-shadow: inset 0 0 0 2px var(--text); }
.amsu.single .amsu-slots { grid-template-columns: minmax(0, 1fr) repeat(3, minmax(0, 1fr)); }
.ams-stack .amsu-ext, .nozzle-group .amsu-ext { margin-top: 0; padding: 0 2px; border-top: 0; }
.ams-rows { display: flex; flex-direction: column; gap: 8px; }
.ams-mini { display: flex; align-items: flex-end; gap: 8px; }
.ams-mini .lbl { font-size: 0.74rem; color: var(--text-3); font-weight: 600; margin-right: 2px; align-self: center; min-width: 52px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.ams-mini .lbl .nz b { width: 18px; height: 18px; font-size: 0.68rem; border-radius: 5px; }
.mini { width: 26px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.mini .spoolv { border-radius: 5px; }
.mini span { font-size: 0.66rem; color: var(--text-3); font-weight: 600; }
.mini.active .spoolv { box-shadow: inset 0 0 0 1px var(--line-strong), 0 0 0 2px var(--surface), 0 0 0 4px var(--rule); }
.ams-mini .env { margin-left: auto; align-self: center; display: inline-flex; gap: 4px; align-items: center; font-size: 0.78rem; color: var(--text-3); }
.ams-mini .env svg { width: 14px; height: 14px; }

.subtabs { margin-bottom: 18px; }
.subview { display: none; }
.subview.is-active { display: block; animation: view-in 260ms var(--ease-out); }
.ams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 16px; }
.ams-card { padding: 14px; }
.ams-card h3 { margin: 0 0 12px; display: flex; align-items: center; gap: 10px; font-size: 1rem; }
.ams-card h3 img { width: 34px; height: 34px; object-fit: contain; }

.src { display: inline-flex; align-items: center; gap: 5px; font-size: 0.78rem; color: var(--text-2); white-space: nowrap; }
.src svg { width: 15px; height: 15px; }
.chip-swatch { width: 26px; height: 34px; flex-shrink: 0; }
.rest-cell { min-width: 120px; }
.rest-cell .bar { margin-top: 4px; height: 5px; }
.rest-cell .bar > span { background: var(--c); }
.where { color: var(--text-2); font-size: 0.88rem; }
.where strong { color: var(--text); font-weight: 600; }

.scan { display: grid; place-items: center; padding: 26px 0 8px; gap: 18px; text-align: center; }
.scan-ring { position: relative; width: 132px; height: 132px; display: grid; place-items: center; }
.scan-ring::before, .scan-ring::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--rule); opacity: 0; animation: ring 2s var(--ease-out) infinite; }
.scan-ring::after { animation-delay: 1s; }
@keyframes ring { 0% { transform: scale(0.45); opacity: 0.9; } 100% { transform: scale(1); opacity: 0; } }
.scan-core { width: 64px; height: 64px; border-radius: 18px; background: color-mix(in srgb, var(--rule) 16%, var(--surface-2)); color: var(--rule); display: grid; place-items: center; }
.scan-core svg { width: 32px; height: 32px; }
.scan p { margin: 0; color: var(--text-2); max-width: 34ch; }
.scan.found .scan-ring::before, .scan.found .scan-ring::after { animation: none; }
.scan.found .scan-core { background: color-mix(in srgb, var(--ok) 18%, var(--surface-2)); color: var(--ok); animation: done-pop 600ms var(--ease-out); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 0.84rem; color: var(--text-2); }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .field { min-height: 42px; }
.color-in { width: 30px; height: 26px; border: 0; padding: 0; background: none; }
.tagline { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 0.88rem; }
.tagline svg { color: var(--rule); }
.tagline code { font-family: inherit; font-weight: 600; letter-spacing: 0.02em; }

/* ---------- Dialoge und Seitenblatt ---------- */
dialog { border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); border-radius: 16px; padding: 0; max-width: min(520px, calc(100vw - 32px)); width: 100%; box-shadow: 0 30px 80px -20px rgba(0,0,0,0.85); }
dialog::backdrop { background: color-mix(in srgb, var(--ground) 72%, transparent); backdrop-filter: blur(3px); }
dialog[open] { animation: dlg-in 260ms var(--ease-out); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.dlg-body { padding: 22px 22px 8px; }
.dlg-body h2 { margin: 0 0 8px; font-size: 1.25rem; letter-spacing: -0.01em; }
.dlg-body p { margin: 0 0 12px; color: var(--text-2); }
.dlg-target { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border-radius: 10px; padding: 12px; margin: 6px 0 14px; }
.dlg-target strong { display: block; font-size: 1.05rem; }
.dlg-target span { color: var(--text-2); font-size: 0.88rem; }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 22px 20px; flex-wrap: wrap; }

.sheet { position: fixed; inset: 0; z-index: 40; display: none; }
.sheet.open { display: block; }
.sheet-backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--ground) 66%, transparent); animation: fade 240ms ease; }
@keyframes fade { from { opacity: 0; } }
.sheet-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); border-left: 1px solid var(--line-strong); display: flex; flex-direction: column; animation: sheet-in 360ms var(--ease-out); box-shadow: -30px 0 60px -30px rgba(0,0,0,0.8); }
@keyframes sheet-in { from { transform: translateX(40px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-size: 1.15rem; }
.sheet-body { padding: 18px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 18px; }
.sheet-foot { padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; }
.sheet-foot .btn { flex: 1; }
.label { font-size: 0.8rem; font-weight: 600; color: var(--text-2); margin: 0 0 8px; }
.pick-list { display: flex; flex-direction: column; gap: 8px; }
.pick { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; transition: border-color 160ms ease, background-color 160ms ease; }
.pick:hover { background: var(--surface-2); }
.pick input { accent-color: var(--rule); width: 18px; height: 18px; }
.pick:has(input:checked) { border-color: var(--rule); background: color-mix(in srgb, var(--rule) 7%, transparent); }
.pick.disabled { opacity: 0.5; cursor: not-allowed; }
.pick small { display: block; color: var(--text-2); }
.map-row { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 10px; align-items: center; padding: 6px 0; }
.map-row .field { min-height: 40px; }
.checks { display: flex; flex-direction: column; gap: 10px; }
.checks label { display: flex; gap: 10px; align-items: center; }
.checks input { accent-color: var(--rule); width: 18px; height: 18px; }
.detail-cam { border-radius: 12px; overflow: hidden; }
.speed .seg { width: 100%; }
.speed .seg button { flex: 1; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; background: var(--surface-3); border: 1px solid var(--line-strong); padding: 12px 16px; border-radius: 12px; z-index: 60; display: flex; align-items: center; gap: 10px; box-shadow: 0 16px 40px -12px rgba(0,0,0,0.8); transition: opacity 240ms ease, transform 320ms var(--ease-out); pointer-events: none; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }


/* ---------- Handy ---------- */
@media (max-width: 860px) {
  .rail { display: none; }
  .saver-mobile { display: flex; min-height: 44px; color: var(--text-2); font-weight: 500; }
  .head-actions { width: 100%; justify-content: space-between; }
  .main { margin-left: 0; padding: calc(16px + env(safe-area-inset-top)) 16px calc(var(--tab-h) + 28px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--mat-edge);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--mat-text); text-decoration: none; font-size: 0.7rem; font-weight: 600; position: relative; }
  .tabbar a[aria-current="page"] { color: #fff; }
  .tabbar a[aria-current="page"] svg { color: var(--rule); }
  .tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 26%; right: 26%; height: 3px; border-radius: 0 0 3px 3px; background: var(--rule); }
  .tabbar .badge { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 16px; height: 16px; border-radius: 999px; background: var(--fail); color: var(--on-fail); font-size: 0.65rem; display: grid; place-items: center; padding: 0 4px; }
  .two-col { grid-template-columns: 1fr; }
  .spools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qitem { grid-template-columns: auto 40px 1fr auto; }
  .qwhen { display: none; }
  .head-actions .btn-label-long { display: none; }
  .sheet-panel { top: auto; width: 100%; max-height: 92dvh; border-left: 0; border-top: 1px solid var(--line-strong); border-radius: 18px 18px 0 0; animation-name: sheet-up; }
  @keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
  .toast { bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); }
  .dlg-actions { flex-direction: column-reverse; }
  .dlg-actions .btn { width: 100%; }
  .hide-m { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .pcard { opacity: 1; transform: none; }
}
