@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Sora:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;
  --bg: #f5efe7;
  --bg-2: #ece2d7;
  --card: #fffdf8;
  --ink: #211810;
  --muted: #6e6054;
  --line: rgba(33, 24, 16, 0.12);
  --brand: #c7592d;
  --brand-strong: #a63f18;
  --accent: #0f6a63;
  --ok: #198754;
  --warn: #a86410;
  --radius: 20px;
  --shadow: 0 26px 40px rgba(49, 27, 8, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Sora', 'Segoe UI', sans-serif;
  background:
    radial-gradient(900px 420px at 80% -20%, #f8d5bf 0%, transparent 65%),
    radial-gradient(640px 320px at -10% 20%, #d7ebe7 0%, transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--ink);
}

.orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}

.orb-a {
  width: 300px;
  height: 300px;
  background: rgba(199, 89, 45, 0.2);
  top: -120px;
  right: -80px;
}

.orb-b {
  width: 260px;
  height: 260px;
  background: rgba(15, 106, 99, 0.18);
  left: -90px;
  bottom: -80px;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 26px 18px 64px;
}

.hero {
  animation: rise 500ms ease;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 12px;
  color: var(--accent);
}

.hero h1 {
  margin: 10px 0;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(2.1rem, 6vw, 3.3rem);
  line-height: 1;
  font-weight: 400;
}

.lede {
  margin: 0;
  max-width: 640px;
  color: var(--muted);
  font-size: 1.02rem;
}

.card {
  margin-top: 18px;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid rgba(33, 24, 16, 0.05);
  box-shadow: var(--shadow);
  animation: rise 420ms ease;
}

.hidden {
  display: none;
}

.section-head h2 {
  margin: 0;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.9rem;
  font-weight: 400;
}

.section-head p {
  margin-top: 6px;
  color: var(--muted);
}

.capture-grid,
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.upload-tile {
  display: grid;
  gap: 8px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  color: var(--muted);
  font-size: 0.92rem;
}

.upload-tile span {
  color: var(--ink);
  font-weight: 600;
}

.upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-name {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.upload-tile input,
label input,
label select,
label textarea {
  width: 100%;
  font: inherit;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

input,
select,
textarea {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(199, 89, 45, 0.16);
}

.prefilled-lock {
  background: #f7f3ee;
  border-style: dashed;
  color: #5d5247;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.preview {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

.preview img {
  width: 100%;
  height: 130px;
  border-radius: 10px;
  object-fit: cover;
}

.actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.decision-block {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffaf4;
}

.decision-title {
  margin: 0 0 10px;
  font-weight: 700;
}

.decision-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.decision-btn {
  min-height: 72px;
  border: 2px solid rgba(199, 89, 45, 0.25);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 140ms ease;
}

.decision-btn:hover {
  border-color: rgba(199, 89, 45, 0.55);
  background: #fff5ed;
}

.decision-btn.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 24px rgba(181, 65, 22, 0.22);
}

.debug-panel {
  background: #f7f6f3;
  border: 1px dashed rgba(33, 24, 16, 0.2);
}

.debug-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 14px;
  margin-top: 10px;
}

.debug-grid p {
  margin: 0;
  font-size: 0.9rem;
}

.debug-events {
  margin: 12px 0 0;
  max-height: 220px;
  overflow: auto;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.35;
  white-space: pre-wrap;
}

.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all 140ms ease;
}

.btn:hover {
  background: #fff5ef;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: transparent;
}

.btn-primary:hover {
  background: var(--brand-strong);
}

.btn-warning {
  border-color: rgba(168, 100, 16, 0.35);
  color: #8a540c;
  background: #fff6ea;
}

.btn-warning:hover {
  background: #ffe9cf;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.voice-shell {
  display: grid;
  gap: 14px;
  justify-items: center;
  margin-top: 12px;
}

.record {
  width: min(240px, 100%);
  height: 240px;
  border-radius: 999px;
  border: none;
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  background: radial-gradient(circle at 30% 20%, #ffccb6 0%, #df7b4f 55%, #b3451e 100%);
  color: #fff;
  box-shadow: 0 24px 40px rgba(181, 65, 22, 0.32);
  transition: transform 180ms ease;
}

.record:hover {
  transform: translateY(-2px);
}

.record.active {
  animation: pulse 1300ms ease infinite;
}

.voice-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.pill {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: #ffe4d6;
  color: #8f3d1e;
}

.pill.muted {
  background: #edf2f1;
  color: #1f5e58;
}

.transcript-wrap {
  margin-top: 14px;
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.check-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.check-item.done {
  border-color: rgba(25, 135, 84, 0.3);
  background: #f1fbf6;
}

.check-name {
  font-weight: 600;
  line-height: 1.35;
  flex: 1;
}

.check-status {
  font-size: 0.84rem;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff0e2;
  color: var(--warn);
}

.check-item.done .check-status {
  background: #dbf6e8;
  color: var(--ok);
}

details {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

summary {
  cursor: pointer;
  font-weight: 700;
}

.full {
  grid-column: 1 / -1;
}

.success {
  text-align: center;
  background: #eaf8f1;
}

@media (max-width: 760px) {
  .record {
    width: min(200px, 100%);
    height: 200px;
  }

  .card {
    padding: 16px;
    border-radius: 16px;
  }

  .decision-btn {
    min-height: 64px;
    font-size: 0.92rem;
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(199, 89, 45, 0.45);
  }
  100% {
    box-shadow: 0 0 0 28px rgba(199, 89, 45, 0);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
