/* stonietseng.com — Apple-style design (owner, 2026-10-03: 「make it feel like apple website style, clear stylish and
   easy to view」), made dense on 2026-10-10 (owner: 「icons and texts dont need to be too big, i hope to see more data
   in a glance, it's best that i dont even need to scroll」): 14 px body, 22 px page titles, ~28–32 px table rows,
   numbers strips instead of big cards, sparkline-size charts. Type scale and density rules: docs/DESIGN.md §15.
   One stylesheet for the public page and the console. Strict CSP: no inline styles; data-driven widths are set by
   app.js from data-pct. Light / dark: follows the device unless html[data-theme] says otherwise. */

:root {
  --bg: #f5f5f7;
  --bg-elev: #ffffff;
  --bg-sunk: #e8e8ed;
  --bg-hover: #f5f5f7;
  --nav-bg: rgba(251, 251, 253, 0.8);
  --line: #d2d2d7;
  --line-soft: #e8e8ed;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --accent: #0071e3;
  --link: #0066cc;
  --accent-soft: rgba(0, 113, 227, 0.1);
  --ok: #34c759;
  --ok-text: #248a3d;
  --ok-soft: rgba(52, 199, 89, 0.14);
  --warn: #ff9f0a;
  --warn-text: #b25000;
  --warn-soft: rgba(255, 159, 10, 0.16);
  --bad: #ff3b30;
  --bad-text: #d70015;
  --bad-soft: rgba(255, 59, 48, 0.12);
  --muted-soft: rgba(120, 120, 128, 0.12);
  --chart: #0071e3;
  --chart-fill: rgba(0, 113, 227, 0.08);
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  /* density scale (DESIGN.md §15) */
  --fs: 14px;
  --fs-s: 12.5px;
  --fs-xs: 11.5px;
  --gap: 12px;
  --pad: 14px;
  --mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang TC", "Helvetica Neue",
    "Microsoft JhengHei", "Noto Sans TC", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --bg-elev: #161617;
    --bg-sunk: #2c2c2e;
    --bg-hover: #1d1d1f;
    --nav-bg: rgba(22, 22, 23, 0.8);
    --line: #424245;
    --line-soft: #2c2c2e;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #86868b;
    --accent: #0a84ff;
    --link: #2997ff;
    --accent-soft: rgba(10, 132, 255, 0.18);
    --ok: #30d158;
    --ok-text: #30d158;
    --ok-soft: rgba(48, 209, 88, 0.16);
    --warn: #ff9f0a;
    --warn-text: #ffb340;
    --warn-soft: rgba(255, 159, 10, 0.18);
    --bad: #ff453a;
    --bad-text: #ff6961;
    --bad-soft: rgba(255, 69, 58, 0.18);
    --muted-soft: rgba(120, 120, 128, 0.24);
    --chart: #2997ff;
    --chart-fill: rgba(41, 151, 255, 0.12);
    --shadow: none;
    --shadow-hover: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #000000;
  --bg-elev: #161617;
  --bg-sunk: #2c2c2e;
  --bg-hover: #1d1d1f;
  --nav-bg: rgba(22, 22, 23, 0.8);
  --line: #424245;
  --line-soft: #2c2c2e;
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #86868b;
  --accent: #0a84ff;
  --link: #2997ff;
  --accent-soft: rgba(10, 132, 255, 0.18);
  --ok: #30d158;
  --ok-text: #30d158;
  --ok-soft: rgba(48, 209, 88, 0.16);
  --warn: #ff9f0a;
  --warn-text: #ffb340;
  --warn-soft: rgba(255, 159, 10, 0.18);
  --bad: #ff453a;
  --bad-text: #ff6961;
  --bad-soft: rgba(255, 69, 58, 0.18);
  --muted-soft: rgba(120, 120, 128, 0.24);
  --chart: #2997ff;
  --chart-fill: rgba(41, 151, 255, 0.12);
  --shadow: none;
  --shadow-hover: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--fs)/1.45 var(--sans);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 0.4rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
