:root {
  color-scheme: light;
  --ink: #1e2926;
  --muted: #60706b;
  --paper: #fffdf8;
  --canvas: #f4f1ea;
  --line: #d8d4ca;
  --green: #176b55;
  --green-dark: #0e4c3c;
  --green-soft: #e5f3ec;
  --amber-soft: #fff2d1;
  --red: #9a342e;
  --shadow: 0 16px 45px rgba(35, 45, 42, 0.09);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button { touch-action: manipulation; }
.app-shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 64px; }
.masthead { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow, .step-label { margin: 0 0 6px; color: var(--green); font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(2.25rem, 5vw, 4.25rem); font-weight: 500; letter-spacing: -.04em; line-height: .95; }
h2 { margin: 0; font-size: 1.35rem; letter-spacing: -.02em; }
.demo-badge, .count { border: 1px solid #b7cec3; border-radius: 999px; background: var(--green-soft); color: var(--green-dark); font-size: .78rem; font-weight: 800; padding: 7px 11px; text-transform: uppercase; letter-spacing: .06em; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .85fr); gap: 22px; align-items: start; }
.entry-column { display: grid; gap: 18px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: var(--shadow); }
.assignment-card label, .field-grid label { display: grid; gap: 8px; color: var(--muted); font-size: .82rem; font-weight: 750; }
select, input { width: 100%; border: 1px solid #b9bcb5; border-radius: 10px; background: #fff; color: var(--ink); padding: 13px 14px; outline: none; }
select:focus, input:focus, button:focus-visible { outline: 3px solid rgba(23,107,85,.24); outline-offset: 2px; border-color: var(--green); }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.section-heading.compact { margin-bottom: 18px; }
.hint { max-width: 570px; color: var(--muted); line-height: 1.55; }
.button-row, .modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.button { min-height: 48px; border: 1px solid transparent; border-radius: 11px; cursor: pointer; padding: 11px 17px; font-weight: 750; transition: transform .12s ease, background .12s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .46; }
.button-primary { background: var(--green); color: white; }
.button-primary:hover:not(:disabled) { background: var(--green-dark); }
.button-secondary { border-color: #b9bcb5; background: white; color: var(--ink); }
.button-dark { background: var(--ink); color: white; }
.button-quiet { background: transparent; color: var(--muted); }
.full-width { width: 100%; }
.mic-indicator { width: 13px; height: 13px; border-radius: 50%; background: #aab3af; box-shadow: 0 0 0 6px #edf0ed; }
.mic-indicator.listening { background: #d34a3e; box-shadow: 0 0 0 6px #f8dfdc; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(211,74,62,.12); } }
.status { display: grid; gap: 3px; margin-top: 18px; border-radius: 12px; background: #f0f1ed; color: var(--muted); padding: 13px 15px; font-size: .9rem; }
.status strong { color: var(--ink); }
.status.error { background: #fae7e5; color: var(--red); }
.status.listening { background: var(--green-soft); color: var(--green-dark); }
.heard { margin: 14px 2px 0; color: var(--muted); font-size: .9rem; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.history-card { position: sticky; top: 20px; }
.history-list { display: grid; gap: 10px; margin: 0 0 18px; padding: 0; list-style: none; }
.history-item { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 11px; border-bottom: 1px solid #e5e1d8; padding: 4px 0 13px; }
.initials-avatar { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: var(--amber-soft); font-size: .76rem; font-weight: 850; }
.history-item strong, .history-item small { display: block; }
.history-item small { margin-top: 3px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 145px; }
.history-score { color: var(--green-dark); font-family: Georgia, serif; font-size: 1.45rem; }
.empty-state { color: var(--muted); line-height: 1.55; }
.modal-backdrop { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; overflow-y: auto; background: rgba(20,30,27,.58); padding: 20px; }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(520px, 100%); border-radius: 22px; background: var(--paper); box-shadow: 0 24px 80px rgba(10,20,17,.3); padding: 28px; }
.modal h2 { font-family: Georgia, serif; font-size: 2rem; font-weight: 500; }
.grade-summary { margin: 24px 0; }
.grade-summary div { display: grid; grid-template-columns: 110px 1fr; gap: 16px; border-top: 1px solid var(--line); padding: 14px 0; }
.grade-summary div:last-child { border-bottom: 1px solid var(--line); }
.grade-summary dt { color: var(--muted); }
.grade-summary dd { margin: 0; font-weight: 800; }
.privacy-note { color: var(--muted); font-size: .88rem; line-height: 1.45; }
.confirmation-listening { display: flex; align-items: center; gap: 14px; margin: 16px 0; border-radius: 12px; background: var(--green-soft); color: var(--green-dark); padding: 13px 15px; font-size: .9rem; }
.confirmation-listening.error { background: #fae7e5; color: var(--red); }
.confirmation-listening .mic-indicator { flex: 0 0 auto; }
.modal-actions .button-primary { flex: 1 0 100%; }

@media (max-width: 760px) {
  .app-shell { width: min(100% - 24px, 600px); padding: 25px 0 40px; }
  .workspace { grid-template-columns: 1fr; }
  .history-card { position: static; }
  .card { border-radius: 16px; padding: 19px; }
  .masthead { align-items: center; }
}
@media (max-width: 440px) {
  .button-row .button { width: 100%; }
  .field-grid { grid-template-columns: 1fr; }
  .modal { padding: 22px 18px; }
  .modal-actions .button { flex: 1 0 44%; }
  .modal-actions .button-primary { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
