:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #edf4ec;
  background: #0b100c;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(85, 130, 80, .18), transparent 34rem),
    #0b100c;
}

button { font: inherit; }

.shell {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 18px max(40px, env(safe-area-inset-bottom));
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 5px;
  color: #89ad84;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 6px;
  font-size: clamp(2rem, 8vw, 3.4rem);
  letter-spacing: -.04em;
}

.subhead {
  margin: 0;
  color: #aeb9ae;
  line-height: 1.45;
}

.status {
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 1px solid #2a352b;
  border-radius: 999px;
  color: #b9c3b9;
  background: rgba(255,255,255,.025);
  font-size: .75rem;
}

.status-ready { color: #b7e7ad; border-color: #3d6039; }
.status-error { color: #efb5aa; border-color: #673f38; }

.listen-card,
.current,
.history {
  border: 1px solid #243026;
  background: rgba(17, 25, 18, .88);
  border-radius: 22px;
}

.listen-card {
  padding: 18px;
  margin-bottom: 34px;
}

.meter-wrap {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #1f2920;
  margin-bottom: 18px;
}

.meter {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #89b983;
  transition: width 90ms linear;
}

.session-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.session-row input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid #2a352b;
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
  color: inherit;
  font: inherit;
  font-size: .92rem;
}

.session-row input[type="text"]::placeholder { color: #6f7a70; }
.session-row input[type="text"]:focus { outline: 1px solid #5d8558; }

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid #2a352b;
  border-radius: 12px;
  color: #b9c3b9;
  font-size: .85rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #89b983;
}

.listen-button {
  width: 100%;
  min-height: 74px;
  border: 0;
  border-radius: 17px;
  background: #dcecd9;
  color: #101610;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
}

.listen-button.active {
  background: #38201d;
  color: #ffd8d0;
  outline: 1px solid #77443c;
}

.button-icon { margin-right: 7px; }

.listen-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: #89958a;
  font-size: .78rem;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin: 0 2px 10px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1rem;
}

.section-heading > span,
.text-button {
  color: #778278;
  font-size: .76rem;
}

.current {
  min-height: 132px;
  padding: 20px;
}

.current.empty {
  display: grid;
  place-items: center;
  color: #7f8a80;
  text-align: center;
}

.current.error-card { border-color: #683c38; }
.current.weak-card { border-color: #675d37; }
.current.quiet-card { color: #aab4aa; }

.result-kicker {
  margin-bottom: 6px;
  color: #8ba287;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.top-result h3 {
  margin-bottom: 2px;
  font-size: clamp(1.55rem, 7vw, 2.45rem);
  letter-spacing: -.03em;
}

.scientific {
  color: #8d998e;
  font-style: italic;
}

.score-row,
.alternate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.score-row {
  padding-top: 10px;
  color: #acb7ac;
}

.alternates {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid #263027;
}

.alternate {
  padding: 7px 0;
  color: #9eaa9f;
  font-size: .88rem;
}

.fineprint {
  margin: 8px 4px 30px;
  color: #69736a;
  font-size: .72rem;
  line-height: 1.4;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.history {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.history li { border-bottom: 1px solid #222c23; }

.history li:last-child { border-bottom: 0; }
.history-right { text-align: right; }
.history-empty { display: block; padding: 14px 17px; color: #778278; }

@media (max-width: 520px) {
  .hero { display: block; }
  .status { display: inline-block; margin-top: 14px; }
  .listen-meta { flex-direction: column; gap: 3px; }
}

/* --- Evidence board, latest clip, spectrograms, summary (V0.2) --- */

.current.live,
.current.summary { display: block; }

.board-row {
  padding: 12px 0;
  border-bottom: 1px solid #263027;
}

.board-row:first-child { padding-top: 0; }

.board-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.board-main strong {
  font-size: 1.25rem;
  letter-spacing: -.02em;
}

.badge {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #3b4a3c;
  color: #9fb09f;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.badge-strong { color: #b7e7ad; border-color: #3d6039; }
.badge-possible { color: #f0d49a; border-color: #6a5a35; }

.board-sub {
  color: #8d998e;
  font-style: italic;
  font-size: .88rem;
}

.board-meta {
  margin-top: 4px;
  color: #9eaa9f;
  font-size: .82rem;
}

.board-note {
  margin-top: 4px;
  color: #d8c48a;
  font-size: .8rem;
}

.board-empty,
.board-trace {
  margin: 10px 0 0;
  color: #7f8a80;
  font-size: .8rem;
  line-height: 1.45;
}

.board-trace span { color: #68736a; }

.latest {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #263027;
  color: #aab4aa;
  font-size: .9rem;
}

.latest.strong strong { color: #d9f0d3; }
.latest.weak { color: #a5a08a; }
.latest.error { color: #efb5aa; }
.latest em { color: #d8c48a; font-style: normal; }

.latest-kicker {
  margin-right: 6px;
  color: #6f7f70;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.spectrogram {
  display: block;
  width: 100%;
  height: 96px;
  margin-top: 12px;
  border-radius: 10px;
  background: #0b100c;
  image-rendering: pixelated;
}

.summary h3 {
  margin-bottom: 4px;
  font-size: 1.5rem;
  letter-spacing: -.03em;
}

.summary-line {
  color: #9eaa9f;
  font-size: .85rem;
}

.summary-rows { margin-top: 8px; }

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 0;
  border-top: 1px solid #263027;
}

.summary-row div { display: flex; flex-direction: column; gap: 2px; }
.summary-row span { color: #778278; font-size: .73rem; }

.history-item { display: block; padding: 0; }

.history-line {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  padding: 14px 17px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.history-line div { display: flex; flex-direction: column; gap: 2px; }
.history-line span { color: #778278; font-size: .73rem; }

.history-detail {
  padding: 0 17px 14px;
}

.history-detail audio {
  width: 100%;
  height: 36px;
}

.candidates {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.candidates li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 5px 0;
  color: #9eaa9f;
  font-size: .84rem;
}

.candidates em { color: #d8c48a; font-style: normal; font-size: .74rem; }

/* The hidden attribute must win over any display rule above (the spectrogram canvas is display:block). */
[hidden] { display: none !important; }
