:root {
  font: 16px/1.45 system-ui, sans-serif;
  color: #19352f;
  background: #f4f5f1;
  --panel: #fff;
  --text: #19352f;
  --muted: #48605a;
  --border: #ccd7d0;
  --accent: #006755;
  --accent-text: #fff;
  --error: #a1261a;
  --delay: #335ca3;
  --frequency: #974652;
}
@media (prefers-color-scheme: dark) {
  :root {
    color: #e6f1eb;
    background: #14221f;
    --panel: #1d302a;
    --text: #e6f1eb;
    --muted: #b2c8bf;
    --border: #4c625a;
    --accent: #8be0c4;
    --accent-text: #14221f;
    --error: #ffb4a6;
    --delay: #a8c5ff;
    --frequency: #f3adb9;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
main { margin: 0 auto; max-width: 1440px; padding: clamp(1rem, 4vw, 3rem); }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 0 1.5rem; }
.site-logo { display: block; width: clamp(7rem, 18vw, 12rem); height: auto; flex: none; }
@media (max-width: 520px) {
  .site-header { flex-direction: column-reverse; align-items: flex-start; gap: .65rem; }
}
.site-footer { margin-top: 1.5rem; padding-top: 1.3rem; border-top: 1px solid var(--border); }
.store-downloads h2 { font-size: 1rem; margin: 0 0 .75rem; }
.store-badges { --badge-height: 44px; display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; }
.store-badges a { display: inline-flex; align-items: center; border-radius: .4rem; }
.store-badges img { display: block; width: auto; height: var(--badge-height); }
/* The official Google Play PNG includes clear space around its 564 × 168 artwork. */
.store-badges .google-play-badge {
  height: calc(var(--badge-height) * 250 / 168);
  margin: calc(var(--badge-height) * -41 / 168);
}
.store-badges :is(.microsoft-store-badge, .snap-store-badge) {
  border-radius: inherit;
  outline: 1px solid #a6a6a6;
  outline-offset: -1px;
}
.store-badges .snap-store-badge { filter: url("#snap-store-dark"); }
.store-badge-filters { position: absolute; }
.trademark-credit { margin-top: .75rem; font-size: .75rem; }
@media (max-width: 420px) {
  .store-badges { --badge-height: 40px; }
}
h1 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -.04em; line-height: 1.12; margin: 0; }
h2 { font-size: 1.18rem; letter-spacing: -.02em; margin: 0 0 1rem; }
p { margin: .6rem 0 0; color: var(--muted); }
.layout { display: grid; grid-template-columns: minmax(285px, .72fr) minmax(0, 1.5fr); gap: 1.25rem; align-items: start; }
section { min-width: 0; padding: clamp(1rem, 2.4vw, 1.6rem); border: 1px solid var(--border); border-radius: .85rem; background: var(--panel); }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }
.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: .65rem; }
.toolbar label { flex: 1 1 9rem; min-width: 0; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.2rem), 1fr)); gap: .7rem; }
label { display: grid; gap: .3rem; font-size: .85rem; font-weight: 600; }
input, select, button { font: inherit; color: var(--text); border: 1px solid var(--border); border-radius: .42rem; background: var(--panel); padding: .55rem .65rem; min-height: 2.65rem; }
input, select { width: 100%; }
button, summary { cursor: pointer; }
button { white-space: nowrap; font-weight: 650; }
button:disabled, fieldset:disabled { opacity: .55; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
fieldset { display: grid; gap: .85rem; margin: 0; padding: 0; border: 0; min-width: 0; }
#start { justify-self: start; }
details { border: 1px solid var(--border); border-radius: .4rem; padding: .6rem .75rem; }
details .fields { margin-top: .65rem; }
.actions { margin-top: .75rem; }
#error { color: var(--error); }
.status { color: var(--accent); font-weight: 650; margin-bottom: 1rem; }
.metrics { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.metrics > div { border: 1px solid var(--border); border-radius: .4rem; padding: .6rem; }
dt { color: var(--muted); font-size: .82rem; }
dd { font-variant-numeric: tabular-nums; font-weight: 650; margin: .2rem 0 0; }
h3 { font-size: 1rem; margin: 0; }
.dashboard { display: grid; gap: .8rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.section-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; }
.section-heading h2 { margin: 0; }
.dashboard .toolbar { align-items: end; }
.section-heading .toolbar label { flex: 0 1 auto; min-width: 7rem; }
.section-heading select, .section-heading button { font-size: .88rem; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: .65rem; }
.charts figure { min-width: 0; padding: .65rem; margin: 0; border: 1px solid var(--border); border-radius: .4rem; }
figcaption { font-size: .85rem; font-weight: 650; }
.chart-value { margin-top: .25rem; font-weight: 650; font-variant-numeric: tabular-nums; }
canvas { display: block; width: 100%; height: 155px; }
.check-option { display: flex; align-items: center; margin-top: .35rem; cursor: pointer; }
.check-option input { width: 1rem; min-height: 1rem; margin: 0; accent-color: var(--accent); }
#progress .toolbar { min-width: 0; }
#progress button { white-space: normal; }
.sample-picker { margin-top: .65rem; }
input[type="range"] { min-height: 2rem; padding: 0; accent-color: var(--accent); }
#statistics .toolbar { margin-top: .65rem; }
.statistics, .timestamps { margin: .65rem 0 0; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); }
.timestamps { display: grid; gap: .65rem; }
.timestamps dd { font: .83rem ui-monospace, monospace; overflow-wrap: anywhere; }
.caption { font-size: .85rem; }

#progress { grid-column: 1 / -1; }
#ptp-log { overflow: auto; max-height: clamp(12rem, 36vh, 28rem); margin-top: .65rem; border: 1px solid var(--border); border-radius: .4rem; overflow-anchor: none; }
#log-rows { margin: 0; padding: .5rem .7rem; list-style: none; white-space: pre; font: .82rem/1.75 ui-monospace, monospace; font-variant-numeric: tabular-nums; }
@media (max-width: 830px) { .layout { grid-template-columns: 1fr; } }

#launch { max-width: 42rem; }
#launch li + li { margin-top: .4rem; }
#launch a { color: var(--accent); }
