:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f5;
  --border: #e4e7eb;
  --text: #15181c;
  --muted: #69717c;
  --accent: #0e9f6e;
  --accent-soft: #e3f5ee;
  --warn: #c27803;
  --warn-soft: #fdf3e1;
  --danger: #d23f3f;
  --danger-soft: #fbe9e9;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --c-fil: #0e9f6e;
  --c-energy: #5b6cf0;
  color-scheme: light;
}
/* Theme: data-theme="light" | "dark" on <html>, otherwise follow the system */
:root[data-theme="dark"] {
    --bg: #111315;
    --surface: #1a1d20;
    --surface-2: #23272b;
    --border: #2c3136;
    --text: #eceef0;
    --muted: #8d959e;
    --accent: #2dc48d;
    --accent-soft: #15322a;
    --warn: #f0b44c;
    --warn-soft: #3a2f19;
    --danger: #f07070;
    --danger-soft: #3a1f1f;
    --shadow: none;
    --c-fil: #1fae7a;
    --c-energy: #6f7df5;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
      --bg: #111315;
      --surface: #1a1d20;
      --surface-2: #23272b;
      --border: #2c3136;
      --text: #eceef0;
      --muted: #8d959e;
      --accent: #2dc48d;
      --accent-soft: #15322a;
      --warn: #f0b44c;
      --warn-soft: #3a2f19;
      --danger: #f07070;
      --danger-soft: #3a1f1f;
      --shadow: none;
    --c-fil: #1fae7a;
    --c-energy: #6f7df5;
  color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 19px; }
