/* AMR 工程後台的樣式（views.js 的 layout() 以 <link> 載入；CSP 只收自己的檔案）。
   設計方向「控制室」：中性灰、一個青綠色 accent，紅／黃／綠只用在狀態。亮色是預設，
   暗色跟著系統（prefers-color-scheme），使用者選單可以用 cookie 強制（<html data-theme>）。 */

:root {
  color-scheme: light;
  --bg: #F4F5F7; --surface: #FFFFFF; --sunken: #EEF0F3; --line: #DADFE6; --line-2: #C5CCD6;
  --ink: #15191F; --ink-2: #4B5563; --ink-3: #69717E;
  --accent: #0F766E; --accent-ink: #FFFFFF; --accent-soft: #E1F2EF; --accent-hover: #0C625B;
  --live: #15803D; --live-bg: #E6F4EA;
  --warn: #A15C07; --warn-bg: #FDF1DE;
  --danger: #B42318; --danger-bg: #FCEBE9;
  --info: #1D4ED8; --info-bg: #E8EEFD;
  --muted-bg: #EEF0F3;
  --shadow: 0 8px 24px rgb(15 23 42 / .12), 0 1px 3px rgb(15 23 42 / .08);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Noto Sans Mono", monospace;
  --top: 52px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E1116; --surface: #151A21; --sunken: #0B0E12; --line: #262D37; --line-2: #36404D;
  --ink: #E5E9EF; --ink-2: #A7B0BD; --ink-3: #8A94A3;
  --accent: #2BB5A7; --accent-ink: #04201D; --accent-soft: #10302D; --accent-hover: #3CC8B9;
  --live: #4ADE80; --live-bg: #11291B;
  --warn: #FDB022; --warn-bg: #2E2410;
  --danger: #F97066; --danger-bg: #351816;
  --info: #7EA6FF; --info-bg: #17213A;
  --muted-bg: #1E242D;
  --shadow: 0 8px 24px rgb(0 0 0 / .5), 0 1px 3px rgb(0 0 0 / .4);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0E1116; --surface: #151A21; --sunken: #0B0E12; --line: #262D37; --line-2: #36404D;
    --ink: #E5E9EF; --ink-2: #A7B0BD; --ink-3: #8A94A3;
    --accent: #2BB5A7; --accent-ink: #04201D; --accent-soft: #10302D; --accent-hover: #3CC8B9;
    --live: #4ADE80; --live-bg: #11291B;
    --warn: #FDB022; --warn-bg: #2E2410;
    --danger: #F97066; --danger-bg: #351816;
    --info: #7EA6FF; --info-bg: #17213A;
    --muted-bg: #1E242D;
    --shadow: 0 8px 24px rgb(0 0 0 / .5), 0 1px 3px rgb(0 0 0 / .4);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans TC", "Noto Sans CJK TC", "PingFang TC",
    "Hiragino Sans", "Microsoft JhengHei", "Heiti TC", sans-serif;
}
code, .mono { font-family: var(--mono); font-size: 12px; }
a { color: var(--accent); text-underline-offset: 2px; }
a:visited { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--surface); padding: 6px 10px; border-radius: 6px; }
.skip:focus { left: 8px; }

/* ---------------------------------------------------------------- 頂列 */
.top {
  position: sticky; top: 0; z-index: 20; height: var(--top);
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand:visited { color: var(--ink); }
.brand .mk { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); position: relative; flex: none; }
.brand .mk::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--surface); }
.top .sp { flex: 1; }
.top summary { list-style: none; cursor: pointer; }
.top summary::-webkit-details-marker { display: none; }

details.menu { position: relative; }
details.menu > summary {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px;
  border-radius: 8px; border: 1px solid transparent; color: var(--ink); white-space: nowrap; max-width: 260px;
}
details.menu > summary:hover, details.menu[open] > summary { background: var(--sunken); }
details.menu > summary .nm { overflow: hidden; text-overflow: ellipsis; }
details.menu > summary .car { color: var(--ink-3); font-size: 11px; }
.pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 220px; max-width: min(320px, calc(100vw - 24px));
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px;
}
.pop.right { left: auto; right: 0; }
.pop a, .pop .row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.pop a:hover { background: var(--sunken); }
.pop a[aria-current] { color: var(--accent); font-weight: 600; }
.pop .lbl { padding: 6px 10px 2px; font-size: 12px; color: var(--ink-3); }
.pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.pop form { margin: 0; }
.pop .seg { display: flex; gap: 4px; padding: 4px 6px 6px; }
.pop .seg button { flex: 1; }
.pop button.link { width: 100%; justify-content: flex-start; border: 0; background: none; color: var(--ink); height: auto; padding: 7px 10px; font-size: 14px; font-weight: 400; }
.pop button.link:hover { background: var(--sunken); }
.pop .scroll { max-height: 60vh; overflow-y: auto; }

