/* QDHCP-NWR - calm, few elements, answers first. */
:root {
  --bg: #f5f5f7; --card: #ffffff; --line: #e3e3e8; --text: #1d1d1f; --muted: #6e6e73;
  --green: #248a3d; --red: #d70015; --amber: #b25000; --grey: #8e8e93; --before: #e8e8ed;
  --tint-red: #fdecec; --tint-amber: #fdf3e2; --accent: #0066cc; --focus: #0071e3;
  --radius: 16px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --card: #1c1c1e; --line: #2c2c2e; --text: #f5f5f7; --muted: #a1a1a6;
    --green: #30d158; --red: #ff453a; --amber: #ff9f0a; --grey: #8e8e93; --before: #2c2c2e;
    --tint-red: #3a1715; --tint-amber: #3a2a10; --accent: #2997ff; --focus: #2997ff; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.47 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 960px; margin: 0 auto; padding: 40px 24px 24px; }
h1, h2, h3, p { margin: 0; }
h1 { font-weight: 600; font-size: clamp(28px, 5vw, 40px); letter-spacing: -0.02em; line-height: 1.1; }
h2 { font-weight: 600; font-size: 21px; margin-bottom: 16px; }
h3 { font-weight: 600; font-size: 17px; margin: 32px 0 12px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.num, .num-table td { font-variant-numeric: tabular-nums; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14px; }

.head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 24px; margin-bottom: 32px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; margin-bottom: 20px; }
.cap { font-size: 14px; font-weight: 600; color: var(--muted); text-transform: none; margin-bottom: 14px; letter-spacing: 0; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.pair .card { margin-bottom: 20px; }
@media (max-width: 700px) {
  .wrap { padding: 28px 16px 16px; }
  .pair { grid-template-columns: 1fr; gap: 0; }
  .card { padding: 22px; }
}

/* Right now */
.now .status { font-weight: 600; font-size: clamp(32px, 6vw, 40px); letter-spacing: -0.02em; line-height: 1.15; display: flex; align-items: center; gap: 14px; }
.now .for { font-size: 21px; margin-top: 4px; }
.now .line { font-size: 19px; margin-top: 10px; }
.now .small { margin-top: 8px; }
.big { font-weight: 600; font-size: 24px; letter-spacing: -0.01em; margin-bottom: 6px; }

.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--grey); flex: none; margin-right: 8px; vertical-align: 0; }
.now .dot { width: 18px; height: 18px; margin: 0; }
.dot.green { background: var(--green); } .dot.red { background: var(--red); } .dot.amber { background: var(--amber); } .dot.grey { background: var(--grey); }
.dot.live { animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(.88); } }

/* 24-hour bar */
.bar { position: relative; height: 10px; border-radius: 5px; background: var(--green); margin-top: 18px; overflow: hidden; }
.bar i { position: absolute; top: 0; bottom: 0; }
.bar i.red { background: var(--red); } .bar i.amber { background: var(--amber); }
.axis { display: flex; justify-content: space-between; margin-top: 6px; }

