/* Customer portal: phone first, light and dark. */
:root {
  --bg: #f4f6f8; --panel: #fff; --panel-2: #f1f4f6; --ink: #10171c; --muted: #5d6a74;
  --line: #dfe5e9; --accent: #0a8763; --accent-ink: #fff; --warn: #9a6400; --warn-soft: #fbf0d8;
  --crit: #b3402f; --crit-soft: #fbe5e1; --ok-soft: #e1f3ec;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1013; --panel: #121a1f; --panel-2: #0f161a; --ink: #e7eef2; --muted: #8b98a2;
    --line: #1f2a31; --accent: #3fd0a0; --accent-ink: #062018; --warn: #e8b65c; --warn-soft: #2b2311;
    --crit: #f2806f; --crit-soft: #311915; --ok-soft: #0e2b22;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
.top { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.top img { height: 28px; width: auto; }
.site { font-weight: 650; letter-spacing: -.01em; }
.sp { flex: 1; }
main { max-width: 560px; margin: 0 auto; padding: 16px 16px 48px; display: grid; gap: 14px; }
h1 { font-size: 22px; margin: 6px 0 2px; letter-spacing: -.02em; }
h2 { font-size: 17px; margin: 0 0 8px; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], input[type=password], input:not([type]) {
  font: inherit; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.code { font: 600 24px ui-monospace, Menlo, monospace; letter-spacing: .3em; text-align: center; }
button { font: inherit; cursor: pointer; }
.btn { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 10px; padding: 10px 14px; font-weight: 550; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.danger { color: var(--crit); }
.btn:disabled { opacity: .55; cursor: default; }
.link { border: 0; background: none; color: var(--accent); padding: 4px 0; font-weight: 550; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.stack { display: grid; gap: 10px; }
.err { color: var(--crit); font-size: 14px; margin: 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 999px; }
.pill.on { background: var(--ok-soft); color: var(--accent); }
.pill.off { background: var(--crit-soft); color: var(--crit); }
.pill.idle { background: var(--panel-2); color: var(--muted); }
.net { display: grid; gap: 4px; padding: 10px 0; border-top: 1px solid var(--line); }
.net:first-of-type { border-top: 0; }
.net .name { font-weight: 600; font-size: 17px; }
.dev { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2px 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.dev:first-child { border-top: 0; }
.dev .how { color: var(--muted); font-size: 13px; text-align: right; }
.check { display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: 15px; }
.qr { width: 220px; max-width: 100%; margin: 6px auto 0; }
.qr svg { display: block; width: 100%; height: auto; border-radius: 8px; }
.toast { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 528px; margin: 0 auto; background: var(--ink); color: var(--bg); border-radius: 12px; padding: 12px 14px; font-size: 15px; }
.toast.bad { background: var(--crit); color: #fff; }
details summary { cursor: pointer; color: var(--accent); font-weight: 550; }
.staffbar { margin: 0; padding: 10px 16px; background: var(--warn-soft); color: var(--ink); border-bottom: 1px solid var(--line); font-size: 14px; }
.staffbar b { color: var(--warn); }
.grp { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); }
.grp .name { font-weight: 600; font-size: 17px; }
.hrs { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 12px; margin: 0; display: grid; gap: 8px; }
.hrs legend { font-size: 14px; font-weight: 600; padding: 0 4px; }
.hrs .ft label { flex: 1 1 120px; }
input[type=time], select { font: inherit; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; width: 100%; min-height: 44px; }
.pch { margin-top: 8px; }
.pdev { border-top: 1px solid var(--line); padding: 8px 0; }
.pdev summary { display: grid; gap: 2px; color: var(--ink); font-weight: 500; list-style: none; }
.pdev summary::-webkit-details-marker { display: none; }
.pdev summary .dn { color: var(--accent); }
.pdev form { padding-top: 10px; }
.link.danger { color: var(--crit); }
.gauge { position: relative; width: 260px; max-width: 100%; margin: 0 auto 14px; --dl: var(--accent); --ul: #7b5cd6; }
.dial { display: block; width: 100%; height: auto; }
.d-track, .d-fill { fill: none; stroke-width: 14; stroke-linecap: round; }
.d-track { stroke: var(--panel-2); }
.d-fill { stroke: var(--dl); transition: stroke-dasharray .9s cubic-bezier(.2, .8, .2, 1); }
.gauge[data-phase="upload"] .d-fill { stroke: var(--ul); }
.gauge[data-phase=""] .d-fill { stroke: transparent; }
.d-ticks text { font: 500 10px system-ui, sans-serif; fill: var(--muted); }
.d-needle { transform-origin: 120px 118px; transform: rotate(-210deg); transition: transform .9s cubic-bezier(.2, .8, .2, 1); }
.d-needle path, .d-needle circle { fill: var(--ink); }
.gauge[data-phase=""] .d-needle { opacity: .35; }
.d-big { font: 700 34px system-ui, sans-serif; fill: var(--ink); font-variant-numeric: tabular-nums; }
.d-unit { font: 500 13px system-ui, sans-serif; fill: var(--muted); }
.d-phase { position: absolute; left: 0; right: 0; bottom: -14px; text-align: center; font-size: 13px; font-weight: 600; color: var(--muted); }
.gauge[data-phase="download"] .d-phase { color: var(--dl); }
.gauge[data-phase="upload"] .d-phase { color: var(--ul); }
.sgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sgrid > div { display: grid; justify-items: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 4px; }
.sgrid span { font-size: 12px; color: var(--muted); }
.sgrid b { font-size: 22px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.sgrid i { font-style: normal; font-size: 11px; color: var(--muted); }
.sgrid .dl b { color: var(--dl); }
.sgrid .ul b { color: var(--ul); }
.sth { width: 100%; border-collapse: collapse; font-size: 14px; color: var(--ink); }
.sth th, .sth td { text-align: right; padding: 5px 4px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.sth th:first-child, .sth td:first-child { text-align: left; }
@media (prefers-reduced-motion: reduce) { .d-needle, .d-fill { transition: none; } }
.help { white-space: pre-line; margin: 0; }
.devi { width: 26px; height: 26px; color: var(--accent); flex: none; }
.dn2 { display: grid; gap: 1px; min-width: 0; }
.pdev summary { grid-template-columns: auto 1fr; align-items: center; column-gap: 12px; }
.netrow { justify-content: space-between; flex-wrap: nowrap; }
.eye { border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); border-radius: 10px; width: 44px; height: 40px; display: grid; place-items: center; padding: 0; flex: none; }
.eye svg { width: 22px; height: 22px; }
.eye[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.pw { font: 600 16px ui-monospace, Menlo, monospace; background: var(--panel-2); border-radius: 8px; padding: 8px 10px; overflow-wrap: anywhere; user-select: all; }
.devd { border-top: 1px solid var(--line); }
.devd:first-of-type { border-top: 0; }
.devd > summary.dev { border-top: 0; list-style: none; cursor: pointer; }
.devd > summary.dev::-webkit-details-marker { display: none; }
.devact { padding: 0 0 10px 38px; }
.devd > summary.dev { color: var(--ink); font-weight: 400; }
.devd > summary.dev .dn2 > span:first-child { font-weight: 500; }
.rhead { display: flex; gap: 14px; align-items: center; }
.rhead h2 { margin-bottom: 2px; }
.rhead p { margin: 0; }
.rphoto { flex: none; width: 64px; height: 64px; border-radius: 12px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; color: var(--muted); }
.rphoto img { width: 60px; height: 60px; object-fit: contain; }
.rphoto svg { width: 34px; height: 34px; }
.use { --dl: var(--accent); --ul: #7b5cd6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .use { --ul: #a48af0; } }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg .btn { padding: 7px 12px; font-size: 14px; }
.seg .btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.utot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.utot > div { display: grid; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.utot b { font-size: 24px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.utot .dl { color: var(--dl); }
.utot .ul { color: var(--ul); }
.ufig { margin: 0; }
.usvg { display: block; width: 100%; height: 120px; }
.u-hit { fill: transparent; }
.u-dl { fill: var(--dl); }
.u-ul { fill: var(--ul); }
.usvg g:hover .u-hit { fill: var(--panel-2); }
.uaxis { display: flex; justify-content: space-between; font-size: 12px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.ulegend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }
.ulegend span { display: inline-flex; align-items: center; gap: 6px; }
.ulegend .k { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.ulegend .k.dl { background: var(--dl); }
.ulegend .k.ul { background: var(--ul); }
.uh { font-size: 15px; margin: 4px 0 0; }
.udev { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2px 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 15px; }
.udev:first-child { border-top: 0; }
.ubar { display: block; height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; margin-top: 3px; }
.ubar i { display: block; height: 100%; width: 0; background: var(--dl); border-radius: 3px; }
/* Collapsible cards: the title folds the card (portal.js wireFolds). */
.card > h2[data-fold] { cursor: pointer; user-select: none; min-height: 32px; margin-bottom: 8px; border-radius: 6px; }
.card > h2[data-fold]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.card > h2 .fold { width: 20px; height: 20px; margin-left: auto; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.card.folded > h2 .fold { transform: rotate(-90deg); }
.card.folded > h2 { margin-bottom: 0; }
.card.folded > :not(h2:first-child) { display: none !important; }
@media (prefers-reduced-motion: reduce) { .card > h2 .fold { transition: none; } }
/* Wi-Fi signal grade on devices: bars + word; green / amber / red. */
.sig { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; white-space: nowrap; }
.sbars { width: 16px; height: 14px; flex: none; }
.sbars rect { fill: var(--line); }
.sig.good { color: var(--accent); }
.sig.fair { color: var(--warn); }
.sig.weak { color: var(--crit); }
.sig .sbars rect.on { fill: currentColor; }
/* Speed test: peak under each result, and each second's rate as a trace. */
.sgrid em { font-style: normal; font-size: 11px; color: var(--muted); min-height: 1.3em; font-variant-numeric: tabular-nums; }
.st { --dl: var(--accent); --ul: #7b5cd6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .st { --ul: #a48af0; } }
.sgraph { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sg { display: grid; gap: 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.sg span { font-size: 12px; color: var(--muted); }
.sg svg { display: block; width: 100%; height: 48px; overflow: visible; }
.sg polyline { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.sg .a { stroke: none; opacity: .14; }
.sg.dl polyline { stroke: var(--dl); } .sg.dl .a { fill: var(--dl); }
.sg.ul polyline { stroke: var(--ul); } .sg.ul .a { fill: var(--ul); }
.stgraph:empty { display: none; }
.sth small { display: block; font-size: 11px; color: var(--muted); }
.sg span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stother:empty { display: none; }
.stother { margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--warn-soft); }
.pcextra { gap: 6px 8px; }
.btn.small { padding: 6px 10px; font-size: 14px; }
/* Help: "?" tips open in place; hints where a problem shows; How do I… */
.tip { flex: none; width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font: 700 13px/1 system-ui, sans-serif; display: inline-grid; place-items: center; vertical-align: middle; position: relative; }
.tip::after { content: ""; position: absolute; inset: -10px; }
.tip[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); }
.tip:focus-visible, .tipl:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tipl { font-size: 14px; padding: 2px 0; }
.tipbox { margin: 2px 0 6px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border-left: 3px solid var(--accent); font-size: 14px; color: var(--ink); font-weight: 400; letter-spacing: 0; }
.hint { margin: 6px 0; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); font-size: 14px; }
.hint p { margin: 0 0 4px; }
.hint ol, .ht ol, .ht ul { margin: 4px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.ht { border-top: 1px solid var(--line); padding: 10px 0; }
.ht:first-of-type { border-top: 0; }
.ht > div { padding-top: 6px; }
.ht p { margin: 6px 0 0; }
.devwhy { margin: 0; padding: 0 0 6px 38px; color: var(--muted); }
/* Sign-in password field with its show/hide eye. */
.pwrow { display: flex; gap: 8px; align-items: center; }
.pwrow input { flex: 1; min-width: 0; }
/* Installed app: clear the phone's status bar and home indicator. */
@media (display-mode: standalone) {
  .top { padding-top: max(12px, env(safe-area-inset-top)); }
  main { padding-bottom: max(48px, calc(env(safe-area-inset-bottom) + 24px)); }
}