.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-grid; place-items: center; font-weight: 600; font-size: 13px; text-transform: uppercase; }

form.jump { display: flex; align-items: center; margin: 0; }
form.jump input {
  width: 300px; height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--sunken); color: var(--ink); font: inherit; font-size: 13px;
}
form.jump input:focus { background: var(--surface); }
.jump-m { display: none; }
.jump-m .pop form.jump input { width: 100%; }

.livepill {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px;
  background: var(--live-bg); color: var(--live); font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap;
}
.livepill:visited { color: var(--live); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }
.dot.pulse { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .dot.pulse { animation: none; } }

/* ---------------------------------------------------------------- 外框與側欄 */
.shell {
  display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: calc(100vh - var(--top));
  background: linear-gradient(to right, var(--surface) 215px, var(--line) 215px 216px, transparent 216px);
}
.shell:not(:has(> .side)) { grid-template-columns: minmax(0, 1fr); background: none; }
.side {
  position: sticky; top: var(--top); align-self: start; height: calc(100vh - var(--top)); overflow-y: auto;
  padding: 16px 10px; background: var(--surface); border-right: 1px solid var(--line);
}
.side h2 { font-size: 12px; font-weight: 500; color: var(--ink-3); margin: 18px 10px 6px; }
.side h2:first-child { margin-top: 0; }
.side ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.side a {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 6px;
  color: var(--ink-2); text-decoration: none; white-space: nowrap;
}
.side a:visited { color: var(--ink-2); }
.side a:hover { background: var(--sunken); color: var(--ink); }
.side a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side .cnt { margin-left: auto; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.side .cnt.live { color: var(--live); display: inline-flex; align-items: center; gap: 4px; }
main { padding: 24px; min-width: 0; max-width: 1440px; width: 100%; }
.bare main { max-width: none; }

/* ---------------------------------------------------------------- 頁首、文字 */
.ph { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 0 0 20px; }
.ph .tt { min-width: 0; }
.ph .crumbs { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.ph .crumbs a { color: var(--ink-3); text-decoration: none; }
.ph .crumbs a:hover { color: var(--accent); text-decoration: underline; }
.ph h1 { font-size: 24px; line-height: 1.3; margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; overflow-wrap: anywhere; }
.ph .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 28px 0 10px; }
.sub { color: var(--ink-2); margin: 4px 0 0; }
.meta { color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 13px; }
.dim { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.secret { font-family: var(--mono); font-size: 15px; letter-spacing: 1px; word-break: break-all; }

/* ---------------------------------------------------------------- 卡片、清單 */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 16px; }
.card > .hd { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.card > .hd .t { font-weight: 600; font-size: 15px; }
.card > .hd .more { margin-left: auto; font-size: 13px; }
.card > .pad { padding: 16px; }
.card > :last-child { border-bottom-left-radius: 9px; border-bottom-right-radius: 9px; }
.card > .tw:first-child { border-radius: 9px 9px 0 0; }
.card > .tw:only-child { border-radius: 9px; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); min-width: 0; }
.list > li:last-child { border-bottom: 0; }
.list .main { flex: 1; min-width: 0; }
.list .t { font-weight: 500; overflow-wrap: anywhere; }
.list .m { font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.list .end { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 0 16px; align-items: start; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0 0 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; text-decoration: none; color: var(--ink); display: block; }
.kpi:visited { color: var(--ink); }
a.kpi:hover { border-color: var(--line-2); }
.kpi .v { font-size: 26px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi .v small { font-size: 15px; color: var(--ink-3); font-weight: 500; }
.kpi .l { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.kpi.live .v { color: var(--live); }
.kpi.danger .v { color: var(--danger); }

.empty { padding: 22px 16px; color: var(--ink-3); text-align: center; }
.empty .act { margin-top: 10px; }

/* ---------------------------------------------------------------- 表格 */
.tw { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
th { color: var(--ink-3); font-weight: 500; font-size: 12px; background: var(--sunken); }
tbody tr:last-child td { border-bottom: none; }
td.wrap { white-space: normal; min-width: 14em; overflow-wrap: anywhere; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.acts { text-align: right; }
td .two { display: block; font-size: 12px; color: var(--ink-3); }
tr.hl td { background: var(--accent-soft); }
tr:target td { background: var(--accent-soft); }
a.rowlink { font-weight: 500; text-decoration: none; }
a.rowlink:hover { text-decoration: underline; }

/* 手機：.stack 表格變成一列一張卡（thead 藏起來，每格用 data-label 當欄位名）。 */
@media (max-width: 640px) {
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  table.stack tbody tr:last-child { border-bottom: 0; }
  table.stack td { border: 0; padding: 2px 0 2px 6.5em; position: relative; white-space: normal; overflow-wrap: anywhere; min-width: 0; text-align: left; }
  table.stack td::before { content: attr(data-label); position: absolute; left: 0; width: 6em; color: var(--ink-3); font-size: 12px; line-height: 22px; }
  table.stack td.lead { padding-left: 0; font-size: 15px; }
  table.stack td.lead::before, table.stack td[data-label=""]::before { display: none; }
  table.stack td[data-label=""] { padding-left: 0; }
  table.stack td.acts { text-align: left; padding-top: 6px; }
}

/* ---------------------------------------------------------------- 狀態 badge */
.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; white-space: nowrap;
  background: var(--muted-bg); color: var(--ink-2); font-size: 12px; line-height: 18px; font-weight: 500; vertical-align: 1px;
}
.tag.live { background: var(--live-bg); color: var(--live); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.danger { background: var(--danger-bg); color: var(--danger); }
.tag.info { background: var(--info-bg); color: var(--info); }
.tag.accent { background: var(--accent-soft); color: var(--accent); }
.tag.muted { background: var(--muted-bg); color: var(--ink-2); }

.bar { display: inline-block; width: 72px; height: 8px; border-radius: 4px; background: var(--muted-bg); vertical-align: middle; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--live); }

/* ---------------------------------------------------------------- 按鈕與表單 */
.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px;
  font: inherit; font-size: 13px; font-weight: 500; line-height: 1; border-radius: 6px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; vertical-align: middle;
}
a.btn:visited { color: var(--ink); }
.btn:hover, button:hover { border-color: var(--ink-3); }
.btn.primary, button.primary, a.btn.primary:visited { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover, button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost, button.ghost, a.btn.ghost:visited { background: transparent; border-color: transparent; color: var(--accent); }
.btn.ghost:hover, button.ghost:hover { background: var(--accent-soft); }
.btn.danger, button.danger { color: var(--danger); border-color: var(--line-2); }
.btn.danger:hover, button.danger:hover { background: var(--danger-bg); border-color: var(--danger); }
button.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.sm, button.sm { height: 26px; padding: 0 9px; font-size: 12px; }
button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
button:disabled { opacity: .55; cursor: default; }
button[aria-pressed="true"]:disabled { opacity: 1; font-weight: 600; }
@media (pointer: coarse) { .btn, button { min-height: 40px; } .btn.sm, button.sm { min-height: 34px; } }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

form.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; flex-wrap: wrap; }
select, input[type=text], input[type=password], input[type=search], textarea {
  font: inherit; font-size: 13px; min-height: 32px; padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 6px;
  background: var(--surface); color: var(--ink); max-width: 100%;
}
textarea { min-height: 72px; }
form.filter {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 16px;
}
form.filter label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--ink-3); min-width: 0; }
details.more { margin-bottom: 16px; }
details.more > summary { cursor: pointer; color: var(--accent); font-size: 13px; margin-bottom: 8px; width: max-content; max-width: 100%; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; align-items: center; }
.chips .lb { font-size: 12px; color: var(--ink-3); margin-right: 2px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); text-decoration: none; font-size: 13px; white-space: nowrap;
}
.chip:visited { color: var(--ink-2); }
.chip:hover { border-color: var(--line-2); color: var(--ink); }
.chip[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip .n { font-variant-numeric: tabular-nums; opacity: .8; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 16px; overflow-x: auto; }
.tabs a { padding: 8px 14px; color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:visited { color: var(--ink-2); }
.tabs a[aria-current] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* 列內的「管理 ▾」選單：直接在格子裡展開（不浮起來，表格的橫向捲動才不會把它裁掉）。 */
details.rowmenu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 6px; font-size: 12px; font-weight: 500; }
details.rowmenu > summary::-webkit-details-marker { display: none; }
details.rowmenu[open] > summary { background: var(--sunken); }
details.rowmenu > .box { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; text-align: left; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--sunken); min-width: 220px; }
details.rowmenu > .box hr { border: 0; border-top: 1px solid var(--line); width: 100%; margin: 2px 0; }

/* ---------------------------------------------------------------- 回饋 */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 8px; margin: 0 0 16px; border: 1px solid; }
.flash.ok { background: var(--live-bg); border-color: color-mix(in srgb, var(--live) 35%, transparent); }
.flash.err { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.flash .dot { margin-top: 7px; }
.flash.ok .dot { color: var(--live); }
.flash.err .dot { color: var(--danger); }
.err { background: var(--danger-bg); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); color: var(--ink); padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; overflow-wrap: anywhere; }
.ok { background: var(--live-bg); border: 1px solid color-mix(in srgb, var(--live) 35%, transparent); color: var(--ink); padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; overflow-wrap: anywhere; }
.warnbox { background: var(--warn-bg); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; }
.errpage { max-width: 560px; }
.errpage .acts { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

dialog.cfm {
  border: 1px solid var(--line); border-radius: 12px; padding: 20px; width: min(440px, calc(100vw - 32px));
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
dialog.cfm::backdrop { background: rgb(0 0 0 / .45); }
dialog.cfm p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
dialog.cfm .acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- ID chip、時間、協助代碼 */
.idc { display: inline-flex; align-items: center; gap: 2px; font-family: var(--mono); font-size: 12px; color: var(--ink-2); background: var(--sunken); border-radius: 6px; padding: 0 0 0 6px; white-space: nowrap; vertical-align: 1px; }
.idc button { height: 20px; min-height: 0; padding: 0 6px; font-size: 11px; border: 0; background: transparent; color: var(--accent); font-family: inherit; }
time { white-space: nowrap; }
.code { font-family: var(--mono); font-size: 22px; font-weight: 600; letter-spacing: 2px; }
.code.sm { font-size: 15px; letter-spacing: 1px; }

/* ---------------------------------------------------------------- 遠程協助 */
.assist { border-color: color-mix(in srgb, var(--live) 40%, var(--line)); }
.assist > .hd { background: var(--live-bg); }
.assist .who { display: flex; flex-direction: column; min-width: 0; }
.assist .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.cmd { border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; overflow: hidden; background: var(--sunken); }
.cmd-hd { display: flex; gap: 10px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--ink-2); background: var(--surface); flex-wrap: wrap; }
.cmd-hd button, .cmd-hd form { margin-left: auto; }
.cmd pre { margin: 0; padding: 9px 11px; overflow-x: auto; white-space: pre; font-family: var(--mono); font-size: 12px; }
.cmd-note { padding: 0 11px 8px; font-size: 12px; color: var(--ink-3); }
.tunnel { border: 1px dashed var(--line-2); border-radius: 8px; padding: 12px; background: var(--surface); }
.tunnel.on { border-style: solid; border-color: color-mix(in srgb, var(--live) 45%, var(--line)); background: var(--live-bg); }
.tunnel form { margin: 0; }
details.manual { margin-top: 12px; }
details.manual > summary { cursor: pointer; color: var(--accent); font-size: 13px; }

/* ---------------------------------------------------------------- 登入與我的帳號 */
.auth { max-width: 440px; margin: 48px auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.auth h1 { font-size: 20px; margin-bottom: 12px; }
.auth form { display: flex; flex-direction: column; gap: 12px; }
.auth label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2); }
.auth input[type=text], .auth input[type=password] { font-size: 15px; min-height: 40px; }
.auth button { height: 40px; font-size: 14px; }
.auth.wide { max-width: 560px; margin: 0; }
.authtop { display: flex; justify-content: center; padding: 28px 16px 0; }
ol.codes { font-family: var(--mono); font-size: 16px; columns: 2; }
.auth svg { max-width: 100%; height: auto; background: #fff; border-radius: 8px; }

/* ---------------------------------------------------------------- 手機 */
@media (max-width: 760px) {
  .top { gap: 8px; padding: 0 12px; }
  .top .brand .tx { display: none; }
  form.jump.d { display: none; }
  .jump-m { display: block; }
  details.menu > summary { max-width: 46vw; padding: 0 8px; }
  .livepill .tx { display: none; }
  .shell { display: block; background: none; }
  .side {
    position: sticky; top: var(--top); z-index: 15; height: auto; display: flex; align-items: center; gap: 4px;
    overflow-x: auto; padding: 6px 12px; border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none;
  }
  .side::-webkit-scrollbar { display: none; }
  .side h2 { display: none; }
  .side ul { flex-direction: row; gap: 4px; }
  .side ul + h2 + ul { border-left: 1px solid var(--line); padding-left: 6px; margin-left: 2px; }
  .side a { padding: 6px 12px; border-radius: 999px; }
  .side a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
  .side a[aria-current="page"] .cnt { color: inherit; }
  main { padding: 16px; }
  .ph h1 { font-size: 21px; }
  .ph .acts { margin-left: 0; width: 100%; }
  .kpi .v { font-size: 22px; }
  form.filter { padding: 10px 12px; }
  .auth { margin: 16px; padding: 18px; }
  ol.codes { columns: 1; }
  .assist .acts { margin-left: 0; width: 100%; }
  .assist .acts .btn, .assist .acts button { flex: 1; }
}
