:root {
  --ink: #15221d;
  --muted: #65716b;
  --line: #dfe8e3;
  --paper: #fffdf8;
  --soft: #f3f8f5;
  --mint: #15c39a;
  --mint-dark: #0c7f67;
  --yellow: #fff2bd;
  --coral: #ff8a6b;
  --blue: #dff1ff;
  --pen: #3158a6;
  --red-pen: #c2473d;
  --shadow: 0 24px 80px rgba(18, 44, 35, .12);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(21,195,154,.18), transparent 32rem),
    radial-gradient(circle at 90% 8%, rgba(255,205,81,.24), transparent 28rem),
    #fbfaf4;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.shell { min-height: 100vh; }
.hero { padding: 24px clamp(18px, 4vw, 64px) 48px; }
.topbar, .hero-grid, .app { max-width: 1180px; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -.03em; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; color: white; background: var(--ink); border-radius: 12px; box-shadow: 0 8px 20px rgba(21,34,29,.18); }
.top-actions, .hero-ctas, .toolbar-actions, .next-row { display: flex; gap: 10px; flex-wrap: wrap; }
.version-control { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: white; border-radius: 999px; padding: 6px 10px 6px 13px; color: var(--mint-dark); font-weight: 900; font-size: .82rem; }
.version-control span { text-transform: uppercase; letter-spacing: .08em; font-size: .66rem; }
.version-control select { border: 0; background: transparent; color: var(--ink); font-weight: 900; outline: 0; cursor: pointer; width: min(42vw, 220px); text-overflow: ellipsis; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 42px; align-items: center; }
.eyebrow, .small-label { color: var(--mint-dark); text-transform: uppercase; font-size: .78rem; font-weight: 800; letter-spacing: .12em; }
h1 { font-size: clamp(2.45rem, 6vw, 5.8rem); line-height: .95; letter-spacing: -.08em; margin: 12px 0 22px; max-width: 820px; }
.hero-copy { color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.3rem); line-height: 1.6; max-width: 680px; }
.primary, .secondary, .ghost, .tool { border: 0; border-radius: 999px; padding: 13px 18px; font-weight: 800; transition: .18s ease; }
.primary { background: var(--ink); color: white; box-shadow: 0 12px 24px rgba(21,34,29,.18); }
.primary:hover { transform: translateY(-1px); background: #07110d; }
.secondary { background: white; color: var(--ink); border: 1px solid var(--line); }
.ghost, .tool { background: rgba(255,255,255,.72); color: var(--ink); border: 1px solid var(--line); }
.file-label { display: inline-flex; align-items: center; }
.wide { width: 100%; justify-content: center; }
.coach-card, .question-card, .answer-card, .feedback-card, .side-panel, dialog { background: rgba(255,253,248,.86); border: 1px solid rgba(223,232,227,.9); border-radius: 34px; box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.coach-card { padding: 30px; transform: rotate(1.2deg); }
.coach-card h2 { font-size: 2rem; margin: 16px 0 8px; letter-spacing: -.04em; }
.coach-card li { margin: 12px 0; }
.coach-card { position: relative; touch-action: pan-y; }
.groove-nav { position: absolute; top: 50%; transform: translateY(-50%); border: 0; background: rgba(20,28,26,.06); color: rgba(28,33,31,.55); width: 24px; height: 42px; border-radius: 999px; cursor: pointer; font-size: 1.1rem; }
.groove-prev { left: -10px; }
.groove-next { right: -10px; }
.groove-stack-hint { width: min(340px, 82%); height: 22px; margin-top: -12px; margin-left: 20px; border-radius: 18px; background: linear-gradient(90deg, rgba(190,198,194,.22), rgba(190,198,194,.08)); }
.pack-sidebar { margin: 0 clamp(18px, 4vw, 64px) 16px; display: grid; justify-items: end; }
.pack-panel { margin-top: 10px; width: min(460px, 100%); padding: 20px; background: rgba(255,253,248,.86); border: 1px solid rgba(223,232,227,.9); border-radius: 24px; box-shadow: var(--shadow); }
.pack-panel h2 { margin: 0 0 8px; }
.menu-shell { position: relative; }
.menu-shell > summary { list-style: none; }
.menu-shell > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 8; min-width: 190px; display: grid; gap: 6px; padding: 8px; border-radius: 14px; background: rgba(255,255,255,.96); border: 1px solid var(--line); box-shadow: var(--shadow); }
.pill { display: inline-flex; align-items: center; gap: 6px; background: var(--yellow); border-radius: 999px; padding: 8px 12px; font-size: .8rem; font-weight: 800; }
.pill.success { background: #d9fff4; color: var(--mint-dark); }
.select-card { display: grid; gap: 8px; margin-top: 16px; font-weight: 900; }
.select-card span { color: var(--mint-dark); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.select-card select { width: 100%; border: 1.5px solid var(--line); border-radius: 18px; background: white; padding: 12px 14px; color: var(--ink); font-weight: 800; outline: 0; }
.select-card select:focus { border-color: var(--mint); box-shadow: 0 0 0 4px rgba(21,195,154,.12); }
.mini-copy { color: var(--muted); font-size: .92rem; line-height: 1.45; }
.app { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; padding: 0 clamp(18px, 4vw, 64px) 64px; }
.side-panel { align-self: start; padding: 22px; position: sticky; top: 18px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; }
.progress-track { height: 10px; background: #e7eee9; border-radius: 999px; overflow: hidden; margin: 18px 0; }
.progress-track span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--mint), #9adf54); border-radius: inherit; transition: width .25s ease; }
.question-list { display: grid; gap: 8px; max-height: 62vh; overflow: auto; padding-right: 4px; }
.q-tab { text-align: left; border: 0; background: transparent; padding: 12px; border-radius: 18px; color: var(--muted); font-weight: 750; }
.q-tab.active { background: var(--ink); color: white; }
.workspace { display: grid; gap: 20px; }
.question-card, .answer-card, .feedback-card { padding: clamp(20px, 3vw, 34px); }
.question-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; color: var(--muted); font-weight: 800; }
.command-badge { background: #d8f7ee; color: var(--mint-dark); padding: 9px 12px; border-radius: 14px; letter-spacing: .08em; }
.source-text { white-space: pre-wrap; font: inherit; line-height: 1.7; background: var(--soft); padding: 22px; border-radius: 24px; border: 1px solid var(--line); margin: 0 0 20px; }
.source-text strong { font-weight: 900; background: linear-gradient(transparent 58%, rgba(255,242,189,.95) 58%); padding: 0 .05em; }
.question-card h2 { font-size: clamp(1.45rem, 3vw, 2.4rem); line-height: 1.15; letter-spacing: -.04em; margin: 0; }
.question-enrichment { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.question-enrichment span { background: #f4f7ff; border: 1px solid #d9e1ff; border-radius: 999px; padding: 8px 11px; color: var(--muted); font-size: .84rem; line-height: 1.35; }
.question-enrichment strong { color: var(--ink); }
.answer-toolbar, .feedback-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.answer-toolbar label { font-weight: 900; }
textarea, input { width: 100%; border: 1.5px solid var(--line); border-radius: 20px; padding: 14px 16px; background: white; color: var(--ink); outline: none; }
textarea:focus, input:focus { border-color: var(--mint); box-shadow: 0 0 0 4px rgba(21,195,154,.12); }
#studentAnswer { resize: vertical; font-size: 1.08rem; line-height: 1.6; }
.mini-checks { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 18px; }
.check { border-radius: 999px; padding: 8px 11px; background: #f1f1ee; color: var(--muted); font-size: .82rem; font-weight: 800; }
.check.on { background: #d9fff4; color: var(--mint-dark); }
.draw-box { margin: 14px 0 18px; }
.draw-box summary { font-weight: 800; color: var(--muted); cursor: pointer; }
canvas { width: 100%; height: 220px; background: white; border: 1.5px dashed var(--line); border-radius: 20px; margin: 12px 0; touch-action: none; }
.hidden { display: none; }
.feedback-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(260px, .8fr); gap: 16px; margin-bottom: 16px; }
.feedback-grid article, .excellent.full-width { position: relative; overflow: hidden; padding: 20px; border-radius: 24px; }
.weak { background: #fff1ed; border: 1px solid #ffd1c5; }
.excellent { background: #ecfff9; border: 1px solid #b9f4e4; }
.command-explainer { background: #f4f7ff; border: 1px solid #d9e1ff; }
.command-explainer h3 { margin: 8px 0 8px; font-size: 1.45rem; letter-spacing: -.04em; }
.command-explainer p { color: var(--muted); line-height: 1.55; }
.command-explainer ul { margin: 12px 0 0; padding-left: 1.1rem; }
.command-explainer li { margin: 8px 0; line-height: 1.4; }
.filter-chips, .set-tabs, .set-cards, .set-checklist { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 10px; font-weight: 700; cursor: pointer; }
.card-btn { border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 10px 12px; text-align: left; cursor: pointer; min-width: 150px; }
.card-btn small { display: block; color: var(--muted); margin-top: 4px; }
.set-checklist label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; background: #fff; }
.groove { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.groove strong { width: 100%; color: var(--mint-dark); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.groove span { background: white; border: 1px solid #d9e1ff; border-radius: 999px; padding: 7px 10px; font-weight: 800; font-size: .82rem; }
.answer-pattern { background: rgba(255,255,255,.72); border-left: 4px solid var(--mint); border-radius: 14px; padding: 10px 12px; font-weight: 800; color: var(--ink) !important; }
.feedback-grid h3, .excellent h3 { margin-top: 0; letter-spacing: -.03em; }
.feedback-grid p, .excellent p { line-height: 1.65; }
.coach-note { position: relative; margin: 18px 0 4px; color: var(--pen); font-family: Caveat, cursive; font-size: clamp(1.18rem, 2vw, 1.55rem); font-weight: 700; line-height: 1.12; transform: rotate(-.8deg); background: rgba(255,255,255,.6); border: 2px dashed rgba(49,88,166,.26); border-radius: 20px; padding: 13px 16px 13px 22px; }
.coach-note.compact { margin: 4px 0 14px; display: inline-block; font-size: clamp(1.05rem, 1.6vw, 1.35rem); }
.coach-note::before { content: 'Coach says'; display: block; color: var(--red-pen); font-family: Inter, sans-serif; font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 2px; }
.stamped::after { content: attr(data-stamp); position: absolute; right: -34px; bottom: 20px; transform: rotate(-18deg); border: 4px solid currentColor; border-radius: 10px; padding: 8px 28px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; opacity: .18; pointer-events: none; }
.weak.stamped::after { color: #c24b40; }
.excellent.stamped::after { color: #087a60; }
.excellent.full-width { margin-top: 4px; }
#exceptionalAnswer { display: block; font-size: 1.08rem; margin-bottom: 18px; }
.answer-part { display: inline; border-radius: 10px; padding: 1px 3px; transition: background .16s ease, box-shadow .16s ease; }
.answer-part.is-active { background: #fff2bd; box-shadow: 0 0 0 3px rgba(255,216,97,.45); }
.coach-breakdown { border-top: 1px solid rgba(12,127,103,.18); padding-top: 18px; margin-top: 8px; }
.coach-breakdown h3 { margin-bottom: 8px; }
.breakdown { display: grid; gap: 12px; }
.break-item { display: grid; grid-template-columns: 190px 1fr; gap: 12px; padding: 16px; background: rgba(255,255,255,.78); border: 1px solid var(--line); border-radius: 22px; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.coach-break-item { border-style: dashed; border-color: rgba(49,88,166,.24); }
.break-item:hover, .break-item:focus, .break-item.is-active { transform: translateY(-1px); border-color: #f0c948; box-shadow: 0 12px 30px rgba(55,44,10,.1); outline: none; }
.break-item strong { color: var(--pen); font-family: Caveat, cursive; font-size: 1.45rem; line-height: 1; }
.break-item p { margin: 0; line-height: 1.55; }
.break-item small { display: block; margin-top: 4px; color: var(--muted); }
.next-row { justify-content: flex-end; margin-top: 22px; }
dialog { border: 0; width: min(720px, calc(100% - 24px)); padding: 0; }
dialog::backdrop { background: rgba(4, 13, 10, .38); backdrop-filter: blur(4px); }
.manual-form { padding: 28px; display: grid; gap: 12px; }
.manual-form h2 { margin: 0; }
.manual-form p { color: var(--muted); margin: 0 0 8px; }
.manual-form label { font-weight: 800; display: grid; gap: 6px; }
.close { position: absolute; top: 18px; right: 18px; border: 0; background: var(--soft); width: 36px; height: 36px; border-radius: 50%; font-size: 1.3rem; }
@media (max-width: 900px) {
  .hero-grid, .app, .feedback-grid { grid-template-columns: 1fr; }
  .side-panel { position: static; }
  .question-list { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); max-height: none; }
  .topbar { align-items: flex-start; flex-direction: column; margin-bottom: 34px; }
  .break-item { grid-template-columns: 1fr; }
}
