:root {
  font-family: Arial, sans-serif;
  color: #29364d;
  background: #fff7e6;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 12% 9%, #ffe1d8 0, transparent 26rem),
    radial-gradient(ellipse at 91% 30%, #dff4e8 0, transparent 29rem),
    #fff7e6;
}

button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, summary:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid #7356c7;
  outline-offset: 4px;
}

.shell { width: min(1120px, calc(100% - 64px)); margin: auto; }
.topbar {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px dashed #e8d9c2;
}
.brand {
  color: #29364d;
  text-decoration: none;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -1.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-dot { color: #f27b68; margin-left: -10px; }
.brand-mark { display: flex; align-items: center; gap: 3px; height: 24px; }
.brand-mark i { display: block; width: 4px; border-radius: 4px; background: #58b89f; }
.brand-mark i:nth-child(1), .brand-mark i:nth-child(4) { height: 10px; }
.brand-mark i:nth-child(2) { height: 20px; }
.brand-mark i:nth-child(3) { height: 15px; }
.top-note, .section-label, .eyebrow, footer, .status, .meter-labels {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.3px;
}
.top-note { color: #68758a; display: flex; align-items: center; gap: 9px; }
.privacy-dot, .eyebrow span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #58b89f;
  display: inline-block;
}

.intro { text-align: center; padding: 66px 0 46px; }
.eyebrow { color: #e66c62; display: flex; align-items: center; justify-content: center; gap: 10px; }
.eyebrow span { background: #f4bd55; }
.intro h1 {
  font-family: Georgia, serif;
  font-size: clamp(54px, 7vw, 80px);
  font-weight: 700;
  line-height: 1.01;
  letter-spacing: -2px;
  margin: 20px 0;
}
.intro h1 em { color: #765cc4; font-weight: 700; font-style: normal; }
.intro p { max-width: 520px; margin: auto; color: #68758a; line-height: 1.7; font-size: 14px; }
.dashboard { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; }
.card {
  background: #fffefa;
  color: #29364d;
  border: 2px solid #f0e5d1;
  border-radius: 22px;
  padding: 31px 34px;
  box-shadow: 0 8px 0 #f0e5d1;
}
.card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.section-label { color: #79869a; font-size: 9px; }
.card h2, .calibration h2 { margin: 9px 0 0; font-size: 15px; font-weight: 800; letter-spacing: -.3px; }
.status {
  color: #758197;
  background: #f1eee8;
  border-radius: 30px;
  padding: 8px 10px;
  white-space: nowrap;
  font-size: 8px;
  letter-spacing: 1px;
}
.status span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #aab2bf; margin-right: 5px; }
.status.active { color: #277b66; background: #dcf4e9; }
.status.active span { background: #42a985; }
.reading { display: flex; align-items: baseline; gap: 10px; margin-top: 31px; }
.reading>span:first-child, .score-number>span:first-child {
  font-family: Georgia, serif;
  font-size: 82px;
  line-height: 1;
  letter-spacing: -3px;
}
.unit { font-size: 20px; font-weight: 700; color: #78859a; }
.unit small { font-size: 9px; letter-spacing: 1px; }
.reading-caption { color: #718095; font-size: 12px; margin: 8px 0 31px; }
.reading-caption.loud { color: #d95950; font-weight: 700; }
.reading-caption.almost-loud { color: #b87939; font-weight: 700; }
.meter { height: 12px; border-radius: 10px; background: #e5eee8; position: relative; }
.meter-fill { height: 100%; width: 0; border-radius: 10px; background: #59b89d; transition: width .12s; }
.meter-fill.loud { background: #ed7969; }
.threshold { position: absolute; height: 20px; width: 2px; background: #ec806d; top: -4px; left: 70.83%; }
.threshold span { position: absolute; bottom: 23px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 9px; font-weight: 800; color: #df7063; }
.quiet-threshold { left: 66.66%; background: #58a98d; }
.quiet-threshold span { left: auto; right: 6px; transform: none; color: #478d75; }
.meter-labels { display: flex; justify-content: space-between; color: #8995a5; margin-top: 12px; font-size: 8px; letter-spacing: 1px; }
.monitor-bottom { display: flex; align-items: center; gap: 19px; margin-top: 38px; }
.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 12px;
  background: #735cc3;
  color: #fff;
  padding: 14px 19px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  min-width: 155px;
  box-shadow: 0 4px 0 #57449c;
}
.primary-button:hover { background: #624eac; transform: translateY(-1px); }
.primary-button:disabled { opacity: .6; cursor: wait; }
.primary-button svg { width: 16px; height: 16px; }
.monitor-bottom p { font-size: 10px; line-height: 1.6; color: #7d899a; margin: 0; }
.error { font-size: 12px; line-height: 1.5; color: #b63f3a; margin-bottom: 0; }

.tv-card {
  background: #7862c8;
  border-color: #5c49a5;
  border-radius: 25px;
  box-shadow: 0 10px 0 #554297;
  display: flex;
  flex-direction: column;
  overflow: visible;
  position: relative;
  padding: 18px;
}
.tv-antennas { position: absolute; width: 76px; height: 31px; left: calc(50% - 38px); top: -25px; }
.tv-antennas span {
  position: absolute;
  bottom: 0;
  width: 5px;
  height: 31px;
  border-radius: 5px;
  background: #ed806f;
  transform-origin: bottom center;
}
.tv-antennas span:first-child { left: 18px; transform: rotate(-35deg); }
.tv-antennas span:last-child { right: 18px; transform: rotate(35deg); }
.tv-antennas span::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #f3bf52;
}
.tv-screen {
  background: #fff8df;
  border: 3px solid #ffe6a4;
  border-radius: 17px;
  padding: 18px 19px;
  box-shadow: inset 0 0 0 2px #f6e8bd;
}
.tv-screen .section-label { color: #7965b0; }
.score-number { margin-top: 15px; display: flex; align-items: baseline; gap: 10px; }
.score-number>span:first-child { font-size: 88px; }
.score-total { color: #705b9c; font-size: 18px; font-weight: 800; }
.quiet-progress { margin-top: 5px; }
.quiet-progress p { margin: 0 0 7px; color: #665687; font-size: 10px; font-weight: 700; line-height: 1.4; }
.quiet-progress-track { height: 9px; border-radius: 10px; background: #e8ddf5; overflow: hidden; }
.quiet-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: #58b89f; transition: width .2s; }
.score-divider { height: 2px; background: #e8dba9; margin: 17px 0; }
.score-info { display: flex; gap: 11px; }
.score-icon { font-size: 21px; color: #ed806f; line-height: 1; }
.score-info h2 { margin: 0 0 7px; }
.score-info p { margin: 0; color: #625478; font-size: 11px; line-height: 1.6; max-width: 260px; }
.reset-button { background: none; border: 0; padding: 0; align-self: flex-start; margin-top: auto; padding-top: 14px; font-weight: 800; font-size: 11px; color: #fff; }
.reset-button span { font-size: 17px; vertical-align: -1px; margin-right: 5px; }
.reset-button:hover { text-decoration: underline; }
.tv-controls { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; margin-top: 13px; }
.tv-speaker { display: grid; grid-template-columns: repeat(6, 4px); gap: 5px; padding: 3px; }
.tv-speaker i { width: 4px; height: 4px; border-radius: 50%; background: #c9b9f1; }
.tv-knobs { display: flex; gap: 9px; }
.tv-knobs span { width: 16px; height: 16px; border: 3px solid #ffe09a; border-radius: 50%; background: #5f4aa7; box-shadow: inset 0 0 0 2px #7862c8; }
.tv-feet { height: 9px; display: flex; justify-content: space-between; margin: 0 12% -25px; }
.tv-feet span { width: 34px; height: 14px; border-radius: 0 0 9px 9px; background: #554297; }

.history { margin-top: 18px; }
.history-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.history-heading h2 { margin-top: 9px; }
.history-cadence { color: #79869a; font-size: 8px; font-weight: 800; letter-spacing: 1.1px; padding-top: 2px; }
.history-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 26px 0 18px; }
.history-stats>div { display: flex; flex-direction: column; gap: 7px; }
.history-stats span { color: #79869a; font-size: 8px; font-weight: 800; letter-spacing: 1.1px; }
.history-stats strong { font-family: Georgia, serif; font-size: 25px; font-weight: 400; color: #29364d; }
.history-chart { height: 220px; position: relative; }
.history-chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart-grid line { stroke: #e3e8e4; stroke-width: 1; stroke-dasharray: 3 5; }
.chart-labels { fill: #8995a5; font: 8px Arial, sans-serif; letter-spacing: .7px; }
.history-line { fill: none; stroke: #59a98e; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.history-point { fill: #59a98e; }
.history-empty { position: absolute; inset: 40% 0 auto; margin: 0; text-align: center; color: #8995a5; font-size: 11px; pointer-events: none; }
.history-empty[hidden] { display: none; }

.calibration { display: flex; gap: 17px; max-width: 720px; margin: 40px auto 55px; color: #68758a; }
.calibration-icon { height: 34px; width: 34px; flex: none; border: 2px solid #f2c56e; border-radius: 50%; display: grid; place-items: center; color: #dc7664; font-size: 23px; }
.calibration h2 { color: #29364d; margin: 0 0 7px; font-size: 13px; }
.calibration p { font-size: 12px; line-height: 1.7; margin: 0; }
details { margin-top: 10px; }
summary { cursor: pointer; color: #6951b6; font-size: 11px; font-weight: 800; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary span { margin-left: 3px; }
details>p { margin-top: 12px !important; }
form { margin-top: 12px; }
label { font-size: 11px; }
.calibration-controls { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; }
.calibration-controls input { width: 75px; border: 1px solid #d5c9b3; background: #fffefa; color: #29364d; padding: 8px; border-radius: 7px; }
.calibration-controls button { border: 0; border-radius: 7px; background: #58b89f; color: #fff; padding: 9px 12px; font-size: 11px; font-weight: 800; }
.calibration-controls button:disabled { opacity: .5; cursor: not-allowed; }
.calibration-controls .text-button { background: none; color: #6951b6; }
footer { border-top: 2px dashed #e8d9c2; padding: 25px 0 35px; display: flex; justify-content: space-between; color: #79869a; font-size: 9px; }
.footer-star { color: #e87361; font-size: 14px; margin-left: 5px; }

@media (max-width: 700px) {
  .shell { width: min(100% - 36px, 520px); }
  .topbar { height: 76px; }
  .top-note { font-size: 8px; }
  .intro { padding: 55px 0 38px; }
  .intro h1 { font-size: 58px; }
  .dashboard { grid-template-columns: 1fr; }
  .card { padding: 27px; }
  .score-number { margin-top: 15px; }
  .score-divider { margin: 17px 0; }
  .reset-button { margin-top: 5px; }
  .calibration { margin: 32px 0 40px; }
  footer { gap: 20px; font-size: 8px; }
}

@media (max-width: 380px) {
  .monitor-bottom { align-items: flex-start; flex-direction: column; gap: 10px; }
  .status { font-size: 7px; }
  .calibration-controls { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
