:root {
  --bg: #0b1b1c;
  --card: #112526;
  --border: #1e3a3b;
  --fg: #e8f1f0;
  --muted: #8fa9a8;
  --accent: #4fd1c5;
  --ok: #48bb78;
  --warn: #ecc94b;
  --error: #fc8181;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.7;
}

header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.brand { font-weight: 700; letter-spacing: -0.02em; }
.accent { color: var(--accent); }
.tag { color: var(--muted); font-size: 0.85rem; }

main { max-width: 46rem; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }

.step { display: none; }
.step.active { display: block; }

h1 { font-size: 1.6rem; line-height: 1.3; margin: 0.5rem 0 0.75rem; }
h2 { font-size: 1.1rem; margin: 2rem 0 0.5rem; }

.lede { color: var(--muted); }
.fineprint { color: var(--muted); font-size: 0.85rem; }

code {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-size: 0.85em;
  word-break: break-all;
}

/* --- spec strip --- */
.spec-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0;
}
.spec-row > div {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
}
.spec-row span { display: block; color: var(--muted); font-size: 0.75rem; }
.spec-row strong { font-size: 1rem; overflow-wrap: anywhere; }

/* --- consent --- */
.consent-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  max-height: 22rem;
  overflow-y: auto;
  white-space: pre-wrap;
  font-size: 0.9rem;
}

.check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin: 1rem 0;
  cursor: pointer;
}
.check input { margin-top: 0.45rem; flex: none; width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.check em { color: var(--muted); font-style: normal; }

/* --- forms --- */
fieldset {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin: 0 0 1.25rem;
}
legend { color: var(--accent); font-size: 0.85rem; padding: 0 0.4rem; }
legend em { color: var(--muted); font-style: normal; }

label { display: block; margin-bottom: 0.9rem; font-size: 0.9rem; }
label small { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 0.35rem; }
label em { color: var(--muted); font-style: normal; }

input, select {
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.6rem 0.7rem;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 0.95rem;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.sensitive {
  border-left: 3px solid var(--warn);
  padding-left: 0.8rem;
  margin-top: 1.25rem;
}

/* --- buttons --- */
button {
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.primary { background: var(--accent); color: #06201e; border-color: var(--accent); }

.row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1rem 0; }

button.record {
  display: block;
  width: 100%;
  padding: 1.1rem;
  font-size: 1.1rem;
  background: var(--accent);
  color: #06201e;
  border-color: var(--accent);
}
button.record.recording { background: var(--error); border-color: var(--error); color: #2a0a0a; }

/* --- meter --- */
.meter {
  height: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin: 1rem 0 0.3rem;
}
.meter-fill {
  height: 100%;
  width: 0;
  background: var(--muted);
  transition: width 60ms linear;
}
.meter-fill.good { background: var(--ok); }
.meter-fill.hot { background: var(--error); }
.meter-label { color: var(--muted); font-size: 0.8rem; margin: 0 0 1rem; }

/* --- recording --- */
.record-head {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.prompt {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 1.5rem 1.25rem;
  margin: 1.25rem 0;
  font-size: 1.5rem;
  line-height: 1.8;
}

.timer { text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; margin: 0 0 0.75rem; }

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: 0.5rem;
  margin: 1rem 0;
}
.metrics > div {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
}
.metrics span { display: block; color: var(--muted); font-size: 0.72rem; }
.metrics strong { font-variant-numeric: tabular-nums; }

audio { width: 100%; margin: 0.5rem 0; }
.hidden { display: none; }

/* --- rules / problems / status --- */
.rules { color: var(--muted); font-size: 0.9rem; padding-left: 1.2rem; }
.rules li { margin-bottom: 0.4rem; }
.rules strong { color: var(--fg); }

.problems { list-style: none; padding: 0; margin: 1rem 0; }
.problems li {
  background: rgba(236, 201, 75, 0.1);
  border: 1px solid var(--warn);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
}

.status { min-height: 1.5rem; font-size: 0.92rem; margin: 0.75rem 0; }
.status.ok { color: var(--ok); }
.status.warn { color: var(--warn); }
.status.error { color: var(--error); }

footer {
  border-top: 1px solid var(--border);
  padding: 1rem 1.25rem;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

/* Operator-facing detail on the preflight block screen: present enough to
   screenshot from the field, quiet enough not to alarm the contributor. */
.hint-detail {
  display: inline-block;
  margin-top: 0.4rem;
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.7rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