h3 { font-size: 15px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--danger); min-height: 1em; margin: 0; font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  padding: 12px max(20px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs a {
  padding: 7px 13px; border-radius: 999px; color: var(--muted); font-weight: 550; white-space: nowrap;
  transition: background .15s, color .15s;
}
.tabs a:hover { color: var(--text); }
.tabs a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); outline: 1px solid var(--border); }
.theme-btn {
  margin-left: auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; flex: none;
}
.theme-btn:hover { color: var(--text); }
.theme-btn svg { width: 18px; height: 18px; }
.live { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.live.on { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

main { max-width: 1240px; margin: 0 auto; padding: 24px 20px 64px; }
.section { margin-top: 32px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }

/* ---------- basics ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 550; cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }

input, select, textarea {
  width: 100%; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input[type=color] { padding: 2px; height: 40px; cursor: pointer; }
label { display: grid; gap: 5px; font-size: 13px; font-weight: 550; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted);
}
.pill.ok { background: var(--accent-soft); color: var(--accent); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  font: inherit; font-size: 13px; font-weight: 550; color: var(--muted); cursor: pointer;
}
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--text); margin-bottom: 6px; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 550; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .value small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 550; letter-spacing: 0; margin-top: 2px; }

/* ---------- printers ---------- */
.printers { display: grid; gap: 16px; }
.printer { padding: 20px; }
.printer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.printer-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.printer-meta { display: flex; gap: 16px; color: var(--muted); font-size: 13px; margin-top: 6px; flex-wrap: wrap; }
.job { margin-top: 16px; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.job-top { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.job-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; margin-top: 10px; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .4s; }

.ams-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-top: 18px; }
.ams { border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.ams-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.slots.single { grid-template-columns: minmax(0, 1fr); max-width: 90px; }
.slot {
  position: relative; display: grid; justify-items: center; gap: 6px; padding: 12px 6px 10px;
  border-radius: 10px; background: var(--surface-2); cursor: pointer; text-align: center;
  border: 2px solid transparent; transition: border-color .15s, background .15s;
}
.slot:hover { background: var(--border); }
.slot.active { border-color: var(--accent); }
.slot.active::after {
  content: "druckt"; position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
}
.slot .mat { font-weight: 650; font-size: 13px; }
.slot .sub { font-size: 11.5px; color: var(--muted); line-height: 1.25; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot .grams { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.slot.empty-slot .mat { color: var(--muted); font-weight: 550; }

/* spool graphic */
.spool {
  --c: #ccc; width: 46px; height: 46px; border-radius: 50%; flex: none;
  background: radial-gradient(circle, var(--surface) 0 22%, transparent 23%),
              conic-gradient(var(--c) calc(var(--p, 100) * 1%), color-mix(in srgb, var(--c) 22%, var(--surface-2)) 0);
  box-shadow: 0 0 0 1px var(--border);
}
.spool.lg { width: 64px; height: 64px; }
.spool.none { background: repeating-linear-gradient(45deg, var(--border) 0 4px, transparent 4px 8px); }

/* ---------- inventory ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input[type=search] { max-width: 260px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.spool-card { padding: 16px; display: grid; gap: 12px; cursor: pointer; transition: border-color .15s, transform .15s; }
.spool-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.spool-card .top { display: flex; gap: 12px; align-items: center; min-width: 0; }
.spool-card .title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spool-card .sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spool-card .amount { display: flex; justify-content: space-between; font-size: 13px; font-variant-numeric: tabular-nums; }
.spool-card .bar { margin-top: 6px; height: 6px; }
.spool-card .foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.bar.low > span { background: var(--warn); }
.bar.empty > span { background: var(--danger); }

/* ---------- history ---------- */
.list { display: grid; }
.row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; padding: 14px 18px;
  border-bottom: 1px solid var(--border); align-items: center;
}
.row:last-child { border-bottom: 0; }
.row .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { color: var(--muted); font-size: 13px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row .right { text-align: right; display: grid; justify-items: end; gap: 4px; }
.swatch { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; }
.swatch i { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); display: inline-block; }

.chart { display: flex; align-items: flex-end; gap: 3px; height: 90px; padding-top: 8px; }
.chart > div { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; position: relative; }
.chart > div:hover { opacity: 1; }

/* ---------- dialog ---------- */
dialog {
  border: 1px solid var(--border); border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 24px));
  background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
dialog::backdrop { background: rgba(10, 12, 14, .45); backdrop-filter: blur(2px); }
.dlg { padding: 22px; display: grid; gap: 16px; max-height: calc(100vh - 40px); overflow: auto; }
.dlg-head { display: flex; align-items: center; gap: 14px; }
.dlg-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.dlg-actions .left { margin-right: auto; display: flex; gap: 8px; }
.pick-list { display: grid; gap: 6px; max-height: 340px; overflow: auto; }
.pick {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%;
}
.pick:hover { background: var(--surface-2); }
.pick.sel { border-color: var(--accent); background: var(--accent-soft); }
.pick .spool { width: 32px; height: 32px; }
.history { display: grid; gap: 0; font-size: 13px; max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.history div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.history div:last-child { border-bottom: 0; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(360px, 100%); display: grid; gap: 12px; justify-items: center; text-align: center; }
.login-card input, .login-card button { width: 100%; }
.login-card h1 { font-size: 22px; }
.login-card p { margin: 0; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 550; font-size: 14px;
  transition: opacity .2s, transform .2s; z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .topbar { gap: 10px 12px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 8px; }
  .tabs { order: 3; width: 100%; }
  .tabs a { padding: 6px 11px; }
  main { padding: 16px 14px 48px; }
  .ams-row { grid-template-columns: 1fr; }
}

/* ---------- review + warnings ---------- */
.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px;
  background: var(--warn-soft); color: var(--text); margin-bottom: 16px;
}
.notice .icon { color: var(--warn); font-weight: 800; flex: none; }
.notice .body { flex: 1; min-width: 0; display: grid; gap: 8px; }
.notice .items { display: flex; gap: 8px; flex-wrap: wrap; }
.notice.bad { background: var(--danger-soft); }
.notice.bad .icon { color: var(--danger); }
.job .notice { margin: 12px 0 0; padding: 10px 12px; font-size: 13.5px; }

/* ---------- statistics ---------- */
.stats.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .stats.six { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.panel { padding: 18px 18px 16px; }
.panel h3 { margin-bottom: 12px; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.cost-chart { position: relative; }
.cost-chart .plot { display: flex; align-items: flex-end; gap: 3px; height: 180px; border-bottom: 1px solid var(--border); padding-top: 6px; }
.cost-chart .col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; cursor: default; position: relative; }
.cost-chart .col:hover::before { content: ""; position: absolute; inset: 0 -1px; background: var(--surface-2); border-radius: 4px; z-index: 0; }
.cost-chart .seg { position: relative; z-index: 1; min-height: 0; }
.cost-chart .seg.fil { background: var(--c-fil); }
.cost-chart .seg.energy { background: var(--c-energy); }
.cost-chart .col .seg:first-child { border-radius: 4px 4px 0 0; }
.cost-chart .axis { display: flex; gap: 3px; font-size: 11px; color: var(--muted); margin-top: 6px; }
.cost-chart .axis span { flex: 1; text-align: center; white-space: nowrap; overflow: hidden; }
.cost-chart .ymax { position: absolute; top: -2px; left: 0; font-size: 11px; color: var(--muted); }
.tip {
  position: fixed; z-index: 50; pointer-events: none; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; box-shadow: 0 8px 24px rgba(0,0,0,.18);
  display: none; min-width: 150px;
}
.tip .t { font-weight: 650; margin-bottom: 4px; }
.tip div { display: flex; justify-content: space-between; gap: 12px; }
.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13.5px; }
.hbar .track { height: 10px; border-radius: 0 4px 4px 0; background: var(--surface-2); overflow: hidden; }
.hbar .fill { height: 100%; background: var(--c-fil); border-radius: 0 4px 4px 0; }
.hbar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .val { font-variant-numeric: tabular-nums; color: var(--muted); text-align: right; }
.color-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.color-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.color-item .dot { width: 22px; height: 22px; border-radius: 50%; box-shadow: 0 0 0 1px var(--border); flex: none; }
.color-item .meta { min-width: 0; }
.color-item .meta div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.simple { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.simple th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 0 8px 8px; }
table.simple td { padding: 9px 8px; border-top: 1px solid var(--border); }
table.simple td.num, table.simple th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cta { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.check { display: flex !important; align-items: center; gap: 8px; color: var(--text) !important; font-weight: 500 !important; font-size: 14px !important; }
.check input { width: auto; }
.stat .label .swatch, .tip .swatch { margin-right: 6px; }

/* ---------- energy (smart plug) ---------- */
.energy-card { padding: 0; overflow: hidden; }
.energy-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.energy-tiles .stat + .stat { border-left: 1px solid var(--border); }
@media (max-width: 860px) {
  .energy-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .energy-tiles .stat:nth-child(3) { border-left: 0; }
  .energy-tiles .stat:nth-child(n+3) { border-top: 1px solid var(--border); }
}
.power-chart { border-top: 1px solid var(--border); padding: 14px 18px 12px; }
.pc-plot { position: relative; height: 140px; cursor: crosshair; }
.pc-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pc-plot .grid { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.pc-plot .line { fill: none; stroke: var(--c-energy); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.pc-plot .area { fill: var(--c-energy); opacity: .12; }
.pc-plot .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.pc-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--c-energy); box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.pc-y span { position: absolute; left: 0; transform: translateY(-120%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; pointer-events: none; }
.pc-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }

/* ---------- inventory views ---------- */
.inv-table { padding: 0; overflow-x: auto; }
.inv-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.inv-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.inv-table th button { all: unset; cursor: pointer; }
.inv-table th button:hover, .inv-table th button.active { color: var(--text); }
.inv-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; font-variant-numeric: tabular-nums; }
.inv-table tr:last-child td { border-bottom: 0; }
.inv-table tbody tr { cursor: pointer; }
.inv-table tbody tr:hover td { background: var(--surface-2); }
.inv-table .num { text-align: right; }
.inv-table .name { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.inv-table .dotc { width: 18px; height: 18px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.inv-table .mini { width: 90px; height: 6px; display: inline-block; vertical-align: middle; margin-right: 8px; }
.group-head { display: flex; align-items: baseline; gap: 10px; margin: 22px 0 10px; }
.group-head h3 { font-size: 15px; }
.inv-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.inv-tile { padding: 14px 10px 12px; display: grid; justify-items: center; gap: 6px; text-align: center; cursor: pointer; }
.inv-tile:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.inv-tile .t { font-size: 13px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-tile .s { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.toolbar select { font: inherit; font-size: 13px; width: auto; }
.inv-controls { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; align-items: center; }
@media (max-width: 700px) {
  .inv-table .opt { display: none; }
  .inv-controls { margin-left: 0; }
}
.plug-rows { border-top: 1px solid var(--border); padding: 10px 18px; display: grid; gap: 6px; }
.plug-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.plug-row strong { margin-left: auto; }

.list-more { display: flex; justify-content: center; margin-top: 16px; }

/* ---------- maintenance ---------- */
.maint-row .bar { max-width: 420px; margin-top: 8px; height: 6px; }
.maint-note { margin-top: 4px; max-width: 70ch; }
.maint-note summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); user-select: none; }
.maint-note summary::-webkit-details-marker { display: none; }
.maint-note summary::before { content: ''; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin-right: 3px; }
.maint-note[open] summary::before { transform: rotate(45deg); }
.maint-note summary:hover { color: var(--text); }
.maint-note > div { margin-top: 4px; white-space: normal; }
.maint-log { padding: 12px 16px; }
.maint-log summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.maint-log .history { margin-top: 10px; }
.bar.due > span { background: var(--danger); }
