﻿:root {
  color-scheme: dark;
  --bg: #0b1117;
  --panel: #141d27;
  --panel-2: #192431;
  --border: #2a3948;
  --text: #f4f7fb;
  --text-secondary: #9cacbd;
  --primary: #6da8ff;
  --success: #3ddc84;
  --warning: #f2a84a;
  --danger: #ff6464;
  --radius-lg: 20px;
  --radius-md: 14px;
  --card: var(--panel);
  --card-2: #101923;
  --card-3: var(--panel-2);
  --line: var(--border);
  --muted: var(--text-secondary);
  --ok: var(--success);
  --warn: var(--warning);
  --bad: var(--danger);
  --accent: var(--primary);
  --accent-ink: #071018;
  --radius: var(--radius-lg);
  --radius-sm: var(--radius-md);
  --shadow: 0 10px 28px rgba(0, 0, 0, .22);
  --gap: 14px;
  --pad: 16px;
  --nav-h: 72px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
::-webkit-scrollbar { height: 0; width: 0; }

.icon-btn svg,
.nav svg,
.eye svg,
.field-ico svg,
.logo svg,
.dc-name svg,
.statebox svg,
.chart-tools svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(14, 19, 24, .92);
  border-bottom: 1px solid rgba(42, 53, 66, .9);
  backdrop-filter: blur(12px);
}
.top-inner {
  position: relative;
  max-width: 1040px;
  margin: 0 auto;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
}
.top-mid { min-width: 0; flex: 1; }
.title-line { display: flex; align-items: center; gap: 0; min-width: 0; }
#title {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body[data-page="device"] #title { cursor: pointer; }
.sub {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 16px;
}
.sub:empty { display: none; }
.sub::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: none;
  flex: 0 0 auto;
}
.sub.run::before, .sub.stop::before, .sub.bad::before { display: inline-block; }
.sub.run::before { background: var(--ok); }
.sub.stop::before { background: #8b98a6; }
.sub.bad::before { background: var(--bad); }
.icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.icon-btn:active { background: var(--card-2); }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card-3);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  flex: 0 0 auto;
}
.avatar:active { transform: scale(.96); }
.menu {
  position: absolute;
  top: calc(100% - 4px);
  left: 52px;
  z-index: 30;
  min-width: 168px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.menu-right { left: auto; right: 12px; }
.menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  font-size: 15px;
}
.menu button:last-child { border-bottom: 0; }
.menu button.on, .menu button:active { background: var(--card-3); color: var(--accent); }

