:root {
  color-scheme: light;
  --ink: #21312b;
  --muted: #64716b;
  --paper: #f7f4ef;
  --panel: #fffaf2;
  --line: #d8d2c7;
  --accent: #0f7b67;
  --accent-strong: #075c4c;
  --warn: #a44920;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
}

button,
textarea,
select,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: max(18px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.capture-panel {
  width: min(100%, 520px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.eyebrow {
  margin: 6px 0 -12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 12vw, 4.8rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.record-area {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.record-button,
.submit-button,
.secondary {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  touch-action: manipulation;
}

.record-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--ink);
  color: white;
  font-weight: 800;
  font-size: 1.05rem;
}

.record-button.listening {
  background: var(--warn);
}

.record-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #f05b3d;
  box-shadow: 0 0 0 6px rgba(240, 91, 61, 0.18);
}

.status {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.field {
  display: grid;
  gap: 8px;
}

.field span,
.notes-gate p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

textarea,
select,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  padding: 13px 14px;
  outline: none;
}

textarea:focus,
select:focus,
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 123, 103, 0.16);
}

textarea {
  resize: vertical;
  min-height: 72px;
}

.quick-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr 1fr;
  gap: 10px;
}

.compact select,
.compact input {
  min-height: 48px;
}

.notes-gate {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef6f0;
}

.button-row {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 10px;
  margin-top: 10px;
}

.secondary {
  background: #e5e0d7;
  color: var(--ink);
  font-weight: 800;
}

.secondary.strong {
  background: var(--accent);
  color: #fff;
}

.submit-button {
  width: 100%;
  background: var(--accent);
  color: white;
  font-weight: 900;
  font-size: 1.08rem;
}

.submit-button:disabled,
.record-button:disabled,
.secondary:disabled {
  cursor: wait;
  opacity: 0.7;
}

.result-link {
  color: var(--accent-strong);
  font-weight: 800;
  text-align: center;
}

@media (max-width: 420px) {
  .quick-grid {
    grid-template-columns: 1fr;
  }
}