/* Day tiles */
.tiles { display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 700px) { .tiles { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; } .tile { font-size: 12px; border-radius: 6px; } }
.tile { aspect-ratio: 1; min-width: 0; min-height: 0; display: grid; place-items: center; border: 0; border-radius: 8px; cursor: pointer; padding: 0; font: inherit; font-size: 13px; color: #fff; font-weight: 600; }
.tile span { opacity: .9; }
.tile.green { background: var(--green); } .tile.red { background: var(--red); } .tile.amber { background: var(--amber); }
.tile.before { background: var(--before); color: var(--muted); cursor: default; font-weight: 400; }
.tile[aria-pressed="true"] { outline: 3px solid var(--text); outline-offset: 2px; }
@media (prefers-color-scheme: dark) { .tile.green, .tile.amber { color: #000; } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 20px; list-style: none; padding: 0; margin: 16px 0 0; }
.legend .dot { width: 10px; height: 10px; }
.daylist { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.daylist h3 { margin: 0 0 10px; }
.daylist ul { list-style: none; margin: 0; padding: 0; }
.daylist li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.daylist li:last-child { border-bottom: 0; }

/* Downloads */
.downloads { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 8px 0 20px; }
.dl-label { color: var(--muted); }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 9px; }
.seg input:checked + span { background: var(--text); color: var(--card); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); }
.btns { display: inline-flex; flex-wrap: wrap; gap: 8px; }
button, .button {
  font: inherit; font-size: 16px; min-height: 44px; padding: 0 18px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--text); display: inline-flex; align-items: center;
}
button:hover, .button:hover { border-color: var(--muted); text-decoration: none; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; justify-content: center; }
button.link { border: 0; background: none; color: var(--accent); padding: 0; min-height: 44px; }

/* Login */
.login { max-width: 400px; margin: 10vh auto 0; }
.login h1 { font-size: 32px; margin-bottom: 6px; }
.stack { display: grid; gap: 16px; margin-top: 28px; }
label { display: grid; gap: 6px; font-size: 15px; color: var(--muted); }
input, select {
  font: inherit; font-size: 17px; color: var(--text); background: var(--card); min-height: 44px;
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; width: 100%;
}
.error { color: var(--red); font-weight: 600; }

/* Footer */
.foot { max-width: 960px; margin: 0 auto; padding: 16px 24px 40px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }

/* Tech */
.technav { display: flex; gap: 24px; align-items: center; max-width: 960px; margin: 0 auto; padding: 12px 24px 0; font-size: 15px; }
.technav form { margin-left: auto; }
.technav a { display: inline-flex; min-height: 44px; align-items: center; }
.ranges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ranges a, .ranges button { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); font-size: 15px; }
.ranges .on { background: var(--text); color: var(--card); border-color: var(--text); }
.ranges a:hover { text-decoration: none; border-color: var(--muted); }
.dates { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.dates input { width: auto; min-height: 40px; font-size: 15px; padding: 4px 8px; }
.scroll { overflow-x: auto; margin: 12px 0; }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data th { text-align: left; font-weight: 600; font-size: 13px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.compact td { padding: 6px 10px; font-size: 14px; }
table.data tr.warn td { background: var(--tint-amber); }
.tablecard { padding: 12px 18px; }
details.outage { border: 1px solid var(--line); border-radius: 12px; margin: 8px 0; }
details.outage summary { cursor: pointer; padding: 12px 14px; min-height: 44px; list-style-position: inside; }
details.outage.red { background: var(--tint-red); } details.outage.amber { background: var(--tint-amber); }
details.outage .scroll { padding: 0 10px 8px; margin: 0; }
details.outage table.data { background: var(--card); border-radius: 8px; }
.inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.inline label { flex: 1 1 160px; }
.inline select { max-width: 100%; }
.row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.row.new { border-bottom: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; }
.flash { border-color: var(--accent); }
.code { font: 600 40px/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .12em; margin-top: 8px; }
.small-code { font-size: 18px; letter-spacing: .08em; }

/* Results for the chosen range */
.sentence { margin: 2px 0 4px; }
.figs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 24px; }
.fig { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.fig p { margin: 0; }
.fig-main { font-weight: 600; font-size: 22px; margin: 4px 0 2px !important; }
@media (max-width: 700px) { .figs { grid-template-columns: 1fr; gap: 8px; } .fig { display: grid; grid-template-columns: 1fr auto; align-items: baseline; } .fig-main { font-size: 18px; } .fig p:last-child { grid-column: 1 / -1; } }
.olist { list-style: none; margin: 0; padding: 0; }
.olist li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.olist li:last-child { border-bottom: 0; }
.olist .when { font-variant-numeric: tabular-nums; color: var(--muted); margin-right: 6px; }
.since { margin-top: 16px; }
.quality { list-style: none; margin: 0; padding: 0; }
.quality li { display: grid; grid-template-columns: 9em auto 1fr; gap: 6px 16px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.quality li:last-child { border-bottom: 0; }
.qname { font-weight: 600; }
.meter { display: inline-flex; gap: 3px; }
.meter i { width: 8px; height: 18px; border-radius: 2px; background: var(--before); }
.meter i.on { background: var(--text); }
.meter i.q2 { background: var(--amber); } .meter i.q1 { background: var(--red); }
@media (max-width: 700px) { .quality li { grid-template-columns: 1fr auto; } .qword { grid-column: 1 / -1; } }
.ranges { margin: 4px 0 20px; }

/* Live view: the recorder's front screen as a device mockup */
.headright { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.live-btn { gap: 8px; font-weight: 600; }
.live-btn .dot { width: 10px; height: 10px; margin: 0; }
.device { max-width: 760px; margin: 0 auto 20px; }
.bezel { background: #1d1d1f; border-radius: 28px; padding: 22px; box-shadow: 0 1px 0 rgba(0,0,0,.04); }
.screen { container-type: inline-size; aspect-ratio: 5 / 3; background: #ffffff; color: #1d1d1f; border-radius: 6px;
  display: flex; flex-direction: column; padding: 2.4cqw 3.2cqw 1.6cqw; overflow: hidden; }
.screen .muted { color: #6e6e73; }
.scr-top { display: flex; justify-content: space-between; font-size: 2.4cqw; color: #6e6e73; font-weight: 600; }
.scr-body { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 3cqw; margin-top: 2cqw; min-height: 0; }
.scr-cap { margin: 0 0 1cqw; font-size: 2.3cqw; font-weight: 600; color: #6e6e73; }
.scr-now { display: flex; flex-direction: column; justify-content: center; }
.scr-status { margin: 0; display: flex; align-items: center; gap: 2cqw; font-size: 6.4cqw; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.scr-status .dot { width: 4cqw; height: 4cqw; margin: 0; }
.scr-for { margin: 1.2cqw 0 0; font-size: 3.4cqw; }
.scr-cause { margin: 1.6cqw 0 0; font-size: 2.9cqw; color: #3a3a3c; line-height: 1.3; }
.scr-side { display: grid; grid-template-rows: 1fr 1fr; gap: 2cqw; border-left: 1px solid #e3e3e8; padding-left: 3cqw; }
.scr-line { margin: 0; font-size: 3.6cqw; font-weight: 600; }
.screen .bar { height: 1.2cqw; margin-top: 1.6cqw; background: #248a3d; }
.screen .bar i.red { background: #d70015; } .screen .bar i.amber { background: #b25000; }
.scr-tiles { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1cqw; }
.scr-tiles .tile { font-size: 1.9cqw; border-radius: 1cqw; color: #fff; }
.scr-tiles .tile.green { background: #248a3d; } .scr-tiles .tile.red { background: #d70015; } .scr-tiles .tile.amber { background: #b25000; }
.scr-tiles .tile.before { background: #e8e8ed; color: #6e6e73; }
.scr-hint { margin: 0; text-align: center; font-size: 1.8cqw; color: #8e8e93; }
.livebar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; margin-bottom: 8px; }
.inline-label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 16px; }
.inline-label select { width: auto; }
#l-meta, #l-note { text-align: center; }

/* Motion */
.fade { animation: fade .5s ease-out both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fade, .dot.live { animation: none; } }
