/* Layout: one column phone app — sticky header (title, region, currency), scrolling view, bottom tab bar. */
:root {
  --bg: #EEF2F4; --surface: #FFFFFF; --ink: #13212C; --muted: #5B6B78; --line: #D5DDE3;
  --accent: #0E6E8C; --accent-ink: #FFFFFF; --accent-soft: #DCEEF4;
  --warn: #9A5B00; --warn-soft: #FBEBD2; --good: #2C7449; --good-soft: #DDF0E4; --bad: #B3261E; --bad-soft: #F8DEDC;
  --bar: #9CC9D8;
  --f-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-display: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --r: 14px;
  --tabs-h: 58px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C1217; --surface: #141D24; --ink: #E4ECF1; --muted: #8FA1AE; --line: #24313B;
    --accent: #5DB8D6; --accent-ink: #062029; --accent-soft: #16313B;
    --warn: #E3A33B; --warn-soft: #33270F; --good: #5DBB85; --good-soft: #13291D; --bad: #F2766B; --bad-soft: #3A1A18;
    --bar: #2C6A80;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0C1217; --surface: #141D24; --ink: #E4ECF1; --muted: #8FA1AE; --line: #24313B;
  --accent: #5DB8D6; --accent-ink: #062029; --accent-soft: #16313B;
  --warn: #E3A33B; --warn-soft: #33270F; --good: #5DBB85; --good-soft: #13291D; --bad: #F2766B; --bad-soft: #3A1A18;
  --bar: #2C6A80;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 var(--f-ui);
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px) + 16px);
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* Header */
.top {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(16px); backdrop-filter: saturate(160%) blur(16px);
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
  border-bottom: 1px solid var(--line);
  display: grid; gap: 6px;
}
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h1 { margin: 0; font: 800 1.55rem/1.1 var(--f-display); letter-spacing: -0.01em; }
.checked { margin: 0; font-size: 0.82rem; color: var(--muted); }
.checked b { color: var(--ink); font-weight: 600; }
.money-toggle { display: flex; background: var(--line); border-radius: 10px; padding: 2px; }
.seg { border: 0; background: transparent; min-width: 40px; min-height: 32px; border-radius: 8px; font-weight: 700; color: var(--muted); }
.seg[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / 0.12); }
main { padding: 14px 16px 0; max-width: 680px; margin: 0 auto; }
.view { display: grid; gap: 14px; }
.view-title { margin: 4px 0 0; font: 800 1.25rem/1.2 var(--f-display); }

/* Form bits used in Updates */
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.with-unit { display: flex; align-items: center; gap: 8px; }
.with-unit input, .field select {
  flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--bg); border-radius: 10px;
  padding: 10px 12px; font-size: 1.05rem; font-variant-numeric: tabular-nums; min-height: 44px;
}
.unit { color: var(--muted); font-weight: 700; min-width: 2.2em; }
.fine { font-size: 0.8rem; color: var(--muted); margin: 0; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r); padding: 18px; color: var(--muted); text-align: center; }

/* Price tables */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; gap: 10px; min-width: 0; }
.panel h3 { margin: 0; font: 700 1.02rem/1.3 var(--f-display); }
.panel p { margin: 0; }
.table-wrap { overflow-x: auto; margin: 0 -14px; padding: 0 14px; }
.pt { width: 100%; border-collapse: collapse; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.pt th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; padding: 0 8px 6px 0; white-space: nowrap; }
.pt td { padding: 7px 8px 7px 0; border-top: 1px solid var(--line); vertical-align: top; }
.pt td.n, .pt th.n { text-align: right; white-space: nowrap; }
.pt td.n:last-child, .pt th.n:last-child { padding-right: 0; }
.sub { display: block; font-size: 0.76rem; color: var(--muted); }