h1 { font-size: 22px; }
h2 { font-size: 15px; letter-spacing: -0.01em; }
h3 { font-size: 14px; letter-spacing: 0; }
p { margin: 0 0 0.6rem; }
code, .mono { font-family: var(--mono); font-size: 0.88em; letter-spacing: 0; }
hr { border: 0; border-top: 1px solid var(--line-soft); margin: 12px 0; }
.small { font-size: var(--fs-s); }
.tiny { font-size: var(--fs-xs); }
.muted { color: var(--text-3); }
.dim { color: var(--text-2); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden, [hidden] { display: none !important; }
.wrap-anywhere { overflow-wrap: anywhere; }
.mt { margin-top: var(--gap); }
.mb { margin-bottom: var(--gap); }
.mb-s { margin-bottom: 6px; }
.mt-s { margin-top: 6px; }
.warn-text { color: var(--warn-text); }
.link-more::after { content: " ›"; }

/* ------------------------------------------------------------------ global nav (frosted glass) */
.globalnav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line-soft);
}
.globalnav-inner {
  max-width: 1480px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 6px; height: 44px;
}
.brand { display: flex; align-items: center; gap: 7px; color: var(--text); font-weight: 600; font-size: 15px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.brand-dot.warn { background: var(--warn); }
.brand-dot.bad { background: var(--bad); }
/* No overflow on the menu bar: an overflow box clips the 更多 dropdown (bug 2026-10-10 — the menu opened inside the
   bar's own scroll box and nothing was visible). Below 1000 px the phone menu takes over. */
.nav { display: flex; gap: 1px; flex: 1; min-width: 0; justify-content: center; align-items: center; }
.nav a { color: var(--text); opacity: 0.8; padding: 4px 9px; font-size: 13px; white-space: nowrap; border-radius: 980px; }
.nav a:hover { opacity: 1; text-decoration: none; background: var(--muted-soft); }
.nav a.active { opacity: 1; font-weight: 600; background: var(--muted-soft); }
.top-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 32px; height: 32px; padding: 0 7px;
  border-radius: 980px; background: transparent; border: 0; color: var(--text); opacity: 0.8; cursor: pointer; font: inherit; font-size: 13px;
}
.icon-btn:hover { opacity: 1; background: var(--muted-soft); text-decoration: none; }
.bell-count, .count-pill { background: var(--bad); color: #fff; border-radius: 9px; font-size: 10.5px; line-height: 16px; min-width: 16px; padding: 0 5px; text-align: center; font-weight: 600; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; }
.user-menu summary::-webkit-details-marker { display: none; }
.menu {
  position: absolute; right: 0; top: 38px; min-width: 210px; background: var(--bg-elev); border: 1px solid var(--line-soft);
  border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18); padding: 5px; z-index: 60;
}
.menu a, .menu button {
  display: block; width: 100%; text-align: left; padding: 6px 10px; border-radius: 7px; color: var(--text); background: none;
  border: 0; font: inherit; font-size: 13.5px; cursor: pointer; opacity: 1;
}
.menu a:hover, .menu button:hover { background: var(--bg-hover); text-decoration: none; }
.menu .menu-head { padding: 6px 10px 8px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.menu .menu-sep { border-top: 1px solid var(--line-soft); margin: 4px 6px; }
.nav-more { position: relative; }
.nav-more > summary { list-style: none; cursor: pointer; color: var(--text); opacity: 0.8; padding: 4px 9px; font-size: 13px; border-radius: 980px; white-space: nowrap; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary::after { content: "⌄"; margin-left: 3px; font-size: 11px; }
.nav-more > summary:hover, .nav-more[open] > summary { opacity: 1; background: var(--muted-soft); }
.nav-more.active > summary { opacity: 1; font-weight: 600; background: var(--muted-soft); }
.nav-more .menu { left: 0; right: auto; top: 32px; min-width: 170px; }
.menu-btn { display: none; }
.glyph { width: 17px; height: 17px; display: block; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--text); color: var(--bg-elev); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; text-transform: uppercase; }
@media (max-width: 1000px) {
  .globalnav .nav { display: none; }
  .menu-btn { display: inline-flex; }
  .globalnav.open .nav {
    display: flex; flex-direction: column; align-items: stretch; position: absolute; top: 44px; left: 0; right: 0;
    padding: 6px 12px 12px; background: var(--bg-elev); box-shadow: 0 16px 32px rgba(0, 0, 0, 0.18);
    border-bottom: 1px solid var(--line-soft); gap: 0; max-height: calc(100vh - 44px); overflow-y: auto;
  }
  .globalnav.open .nav a, .globalnav.open .nav-more > summary {
    font-size: 15px; padding: 9px 10px; min-height: 40px; border-radius: 9px; opacity: 1; display: flex; align-items: center;
  }
  .globalnav.open .nav-more .menu { position: static; box-shadow: none; border: 0; background: transparent; padding: 0 0 0 14px; min-width: 0; }
  .globalnav.open .nav-more .menu a { font-size: 15px; }
}

/* ------------------------------------------------------------------ page structure */
.page { max-width: 1480px; margin: 0 auto; padding: 16px 20px 36px; }
.page-wide { max-width: 1480px; }
.page-mid { max-width: 1120px; }
.page-narrow { max-width: 760px; }
.page-head { display: flex; align-items: flex-end; gap: 6px 14px; flex-wrap: wrap; margin-bottom: 12px; }
.page-head h1 { margin: 0; }
.page-head .eyebrow { color: var(--text-2); font-size: 12px; font-weight: 600; margin-bottom: 1px; }
.page-head .sub { color: var(--text-2); margin-top: 2px; font-size: 13px; }
.page-head .actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.section-title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; margin: 18px 0 8px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.section-title .side { margin-left: auto; font-size: 12.5px; font-weight: 400; letter-spacing: 0; }
.section-title:first-child { margin-top: 0; }
.footer { color: var(--text-3); font-size: 11px; text-align: center; padding: 14px 20px 20px; border-top: 1px solid var(--line-soft); }
.footer a { color: var(--text-2); }

.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.stack > * + * { margin-top: var(--gap); }
.row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.row > select { width: auto; max-width: 100%; }  /* a choice next to a button (e.g. which Pushover application) */
.row-between { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.spacer { flex: 1; }
.split { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.split-3 { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 960px) { .split, .split-3 { grid-template-columns: minmax(0, 1fr); } }

.card { background: var(--bg-elev); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px var(--pad); min-width: 0; }
.card > h2:first-child, .card > h3:first-child { margin-bottom: 8px; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head .actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-head { padding: 10px var(--pad) 4px; }
.card-link { color: inherit; display: block; transition: box-shadow 0.2s ease; }
.card-link:hover { text-decoration: none; box-shadow: var(--shadow-hover), inset 0 0 0 1px var(--line); }

/* ------------------------------------------------------------------ tiles (numbers) */
.tiles { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); margin-bottom: var(--gap); }
.tile { background: var(--bg-elev); border-radius: var(--radius-sm); padding: 8px 12px; box-shadow: var(--shadow); min-width: 0; }
.tile .label { color: var(--text-2); font-size: 11.5px; font-weight: 600; }
.tile .value { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .value small { font-size: 12px; color: var(--text-3); font-weight: 500; margin-left: 2px; letter-spacing: 0; }
.tile .value.small-value { font-size: 16px; }
.tile .note { color: var(--text-3); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.ok .value { color: var(--ok-text); }
.tile.warn .value { color: var(--warn-text); }
.tile.bad .value { color: var(--bad-text); }
.tiles.in-card .tile { background: var(--bg); box-shadow: none; }

/* ------------------------------------------------------------------ badges, dots */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 0 7px; border-radius: 980px; font-size: 11px; font-weight: 600;
  background: var(--muted-soft); color: var(--text-2); white-space: nowrap; line-height: 17px; letter-spacing: 0; vertical-align: 1px;
}
.badge.ok { background: var(--ok-soft); color: var(--ok-text); }
.badge.warn { background: var(--warn-soft); color: var(--warn-text); }
.badge.bad { background: var(--bad-soft); color: var(--bad-text); }
.badge.info { background: var(--accent-soft); color: var(--accent); }
.badge .dot { width: 6px; height: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); display: inline-block; flex: none; }
.dot.ok, .dot.online, .dot.up { background: var(--ok); }
.dot.warn, .dot.degraded, .dot.new, .dot.unknown { background: var(--warn); }
.dot.bad, .dot.offline, .dot.down { background: var(--bad); }
.dot.off, .dot.paused { background: var(--text-3); }
.dot.pulse { animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.5); } 70% { box-shadow: 0 0 0 6px rgba(52, 199, 89, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0); } }
.state-text { font-weight: 600; }
.state-text.up, .state-text.ok, .state-text.online { color: var(--ok-text); }
.state-text.down, .state-text.bad, .state-text.offline { color: var(--bad-text); }
.state-text.degraded, .state-text.warn { color: var(--warn-text); }

/* ------------------------------------------------------------------ meters */
.meter { display: grid; grid-template-columns: 44px 1fr 38px; align-items: center; gap: 8px; font-size: 12px; }
.meter + .meter { margin-top: 5px; }
.meter .name { color: var(--text-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.bar { height: 5px; background: var(--bg-sunk); border-radius: 3px; overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; background: var(--ok); border-radius: 3px; transition: width 0.6s cubic-bezier(0.25, 0.1, 0.25, 1); }
.bar.warn > span { background: var(--warn); }
.bar.bad > span { background: var(--bad); }
.meter.wide { grid-template-columns: minmax(80px, 150px) 1fr 38px; }

.spark polyline { fill: none; stroke: var(--chart); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }

/* ------------------------------------------------------------------ 主機 (/console/hosts, rewritten 2026-11-21 — owner:
   「more clear, monitoring … no text going out of the textbox」). Numbers strip → filter → rows or cards. Every text
   that can be long (names, models, alert titles) is ONE line with an ellipsis (its full text is the tooltip); the
   list's columns drop with the panel's width (container queries) and stack on phones. */
.hosts-sub { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; }
/* .kpis.hosts-kpis: two classes, so these win over the generic .kpis rules further down */
.kpis.hosts-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpis.hosts-kpis .kpi .s { max-width: 100%; }
.kpis.hosts-kpis .kpi.has-spark .s { max-width: 56%; }  /* the sparkline sits on the right half */
@media (max-width: 900px) {
  .kpis.hosts-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis.hosts-kpis .kpi { box-shadow: -1px 0 0 var(--line-soft), 0 -1px 0 var(--line-soft); }
  .kpis.hosts-kpis .kpi:last-child { grid-column: span 2; }  /* 3 + 2: no empty cell */
}
@media (max-width: 560px) {
  .kpis.hosts-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis.hosts-kpis .kpi:last-child { grid-column: 1 / -1; }
}
.hosts-bar { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin-bottom: 10px; }
.hosts-bar .segmented a { display: inline-flex; align-items: center; gap: 6px; }
.seg-n { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 980px; background: var(--muted-soft); color: var(--text-2);
  font-size: 11px; font-weight: 600; line-height: 16px; text-align: center; font-variant-numeric: tabular-nums; }
.seg-n.warn { background: var(--warn-soft); color: var(--warn-text); }
.seg-n.bad { background: var(--bad-soft); color: var(--bad-text); }
.hosts-legend { margin-left: auto; display: flex; gap: 4px 12px; flex-wrap: wrap; color: var(--text-3); font-size: 11.5px; }
.hosts-legend .lg { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.hosts-empty a { white-space: nowrap; }

/* a problem: one line, ellipsis — never wider than its row / card */
.prob { position: relative; display: inline-block; max-width: 100%; min-width: 0; padding: 0 8px 0 18px; border-radius: 980px;
  font-size: 11.5px; font-weight: 500; line-height: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--muted-soft); color: var(--text-2); }
.prob::before { content: ""; position: absolute; left: 7px; top: 50%; margin-top: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.prob.bad { background: var(--bad-soft); color: var(--bad-text); }
.prob.bad::before { background: var(--bad); }
.prob.warn { background: var(--warn-soft); color: var(--warn-text); }
.prob.warn::before { background: var(--warn); }
.prob.info { background: var(--accent-soft); color: var(--accent); }
.prob.info::before { background: var(--accent); }
.prob.more { padding-left: 8px; }
.prob.more::before { display: none; }
.temp-v.warn, .hl-c b.warn, .hc-facts b.warn { color: var(--warn-text); }
.temp-v.bad, .hl-c b.bad, .hc-facts b.bad { color: var(--bad-text); }

/* list: a header row + one grid row per machine; problems are a full-width line under the numbers */
.hl-head, .hl-row { display: grid; column-gap: 12px; align-items: center; padding-left: var(--pad); padding-right: var(--pad);
  grid-template-columns: minmax(150px, 2.4fr) 84px repeat(3, minmax(88px, 1fr)) 84px 92px 96px 92px; }
.hl-head { font-size: 11.5px; font-weight: 600; color: var(--text-2); padding-top: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.hl-head > span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hl-head .r, .hl-row .r { text-align: right; align-items: flex-end; }
.hl-group { display: flex; align-items: baseline; gap: 10px; padding: 5px var(--pad); background: var(--bg); font-size: 11.5px; font-weight: 600;
  color: var(--text-2); border-bottom: 1px solid var(--line-soft); }
.hl-group .n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl-group .c { margin-left: auto; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hl-row { color: var(--text); min-height: 46px; padding-top: 6px; padding-bottom: 6px; row-gap: 5px; border-bottom: 1px solid var(--line-soft); }
.host-list > .hl-row:last-child { border-bottom: 0; }
a.hl-row:hover { text-decoration: none; background: var(--bg-hover); }
.hl-row > * { min-width: 0; }
.hl-row.lvl-bad { box-shadow: inset 3px 0 0 var(--bad); }
.hl-row.lvl-warn { box-shadow: inset 3px 0 0 var(--warn); }
.hl-name, .hc-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hl-id, .hc-id { min-width: 0; flex: 1 1 auto; }
.hl-id .n, .hc-id .n { font-weight: 600; font-size: 13.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.hl-id .t, .hc-id .t { color: var(--text-3); font-size: 11.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hl-row.offline .hl-id .n, .hl-row.new .hl-id .n, .hl-row.off .hl-id .n { color: var(--text-2); }
.hl-state { display: flex; }
.hl-state .badge, .hc-head .badge { flex: none; }
.hl-lab { display: none; }
.hl-m .mm { min-width: 0; }
.hl-c, .hl-net, .hl-up { display: flex; flex-direction: column; font-size: 12px; line-height: 1.3; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.hl-c > *, .hl-net > *, .hl-up > * { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.hl-c b { font-weight: 600; }
.hl-c small, .hl-up small { color: var(--text-3); font-size: 11px; }
.hl-net { color: var(--text-2); font-size: 11.5px; }
.hl-spark .spark { display: block; width: 100%; height: 22px; }
.hl-gone { grid-column: 3 / -1; color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hl-probs { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; padding-left: 15px; }
@container (max-width: 1080px) {
  .hl-head, .hl-row { grid-template-columns: minmax(150px, 2.4fr) 84px repeat(3, minmax(84px, 1fr)) 84px 92px 88px; }
  .hl-spark, .hl-spark-h { display: none; }
}
@container (max-width: 880px) {
  .hl-head, .hl-row { grid-template-columns: minmax(130px, 2fr) 80px repeat(3, minmax(76px, 1fr)) 76px; }
  .hl-net, .hl-net-h, .hl-up, .hl-up-h { display: none; }
}
@container (max-width: 640px) {
  .hl-head { display: none; }
  .hl-row { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 14px; row-gap: 6px; padding-top: 9px; padding-bottom: 10px; }
  .hl-name { grid-column: 1 / 3; }
  .hl-state { grid-column: 3; justify-content: flex-end; }
  .hl-lab { display: block; font-size: 10.5px; font-weight: 600; color: var(--text-3); line-height: 1.2; margin-bottom: 1px; }
  .hl-c { display: none; }
  .hl-gone { grid-column: 1 / -1; padding-left: 15px; }
  .hl-m { padding-left: 0; }
  .hl-row .hl-m:first-of-type { padding-left: 15px; }
}

/* cards: header · meters · 24 h CPU · facts grid · problems · footer — fixed slots, so long texts never push out */
.host-cards { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, 272px), 1fr)); }
.hc { display: flex; flex-direction: column; gap: 9px; padding: 12px 14px 10px; overflow: hidden; }
.hc.lvl-bad { box-shadow: inset 3px 0 0 var(--bad), var(--shadow); }
.hc.lvl-warn { box-shadow: inset 3px 0 0 var(--warn), var(--shadow); }
.hc.lvl-bad:hover { box-shadow: inset 3px 0 0 var(--bad), var(--shadow-hover), inset 0 0 0 1px var(--line); }
.hc.lvl-warn:hover { box-shadow: inset 3px 0 0 var(--warn), var(--shadow-hover), inset 0 0 0 1px var(--line); }
.hc-id .n { font-size: 14px; }
.hc-spark { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; }
.hc-spark .spark { display: block; width: 100%; height: 24px; }
.hc-spark span { font-size: 10.5px; color: var(--text-3); white-space: nowrap; }
.hc-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; margin: 0; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.hc-facts > div { min-width: 0; }
.hc-facts dt { font-size: 10.5px; font-weight: 600; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-facts dd { margin: 0; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-facts dd b { font-weight: 600; }
.hc-gone { display: flex; flex-direction: column; gap: 2px; padding: 9px 11px; border-radius: var(--radius-sm); background: var(--bad-soft); min-width: 0; }
.hc-gone strong { color: var(--bad-text); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-gone span { color: var(--text-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc.new .hc-gone { background: var(--warn-soft); }
.hc.new .hc-gone strong { color: var(--warn-text); }
.hc.off .hc-gone { background: var(--muted-soft); }
.hc.off .hc-gone strong { color: var(--text-2); }
.hc-probs { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.hc-foot { margin-top: auto; display: flex; gap: 10px; font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .hosts-legend { display: none; } }

/* host page (主機 → one machine, 2026-11-21): problems as one-line chips, disk rows whose mount point is shortened
   from the left (full path on hover), settings in a policy card + 主機設定 | small cards. */
.host-probs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: var(--gap); min-width: 0; }
a.prob:hover { text-decoration: none; filter: brightness(0.97); }
.disk-row { padding: 3px 0 5px; min-width: 0; }
.disk-row + .disk-row { border-top: 1px solid var(--line-soft); padding-top: 6px; }
.disk-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.disk-mount { flex: 1 1 auto; min-width: 0; font-family: var(--mono); font-size: 11.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.disk-pct { flex: none; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.disk-pct.warn { color: var(--warn-text); }
.disk-pct.bad { color: var(--bad-text); }
.disk-row .bar { display: block; margin: 3px 0 2px; }
.disk-sub { color: var(--text-3); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table.fs-table td.wrap { min-width: 100px; }  /* 磁碟 → 檔案系統: path (format under it) · size · bar fit a phone */
.table.procs-mini td.wrap { min-width: 0; }  /* 總覽's side card: the program name wraps, the numbers stay in view */
.fs-table .fs-use { width: 34%; min-width: 96px; }
.check-list { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-bottom: 4px; }
.check-list .check { margin: 0; }
.form-grid.align-end { align-items: end; }
.settings-split { align-items: start; }
.alert-rules { display: flex; flex-direction: column; }
.alert-rule { display: grid; gap: 8px; align-items: end; padding: 8px 0; border-top: 1px solid var(--line-soft);
  grid-template-columns: minmax(130px, 1fr) minmax(160px, 2.2fr) 96px 112px auto; }
.alert-rule:last-child { border-bottom: 1px solid var(--line-soft); }
.alert-rule .field { margin: 0; min-width: 0; }
.alert-rule .ar-remove { margin-bottom: 2px; }
@media (max-width: 734px) { .form-grid.thresholds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }  /* value + 持續 side by side */
@media (max-width: 760px) {
  .alert-rule { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .alert-rule .ar-value { grid-column: 1 / -1; grid-row: 2; }
  .alert-rule .ar-kind { grid-column: 1 / -1; }
  .alert-rule .ar-remove { grid-column: 1 / -1; justify-self: start; }
}
/* the safety net: an unbreakable word (a path, a token, a long name) wraps inside its card instead of widening the
   page; break-word (not anywhere) leaves tables' column widths alone */
.card, .panel, .page-head, .callout { overflow-wrap: break-word; }
.page-head > div { min-width: 0; }
.big-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.big-stats .stat .v { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.big-stats .stat .v small { font-size: 12px; color: var(--text-3); font-weight: 500; }
.big-stats .stat .k { font-size: 11px; color: var(--text-2); font-weight: 600; }
.big-stats .stat .bar { margin-top: 4px; }

/* ------------------------------------------------------------------ lists & tables (rows ≈ 28–32 px) */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; color: var(--text-2); font-weight: 600; font-size: 11.5px; padding: 6px 10px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.table td { padding: 5px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; line-height: 1.35; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--bg-hover); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-compact { font-size: 12.5px; }
.table-compact td, .table-compact th { padding: 4px 8px; }
.table td.wrap { white-space: normal; overflow-wrap: anywhere; word-break: break-word; min-width: 160px; }
.table .show-s { display: none; }  /* phones only: what the .hide-s columns held (e.g. 通知紀錄's message) */
.table td.top { vertical-align: top; }
.table .sub-line { display: block; color: var(--text-3); font-size: 11.5px; line-height: 1.3; }
.table tr.group td { background: var(--bg); font-size: 11.5px; font-weight: 600; color: var(--text-2); padding-top: 5px; padding-bottom: 5px; }
.table tr.group:hover td { background: var(--bg); }
.table tr.offline td, .table tr.paused td { color: var(--text-2); }
.table .bar { min-width: 40px; }
.mm { display: inline-flex; align-items: center; gap: 6px; min-width: 84px; width: 100%; }
.mm .bar { flex: 1; min-width: 36px; }
.mm .v { min-width: 30px; text-align: right; font-weight: 600; font-size: 12px; font-variant-numeric: tabular-nums; }
.table .spark { width: 84px; height: 20px; display: block; }
.table .power-spark { width: 120px; height: 22px; }
.table .bars-cell { min-width: 150px; width: 22%; }
.table .bars-cell .uptime-bars { height: 14px; }
.table .actions-cell { text-align: right; white-space: nowrap; }
.table .actions-cell form { display: inline; }
.card.flush .table td:first-child, .card.flush .table th:first-child { padding-left: var(--pad); }
.card.flush .table td:last-child, .card.flush .table th:last-child { padding-right: var(--pad); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; font-size: 13px; margin: 0; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
/* iOS-style grouped list */
.list { background: var(--bg-elev); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.list-row { display: flex; align-items: center; gap: 10px; padding: 6px var(--pad); min-height: 34px; color: var(--text); position: relative; }
.list-row + .list-row::before { content: ""; position: absolute; top: 0; left: var(--pad); right: 0; border-top: 1px solid var(--line-soft); }
a.list-row:hover { background: var(--bg-hover); text-decoration: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { font-weight: 500; }
.list-row .sub { color: var(--text-2); font-size: 12px; }
.list-row .chev { color: var(--text-3); }
.list-row .chev::after { content: "›"; font-size: 17px; line-height: 1; }

/* ------------------------------------------------------------------ forms */
label { display: block; font-weight: 500; margin-bottom: 3px; color: var(--text); font-size: 12.5px; }
input:not([type]), input[type=text], input[type=password], input[type=email], input[type=number], input[type=url], input[type=search], input[type=date], input[type=time], select, textarea {
  width: 100%; padding: 5px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-elev);
  color: var(--text); font: inherit; font-size: 13.5px; min-height: 32px; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
select { -webkit-appearance: none; appearance: none; padding-right: 28px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 11px) 50%; background-size: 4px 4px; background-repeat: no-repeat; }
textarea { min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.field { margin-bottom: 10px; }
.field .help { color: var(--text-2); font-size: 11.5px; margin-top: 3px; line-height: 1.4; }
.field .error { color: var(--bad-text); font-size: 12px; margin-top: 3px; }
.form-grid { display: grid; gap: 0 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.form-grid.wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; color: var(--text); font-size: 13px; }
.check input { margin-top: 2px; }
.inline-form { display: inline; }
.form-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.form-row > .field { flex: 1 1 160px; margin-bottom: 0; }
.form-row > .field-narrow { flex: 0 1 90px; }
.form-row > .field-auto { flex: 0 0 auto; padding-bottom: 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 4px 13px; min-height: 30px;
  border-radius: 980px; border: 0; background: var(--bg-sunk); color: var(--text); font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap; letter-spacing: 0; transition: background 0.15s ease, filter 0.15s ease;
}
.btn:hover { text-decoration: none; filter: brightness(0.96); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--bad-soft); color: var(--bad-text); }
.btn.ghost { background: transparent; color: var(--link); padding-left: 6px; padding-right: 6px; }
.btn.small { padding: 1px 10px; min-height: 24px; font-size: 12px; }
.btn.large { padding: 8px 22px; min-height: 40px; font-size: 15px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
/* segmented control */
.segmented { display: inline-flex; background: var(--bg-sunk); border-radius: 8px; padding: 2px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; vertical-align: middle; }
.segmented::-webkit-scrollbar { display: none; }
.segmented a { padding: 2px 10px; color: var(--text); font-size: 12px; font-weight: 500; border-radius: 6px; white-space: nowrap; line-height: 20px; }
.segmented a:hover { text-decoration: none; background: rgba(255, 255, 255, 0.4); }
.segmented a.active { background: var(--bg-elev); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); font-weight: 600; }
/* uptime window buttons (3 小時 · 1 天 · … · 1 年): narrower, so all seven fit a phone without scrolling */
.segmented.seg-range a { padding: 2px 8px; }
.panel-tools { padding: 0 12px 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ------------------------------------------------------------------ flash / notices */
.flashes { max-width: 1480px; margin: 10px auto 0; padding: 0 20px; }
.flash { border-radius: var(--radius-sm); padding: 7px 12px; margin-bottom: 6px; font-size: 13px; background: var(--bg-elev); box-shadow: var(--shadow); border-left: 3px solid var(--accent); }
.flash.success { border-left-color: var(--ok); }
.flash.error { border-left-color: var(--bad); }
.flash.warning { border-left-color: var(--warn); }
.notice { border-radius: var(--radius-sm); padding: 7px 12px; background: var(--bg-sunk); color: var(--text); font-size: 13px; }
.notice.warn { background: var(--warn-soft); }
.notice.bad { background: var(--bad-soft); }
.notice.ok { background: var(--ok-soft); }
.notice.info { background: var(--accent-soft); }
.empty { color: var(--text-2); text-align: center; padding: 18px 12px; font-size: 13px; }
.secret { font-family: var(--mono); font-size: 15px; background: var(--bg); border-radius: var(--radius-sm); padding: 10px 12px; overflow-wrap: anywhere; user-select: all; letter-spacing: 0.02em; }
pre.code { font-family: var(--mono); font-size: 12px; background: var(--bg); border-radius: var(--radius-sm); padding: 10px 12px; overflow-x: auto; white-space: pre; margin: 0 0 10px; letter-spacing: 0; line-height: 1.45; }
pre.log { max-height: 380px; overflow: auto; }
pre.code.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ tabs (pill row) */
.tabs { display: flex; gap: 2px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; padding-bottom: 1px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 3px 12px; color: var(--text); font-size: 13px; border-radius: 980px; white-space: nowrap; line-height: 20px; }
.tabs a:hover { background: var(--muted-soft); text-decoration: none; }
.tabs a.active { background: var(--text); color: var(--bg-elev); font-weight: 600; }

/* ------------------------------------------------------------------ charts (server-drawn SVG, sparkline-size) */
.viz { margin: 0; min-width: 0; }
.viz figcaption { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; flex-wrap: wrap; }
.viz-title { font-weight: 600; font-size: 12px; color: var(--text-2); }
.viz-now { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.viz-plot { position: relative; height: 70px; }
.viz-plot svg { width: 100%; height: 100%; display: block; overflow: visible; }
.viz-grid { stroke: var(--line-soft); stroke-width: 1; vector-effect: non-scaling-stroke; }
.viz-base { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.viz-line { fill: none; stroke: var(--chart); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.viz-area { fill: var(--chart-fill); stroke: none; }
.viz-tick { position: absolute; right: 0; font-size: 10px; color: var(--text-3); background: var(--bg-elev); padding: 0 3px; line-height: 13px; }
.viz-tick-top { top: -6px; }
.viz-tick-mid { top: calc(50% - 6px); }
.viz-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 12px; }
.viz-axis { display: flex; justify-content: space-between; margin-top: 2px; font-size: 10.5px; }
.viz-cross { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); pointer-events: none; }
.viz-dot { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--chart); border: 2px solid var(--bg-elev); pointer-events: none; }
.viz-tip { position: absolute; top: -26px; transform: translateX(-50%); background: var(--text); color: var(--bg-elev); font-size: 11px; padding: 2px 8px; border-radius: 6px; white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; z-index: 2; }
.charts { display: grid; gap: 14px 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }

/* ------------------------------------------------------------------ uptime bars */
.uptime-bars { display: flex; gap: 1px; height: 18px; align-items: stretch; }
.uptime-bars span { flex: 1; border-radius: 2px; background: var(--bg-sunk); min-width: 1px; }
.uptime-bars span.up { background: var(--ok); }
.uptime-bars span.degraded { background: var(--warn); }
.uptime-bars span.down { background: var(--bad); }
.uptime-bars span:hover { opacity: 0.7; }
.uptime-axis { display: flex; justify-content: space-between; color: var(--text-3); font-size: 11px; margin-top: 3px; }

/* ------------------------------------------------------------------ public status page (older blocks) */
.hero { text-align: center; padding: 28px 20px 14px; }
.hero .eyebrow { font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.hero h1 { font-size: 28px; letter-spacing: -0.025em; margin-bottom: 6px; }
.hero p { font-size: 15px; color: var(--text-2); margin: 0 auto; max-width: 720px; line-height: 1.4; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 6px 14px; border-radius: 980px; background: var(--bg-elev); box-shadow: var(--shadow); font-size: 14px; font-weight: 600; }
.status-pill .dot { width: 9px; height: 9px; }
.status-pill.down { color: var(--bad-text); }
.status-pill.degraded { color: var(--warn-text); }
.updated { color: var(--text-3); font-size: 12px; margin-top: 6px; }
.service-group { margin-bottom: var(--gap); }
.service-group-head { display: flex; align-items: center; gap: 10px; padding: 10px var(--pad) 4px; flex-wrap: wrap; }
.service-group-head .icon { font-size: 18px; line-height: 1; }
.service-group-head h3 { margin: 0; font-size: 14px; }
.service-group-head .desc { color: var(--text-2); font-size: 12px; }
.service-group-head .summary { margin-left: auto; font-size: 12.5px; }
.service-row { padding: 7px var(--pad); position: relative; }
.service-row + .service-row::before { content: ""; position: absolute; top: 0; left: var(--pad); right: 0; border-top: 1px solid var(--line-soft); }
.service-row .head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }
.service-row .head .name { font-weight: 600; font-size: 14px; color: var(--text); }
.service-row .head .stats { margin-left: auto; color: var(--text-2); font-size: 12px; display: flex; gap: 10px; align-items: center; font-variant-numeric: tabular-nums; }
.incident { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.incident:last-child { border-bottom: 0; }

/* ------------------------------------------------------------------ login */
.auth-wrap { min-height: calc(100vh - 45px); display: flex; align-items: flex-start; justify-content: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 400px; padding: 26px 26px; }
.auth-card h1 { font-size: 24px; margin-bottom: 4px; }
.auth-card .lead { color: var(--text-2); margin-bottom: 16px; }
.or-line { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; color: var(--text-3); font-size: 12px; }
.or-line::before, .or-line::after { content: ""; flex: 1; border-top: 1px solid var(--line-soft); }
.banner-wrap { max-width: 1480px; margin: 10px auto 0; padding: 0 20px; }
.banner-wrap .callout { margin-bottom: 0; }
.code-input { font-family: var(--mono); font-size: 22px !important; letter-spacing: 0.35em; text-align: center; }
.pair-code { font-family: var(--mono); font-size: 40px; letter-spacing: 0.2em; text-align: center; font-weight: 600; padding: 12px 0; }
.qr { background: #fff; padding: 8px; border-radius: var(--radius-sm); display: inline-block; }
.qr img { display: block; width: 180px; height: 180px; }
.recovery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 10px 32px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 600; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.steps li strong { display: block; }

/* ------------------------------------------------------------------ misc */
.shots { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.shots img { width: 100%; height: auto; border-radius: var(--radius-sm); background: var(--bg-sunk); }
.links-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.link-tile { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--bg-elev); box-shadow: var(--shadow); color: var(--text); min-width: 0; }
.link-tile:hover { text-decoration: none; box-shadow: var(--shadow-hover), inset 0 0 0 1px var(--line); }
.link-tile .icon { font-size: 18px; width: 24px; text-align: center; flex: none; }
.link-tile .t { min-width: 0; }
.link-tile .t div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-tile .t div:first-child { font-weight: 600; }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: var(--gap); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: var(--gap); }
.filters .field { margin: 0; min-width: 130px; }
details.more > summary { cursor: pointer; color: var(--link); margin: 4px 0; list-style: none; font-size: 13px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: " ›"; }
details.more[open] > summary::after { content: " ⌄"; }
.json { max-height: 320px; overflow: auto; }
.level-ERROR, .level-CRITICAL { color: var(--bad-text); font-weight: 600; }
.level-WARNING { color: var(--warn-text); font-weight: 600; }
.live-flag { font-size: 12px; color: var(--ok-text); display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }
.callout { background: var(--bg-elev); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px var(--pad); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: var(--gap); font-size: 13px; }
.callout .icon { font-size: 18px; }
.callout .grow { flex: 1; min-width: 200px; }
.tile-code { font-size: 40px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; margin-bottom: 8px; }
.center-row { justify-content: center; }

/* ------------------------------------------------------------------ overview cards (public 總覽 cards, db hero) */
.overall-hero { text-align: center; padding: 18px 20px 14px; }
.overall-hero .eyebrow { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.overall-hero h1 { font-size: 24px; letter-spacing: -0.02em; display: inline-flex; align-items: center; gap: 10px; margin: 0; }
.overall-hero h1 .dot { width: 11px; height: 11px; }
.overall-hero.down h1 { color: var(--bad-text); }
.overall-hero.degraded h1 { color: var(--warn-text); }
.overall-hero .sub { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.summary-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.summary-card { display: flex; flex-direction: column; gap: 6px; min-height: 0; color: var(--text); }
.summary-card:hover { text-decoration: none; }
.summary-card .head { display: flex; align-items: center; gap: 8px; }
.summary-card .head h2 { margin: 0; font-size: 15px; }
.summary-card .head .state { margin-left: auto; font-size: 12.5px; }
.summary-card .big { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.summary-card .big small { font-size: 13px; color: var(--text-3); font-weight: 500; letter-spacing: 0; margin-left: 4px; }
.summary-card .caption { color: var(--text-2); font-size: 13px; }
.summary-card .problems { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.summary-card .problems li { display: flex; gap: 6px; align-items: center; padding: 1px 0; }
.summary-card .more { margin-top: auto; color: var(--link); font-size: 13px; }
.summary-card .more::after { content: " ›"; }
.summary-card.bad .big { color: var(--bad-text); }
.summary-card.warn .big { color: var(--warn-text); }
.hint { color: var(--text-2); font-size: 13px; }
.platform { background: var(--bg-elev); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 8px; overflow: hidden; }
.platform > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 10px var(--pad); }
.platform > summary::-webkit-details-marker { display: none; }
.platform > summary .title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.platform > summary .desc { color: var(--text-2); font-size: 12.5px; }
.platform > summary::after { content: "＋"; margin-left: auto; font-size: 16px; color: var(--text-3); font-weight: 300; }
.platform[open] > summary::after { content: "－"; }
.platform .body { padding: 0 var(--pad) var(--pad); }
.platform .body h3 { margin-top: 12px; }
.downloads { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 4px; }
.value-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr)); }
.value-grid .v { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.value-grid .k { color: var(--text-2); font-size: 11.5px; font-weight: 600; }
.switch-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* report page: screenshots the person can remove / retake */
.shot-list { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.shot-item { margin: 0; max-width: 100%; }
.shot-item img { display: block; max-width: 100%; max-height: 220px; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 4px; }

/* ------------------------------------------------------------------ 資料庫 (database clusters) */
.db-hero { padding-top: 6px; padding-bottom: 12px; }
.db-hero .sub { max-width: 760px; margin-left: auto; margin-right: auto; }
.chips { display: inline-flex; gap: 4px; flex-wrap: wrap; vertical-align: 1px; margin-left: 4px; }
.list-row .side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.node-facts { display: flex; gap: 1px 12px; flex-wrap: wrap; color: var(--text-3); font-size: 11.5px; margin-top: 1px; font-variant-numeric: tabular-nums; }
.db-node .sub + .sub { margin-top: 0; }
.db-matrix td, .db-matrix th { vertical-align: middle; }
.db-matrix tr.stale td { opacity: 0.55; }
.db-matrix .tiny { font-weight: 600; }
.db-note { padding: 6px var(--pad) 10px; margin: 0; }
.state-text.dim { color: var(--text-2); font-weight: 500; }

/* ================================================================== overview (v5, dense — owner 2026-10-10): status
   line, one numbers strip, three columns (sites | services + 資料庫 + 切換 | alerts + recent + links). Every column is a
   plain stack of .panel sections: another panel can be added to any column. */
.page-dash { max-width: 1480px; padding-top: 12px; }
.statusbar { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; margin-bottom: 10px; }
.statusbar .state-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 3px 12px 3px 10px; border-radius: 980px;
  background: var(--ok-soft); color: var(--ok-text); font-weight: 600; font-size: 13.5px;
}
.statusbar .state-pill .dot { width: 8px; height: 8px; }
.statusbar .state-pill.degraded { background: var(--warn-soft); color: var(--warn-text); }
.statusbar .state-pill.down { background: var(--bad-soft); color: var(--bad-text); }
.statusbar h1 { font-size: 20px; margin: 0; letter-spacing: -0.02em; }
.statusbar .meta { color: var(--text-2); font-size: 12.5px; display: flex; gap: 4px 12px; flex-wrap: wrap; align-items: center; }
.statusbar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; color: var(--text-3); font-size: 12px; }
.live-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--text-2);
  background: var(--muted-soft); border-radius: 980px; padding: 1px 8px 1px 7px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.live-pill .dot { width: 6px; height: 6px; background: var(--ok); }
.live-pill.stale .dot { background: var(--warn); }

/* numbers strip: one panel, cells divided by thin lines */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); margin-bottom: var(--gap);
  background: var(--bg-elev); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.kpi { padding: 7px 12px 7px; color: var(--text); display: flex; flex-direction: column; gap: 0; min-width: 0; position: relative;
  overflow: hidden; box-shadow: -1px 0 0 var(--line-soft); }
a.kpi:hover { text-decoration: none; background: var(--bg-hover); }
.kpi .k { font-size: 11.5px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.kpi .v { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .v small { font-size: 12px; font-weight: 500; color: var(--text-3); margin-left: 2px; letter-spacing: 0; }
.kpi .s { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.bad .v { color: var(--bad-text); }
.kpi.ok .v { color: var(--ok-text); }
.kpi.warn .v { color: var(--warn-text); }
.kpi .kspark { position: absolute; right: 10px; top: 22px; height: 22px; width: 42%; opacity: 0.9; pointer-events: none; }
.kspark polygon, .area-spark polygon { fill: var(--chart-fill); stroke: none; }
.kspark polyline, .area-spark polyline { fill: none; stroke: var(--chart); stroke-width: 1.4; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.kpi .s.over { position: relative; z-index: 1; }
.kpi.has-spark .s { visibility: visible; }
@media (max-width: 560px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .kpi { box-shadow: -1px 0 0 var(--line-soft), 0 -1px 0 var(--line-soft); } .kpi .v { font-size: 18px; } }

/* panels */
.panel { background: var(--bg-elev); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; overflow: hidden; container-type: inline-size; }
.panel + .panel, .panels + .panel, .panel + .panels { margin-top: var(--gap); }
.panel-head { display: flex; align-items: center; gap: 6px 8px; padding: 8px 12px 4px; flex-wrap: wrap; min-height: 34px; }
.panel-head h2 { margin: 0; font-size: 14px; letter-spacing: -0.01em; }
.panel-head h2 a { color: inherit; }
.panel-head .chips-inline { display: flex; gap: 4px; flex-wrap: wrap; }
.panel-head .side { margin-left: auto; color: var(--text-2); font-size: 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.panel-head .side a { font-size: 12px; }
.panel-body { padding: 0 12px 8px; }
.panel-sub { font-size: 11px; font-weight: 600; color: var(--text-3); letter-spacing: 0.03em; margin: 6px 0 2px; }
.panels { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
@media (max-width: 960px) { .panels { grid-template-columns: 1fr; } }
.site-panel.down .panel-head h2 { color: var(--bad-text); }
.dash-cols { display: grid; gap: var(--gap); align-items: start; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3fr); }
.dash-col { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.dash-col > .panel + .panel, .panels > .panel + .panel { margin-top: 0; }  /* grid gap only */
@media (max-width: 1180px) { .dash-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .dash-col.c1 { grid-row: span 2; } }
@media (max-width: 760px) { .dash-cols { grid-template-columns: minmax(0, 1fr); } .dash-col.c1 { grid-row: auto; } }

/* dense machine rows (overview, public page, 主機 清單) */
.hrows { display: flex; flex-direction: column; }
.hrow { display: grid; align-items: center; gap: 2px 10px; padding: 4px 0; min-height: 34px; border-top: 1px solid var(--line-soft); color: var(--text);
  grid-template-columns: minmax(104px, 1.5fr) repeat(3, minmax(46px, 0.8fr)) minmax(40px, 0.5fr) minmax(64px, 0.7fr) 58px; }
a.hrow:hover { text-decoration: none; background: var(--bg-hover); margin: 0 -12px; padding-left: 12px; padding-right: 12px; }
.hrows .hrow:first-child { border-top: 0; }
.hrow .who { display: flex; align-items: center; gap: 7px; min-width: 0; }
.hrow .who .n { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.hrow .who .t { color: var(--text-3); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.hrow .who > div { min-width: 0; }
.hrow .m { display: grid; grid-template-columns: auto 1fr; gap: 1px 4px; align-items: center; font-size: 11px; line-height: 1.25; }
.hrow .m .l { color: var(--text-3); font-weight: 600; }
.hrow .m .x { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.hrow .m .bar { grid-column: 1 / -1; height: 4px; }
.hrow .c { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hrow .c b { color: var(--text); font-weight: 600; }
.hrow .net { font-size: 11px; color: var(--text-2); line-height: 1.3; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hrow .spark { width: 58px; height: 20px; }
.hrow.offline .who .n, .hrow.new .who .n { color: var(--text-2); }
.hrow .gone { grid-column: 2 / -1; color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hrow .flags { display: flex; gap: 3px; flex-wrap: wrap; }
@container (max-width: 520px) {
  .hrow { grid-template-columns: minmax(96px, 1.4fr) repeat(3, minmax(40px, 0.8fr)) minmax(36px, 0.5fr) minmax(58px, 0.7fr); }
  .hrow .spark { display: none; }
}
@container (max-width: 400px) {
  .hrow { grid-template-columns: minmax(90px, 1.4fr) repeat(3, minmax(38px, 0.8fr)); }
  .hrow .c, .hrow .net, .hrow .spark { display: none; }
}
@media (max-width: 560px) {
  .hrow { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 6px 0; }
  .hrow .who { grid-column: 1 / -1; }
  .hrow .c, .hrow .net, .hrow .spark { display: none; }
  .hrow .gone { grid-column: 1 / -1; }
  a.hrow:hover { margin: 0; padding-left: 0; padding-right: 0; }
}

/* power: a one-line strip per house (now · today · month · 24 h area spark) */
.pstrip { display: grid; gap: 2px 14px; grid-template-columns: auto auto auto minmax(80px, 1fr); align-items: center; padding: 5px 0; }
.pstrip + .pstrip { border-top: 1px solid var(--line-soft); }
.pstrip .big { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pstrip .big small, .pstrip .num small { font-size: 11px; color: var(--text-3); font-weight: 500; margin-left: 2px; }
.pstrip .num { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pstrip .lab { font-size: 10.5px; color: var(--text-3); font-weight: 600; white-space: nowrap; line-height: 1.2; }
.pstrip .name { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.pstrip .name a { color: var(--text); font-weight: 600; font-size: 13px; }
.pstrip .chart { min-width: 0; }
.pstrip .chart .tiny { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.area-spark { width: 100%; height: 26px; display: block; }
@media (max-width: 560px) { .pstrip { grid-template-columns: repeat(3, auto); } .pstrip .chart { grid-column: 1 / -1; } }

/* chips (devices, small things) */
.chip-row { display: flex; gap: 4px; flex-wrap: wrap; }
.chip-line { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; padding: 3px 0; border-top: 1px solid var(--line-soft); }
.chip-line .lab { font-size: 10.5px; font-weight: 600; color: var(--text-3); margin-right: 2px; min-width: 24px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 980px; background: var(--bg-sunk);
  font-size: 12px; color: var(--text); max-width: 100%; white-space: nowrap; line-height: 18px; }
a.chip:hover { text-decoration: none; filter: brightness(0.96); }
.chip .v { color: var(--text-2); font-variant-numeric: tabular-nums; }
.chip.down { background: var(--bad-soft); color: var(--bad-text); }
.chip.down .v { color: var(--bad-text); }
.chip.warn { background: var(--warn-soft); color: var(--warn-text); }
.chip .dot { width: 6px; height: 6px; }

/* services with their last days */
.srows { display: flex; flex-direction: column; }
.srow { display: grid; grid-template-columns: minmax(96px, 1.3fr) 52px minmax(80px, 1.6fr) 50px; gap: 8px; align-items: center;
  padding: 3px 0; min-height: 26px; border-top: 1px solid var(--line-soft); color: var(--text); }
.srows .srow:first-child { border-top: 0; }
a.srow:hover { text-decoration: none; background: var(--bg-hover); }
.srow .who { display: flex; align-items: center; gap: 6px; min-width: 0; }
.srow .who .n { font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srow .ms { font-size: 11.5px; color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.srow .pct { font-size: 11.5px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.srow .uptime-bars { height: 12px; gap: 1px; }
.srow .uptime-bars span { border-radius: 1px; min-width: 1px; }
.cat-label { font-size: 11px; font-weight: 600; color: var(--text-3); letter-spacing: 0.03em; padding: 6px 0 1px; display: flex; gap: 8px; }
.cat-label .summary { margin-left: auto; font-weight: 500; letter-spacing: 0; }
@media (max-width: 560px) { .srow { grid-template-columns: minmax(0, 1fr) 50px 48px; } .srow .uptime-bars { display: none; } }

/* alerts + activity feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 7px; align-items: flex-start; padding: 4px 0; border-top: 1px solid var(--line-soft); font-size: 12.5px; line-height: 1.35; }
.feed li:first-child { border-top: 0; }
.feed li .dot { margin-top: 5px; }
.feed li .badge { margin-top: 1px; }
.feed .grow { flex: 1; min-width: 0; }
.feed .t { overflow-wrap: anywhere; }
.feed .when { color: var(--text-3); font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.feed .t .when { margin-left: 4px; }
.feed a { color: var(--text); }
.scroll-box { max-height: 360px; overflow-y: auto; }
.empty-note { color: var(--text-3); font-size: 12.5px; padding: 4px 0 2px; }

/* power pages */
.power-hero { display: grid; gap: 8px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: var(--gap); }
@media (max-width: 900px) { .power-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bars-viz { position: relative; height: 90px; }
.bars-viz svg { width: 100%; height: 100%; display: block; overflow: visible; }
.bars-viz rect { fill: var(--chart); }
.bars-viz rect.none { fill: var(--bg-sunk); }
.bars-viz rect:hover { opacity: 0.75; }
.outlets { width: 100%; }
.outlets td.name { min-width: 120px; }
.outlet-sub td { color: var(--text-2); font-size: 12px; }
.outlet-sub td.name { padding-left: 28px; }
.token-box { font-family: var(--mono); font-size: 14px; background: var(--bg); border-radius: var(--radius-sm); padding: 10px 12px;
  overflow-wrap: anywhere; user-select: all; }
.site-badge { display: inline-flex; align-items: center; padding: 0 7px; border-radius: 980px; background: var(--muted-soft); color: var(--text-2);
  font-size: 11px; font-weight: 600; white-space: nowrap; line-height: 17px; }

/* public status page */
.pub-hero { padding: 2px 0 10px; display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; }
.pub-hero .eyebrow { color: var(--text-2); font-weight: 600; font-size: 12.5px; width: 100%; }
.pub-hero h1 { font-size: 22px; letter-spacing: -0.02em; margin: 0; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.pub-hero h1 .dot { width: 10px; height: 10px; }
.pub-hero.down h1 { color: var(--bad-text); }
.pub-hero.degraded h1 { color: var(--warn-text); }
.pub-hero .sub { color: var(--text-2); font-size: 13px; display: flex; gap: 6px 10px; align-items: center; flex-wrap: wrap; }
.pub-svc { display: grid; grid-template-columns: minmax(110px, 1.2fr) 70px 58px minmax(120px, 2.4fr) 56px 56px 90px; gap: 4px 10px;
  align-items: center; padding: 4px 0; min-height: 28px; border-top: 1px solid var(--line-soft); font-size: 12.5px; }
.pub-svc.head { border-top: 0; color: var(--text-3); font-size: 11px; font-weight: 600; min-height: 0; padding: 0 0 2px; }
.pub-svc .who { display: flex; gap: 6px; align-items: center; min-width: 0; }
.pub-svc .who .n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pub-svc .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pub-svc .uptime-bars { height: 14px; }
.pub-svc .spark { width: 100%; height: 18px; }
@media (max-width: 760px) {
  .pub-svc { grid-template-columns: minmax(0, 1fr) 62px 52px 52px 52px; gap: 4px 6px; }
  .pub-svc .uptime-bars, .pub-svc .spark-cell, .pub-svc .hide-s { display: none; }
}
.fo-pub { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 10px; align-items: center; padding: 4px 0; border-top: 1px solid var(--line-soft); font-size: 12.5px; }
.fo-pub:first-child { border-top: 0; }
@media (max-width: 734px) { .pub-hero h1 { font-size: 19px; } .statusbar h1 { font-size: 18px; } .page-dash { padding-top: 10px; } }

/* 切換 (failover): one dense row per hostname (both NAS side by side); the switch confirmation is a popover (a
   <details>: works without JavaScript and pauses the page's refresh while open). No overflow box around the rows,
   so the popover is never clipped. */
.fo-card { position: relative; }
.fo-host { overflow-wrap: anywhere; letter-spacing: -0.01em; }
.fo-rows { background: var(--bg-elev); border-radius: var(--radius); box-shadow: var(--shadow); }
.fo-row { display: grid; gap: 4px 12px; padding: 7px var(--pad); align-items: start; position: relative;
  grid-template-columns: minmax(200px, 1.6fr) minmax(170px, 1fr) minmax(170px, 1fr) minmax(130px, 0.9fr) minmax(170px, auto); }
.fo-row + .fo-row { border-top: 1px solid var(--line-soft); }
.fo-row.head { color: var(--text-3); font-size: 11px; font-weight: 600; padding-top: 6px; padding-bottom: 4px; }
.fo-row .fo-name { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; min-width: 0; }
.fo-row .fo-name strong { font-size: 13.5px; overflow-wrap: anywhere; }
.fo-row .note-line { grid-column: 1 / -1; }
.fo-sites { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 8px 0; }
.fo-site { background: var(--bg); border-radius: var(--radius-sm); padding: 4px 8px; min-width: 0; display: flex; flex-direction: column; gap: 0; font-size: 12px; }
.fo-site.serving { box-shadow: inset 0 0 0 1.5px var(--accent); }
.fo-site-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fo-site-head .fo-state { margin-left: auto; font-size: 12px; }
.fo-actions { gap: 4px; justify-content: flex-end; }
@media (max-width: 1100px) {
  .fo-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .fo-row.head { display: none; }
  .fo-row .fo-name, .fo-row .fo-actions { grid-column: 1 / -1; }
  .fo-actions { justify-content: flex-start; }
}
@media (max-width: 560px) { .fo-sites, .fo-row { grid-template-columns: minmax(0, 1fr); } }
details.confirm { position: relative; }
details.confirm > summary { list-style: none; }
details.confirm > summary::-webkit-details-marker { display: none; }
details.confirm[open] > summary { box-shadow: inset 0 0 0 2px var(--accent); }
.confirm-panel { position: absolute; right: 0; top: 30px; width: min(440px, calc(100vw - 32px)); z-index: 20;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; text-align: left;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18); white-space: normal; }
.confirm-panel h3 { margin: 0 0 6px; font-size: 14px; overflow-wrap: anywhere; }
@media (max-width: 1100px) { .confirm-panel { left: 0; right: auto; } }
/* 切換 → 維護: the card / banner and its confirmation (the hostnames that move, the ones left alone) */
.confirm-panel.wide { width: min(560px, calc(100vw - 32px)); }
.maint-head { display: flex; gap: 8px 10px; align-items: flex-start; flex-wrap: wrap; }
.maint-head h2 { margin: 0 0 2px; }
.maint-head .grow { flex: 1 1 320px; min-width: 0; }
.maint-banner { padding: 9px 12px; }
.maint-hosts { overflow-wrap: anywhere; margin-top: 2px; }
.maint-lab { font-size: 12px; font-weight: 600; color: var(--text-2); margin-top: 6px; }
.maint-list { margin: 2px 0 8px; padding-left: 18px; font-size: 13px; overflow-wrap: anywhere; }
.maint-list li { margin: 1px 0; }
.maint-card, .maint-banner { position: relative; }
/* phones: a confirmation spans its card (the second button's popover would run off the screen) */
@media (max-width: 734px) {
  details.confirm { position: static; }
  .confirm-panel, .confirm-panel.wide { left: 8px; right: 8px; width: auto; top: auto; margin-top: 4px; }
}

/* ------------------------------------------------------------------ phones: ≥ 36 px touch targets, 16 px inputs (no
   iOS zoom), one column */
@media (max-width: 734px) {
  .globalnav-inner { padding: 0 10px; gap: 2px; }
  .icon-btn { min-width: 38px; height: 38px; }
  .page { padding: 12px 12px 32px; }
  .flashes, .banner-wrap { padding: 0 12px; }
  h1 { font-size: 20px; }
  .section-title { margin-top: 14px; }
  .card { padding: 10px 12px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .btn { min-height: 38px; padding: 6px 14px; font-size: 14px; }
  .btn.small { min-height: 36px; padding: 4px 12px; font-size: 13px; }
  .segmented a, .tabs a { padding: 7px 12px; line-height: 22px; }
  .segmented.seg-range a { padding: 7px 8px; }
  input:not([type]), input[type=text], input[type=password], input[type=email], input[type=number], input[type=url], input[type=search], input[type=date], input[type=time], select, textarea {
    font-size: 16px; min-height: 40px;
  }
  .list-row { min-height: 44px; }
  .table .hide-s { display: none; }
  .table td.wrap { min-width: 110px; }
  .table .show-s { display: block; }
  .table.notify-log td.wrap { min-width: 120px; }
  a.srow { min-height: 38px; }
  a.chip { min-height: 32px; padding: 4px 10px; }
  .service-row .head .stats { margin-left: 0; width: 100%; }
  .auth-card { padding: 22px 18px; }
  .card.flush .table td:first-child, .card.flush .table th:first-child { padding-left: 12px; }
  .menu a, .menu button { padding: 9px 10px; font-size: 15px; }
}

/* ---------------------------------------------------------------- 貓咪 card (總覽: petfeeder's /embed/summary) +
   遠端桌面 (docs/PETS.md, docs/REMOTE.md) */
.pets-card { display: block; width: 100%; height: 190px; border: 0; background: transparent; }
.form-row > .field.grow { flex: 3 1 220px; }
.remote-table .btn.ghost { min-height: 22px; }
.remote-table td.rname { white-space: nowrap; }
@media (max-width: 734px) {
  /* phones: name (+ state · last seen · ID under it), control badge, 連線 — 允許控制／收回 on the device page */
  .remote-table td.rname { white-space: normal; }
  .table .actions-cell form.hide-s { display: none; }
}

/* ---------------------------------------------------------------- 攝影機 v2 (docs/CAMERAS.md §9–§12): names and
   「www 即時」 in the cameras table, 即時影像 (iframes of the house's family page, 16:9; 1 column on phones, 2–3 on a
   desktop) */
.cam-table .label-input { width: 100%; min-width: 110px; max-width: 220px; min-height: 26px; padding: 2px 8px; font-size: 13px; }
.cam-table .cam-name { display: flex; align-items: center; gap: 6px; }
.cam-table .cam-name ~ .tiny { margin-top: 1px; padding-left: 13px; }
.check-cell { text-align: center; }
.check-cell label { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; min-height: 26px; margin: 0; cursor: pointer; }
.conditions { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; margin: 2px 0 6px 24px; }
.conditions .state-text { font-weight: 500; }
.live-source .panel-head h2 { display: flex; align-items: center; gap: 6px; }
.live-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); }
.live-tile { margin: 0; min-width: 0; }
.live-tile figcaption { display: flex; align-items: center; gap: 6px; font-size: 12.5px; margin-bottom: 4px; min-width: 0; white-space: nowrap; overflow: hidden; }
.live-tile figcaption strong { overflow: hidden; text-overflow: ellipsis; }
.live-frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius-sm); background: var(--bg-sunk); }
@media (max-width: 734px) {
  .cam-table .label-input { min-height: 36px; min-width: 96px; max-width: 150px; }
  .check-cell label { min-width: 36px; min-height: 36px; }
  .conditions { margin-left: 0; }
}

/* ---------------------------------------------------------------- 攝影機 v2.1 (docs/CAMERAS.md §13–§16): 攝影機設定
   (one row per camera; phones: a card per camera with labelled switches), 時間軸 (a day of motion grouped by hour,
   lazy thumbnails), thumbnails in 動態紀錄, the picture viewer (app.js builds it on first use) */
.cam-config .cc-order { width: 64px; }
.cam-config .cc-order input { width: 52px; min-height: 26px; padding: 2px 6px; font-size: 13px; text-align: center; }
.cam-config .cc-name { min-width: 150px; display: flex; flex-wrap: wrap; align-items: center; gap: 1px 8px; }
.cam-config .label-input { width: 100%; min-width: 110px; max-width: 200px; min-height: 26px; padding: 2px 8px; font-size: 13px; }
.cam-config .cc-name .warn-text { flex-basis: 100%; }
.cam-config .cc-check { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 28px; min-height: 26px; margin: 0; cursor: pointer; font-weight: 400; }
.cam-config .cc-lab { display: none; font-size: 12.5px; color: var(--text); }
.cam-config .cc-snap { white-space: nowrap; }
.cam-config .cc-snap .cc-check { vertical-align: middle; margin-right: 4px; }
.cam-config select { width: auto; min-height: 26px; padding: 1px 24px 1px 8px; font-size: 12.5px; vertical-align: middle; }
.cam-config th.center { text-align: center; }
.cc-help { margin: 6px 0 0; line-height: 1.5; }
.btn[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }
.panel[id] { scroll-margin-top: 56px; }  /* a link to #camera-settings / #events lands below the sticky menu */
.ev-shots { white-space: nowrap; }
.ev-shots a { display: inline-block; vertical-align: middle; margin-right: 4px; }
.ev-shots img, .tl-thumbs img { display: block; object-fit: cover; background: var(--bg-sunk); border-radius: 4px; }
.ev-shots img { width: 48px; height: 27px; }
.tl-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.tl-days { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tl-date { display: flex; align-items: center; gap: 6px; margin: 0; }
.tl-date input[type=date] { width: auto; min-height: 28px; padding: 2px 8px; }
.segmented.tl-cams { display: flex; width: fit-content; margin-bottom: var(--gap); }
.tl-n { color: var(--text-3); font-weight: 400; font-variant-numeric: tabular-nums; }
.tl { padding: 2px 12px 8px; }
.tl-hour { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 2px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tl-hour span { font-size: 11.5px; font-weight: 400; color: var(--text-3); }
.tl-item { display: grid; grid-template-columns: 64px minmax(0, 240px) minmax(0, 1fr); gap: 2px 10px; align-items: center; padding: 4px 0; border-top: 1px solid var(--line-soft); min-height: 30px; }
.tl-when { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tl-what { font-size: 13px; min-width: 0; }
.tl-meta { display: block; color: var(--text-3); font-size: 11.5px; }
.tl-thumbs { display: flex; flex-wrap: wrap; gap: 4px; }
.tl-thumbs a { display: block; border-radius: 4px; }
.tl-thumbs img { width: 128px; height: 72px; }
.tl-thumbs a:focus-visible, .ev-shots a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
body.viewer-open { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; background: #000; color: #f5f5f7; }
.viewer[hidden] { display: none; }
.viewer-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 13px; min-height: 48px; }
.viewer-caption { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-count { color: #a1a1a6; font-variant-numeric: tabular-nums; white-space: nowrap; }
.viewer-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 8px 12px; }
.viewer-img { display: block; max-width: calc(100% - 112px); max-height: 100%; object-fit: contain; border-radius: 6px; background: #1d1d1f; }
.viewer-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.14); color: #f5f5f7; font: inherit; font-size: 22px; line-height: 1; cursor: pointer; }
.viewer-btn.viewer-speed { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.viewer-btn.viewer-play, .viewer-btn.viewer-dl { font-size: 17px; text-decoration: none; }

/* ------------------------------------------------------------------ camera fleet overview & 5-year photo library (3.9) */
.cam-group-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.cam-group-main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cam-group-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 12.5px; }
.photo-toolbar { padding: 14px 16px; }
.photo-cal { margin-top: 12px; padding: 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--bg); max-width: 420px; }
.photo-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.photo-cal-title { font-size: 14px; font-variant-numeric: tabular-nums; }
.photo-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.photo-cal-wd { font-size: 11px; color: var(--text-3); padding: 2px 0; }
.photo-cal-day { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 42px;
  border-radius: 8px; text-decoration: none; color: var(--text); font-size: 13px; border: 1px solid transparent; transition: background .12s; }
.photo-cal-day:hover:not(.future) { background: var(--surface-2, rgba(128,128,128,.12)); }
.photo-cal-day.has-photos { background: color-mix(in srgb, var(--accent) 12%, transparent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.photo-cal-day.selected { background: var(--accent); color: #fff; border-color: var(--accent); }
.photo-cal-day.selected .photo-cal-cnt { color: rgba(255,255,255,.9); }
.photo-cal-day.today:not(.selected) { border-color: var(--accent); font-weight: 700; }
.photo-cal-day.future { opacity: .32; pointer-events: none; }
.photo-cal-num { line-height: 1.1; font-variant-numeric: tabular-nums; }
.photo-cal-cnt { font-size: 10px; color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 1px; }
.photo-cal-foot { margin-top: 8px; }

.hour-strip { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 3px; align-items: end; padding-top: 4px; }
.hour-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 46px; text-decoration: none; color: var(--text-3); }
.hour-bar.active { color: var(--text-2); }
.hour-bar.active:hover .hour-fill { background: var(--accent); opacity: 1; }
.hour-fill { width: 100%; max-width: 24px; border-radius: 3px 3px 0 0; background: var(--accent); opacity: .68; transition: opacity .12s; }
.hour-lab { font-size: 10px; margin-top: 3px; font-variant-numeric: tabular-nums; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; padding: 12px 14px; }
.photo-card { display: flex; flex-direction: column; border: 1px solid var(--line-soft); border-radius: 8px; overflow: hidden;
  text-decoration: none; color: inherit; background: var(--bg); transition: transform .12s, border-color .12s; }
.photo-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.photo-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: #141416; }
.photo-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 8px 2px; font-size: 12.5px; }
.photo-card-time { font-weight: 600; font-variant-numeric: tabular-nums; }
.photo-card-sub { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 8px 7px; font-size: 11.5px; }
.photo-card-cam { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 680px) {
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; }
  .hour-strip { gap: 2px; }
  .hour-lab { font-size: 9px; }
}
.viewer-btn:hover { background: rgba(255, 255, 255, 0.24); text-decoration: none; }
.viewer-bar .viewer-btn { width: 36px; height: 36px; font-size: 16px; }
@media (max-width: 734px) {
  .cam-config thead { display: none; }
  .cam-config tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 12px; border-bottom: 1px solid var(--line-soft); }
  .cam-config tbody tr:last-child { border-bottom: 0; }
  .cam-config tbody td { display: block; padding: 0; border: 0; }
  .cam-config tbody tr:hover td { background: transparent; }
  .cam-config .cc-order { width: auto; }
  .cam-config .cc-order input { width: 48px; min-height: 36px; }
  .cam-config .cc-name { flex: 1 1 200px; min-width: 0; }
  .cam-config .label-input { max-width: none; min-height: 36px; }
  .cam-config .cc-lab { display: inline; }
  .cam-config .check-cell { text-align: left; }
  .cam-config .cc-check { min-height: 36px; justify-content: flex-start; }
  .cam-config .cc-snap { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; white-space: normal; }
  .cam-config select { min-height: 36px; font-size: 16px; }
  .tl-item { grid-template-columns: 58px minmax(0, 1fr); }
  .tl-thumbs { grid-column: 1 / -1; }
  .tl-thumbs img { width: calc((100vw - 64px) / 3); max-width: 128px; height: auto; aspect-ratio: 16 / 9; }
  .tl-date input[type=date] { min-height: 36px; }
  .viewer-img { max-width: 100%; }
  .viewer-stage { position: relative; padding: 0 0 12px; }
  .viewer-stage .viewer-prev, .viewer-stage .viewer-next { position: absolute; bottom: 20px; z-index: 1; }
  .viewer-stage .viewer-prev { left: 12px; }
  .viewer-stage .viewer-next { right: 12px; }
}

/* ------------------------------------------------------------------ 容器 (live list, agent 2.4) + the output viewer of
   remote commands (容器記錄 / 系統診斷) */
.button-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.card.flush > .card-note { padding: 6px var(--pad) 10px; margin: 0; }
.containers-table .mm { min-width: 96px; }
.containers-table td .sub-line { white-space: nowrap; }
.containers-table td.c-name { white-space: nowrap; }
.containers-table td.c-name .badge { font-family: var(--sans); margin-top: 2px; }
.containers-table td.c-name .sub-line { white-space: normal; overflow-wrap: anywhere; font-family: var(--sans); min-width: 140px; }
.top-table { table-layout: fixed; }
.top-table td.mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-table th.num, .top-table td.num { width: 72px; }
.log-toolbar { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-bottom: 8px; }
.log-toolbar input[type="search"] { flex: 1 1 200px; max-width: 320px; }
.log-toolbar .check { align-items: center; }
.log-toolbar .check input { margin-top: 0; }
pre.logview { position: relative; max-height: calc(100vh - 250px); min-height: 160px; overflow: auto; margin: 0; }
pre.logview mark { background: var(--warn-soft); color: inherit; border-radius: 2px; }
pre.logview mark.current { background: var(--warn); color: #fff; }
@media (max-width: 734px) {
  .containers-table .mm { min-width: 0; width: auto; }
  .containers-table .mm .bar { display: none; }
  pre.logview { max-height: 70vh; font-size: 11.5px; }
  .log-toolbar input[type="search"] { max-width: none; }
  .button-row .btn.small { min-height: 36px; }
}

/* ---------------------------------------------------------------- 攝影機管理 (cameras v3, docs/CAMERAS_V3.md §2): one
   row per camera — order (⠿ drag / ↑ ↓, app.js), name, 啟用, connection, resolution, quality, family page,
   notifications, ★ admin switches, 移除. A panel narrower than the whole table (≤ 1300 px: a 1280 laptop, a tablet,
   a phone) shows each camera as a card: the name line, then the settings in labelled groups that wrap. */
.cm-table td { vertical-align: top; }
.cm-table th.center { text-align: center; }
.cm-table .cm-order { width: 92px; white-space: nowrap; }
.cm-handle { display: inline-flex; align-items: center; justify-content: center; width: 18px; min-height: 26px; color: var(--text-3);
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; font-size: 15px; vertical-align: middle; }
.cm-handle:active { cursor: grabbing; }
.cm-table .cm-order input { width: 34px; min-height: 26px; padding: 2px; font-size: 13px; text-align: center; vertical-align: middle; -moz-appearance: textfield; }
.cm-table input[type=number]::-webkit-outer-spin-button, .cm-table input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cm-moves { display: inline-flex; vertical-align: middle; }
.cm-moves .btn { padding: 0 5px; min-height: 26px; font-size: 13px; }
.cm-table tr.cm-dragging td { background: var(--accent-soft); }
.cm-table tr.cm-muted .label-input { color: var(--text-2); }
.cm-name { min-width: 180px; }
.cm-title { display: flex; align-items: center; gap: 6px; }
.cm-table .cm-name .label-input { width: 100%; max-width: 190px; min-height: 26px; padding: 2px 8px; font-size: 13px; }
.cm-name .tiny { margin-top: 1px; line-height: 1.35; }
.cm-line { display: flex; align-items: center; gap: 3px 6px; }
.cm-line + .cm-line, .cm-check + .cm-line { margin-top: 3px; }
.cm-conn { min-width: 222px; }
.cm-table .cm-ip { width: 132px; min-height: 26px; padding: 2px 6px; font-size: 13px; font-family: var(--mono); }
.cm-table .cm-port { width: 52px; min-height: 24px; padding: 1px 4px; font-size: 12.5px; text-align: center; -moz-appearance: textfield; }
.cm-table select { width: auto; max-width: 168px; min-height: 26px; padding: 1px 24px 1px 8px; font-size: 12.5px; }
.cm-res { min-width: 150px; max-width: 190px; }
.cm-quality { min-width: 140px; }
.cm-admin { min-width: 170px; }
.cm-check { display: flex; align-items: center; gap: 5px; min-height: 22px; margin: 0; font-weight: 400; font-size: 12.5px; white-space: nowrap; cursor: pointer; }
.cm-table .check-cell .cm-check { justify-content: center; }
.cm-table .check-cell .cm-word { display: none; }  /* the column head says 啟用; the card view shows the word */
.cm-remove { text-align: right; white-space: nowrap; }
.cm-lab { display: none; }
.cm-actions .button-row { justify-content: flex-end; }
@container (max-width: 1300px) {
  .cm-table thead { display: none; }
  .cm-table tbody tr { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 22px; padding: 8px 12px 9px; border-bottom: 1px solid var(--line-soft); }
  .cm-table tbody tr:last-child { border-bottom: 0; }
  .cm-table tbody td { display: block; padding: 0; border: 0; }
  .cm-table tbody tr:hover td { background: transparent; }
  .cm-table tr.cm-dragging { background: var(--accent-soft); }
  .cm-table .cm-order { width: auto; }
  .cm-table .cm-name { flex: 0 1 300px; min-width: 220px; }
  .cm-table .cm-remove { order: 3; margin-left: auto; padding-top: 14px; }
  .cm-table .cm-res, .cm-table .cm-quality, .cm-table .cm-conn, .cm-table .cm-admin { max-width: none; min-width: 0; }
  .cm-table .check-cell { padding-top: 14px; }
  .cm-table .check-cell .cm-check { justify-content: flex-start; }
  .cm-table .check-cell .cm-word { display: inline; }
  .cm-table .cm-flags { order: 2; }
  .cm-checks { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; }
  .cm-checks .cm-line + .cm-line, .cm-checks .cm-check + .cm-line { margin-top: 0; }
  .cm-lab { display: block; font-size: 11px; font-weight: 600; color: var(--text-3); margin-bottom: 2px; }
  .cm-order .cm-lab { display: none; }
}
@media (max-width: 734px) {
  .cm-handle { width: 30px; min-height: 36px; font-size: 18px; }
  .cm-table .cm-order input { display: none; }  /* phones: ⠿ / ↑ ↓ renumber it; the name shares the line */
  .cm-moves .btn { min-height: 36px; min-width: 36px; }
  .cm-table .cm-remove, .cm-table .check-cell { padding-top: 0; }
  .cm-table .cm-name { flex: 1 1 180px; min-width: 0; }
  .cm-table .cm-name .label-input { max-width: none; min-height: 36px; }
  .cm-table .cm-ip { width: 150px; min-height: 36px; font-size: 16px; }
  .cm-table .cm-port { width: 70px; min-height: 36px; font-size: 16px; }
  .cm-conn .cm-line { flex-wrap: wrap; }
  .cm-table select { min-height: 36px; font-size: 16px; max-width: 100%; }
  .cm-check { min-height: 36px; font-size: 13px; }
  .cm-actions tr { display: flex; flex-wrap: wrap; gap: 4px 8px; padding: 6px 12px; border-bottom: 1px solid var(--line-soft); }
  .cm-actions td { display: block; padding: 0; border: 0; }
  .cm-actions .button-row { justify-content: flex-start; }
}

/* ------------------------------------------------------------------ 登入代碼 (/console/codes) */
.tabs a .tab-count { display: inline-block; margin-left: 5px; padding: 0 6px; border-radius: 980px; background: var(--ok-soft);
  color: var(--ok-text); font-size: 11px; font-weight: 600; line-height: 16px; font-variant-numeric: tabular-nums; }
.tabs a.active .tab-count { background: var(--bg-elev); color: var(--text); }
.codes-new { border: 2px solid var(--warn); }
.code-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px 20px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.code-list li { display: flex; align-items: baseline; gap: 10px; padding: 6px 10px; background: var(--bg); border-radius: var(--radius-sm); }
.code-list .n { color: var(--text-3); font-size: 12px; min-width: 18px; text-align: right; font-variant-numeric: tabular-nums; }
.code-list .code { font-family: var(--mono); font-size: 22px; font-weight: 600; letter-spacing: 0.06em; user-select: all; }
.codes-form .field { flex: 1 1 200px; }
.codes-form .field-narrow { flex: 0 1 110px; }
.codes-filters { padding: 0 12px; margin-bottom: 8px; }
.code-input.code-text { letter-spacing: 0.12em; font-size: 20px !important; }
.print-only { display: none; }
@media (max-width: 734px) {
  .codes-form select, .codes-form input, .codes-filters select, .codes-filters input { min-height: 36px; font-size: 16px; }
  .code-list .code { font-size: 20px; }
}
@media print {
  .globalnav, .footer, .flashes, .no-print { display: none !important; }
  .print-only { display: block; }
  body, .page, .panel { background: #fff !important; color: #000 !important; box-shadow: none !important; }
  .codes-new { border: 1px solid #000; }
  .code-list li { background: #fff; border: 1px solid #999; }
  .code-list .code { color: #000; }
}

/* 自動截圖 grid & 統一主機儀表板 (agent 2.11.0) */
.shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-top: 10px; }
.shot-grid a { display: block; text-decoration: none; }
.shot-grid img { width: 100%; height: 112px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: var(--bg-sunk); display: block; }
.shot-grid span { display: block; margin-top: 2px; }
.shot-card { position: relative; }
.shot-card.shot-mini img { height: 90px; object-fit: cover; }
.shot-del { position: absolute; top: 5px; right: 5px; margin: 0; }
.icon-x { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0;
  border: 0; border-radius: 980px; background: rgba(0, 0, 0, 0.62); color: #fff; font-size: 14px; line-height: 1;
  cursor: pointer; backdrop-filter: blur(6px); }
.icon-x:hover { background: var(--bad); }
.icon-x-inline { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0;
  border: 0; border-radius: 980px; background: transparent; color: var(--text-3); font-size: 15px; line-height: 1; cursor: pointer; }
.icon-x-inline:hover { background: var(--bad-soft); color: var(--bad-text); }
.url-text { overflow-wrap: anywhere; word-break: break-all; }
.activity-filter { flex-wrap: wrap; gap: 8px; }
.activity-filter input[type="search"] { flex: 1 1 200px; min-width: 140px; max-width: 320px; }

.host-head { overflow: visible; }
.host-actions { flex-wrap: wrap; gap: 6px; }
details.inline-pop { position: relative; display: inline-block; }
details.inline-pop > summary { list-style: none; }
details.inline-pop > summary::-webkit-details-marker { display: none; }
.pop-card { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 240px;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16); padding: 10px 12px; }
.pop-card input { min-width: 150px; }
.pop-menu { display: flex; flex-direction: column; gap: 4px; min-width: 185px; padding: 6px; }
.full-w { width: 100%; justify-content: flex-start; text-align: left; }

.posture-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 8px; }
.posture-item { padding: 7px 10px; border-radius: var(--radius-sm); background: var(--bg);
  border-left: 3px solid var(--line); min-width: 0; }
.posture-item.st-ok { border-left-color: var(--ok); }
.posture-item.st-warn { border-left-color: var(--warn); background: var(--warn-soft); }
.posture-item.st-bad { border-left-color: var(--bad); background: var(--bad-soft); }
.posture-val { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

.allow-quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.allow-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px;
  background: var(--bg); border: 1px solid var(--line-soft); border-radius: 980px; max-width: 100%; }
.btn.tiny-btn { min-height: 22px; padding: 1px 8px; font-size: 11.5px; line-height: 1.3; }
.mini-cmd { padding: 6px 0; border-top: 1px solid var(--line-soft); }
.mini-cmd:first-of-type { border-top: 0; padding-top: 0; }
.timeline-table td { vertical-align: top; }
.bad-text { color: var(--bad-text); }
.weekday-row { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; min-height: 32px; }
.weekday-row .check { margin: 0; }
.mt-xs { margin-top: 4px; }
.xfer-prog .bar, .xfer-state .bar { display: block; height: 6px; margin-top: 4px; }
.fs-bar { gap: 6px; align-items: center; }
.fs-bar input { flex: 1 1 200px; min-width: 140px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; font: inherit; text-align: left; }
.link-btn:hover { text-decoration: underline; }
@media (max-width: 734px) {
  .pop-card { right: auto; left: 0; min-width: min(280px, calc(100vw - 32px)); }
  .posture-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ------------------------------------------------------------------ Customizable Homepages (public / & console /) */
.hero-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap;
  background: var(--bg-elev); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 16px; margin-bottom: var(--gap); border-left: 3px solid var(--ok);
}
.hero-card.degraded { border-left-color: var(--warn); }
.hero-card.down { border-left-color: var(--bad); }
.hero-card.pub-hero { padding: 14px 18px; }
.hero-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 280px; }
.hero-top { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; }
.hero-title { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
.hero-meta { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; color: var(--text-2); font-size: 12.5px; }
.hero-sub { color: var(--text); font-weight: 500; }
.hero-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.quick-pills { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hero-mini-bar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-bottom: 8px; }
.announce-bar { display: flex; align-items: center; gap: 10px; margin-bottom: var(--gap); }
.custom-note-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.6; color: var(--text); padding: 4px 0; }

.dash-cols.cols-1 { grid-template-columns: minmax(0, 1fr); }
.dash-cols.cols-2 { grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); }
.dash-cols.cols-3 { grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3fr); }
@media (max-width: 1180px) {
  .dash-cols.cols-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .dash-cols.cols-2 .dash-col.c1 { grid-row: auto; }
}
@media (max-width: 760px) {
  .dash-cols.cols-2, .dash-cols.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .hero-actions { margin-left: 0; width: 100%; }
}

/* Customizer (/console/customize) */
.cust-tabs { margin-bottom: var(--gap); }
.cust-preset-bar { margin-bottom: var(--gap); }
.cust-preset-bar form { display: inline-flex; }
.cust-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
@media (max-width: 820px) { .cust-grid { grid-template-columns: minmax(0, 1fr); } }
.cust-checks, .kpi-checks { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.check-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
  border-radius: 980px; background: var(--bg); border: 1px solid var(--line-soft);
  font-size: 12.5px; cursor: pointer; user-select: none; margin: 0;
}
.check-chip.strong { font-weight: 600; background: var(--accent-soft); border-color: transparent; }
.check-chip input[type="checkbox"] { margin: 0; width: auto; }
.cust-subhead { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.cust-widget-table td { vertical-align: middle; }
.cust-order-input { width: 68px; text-align: center; font-variant-numeric: tabular-nums; }
.cust-save-bar {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  background: var(--bg-elev); border-radius: var(--radius); box-shadow: var(--shadow);
}
.nowrap { white-space: nowrap; }

/* ------------------------------------------------------------------ Unified Hosts & Audit Hub + Windows Visual Diagnostic Timeline */
.hub-tabs { margin-top: -4px; margin-bottom: 12px; }

.vtl-controls { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.vtl-controls input[type="date"] { width: auto; min-height: 30px; padding: 3px 8px; font-size: 12.5px; }
.vtl-search { flex: 1 1 240px; min-width: 180px; }
.vtl-search input[type="search"] { flex: 1 1 180px; min-width: 140px; }

.vtl-hour-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--line-soft);
}
.vtl-hour-head h3 { margin: 0; font-size: 13.5px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.vtl-hour-pills { display: flex; gap: 5px; flex-wrap: wrap; }

.vtl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.vtl-node {
  display: grid; grid-template-columns: 62px 22px minmax(0, 1fr); gap: 0 6px;
  align-items: stretch; position: relative;
}
.vtl-time {
  font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums;
  padding-top: 9px; text-align: right; white-space: nowrap;
}
.vtl-rail { position: relative; display: flex; justify-content: center; }
.vtl-rail::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px;
  transform: translateX(-50%); background: var(--line-soft);
}
.vtl-node:first-child .vtl-rail::before { top: 14px; }
.vtl-node:last-child .vtl-rail::before { bottom: calc(100% - 14px); }
.vtl-dot {
  position: relative; z-index: 1; margin-top: 10px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--text-3); border: 2px solid var(--bg-elev);
  box-shadow: 0 0 0 1px var(--line);
}
.vtl-node.kind-shot .vtl-dot { background: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.vtl-node.sev-bad .vtl-dot { background: var(--bad); box-shadow: 0 0 0 2px var(--bad-soft); }
.vtl-node.sev-warn .vtl-dot { background: var(--warn); box-shadow: 0 0 0 2px var(--warn-soft); }
.vtl-node.sev-ok .vtl-dot { background: var(--ok); box-shadow: 0 0 0 2px var(--ok-soft); }

.vtl-body {
  min-width: 0; margin: 3px 0 8px; padding: 7px 11px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--line-soft); border-left: 3px solid var(--line);
}
.vtl-node.kind-shot .vtl-body { border-left-color: var(--accent); }
.vtl-node.sev-bad .vtl-body { border-left-color: var(--bad); background: var(--bad-soft); }
.vtl-node.sev-warn .vtl-body { border-left-color: var(--warn); background: var(--warn-soft); }
.vtl-node.is-muted .vtl-body { opacity: 0.72; }

.vtl-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vtl-src { font-size: 12px; font-weight: 600; color: var(--text); }
.vtl-title { font-size: 13px; margin-top: 3px; overflow-wrap: anywhere; line-height: 1.4; }

.vtl-shot-row { display: flex; gap: 12px; align-items: flex-start; margin-top: 6px; flex-wrap: wrap; }
.vtl-thumb {
  display: block; flex: 0 0 220px; max-width: 100%; border-radius: 7px; overflow: hidden;
  border: 1px solid var(--line); background: var(--bg-sunk); transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.vtl-thumb:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.vtl-thumb img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.vtl-shot-meta { flex: 1 1 200px; min-width: 0; }

@media (max-width: 734px) {
  .vtl-node { grid-template-columns: 50px 18px minmax(0, 1fr); gap: 0 4px; }
  .vtl-time { font-size: 10.5px; }
  .vtl-thumb { flex: 1 1 100%; }
}

/* ------------------------------------------------------------------ Command Palette (⌘K) + Bulk Host Actions */
.cmdk-trigger { gap: 5px; padding: 0 9px; background: var(--muted-soft); }
.cmdk-trigger kbd, .cmdk-head kbd {
  font-family: var(--mono); font-size: 10.5px; padding: 1px 5px; border-radius: 5px;
  background: var(--bg-elev); border: 1px solid var(--line-soft); color: var(--text-2);
}
@media (max-width: 560px) { .cmdk-trigger kbd { display: none; } }

.cmdk-backdrop {
  position: fixed; inset: 0; z-index: 120; background: rgba(0, 0, 0, 0.42); backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center; padding: min(14vh, 110px) 16px 24px;
}
.cmdk-backdrop[hidden] { display: none; }
.cmdk-box {
  width: 100%; max-width: 580px; background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32); overflow: hidden;
  display: flex; flex-direction: column; max-height: 70vh;
}
.cmdk-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.cmdk-input {
  flex: 1; border: 0; background: transparent; color: var(--text); font-size: 15px; outline: none;
  padding: 2px 0; min-width: 0;
}
.cmdk-list { overflow-y: auto; padding: 6px; }
.cmdk-group { font-size: 11px; font-weight: 600; color: var(--text-3); padding: 6px 10px 3px; }
.cmdk-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 10px; border-radius: 9px; color: var(--text); text-decoration: none;
}
.cmdk-item:hover, .cmdk-item.active { background: var(--accent-soft); text-decoration: none; }
.cmdk-meta { min-width: 0; flex: 1; }
.cmdk-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-sub { font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-empty { padding: 24px 16px; text-align: center; color: var(--text-3); font-size: 13px; }

.hosts-search { flex: 1 1 260px; gap: 6px; }
.hosts-search input[type="search"] { flex: 1 1 160px; min-width: 130px; max-width: 260px; }
.bulk-card { padding: 10px 14px; }
.bulk-summary { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; cursor: pointer; list-style: none; }
.bulk-summary::-webkit-details-marker { display: none; }
.bulk-summary .badge { margin-left: auto; }
.bulk-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 180px; overflow-y: auto; }
.bulk-actions-row { gap: 8px; align-items: center; }
.bulk-actions-row input[type="time"] { width: auto; min-height: 30px; padding: 3px 8px; }

/* ------------------------------------------------------------------ Linode Diagnostics (/console/linode, zero-scroll bento) */
.ld-page { max-width: 1360px; padding-top: 12px; padding-bottom: 14px; }
.ld-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.ld-head-left, .ld-head-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ld-title { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.ld-meta { font-size: 12px; color: var(--text-2); }
.ld-meta code { font-family: var(--mono); font-size: 11.5px; padding: 1px 5px; border-radius: 5px; background: var(--bg-sunk); color: var(--text); }
.ld-warn-note { font-size: 12px; font-weight: 600; color: var(--warn-text); background: var(--warn-soft); padding: 3px 9px; border-radius: 999px; }
.ld-live-tag {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-2);
  background: var(--bg-elev); border: 1px solid var(--line-soft); padding: 3px 9px; border-radius: 999px;
}
.ld-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.ld-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
}
.ld-pill-ok { background: var(--ok-soft); color: var(--ok-text); }
.ld-pill-warn { background: var(--warn-soft); color: var(--warn-text); }
.ld-pill-bad { background: var(--bad-soft); color: var(--bad-text); }
.ld-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.ld-dot-ok { background: var(--ok); }
.ld-dot-warn { background: var(--warn); }
.ld-dot-bad { background: var(--bad); }
.ld-dot-muted { background: var(--text-3); }

.ld-kpis {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; margin-bottom: 10px;
}
.ld-kpi {
  background: var(--bg-elev); border: 1px solid var(--line-soft); border-radius: 11px;
  padding: 9px 11px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 5px; min-width: 0;
}
.ld-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.ld-kpi-label { font-size: 11.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-kpi-val { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-kpi-sub { font-size: 12px; font-weight: 500; color: var(--text-2); }
.ld-kpi-foot { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ld-bar { height: 5px; background: var(--bg-sunk); border-radius: 999px; overflow: hidden; }
.ld-bar-fill { height: 100%; border-radius: 999px; transition: width 0.3s ease; }
.ld-fill-ok { background: var(--ok); }
.ld-fill-warn { background: var(--warn); }
.ld-fill-bad { background: var(--bad); }
.ld-fill-accent { background: var(--accent); }
.ld-fill-muted { background: var(--text-3); }

.ld-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: stretch; }
.ld-card {
  background: var(--bg-elev); border: 1px solid var(--line-soft); border-radius: 12px;
  padding: 12px 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 9px; min-width: 0;
}
.ld-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ld-card-head h2 { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.ld-tag { font-size: 11px; color: var(--text-2); background: var(--bg-sunk); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }

.ld-stack-bar {
  display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--bg-sunk); gap: 1px;
}
.ld-seg { display: block; height: 100%; min-width: 2px; }
.ld-seg-shots { background: #30d158; }
.ld-seg-db { background: var(--accent); }
.ld-seg-dl { background: #af52de; }
.ld-seg-other { background: #ff9f0a; }
.ld-legend { display: flex; flex-wrap: wrap; gap: 5px 11px; font-size: 11px; color: var(--text-2); }
.ld-legend b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.ld-sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }

.ld-rows { display: flex; flex-direction: column; gap: 4px; }
.ld-rows-tight { gap: 3px; }
.ld-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12px; padding: 3px 0; border-bottom: 1px solid var(--line-soft);
}
.ld-row:last-child { border-bottom: 0; }
.ld-mono { font-family: var(--mono); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.ld-warn { color: var(--warn-text); font-weight: 600; }

.ld-subhead { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.03em; margin-top: 2px; }
.ld-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ld-chip {
  font-size: 11.5px; padding: 3px 8px; border-radius: 7px; background: var(--bg);
  border: 1px solid var(--line-soft); color: var(--text); white-space: nowrap;
}
.ld-chip b { font-family: var(--mono); font-weight: 600; }
.ld-chip small { color: var(--text-3); }

.ld-nas-box {
  background: var(--bg); border: 1px solid var(--line-soft); border-radius: 9px;
  padding: 8px 10px; display: flex; flex-direction: column; gap: 5px;
}
.ld-nas-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.ld-nas-name { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.ld-nas-sub { font-size: 11px; color: var(--text-2); }

.ld-runs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
.ld-run {
  display: flex; flex-direction: column; align-items: center; padding: 5px 4px; border-radius: 8px;
  border: 1px solid var(--line-soft); background: var(--bg); text-align: center;
}
.ld-run-ok { border-color: var(--ok-soft); background: var(--ok-soft); }
.ld-run-bad { border-color: var(--bad-soft); background: var(--bad-soft); }
.ld-run-day { font-size: 10.5px; font-weight: 700; color: var(--text); }
.ld-run-cnt { font-size: 11px; font-family: var(--mono); color: var(--text-2); }
.ld-run-sz { font-size: 10px; font-family: var(--mono); color: var(--text-3); }

.ld-svc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.ld-svc {
  display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 7px;
  background: var(--bg); border: 1px solid var(--line-soft); min-width: 0; font-size: 11.5px;
}
.ld-svc-bad { border-color: var(--bad); background: var(--bad-soft); }
.ld-svc-warn { border-color: var(--warn); background: var(--warn-soft); }
.ld-svc-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.ld-svc-ver { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); }

.ld-quick-links {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; border-top: 1px solid var(--line-soft);
}
.ld-quick-links a {
  font-size: 11.5px; padding: 3px 8px; border-radius: 7px; background: var(--accent-soft);
  color: var(--link); text-decoration: none; font-weight: 500;
}
.ld-quick-links a:hover { text-decoration: underline; }
.ld-outdated {
  font-size: 11px; padding: 3px 8px; border-radius: 7px; background: var(--warn-soft); color: var(--warn-text); font-weight: 600;
}

@media (max-width: 1180px) {
  .ld-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ld-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .ld-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ld-grid { grid-template-columns: 1fr; }
  .ld-runs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ------------------------------------------------------------------ Synology Drive Fleet Manager (/console/hosts/synology) */
.sd-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
.sd-kpi {
  background: var(--bg-elev); border: 1px solid var(--line-soft); border-radius: 10px;
  padding: 9px 12px; display: flex; flex-direction: column; gap: 3px; box-shadow: var(--shadow);
}
.sd-kpi-ok { border-color: var(--ok-soft); }
.sd-kpi-warn { border-color: var(--warn-soft); }
.sd-kpi-bad { border-color: var(--bad-soft); }
.sd-kpi-lbl { font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.sd-kpi-val { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sd-kpi-val small { font-size: 11.5px; font-weight: 500; color: var(--text-3); }
.sd-top-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; }
.sd-card { padding: 12px 14px; }
.sd-srv-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  padding: 6px 0; border-bottom: 1px solid var(--line-soft);
}
.sd-srv-row:last-child { border-bottom: 0; }
.sd-srv-info, .sd-srv-actions, .sd-op-btns { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.sd-bulk-rows { display: flex; flex-direction: column; gap: 7px; }
.sd-inline-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sd-inline-bar input[type="text"] { flex: 1 1 130px; min-width: 110px; padding: 4px 8px; min-height: 28px; font-size: 12.5px; }
.sd-inline-bar select { width: auto; min-height: 28px; padding: 3px 8px; font-size: 12px; }
.sd-detail { max-width: 210px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-folder-line { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-bottom: 2px; }
.sd-ops { white-space: nowrap; }
.sd-ops .sd-op-btns { justify-content: flex-end; }
.sd-more-edit { margin-top: 4px; text-align: left; }
.sd-more-edit summary { cursor: pointer; color: var(--link); }
.sd-pop-forms { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; padding: 8px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line-soft); min-width: 280px; }
.sd-pop-form { display: flex; flex-direction: column; gap: 4px; }
.sd-inline-bar input[type="password"] { flex: 1 1 110px; min-width: 95px; padding: 4px 8px; min-height: 28px; font-size: 12.5px; }
.sd-mini-ta { width: 100%; font-family: var(--mono); font-size: 12px; padding: 5px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg-elev); color: var(--text); }
.sd-setup-sum { cursor: pointer; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sd-setup-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sd-field { display: flex; flex-direction: column; gap: 3px; }
.sd-field input, .sd-field select, .sd-field textarea { width: 100%; font-size: 12.5px; }
.sd-field textarea { font-family: var(--mono); padding: 6px 8px; }
.sd-setup-opts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sd-setup-opts select { width: auto; min-height: 28px; padding: 3px 8px; font-size: 12px; }
.sd-host-ctrl { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
@media (max-width: 960px) {
  .sd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sd-top-grid, .sd-setup-grid { grid-template-columns: 1fr; }
}

/* 門禁 main /console/ overview card thumbnail */
.home-dash-snap { margin-top: 8px; display: grid; gap: 4px; }
.home-dash-thumb { display: block; width: 100%; max-height: 150px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--line, rgba(128,128,128,0.2)); background: #111; }