main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px var(--pad) calc(var(--nav-h) + 28px + env(safe-area-inset-bottom));
}
body[data-page="home"] main,
body[data-page="account"] main { padding-bottom: calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); }
body[data-page="login"] .topbar { display: none; }
body[data-page="login"] main {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px calc(28px + env(safe-area-inset-bottom));
}
#view.enter { animation: fade .18s ease; }
@keyframes fade { from { opacity: .35; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  #view.enter, .spin { animation: none; }
  .device-card, .go, .chip, .avatar { transition: none; }
}

.hero, .card, .shaft-card, .device-card, .panel, .login-card, .user-card, .roll, .fold {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card, .panel, .shaft-card, .roll { box-shadow: none; }
.hero {
  background: linear-gradient(180deg, #1c2631 0%, var(--card) 70%);
  padding: 16px;
}
.card { padding: 12px; }
.panel { padding: 12px; margin-top: var(--gap); background: var(--card-2); }
.panel-label, .label, .card > span, .shaft-card header span, .dc-metrics span, .user-card .meta {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: var(--gap); }
.wide { grid-column: 1 / -1; }
.minor .card { background: var(--card-2); }
.minor .card strong { font-size: 18px; color: #d5dee8; }

.speed, .hero strong.num, .meter-line strong, .dc-metrics strong, .health-score {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.speed {
  font-size: clamp(42px, 14vw, 64px);
  line-height: .95;
  font-weight: 650;
  margin-top: 6px;
}
.unit, .meter-line small, .dc-metrics small, .mval small, strong small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  margin-left: 4px;
  letter-spacing: 0;
}
.bar { height: 8px; border-radius: 99px; background: #2a3440; margin-top: 10px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.bar.health i { background: var(--ok); }
.bar.health.warn i { background: var(--warn); }
.bar.health.bad i { background: var(--bad); }
.spark { width: 100%; height: 72px; display: block; margin-top: 8px; }
.spark-label { margin-top: 14px; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #8b98a6; margin-right: 6px; }
.dot.run { background: var(--ok); }
.dot.full { background: var(--ok); }
.dot.prun, .dot.thread { background: var(--accent); }
.dot.crawl { background: #e0a15a; }
.dot.low { background: #8eb4d4; }
.dot.stop { background: #8b98a6; }
.dot.bad { background: var(--bad); }
.dot.wait { background: var(--warn); }
.status { display: inline-flex; align-items: center; font-size: 13px; color: var(--muted); }
.status.run, .status.full { color: var(--ok); }
.status.prun, .status.thread { color: var(--accent); }
.status.crawl { color: #e0a15a; }
.status.low { color: #8eb4d4; }
.status.stop { color: #b7c3d0; }
.status.bad { color: var(--bad); }

.state { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.state.run, .state.good, .state.full { background: #143526; color: var(--ok); }
.state.prun, .state.thread { background: #1a2a3d; color: var(--accent); }
.state.crawl { background: #3a2c16; color: #e0a15a; }
.state.low { background: #1c2a36; color: #8eb4d4; }
.state.stop { background: #2a323b; color: #c5d0db; }
.state.warn { background: #3a3014; color: var(--warn); }
.state.bad { background: #3a2424; color: var(--bad); }

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #3a241c;
  color: #ffc7b0;
  font-size: 13px;
}
.banner button, .statebox button {
  border: 1px solid rgba(255, 255, 255, .16);
  background: transparent;
  color: inherit;
  border-radius: 10px;
  min-height: 36px;
  padding: 0 10px;
}

.shaft-card { padding: 14px; margin-top: 10px; }
.shaft-card header, .dc-top, .dc-foot, .chart-head, .user-top, .health-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.shaft-card header b { color: var(--accent); font-size: 13px; }
.meter-line { margin-top: 8px; }
.meter-line strong { font-size: 28px; }
.shaft-card p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }

.motors { margin-top: var(--gap); padding: 4px 12px 8px; }
.mrow {
  display: grid;
  grid-template-columns: 1.1fr .9fr .9fr;
  gap: 8px;
  align-items: baseline;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.mrow:last-child { border-bottom: 0; }
.mname { color: var(--text); font-size: 14px; }
.mval { text-align: right; font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; }
.mhead { color: var(--muted); font-size: 12px; font-weight: 500; padding-bottom: 0; }
.mhead span { font-weight: 500; font-size: 12px; }

.temp-mark {
  display: block;
  width: 36px;
  height: 4px;
  margin-top: 10px;
  border-radius: 99px;
  background: #8d7560;
}

.device-head { margin: 4px 2px 14px; }
.device-head h2 { margin: 0; font-size: 22px; font-weight: 650; }
.device-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.device-card {
  width: 100%;
  text-align: left;
  padding: 16px;
  margin-top: 12px;
  color: var(--text);
  transition: transform .16s ease, background .16s ease;
}
.device-card:active { transform: scale(.985); background: var(--card-3); }
.dc-name { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; }
.dc-name svg { width: 18px; height: 18px; color: var(--accent); }
.dc-metrics { display: flex; gap: 18px; margin: 16px 0 14px; }
.dc-metrics strong { display: block; margin-top: 4px; font-size: 28px; line-height: 1; }
.dc-product { margin-top: 10px; color: var(--muted); font-size: 13px; }
.dc-foot { color: var(--muted); font-size: 13px; }
.shift-block { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.shift-kicker { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.shift-line { display: flex; justify-content: space-between; gap: 12px; margin-top: 4px; color: var(--muted); font-size: 13px; }
.shift-line strong { color: var(--text); font-weight: 650; }
.rate.high { color: var(--ok); }
.rate.mid { color: var(--accent); }
.rate.low { color: #e0a15a; }
.fold { margin-top: 10px; padding: 0; overflow: hidden; }
.fold-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 16px;
  font-weight: 700;
}
.fold-head b { color: var(--muted); font-size: 13px; font-weight: 650; }
.fold-body { padding: 0 14px 14px; }
.fold-label { margin: 12px 0 0; color: var(--text); font-size: 13px; font-weight: 700; }
.mini { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.mini input, .mini select, .mini textarea {
  width: 100%;
  background: #10161c;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 44px;
  padding: 8px 12px;
  font-size: 16px;
}
.mini textarea { min-height: 72px; resize: vertical; }
.pair { display: flex; gap: 8px; }
.pair .mini { flex: 1; min-width: 0; }
.go.slim { min-height: 40px; margin-top: 8px; }
.item-block { margin-top: 8px; padding-top: 4px; border-top: 1px solid var(--line); }
.item-block:first-child { border-top: 0; }
.report-banner strong { font-size: 16px; }
.home-actions { margin: 8px 0 4px; }
.home-actions .go { flex: 1; }
.query-device { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.query-device strong { font-size: 16px; }
.fold.low { border-color: #8a6233; }
.report-back {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-height: 32px;
  padding: 0;
  font-size: 13px;
}
.report-titlebar { position: relative; min-height: 32px; margin: 2px 0 8px; }
.report-titlebar h2 { margin: 0; text-align: center; font-size: 22px; font-weight: 700; }
.report-who {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  max-width: 46%;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  text-align: right;
}
.report-split { margin: 16px 2px 4px; color: var(--muted); font-size: 12px; text-align: center; }
.confirm-tag { color: #e0a15a; font-weight: 700; font-size: 12px; margin-left: 6px; }
.qty-line { display: flex; gap: 8px; align-items: flex-end; }
.qty-line .mini { flex: 1; min-width: 0; }
.unit-suffix { display: flex; align-items: center; min-height: 44px; color: var(--muted); font-size: 14px; }
#parseText { min-height: 140px; }
.report-done { white-space: pre-line; font-size: 15px; font-weight: 700; }
.mask {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, .55);
}
.sheet {
  width: min(100%, 520px);
  margin-bottom: 8px;
  padding: 18px 16px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.sheet strong { display: block; font-size: 17px; }
.sheet p { margin: 8px 0 0; color: var(--text); font-size: 14px; }
.ask-actions { display: flex; gap: 8px; margin-top: 16px; }
.ask-actions .go { flex: 1; margin-top: 0; }
body.report-screen #title { visibility: visible; }
.sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sheet-grid .qty-line { min-width: 0; }
@media (max-width: 640px) {
  .sheet-grid { grid-template-columns: 1fr; }
}
input.auto-filled, textarea.auto-filled, select.auto-filled {
  border-color: #ef5350;
  background: rgba(239, 83, 80, 0.08);
  box-shadow: 0 0 0 1px rgba(239, 83, 80, 0.18);
  color: var(--text);
}
@keyframes uncertainPulse {
  0%, 100% {
    border-color: #ef5350;
    box-shadow: 0 0 0 1px rgba(239, 83, 80, 0.2);
  }
  50% {
    border-color: #ff8a80;
    box-shadow: 0 0 8px rgba(239, 83, 80, 0.6);
  }
}
input.field-uncertain, textarea.field-uncertain, select.field-uncertain {
  animation: uncertainPulse 1.2s ease-in-out infinite;
  background: rgba(239, 83, 80, 0.05);
  color: var(--text);
}
input.validation-error, textarea.validation-error, select.validation-error {
  border-color: #ff4d4f !important;
  background: rgba(255, 77, 79, 0.06);
  box-shadow: 0 0 0 1px rgba(255, 77, 79, 0.35);
  animation: none !important;
}
.mode-hint { margin: 4px 0 0; color: #ff8a80; font-size: 12px; }
.fine-card {
  position: relative;
  margin: 8px 0;
  padding: 8px 8px 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.fine-card .icon-x {
  position: absolute;
  top: 6px;
  right: 6px;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.day-add { margin-top: 4px; }
.hp-shift, .day-shift { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.hp-shift:first-child, .day-shift:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.hp-label { margin: 0 0 8px; text-align: center; color: var(--muted); font-size: 13px; letter-spacing: 0.12em; }
.dc-foot .go-mark { color: var(--text); font-size: 20px; line-height: 1; }

.login-card { width: min(100%, 400px); padding: 28px 20px 20px; }
.brand { text-align: center; margin-bottom: 22px; }
.logo {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #1d3348;
  color: var(--accent);
}
.brand h2 { margin: 0; font-size: 22px; }
.brand .en { margin: 4px 0 0; color: var(--muted); font-size: 12px; letter-spacing: .04em; }
.brand .tag { margin: 8px 0 0; color: #b7c6d6; font-size: 13px; }
.field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  margin-top: 10px;
  padding: 0 8px 0 12px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.field-text { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 6px 0; }
.field-k { color: var(--muted); font-size: 11px; }
.field input {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  height: 24px;
  font-size: 16px;
}
.field input:focus { outline: none; }
.eye {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
}
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack label { color: var(--muted); font-size: 13px; margin-top: 6px; }
.stack input, .stack select, .times input, input[type="date"], input[type="month"], input[type="time"], input[type="text"], input[type="password"] {
  width: 100%;
  background: #10161c;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 48px;
  padding: 10px 12px;
  font-size: 16px;
}
.stack input[type="checkbox"] { width: auto; min-height: 0; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); }

.go, .chip {
  border: 1px solid var(--line);
  background: #24303b;
  color: var(--text);
  border-radius: 12px;
  min-height: 44px;
  padding: 8px 12px;
  transition: transform .16s ease, background .16s ease;
}
.go:active, .chip:active, .roll:active, .user-card:active { transform: scale(.98); }
.go.primary {
  width: 100%;
  margin-top: 8px;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}
#loginGo { letter-spacing: .12em; }
.go.block { width: 100%; margin-top: 10px; }
.chip.on, .seg button.on {
  background: #1d3d66;
  border-color: #3d6eaa;
  color: #d7e8ff;
}
.fine { text-align: center; color: var(--muted); font-size: 12px; margin: 12px 0 0; }
.err { color: #ff8d8d; min-height: 1.2em; margin: 8px 0; font-size: 13px; }
.ok { color: var(--ok); min-height: 1.2em; margin: 8px 0; font-size: 13px; }
.hint { margin: 8px 2px 0; color: var(--muted); font-size: 12px; }
.h2 { margin: 16px 0 0; font-size: 16px; }

.scroller, .row { display: flex; gap: 8px; align-items: center; }
.row { flex-wrap: wrap; }
.card strong, .roll strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}
.hero > span { color: var(--muted); font-size: 12px; }
.shiftbar.on { border-color: #3d6eaa; }
.scroller { overflow-x: auto; padding-bottom: 2px; }
.scroller .chip, .row .chip, .row .go { flex: 0 0 auto; border-radius: 999px; }
.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-top: 10px;
}
.seg button {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}
.times { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.times .go { grid-column: 1 / -1; }
.picked { margin: 8px 0; color: var(--text); font-size: 14px; }
.group-name { margin: 12px 0 6px; color: var(--muted); font-size: 12px; }
.fields { margin-top: 4px; }
.fields .row { flex-wrap: wrap; }

.chart-card { margin-top: var(--gap); padding: 12px; }
.chart-head { align-items: flex-start; margin-bottom: 6px; }
.chart-head .meta, #histMeta, #hpMeta { color: var(--muted); font-size: 12px; line-height: 1.45; }
#chart { width: 100%; height: 320px; }
#chartWrap:fullscreen, #chartWrap:-webkit-full-screen {
  background: var(--bg);
  padding: 12px;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
#chartWrap:fullscreen #chart, #chartWrap:-webkit-full-screen #chart { height: auto; flex: 1; min-height: 0; }
.chart-tools {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--text);
}
#monthChart { height: 420px; }

.shiftbar { width: 100%; text-align: left; margin-top: 8px; }
.shiftbar strong { font-size: 18px; }
.roll {
  display: block;
  width: 100%;
  text-align: left;
  margin-top: 8px;
  padding: 12px;
  color: inherit;
}
.roll strong { display: block; margin-top: 4px; font-size: 18px; }
.health-card { text-align: left; padding: 14px; }
.health-score { font-size: 40px; line-height: 1; margin: 8px 0; }
.health-foot { margin-top: 8px; }

.toolbar { display: flex; gap: 8px; }
.toolbar .go { flex: 1; }

.user-card {
  width: 100%;
  text-align: left;
  padding: 14px;
  margin-top: 10px;
  color: inherit;
}
.user-card strong { font-size: 16px; }
.user-card .id { color: var(--muted); font-size: 13px; margin-top: 2px; }
.users-wrap { display: none; overflow-x: auto; }
.users { width: 100%; border-collapse: collapse; font-size: 14px; }
.users th, .users td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.more { color: var(--muted); letter-spacing: 1px; }

.statebox {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 2px 4px;
  color: var(--muted);
}
.statebox.bad { color: #ffb4b4; }
.spin {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  background: #0c1014;
  border-top: 1px solid var(--line);
  padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
}
nav.show { display: grid; }
nav.cols3 { grid-template-columns: repeat(3, 1fr); }
nav button {
  min-height: 52px;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  border-radius: 12px;
  position: relative;
}
nav button svg { width: 20px; height: 20px; }
nav button.active { color: var(--accent); font-weight: 700; background: rgba(126, 182, 255, .08); }
nav button.active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 18px;
  height: 2px;
  border-radius: 99px;
  background: var(--accent);
}

@media (min-width: 800px) {
  .grid.metrics-4 { grid-template-columns: repeat(4, 1fr); }
  .user-cards { display: none; }
  .users-wrap { display: block; }
  #chart { height: 420px; }
  nav {
    left: 50%;
    right: auto;
    width: min(1040px, 100%);
    transform: translateX(-50%);
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }
}
@media (max-width: 799px) {
  .users-wrap { display: none; }
}
.month-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.month-nav strong { font-size: 16px; }
.month-nav button {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  font-size: 22px;
}
.rate.multi { color: #8aa4be; }
.rate.none { color: var(--muted); }
.ov-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.ov-sum .card span { display: block; color: var(--muted); font-size: 12px; }
.ov-sum .card strong { display: block; margin-top: 6px; font-size: 20px; }
.ov-chart-scroll { width: 100%; min-width: 0; }
#ovChart { width: 100%; min-width: 0; }
.ov-chart-tip { margin-top: 4px; }
.ov-cards { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 8px; }
.ov-card {
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.ov-unit { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.ov-unit .hint { margin: 0 0 4px; }
#ovChart { height: 420px; margin-top: 8px; }
.comp-kicker { margin: 14px 2px 0; font-weight: 700; }
.comp-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.comp-sum .card span { display: block; color: var(--muted); font-size: 12px; }
.comp-sum .card strong { display: block; margin-top: 6px; font-size: 18px; }
#compChart { height: 280px; margin-top: 12px; }
.comp-title { margin: 16px 2px 0; font-size: 15px; }
.comp-day {
  margin-top: 8px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.comp-day-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.comp-more {
  margin-top: 8px;
  margin-left: auto;
  display: block;
  border: 0;
  background: transparent;
  color: var(--accent);
  min-height: 36px;
  font-size: 14px;
}
.comp-table { display: none; width: 100%; border-collapse: collapse; margin-top: 8px; }
.comp-table th, .comp-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.comp-sheet { width: min(100%, 560px); max-height: min(78vh, 680px); overflow: auto; margin-bottom: calc(8px + env(safe-area-inset-bottom)); }
.comp-shift { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.comp-item { margin-top: 8px; padding-top: 8px; }
.comp-item + .comp-item { border-top: 1px dashed var(--line); }
@media (min-width: 800px) {
  .comp-table { display: table; }
  .comp-cards { display: none; }
  .ov-sum { grid-template-columns: repeat(4, 1fr); }
  .ov-cards { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1100px) {
  .ov-cards { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 380px) {
  main, .top-inner { padding-left: 12px; padding-right: 12px; }
  .comp-sum { grid-template-columns: 1fr; }
  .speed { font-size: 40px; }
  .dc-metrics strong { font-size: 24px; }
}

/* Unified mobile-first presentation. No data or save rules are defined here. */
html { scroll-padding-top: 140px; }
body { font-size: 16px; line-height: 1.5; }
button, input, select, textarea { font-family: inherit; }
button { touch-action: manipulation; }
main { max-width: 1320px; padding: 18px 16px calc(var(--nav-h) + 32px + env(safe-area-inset-bottom)); }
.topbar { background: rgba(11,17,23,.96); border-color: var(--border); }
.top-inner { max-width: 1320px; min-height: calc(76px + env(safe-area-inset-top)); padding: calc(12px + env(safe-area-inset-top)) 16px 12px; gap: 12px; }
#title { font-size: clamp(26px, 6.6vw, 30px); font-weight: 700; line-height: 1.3; }
.sub { font-size: 13px; margin-top: 4px; }
.icon-btn, .avatar, .eye { width: 44px; height: 44px; min-height: 44px; }
.avatar { background: var(--panel-2); font-size: 17px; }
.icon-btn svg { width: 26px; height: 26px; }
.device-tabs { max-width: 1288px; margin: 0 auto; padding: 0 16px 12px; display: flex; gap: 6px; }
.device-tabs button { flex: 1; min-width: 0; min-height: 44px; display: flex; justify-content: center; align-items: center; gap: 6px; border: 0; border-radius: var(--radius-md); background: var(--panel); color: var(--muted); font-size: 14px; }
.device-tabs button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.device-tabs button.active { color: var(--primary); background: #172c46; }
nav, nav.cols3 { grid-template-columns: repeat(3, minmax(0,1fr)); background: rgba(11,17,23,.98); padding: 6px 10px calc(6px + env(safe-area-inset-bottom)); }
nav button { min-height: 60px; font-size: 13px; gap: 4px; border-radius: 16px; }
nav button svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
nav button.active { color: var(--primary); background: #142740; }
nav button.active::before { height: 3px; width: 26px; }
.hero, .card, .shaft-card, .device-card, .panel, .fold, .ov-card, .comp-day { border-radius: var(--radius-lg); box-shadow: none; }
.hero { padding: 22px 20px; background: var(--panel-2); }
.card, .ov-card, .comp-day, .shaft-card { padding: 18px; }
.panel { padding: 18px; }
.grid { gap: 14px; grid-template-columns: repeat(2,minmax(0,1fr)); }
.grid > *, .pair > *, .sheet-grid > *, .ov-sum > *, .comp-sum > * { min-width: 0; }
.card > span, .label, .panel-label, .shaft-card header span { font-size: 14px; }
.card strong { font-size: 26px; line-height: 1.3; overflow-wrap: anywhere; }
.card .shift-line strong, .ov-card .shift-line strong, .comp-day .shift-line strong { font-size: 16px; margin-top: 0; }
.hero .speed { font-size: 44px; line-height: 1.15; font-weight: 700; margin-top: 6px; overflow-wrap: anywhere; }
.hero .unit, .dc-metrics small { font-size: 16px; }
.hero .label { margin-top: 10px; }
.hero .state { font-size: 14px; padding: 5px 12px; }
.hero .speed[style] { font-size: 24px !important; letter-spacing: 0; }
.state { white-space: normal; }
.status { font-size: 13px; }
.dot { flex: 0 0 8px; }
.status.stop, .status.wait, .rate.none { color: var(--muted); }
.dot.stop, .dot.wait { background: var(--muted); }
.status.bad { color: var(--danger); }
.rate.low, .status.crawl { color: var(--warning); }
.dc-top { align-items: flex-start; gap: 10px; }
.dc-top .status { flex-shrink: 0; padding-top: 3px; }
.device-head { margin: 0 0 16px; }
.device-head h2 { font-size: 23px; }
.device-head p { font-size: 14px; margin-top: 4px; }
#picker { display: grid; grid-template-columns: minmax(0,1fr); gap: 14px; }
.device-card { margin: 0; padding: 12px 16px; min-width: 0; align-self: start; }
.device-card[data-live]:not([data-live=""]) { min-height: 210px; }
.dc-name { font-size: 21px; line-height: 1.3; min-width: 0; }
.dc-name svg { flex-shrink: 0; width: 21px; height: 21px; }
.dc-metrics { gap: 18px; margin: 4px 0 2px; align-items: flex-end; }
.dc-metrics > div { min-width: 0; }
.dc-metrics span { font-size: 13px; line-height: 1.3; }
.dc-metrics strong { display: inline; font-size: 36px; font-weight: 700; line-height: 1.1; margin-top: 0; }
.dc-metrics small { display: inline; margin-left: 6px; }
.device-card[data-live="hotpress"] .dc-metrics > div + div strong { font-size: 22px; letter-spacing: -.02em; overflow-wrap: anywhere; }
.device-card[data-live="hotpress"] .dc-metrics > div + div small { font-size: 13px; }
.dc-product { margin: 0; font-size: 16px; line-height: 1.3; color: var(--text); overflow-wrap: anywhere; }
.dc-foot { font-size: 13px; line-height: 1.25; margin-top: 4px; }
.shift-block { margin-top: 8px; padding-top: 8px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px 10px; line-height: 1.3; }
.shift-kicker { grid-column: 1 / -1; font-size: 13px; line-height: 1.4; }
.shift-block .shift-line { display: block; margin: 0; font-size: 12px; }
.shift-block .shift-line strong { display: block; font-size: 14px; overflow-wrap: anywhere; }
.shift-block .shift-line:has(strong):nth-last-child(1) { min-width: 0; }
.shift-block > .shift-line:only-of-type { grid-column: 1 / -1; }
.shift-line { font-size: 14px; align-items: baseline; gap: 12px; margin-top: 8px; }
.shift-line > strong { text-align: right; overflow-wrap: anywhere; min-width: 0; }
.shift-block .shift-line > strong { text-align: left; }
.statebox { padding: 22px 2px; font-size: 15px; }
.statebox p { margin: 0; }
.loading-state { padding: 20px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-top: 14px; }
.loading-caption { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.skeleton { background: var(--panel-2); height: 18px; border-radius: 6px; margin-top: 10px; animation: skeletonPulse 1.5s ease-in-out infinite alternate; }
.skeleton.short { width: 64%; }
@keyframes skeletonPulse { to { opacity: .45; } }
.report-back, #statBack, #queryBack, #userBack { display: none; }
#reportRoot, #compRoot, #statRoot, #queryRoot { min-width: 0; }
.report-titlebar { min-height: 0; margin: 0 0 10px; }
.report-titlebar h2 { display: none; }
.report-who { position: static; transform: none; max-width: none; text-align: left; font-size: 13px; }
.seg { padding: 4px; gap: 4px; border-radius: 16px; margin: 0 0 14px; background: var(--card-2); }
.seg button { min-height: 48px; border-radius: 12px; padding: 8px; font-size: 15px; line-height: 1.4; min-width: 0; font-weight: 600; }
.seg button.on, .chip.on { color: #dceaff; background: #1d395c; border-color: #426799; }
#parseKinds button { font-size: 14px; }
#reportModes { margin-top: 0; }
#reportShifts { margin: 12px 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
#reportShifts .chip { width: 100%; border-radius: 14px; }
.fold-label { margin: 14px 0 8px; font-size: 14px; }
.report-split { text-align: left; font-size: 15px; font-weight: 600; margin: 22px 0 10px; color: var(--text); }
#parseBox { margin-top: 14px; padding: 16px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); }
#parseBox .fold-label { margin-top: 0; }
#parseBox .seg { margin-bottom: 12px; }
#parseText { min-height: 160px; max-height: none; resize: vertical; line-height: 1.6; }
.mini { font-size: 14px; gap: 7px; margin-top: 12px; }
.mini input, .mini select, .mini textarea, .stack input:not([type="checkbox"]), .stack select, .times input,
input[type="date"], input[type="month"], input[type="time"], input[type="text"], input[type="password"] {
  width: 100%; min-width: 0; min-height: 54px; border-radius: 14px; border: 1px solid var(--border); background: var(--card-2); color: var(--text); padding: 12px; font-size: 16px; line-height: 1.4;
}
.mini textarea { min-height: 84px; font-family: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(109,168,255,.4); outline-offset: 1px; border-color: var(--primary); }
input[type="date"], input[type="month"], input[type="time"] { max-width: 100%; }
.field { min-height: 64px; }
.field input, .field input[type="password"], .field input[type="text"] { min-height: 30px; height: 30px; background: transparent; border: 0; padding: 0; border-radius: 0; }
.field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(109,168,255,.16); }
.field input:focus { outline: 0; }
.field-k { font-size: 12px; }
.field-text { padding: 9px 0; }
.go, .go.slim, .go.block, .chip, .chart-tools, .banner button, .statebox button { min-height: 52px; border-radius: 14px; padding: 10px 16px; font-size: 15px; }
.go.primary { min-height: 54px; margin-top: 14px; background: var(--primary); color: #091728; }
.go.slim { min-height: 44px; font-size: 14px; }
#reportSave { margin-top: 22px; }
.err:empty, .ok:empty { margin: 0; min-height: 0; }
.err, .ok { font-size: 14px; overflow-wrap: anywhere; }
.hint, .fine { font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.hint.warn { color: var(--warning); }
.pair, .sheet-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.sheet-grid:has(> .qty-line > select) { grid-template-columns: minmax(0,1fr); }
.qty-line { gap: 6px; min-width: 0; }
.qty-line > select { width: 76px; flex: 0 0 76px; min-width: 0; min-height: 54px; border-radius: 14px; padding: 8px; border: 1px solid var(--border); background: var(--card-2); }
.unit-suffix { min-height: 54px; font-size: 14px; flex-shrink: 0; }
.fold { margin-top: 12px; }
.fold-head { min-height: 62px; padding: 16px; gap: 10px; font-size: 18px; }
.fold-head > span { min-width: 0; overflow-wrap: anywhere; }
.fold-head b { flex-shrink: 0; font-size: 13px; border-radius: 99px; padding: 4px 9px; background: var(--panel-2); }
.fold-head[data-tone="normal"] b { color: var(--success); }
.fold-head[data-tone="stop"] b { color: var(--muted); }
.fold-head[data-tone="bad"] b { color: var(--danger); }
.fold-head[data-tone="warn"] b { color: var(--warning); }
.fold-body { padding: 0 16px 18px; }
.fold-body .mini:first-child { margin-top: 0; }
.item-block, .fine-card { border: 0; border-radius: 0; padding: 12px 0 0; margin-top: 12px; }
.item-block + .item-block, .fine-card + .fine-card { border-top: 1px solid var(--border); }
.fine-card { padding-top: 38px; }
.fine-card .icon-x { min-height: 36px; top: 0; right: 0; }
.hp-shift, .day-shift { margin-top: 20px; padding-top: 20px; }
.hp-label { font-size: 15px; text-align: left; letter-spacing: 0; font-weight: 700; color: var(--primary); padding-bottom: 4px; }
input.auto-filled, textarea.auto-filled, select.auto-filled { border-color: #e07777; background: rgba(255,100,100,.05); box-shadow: none; }
@keyframes uiUncertainPulse { from { border-color: #ec8a53; box-shadow: 0 0 0 1px rgba(242,168,74,.14); } to { border-color: #ffad78; box-shadow: 0 0 0 3px rgba(242,168,74,.24); } }
input.field-uncertain, textarea.field-uncertain, select.field-uncertain,
input.auto-uncertain, textarea.auto-uncertain, select.auto-uncertain { border-color: #ff995f; animation: uiUncertainPulse 1.5s ease-in-out infinite alternate; background: rgba(242,168,74,.08); }
input.validation-error, textarea.validation-error, select.validation-error { border: 2px solid #ff4d4f !important; background: rgba(255,77,79,.1) !important; box-shadow: 0 0 0 2px rgba(255,77,79,.22) !important; animation: none !important; }
.ov-sum { gap: 12px; margin: 14px 0; grid-template-columns: repeat(2,minmax(0,1fr)); }
.ov-sum .card { min-height: 106px; padding: 16px; }
.ov-sum .card span { font-size: 13px; }
.ov-sum .card strong { font-size: 32px; line-height: 1.2; margin-top: 8px; }
.ov-sum .card:first-child strong { font-size: 30px; }
.ov-cards { gap: 14px; }
.comp-title { font-size: 21px; margin: 22px 0 12px; }
.comp-sum { gap: 12px; }
.comp-sum .card { padding: 14px; }
.comp-sum .card span { font-size: 13px; }
.comp-sum .card strong { font-size: 22px; overflow-wrap: anywhere; }
.comp-day-top { align-items: flex-start; }
.comp-day-top > strong { font-size: 19px; }
.comp-more { min-height: 44px; font-size: 15px; padding: 8px 0 8px 12px; }
#compRange { margin: 0 0 12px; }
#compChart { height: 300px; }
#ovChart { margin-top: 14px; }
#statModes { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; overflow: visible; }
#statModes .chip { border-radius: 14px; padding: 8px 4px; font-size: 14px; }
#statBody { display: grid; grid-template-columns: minmax(0,1fr); gap: 14px; }
#statBody > .hint, #statBody > #statUnit, #statBody > .chart-card, #statBody > #statDetail { grid-column: 1 / -1; }
#statBody > .hint { margin: 14px 0 0; }
#statBody .card > strong:first-child { font-size: 21px; margin: 0 0 12px; }
.scroller { flex-wrap: wrap; overflow: visible; }
.scroller .chip { flex: 1 1 auto; border-radius: 14px; }
.chart-card { padding: 16px; }
.chart-tools { min-height: 44px; padding: 8px 10px; }
.chart-head { flex-wrap: wrap; gap: 10px; }
.chart-head .meta { font-size: 13px; }
.mrow { grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1fr); }
.mval { overflow-wrap: anywhere; }
.motors { padding-top: 8px; padding-bottom: 8px; }
.shaft-card { margin-top: 14px; }
.shaft-card header span { font-size: 15px; }
.sheet, .comp-sheet { border-radius: 22px; padding: 22px 18px; max-height: calc(90dvh - env(safe-area-inset-bottom)); overflow-y: auto; }
.mask { padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
.ask-actions { gap: 12px; }
.ask-actions .go { min-width: 0; padding: 10px; }
.login-card { padding: 30px 22px 24px; border-radius: 24px; }
.brand h2 { font-size: 28px; }
.brand .en { font-size: 13px; }
.brand .tag { font-size: 14px; }
.logo { width: 60px; height: 60px; border-radius: 18px; }
.menu button { min-height: 52px; }
@media (min-width: 800px) {
  nav { width: min(1320px,100%); }
  .ov-sum { grid-template-columns: repeat(5,minmax(0,1fr)); }
  .ov-cards { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #picker { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #statBody { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #reportRoot { max-width: 960px; margin: 0 auto; }
  .fold-body > .hp-shift, .fold-body > .day-shift { max-width: 100%; }
  .fold-body:has(> .hp-shift), .fold-body:has(> .day-shift) { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
  .fold-body > .hp-shift, .fold-body > .day-shift { margin-top: 0; padding-top: 0; border-top: 0; min-width: 0; }
}
@media (min-width: 1100px) {
  #picker, .ov-cards, #statBody { grid-template-columns: repeat(3,minmax(0,1fr)); }
  body[data-page="device"] .grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 380px) {
  main, .top-inner { padding-left: 16px; padding-right: 16px; }
  .top-inner { gap: 8px; }
  #title { font-size: 26px; }
  .device-tabs { gap: 4px; }
  .device-tabs button { font-size: 13px; gap: 4px; }
  .device-tabs button svg { width: 16px; }
  .comp-sum { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
  .comp-sum .card { padding: 10px; }
  .comp-sum .card strong { font-size: 20px; }
  .dc-metrics strong { font-size: 36px; }
  .sheet-grid .qty-line { gap: 4px; }
  .qty-line > select { width: 64px; flex-basis: 64px; }
}
@media (max-width: 339px) {
  .pair, .sheet-grid, .comp-sum { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton, input.field-uncertain, textarea.field-uncertain, select.field-uncertain,
  input.auto-uncertain, textarea.auto-uncertain, select.auto-uncertain { animation: none; }
}

/* Home exit protection: a non-blocking, short-lived navigation hint. */
.exit-toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  top: 62%;
  transform: translate(-50%, -50%);
  max-width: calc(100vw - 40px);
  padding: 12px 22px;
  border-radius: 14px;
  background: rgba(45, 52, 62, .94);
  color: #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .24);
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
  pointer-events: none;
}

/* Fixed-device manual completion page, with separate collection details. */
.device-report-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; }
.device-report-head strong { font-size:20px; }
.device-report-head .hint { margin:6px 0 0; }
.device-report-head .go { flex-shrink:0; padding:10px 12px; width:auto; }
.device-report .comp-cards { display:grid; grid-template-columns:minmax(0,1fr); gap:14px; }
.device-report .comp-table { display:none; }
.device-report .comp-day { min-width:0; margin:0; }
.device-manual-title,.device-auto-title { font-size:13px; font-weight:600; color:var(--text-secondary); margin:12px 0 8px; }
.device-auto { border-top:1px solid var(--border); margin-top:12px; padding-top:2px; }
.device-auto-title { color:var(--primary); }
.device-auto-value { font-size:16px; line-height:1.6; overflow-wrap:anywhere; }
.device-auto .comp-more { margin-top:8px; }
.device-auto-value .comp-more { margin-left:8px; }
@media(min-width:800px) { .device-report .comp-cards { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(min-width:1100px) { .device-report .comp-cards { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:380px) { .device-report-head { align-items:flex-start; } .device-report-head .go { font-size:14px; } }

/* Four primary destinations, including the default online equipment page. */
nav.cols4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Collection timestamps and source freshness, shared by home and live pages. */
.source-freshness { display:flex; flex-direction:column; gap:5px; padding:12px 14px; margin:0 0 14px; border:1px solid #344858; border-radius:12px; color:#aebed0; background:#16212c; font-size:13px; line-height:1.55; overflow-wrap:anywhere; text-align:left; }
.source-freshness strong { font-size:14px; color:#b7d4ec; }
.source-freshness.warn { border-color:#9b7436; background:#30291d; }
.source-freshness.warn strong { color:#ffd18a; }
.source-freshness.bad { border-color:#a15b63; background:#30212a; }
.source-freshness.bad strong { color:#ffb0b9; }
.dc-foot:has(.source-freshness) { align-items:flex-start; }
.dc-foot .source-freshness { flex:1; min-width:0; margin:0; padding:9px 10px; font-size:12px; }
.dc-foot .source-freshness strong { font-size:13px; }
.state.bad { color:#ffb0b9; background:#4a2c36; }

/* Healthy collection data has no notice or empty footer row. */
.source-freshness[hidden], .dc-foot:has(.source-freshness[hidden]) { display:none; }

#fDevices, #reportDeviceSelection { border: 1px solid var(--line, #2d3b49); border-radius: 14px; padding: 12px; margin: 12px 0; min-width: 0; }
#fDevices .check, #reportDeviceSelection .check { display: inline-flex; align-items: center; gap: 8px; margin: 8px 16px 8px 0; }
#fDevices input, #reportDeviceSelection input { width: 20px; height: 20px; }
.submit-summary section { padding: 12px 0; border-top: 1px solid var(--line, #2d3b49); }
.submit-summary p { overflow-wrap: anywhere; }

#appUpdateNotice { position: fixed; z-index: 1200; top: calc(8px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 24px); border: 1px solid #6ba7ff; border-radius: 12px; background: #1b3555; color: #fff; padding: 12px 18px; box-shadow: 0 4px 20px #0005; font: inherit; cursor: pointer; }