/* Updates */
.status-head { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.pill { border-radius: 999px; padding: 2px 10px; font-size: 0.78rem; font-weight: 800; background: var(--line); }
.pill.ok { background: var(--good-soft); color: var(--good); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.run { background: var(--accent-soft); color: var(--accent); }
.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 0.9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.btn { border: 0; background: var(--accent); color: var(--accent-ink); border-radius: 12px; min-height: 46px; padding: 0 18px; font-weight: 700; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.btn:disabled { opacity: 0.55; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.msg { min-height: 1.2em; font-size: 0.88rem; color: var(--muted); }
.msg.bad { color: var(--bad); }
.msg.good { color: var(--good); }
.list-title { margin: 6px 0 0; font: 700 0.8rem var(--f-ui); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.log { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.log li { padding: 10px 14px; border-top: 1px solid var(--line); display: grid; gap: 2px; font-size: 0.9rem; min-width: 0; }
.log li:first-child { border-top: 0; }
.log .when { font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.log .chg { display: flex; justify-content: space-between; gap: 10px; font-variant-numeric: tabular-nums; }
.log .chg span:first-child { min-width: 0; overflow-wrap: anywhere; }
.up { color: var(--bad); font-weight: 700; white-space: nowrap; }
.down { color: var(--good); font-weight: 700; white-space: nowrap; }
.log .bad { color: var(--bad); }

/* Bottom tabs */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: grid; grid-template-columns: repeat(var(--n, 5), 1fr);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(16px); backdrop-filter: saturate(160%) blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabs button { position: relative; border: 0; background: none; height: var(--tabs-h); display: grid; place-items: center; align-content: center; gap: 2px; color: var(--muted); font-size: 0.7rem; font-weight: 600; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs button[aria-current="page"] { color: var(--accent); }
.dot { position: absolute; top: 9px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }

/* My server */
.banner { border-radius: var(--r); padding: 12px 14px; font-weight: 600; background: var(--good-soft); color: var(--good); display: grid; gap: 2px; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.bad { background: var(--bad-soft); color: var(--bad); }
.banner small { font-weight: 500; opacity: 0.9; }
.hero { gap: 6px; }
.eyebrow { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; color: var(--muted); }
.big { font: 800 2.6rem/1.05 var(--f-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.plan { margin: 0; font-weight: 600; }
.hero .facts { margin-top: 6px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pct { font: 800 1.15rem var(--f-display); font-variant-numeric: tabular-nums; }
.meter { height: 12px; border-radius: 6px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--accent); }
.meter i.warn { background: var(--warn); }
.meter i.bad { background: var(--bad); }
.two { grid-template-columns: 1fr 1fr; gap: 16px; }
.two > div { display: grid; gap: 8px; min-width: 0; align-content: start; }
.spark-wrap svg { display: block; width: 100%; height: 64px; }
.spark-wrap .line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark-wrap .area { fill: var(--accent-soft); stroke: none; }
.spark-wrap .end { fill: var(--accent); }
.spark-wrap text { fill: var(--muted); font: 600 10px var(--f-ui); }
@media (prefers-reduced-motion: no-preference) {
  .meter i { transition: width 0.4s ease; }
}

/* Sites */
.sites li { grid-template-columns: auto 1fr auto; align-items: center; column-gap: 10px; }
.state { width: 10px; height: 10px; border-radius: 50%; background: var(--good); }
.state.down { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft); }
.site-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.site-name small { display: block; font-weight: 400; color: var(--muted); font-size: 0.78rem; }
.site-ms { font-size: 0.82rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.site-ms.down { color: var(--bad); font-weight: 700; }
.bad-dot { background: var(--bad); }

/* Tappable site rows and the downtime record */
a.site-link { display: contents; color: inherit; text-decoration: none; }
.sites li:has(a.site-link) { cursor: pointer; }
.sites li:has(a.site-link):active { background: var(--accent-soft); }
.open-arrow { color: var(--accent); font-weight: 700; margin-left: 4px; }
.stats { grid-template-columns: repeat(3, 1fr); text-align: center; gap: 4px; }
.stats b { display: block; font: 800 1.45rem/1.15 var(--f-display); font-variant-numeric: tabular-nums; }
.stats span { font-size: 0.78rem; color: var(--muted); }
.stats .red b { color: var(--bad); }
.dt-right { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dt-right b { display: block; }
.dt-right b.red { color: var(--bad); }
.dt-right small { color: var(--muted); font-size: 0.78rem; }

/* Home cards, platform tabs, switches, bars (one shared layout for phones, iPhone web app and the Android app) */
.brand { font: 800 1.35rem/1.1 var(--f-display); color: var(--ink); text-decoration: none; }
.pgrid { display: grid; gap: 14px; }
.pcard { display: grid; gap: 6px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); color: inherit; text-decoration: none; }
.pcard:active { background: var(--accent-soft); }
.pcard-head { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.pcard-head b { display: block; font: 700 1.1rem var(--f-display); }
.pcard-head small { color: var(--muted); font-size: 0.8rem; }
.picon { font-size: 1.4rem; color: var(--accent); width: 1.6em; text-align: center; }
.chev { color: var(--muted); font-size: 1.4rem; }
.pbig { font: 800 2.1rem/1.1 var(--f-display); font-variant-numeric: tabular-nums; }
.pcap { margin: 0; color: var(--muted); font-size: 0.9rem; }
.palert { margin: 0; color: var(--warn); font-weight: 600; font-size: 0.88rem; }
.tabs a { position: relative; display: grid; place-items: center; align-content: center; gap: 2px; height: var(--tabs-h); color: var(--muted); font-size: 0.68rem; font-weight: 600; text-decoration: none; }
.tabs a span { font-size: 1.15rem; line-height: 1; }
.tabs a[aria-current="page"] { color: var(--accent); }
.badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 16px; height: 16px; border-radius: 8px; background: var(--bad); color: #fff; font: 700 0.65rem/16px var(--f-ui); font-style: normal; text-align: center; padding: 0 4px; }
.checked { margin: 0; font-size: 0.82rem; color: var(--muted); }
.checked b { color: var(--ink); }
.sites li { display: flex; align-items: center; gap: 10px; }
.site-open { all: unset; box-sizing: border-box; flex: 1; min-width: 0; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; cursor: pointer; }
.state.off { background: var(--muted); }
.switch { position: relative; flex: none; width: 50px; height: 30px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 15px; background: var(--line); transition: background 0.2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 0.3); transition: transform 0.2s; }
.switch input:checked + span { background: var(--good); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:disabled + span { opacity: 0.5; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 90px; }
.bars span { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.bars i { display: block; width: 100%; background: var(--accent); border-radius: 2px 2px 0 0; min-height: 2px; }
.meter.thin { height: 6px; }
.seg-row { display: flex; gap: 6px; flex-wrap: wrap; }
.row-btns.col { flex-direction: column; align-items: stretch; }
.btn.danger { background: var(--bad); color: #fff; }
.srow { display: grid; gap: 4px; color: inherit; text-decoration: none; }
.back { color: var(--accent); text-decoration: none; font-weight: 600; }
.muted { opacity: 0.75; }
.facts dd small { color: var(--muted); }
html.in-app .top { padding-top: 10px; }

/* Galaxy Fold 7 open, tablets, desktop: more room, two columns */
@media (min-width: 640px) {
  main { max-width: 1000px; }
  .pgrid { grid-template-columns: 1fr 1fr; }
  .view { grid-template-columns: 1fr 1fr; align-items: start; }
  .view > .view-title, .view > .banner, .view > .checked, .view > .fine, .view > .list-title, .view > .log, .view > .row-btns, .view > .back, .view > .pgrid, .view > .hero { grid-column: 1 / -1; }
  .tabs { max-width: 1000px; margin: 0 auto; border-radius: 16px 16px 0 0; }
}
