:root {
  --ink: #173b3a;
  --ink-soft: #4d6866;
  --paper: #fffdf8;
  --cream: #f7f2e7;
  --cream-deep: #eee5d5;
  --green: #0b6b62;
  --green-deep: #07524c;
  --green-soft: #dcefe8;
  --mint: #a9d9c7;
  --coral: #eb744d;
  --coral-text: #bc4e31;
  --coral-soft: #fbe3d7;
  --yellow: #f5c65b;
  --yellow-soft: #fff1c9;
  --purple: #7669a9;
  --purple-soft: #e7e2f4;
  --line: #ded8cc;
  --white: #ffffff;
  --danger: #b84739;
  --shadow-sm: 0 8px 22px rgba(27, 65, 58, .08);
  --shadow-lg: 0 24px 70px rgba(31, 70, 61, .13);
  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 32px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 12%, rgba(245, 198, 91, .19), transparent 22rem),
    radial-gradient(circle at 94% 31%, rgba(169, 217, 199, .22), transparent 24rem),
    var(--paper);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, textarea, input { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(235, 116, 77, .42); outline-offset: 3px; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.app-shell { min-height: 100vh; }

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 78px;
  padding: 12px clamp(20px, 5vw, 76px);
  border-bottom: 1px solid rgba(23, 59, 58, .1);
  background: rgba(255, 253, 248, .91);
  backdrop-filter: blur(18px);
}

.brand { display: inline-flex; width: fit-content; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 15px; color: var(--white); background: var(--green); transform: rotate(-3deg); }
.brand-mark svg { width: 34px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.brand > span:last-child { display: flex; flex-direction: column; }
.brand strong { font-size: 16px; letter-spacing: .08em; }
.brand small { margin-top: 1px; color: var(--ink-soft); font-size: 11px; }

.main-nav { display: flex; gap: 5px; padding: 4px; border: 1px solid rgba(23, 59, 58, .11); border-radius: 999px; background: rgba(255, 255, 255, .65); }
.nav-link { min-height: 42px; padding: 0 22px; border: 0; border-radius: 999px; color: var(--ink-soft); background: transparent; cursor: pointer; font-size: 14px; font-weight: 700; }
.nav-link:hover { color: var(--ink); background: var(--cream); }
.nav-link.is-active { color: var(--white); background: var(--green); box-shadow: 0 5px 14px rgba(11, 107, 98, .21); }

.header-note { justify-self: end; display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #3fa77e; box-shadow: 0 0 0 4px rgba(63, 167, 126, .14); }

main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.app-view { padding: 48px 0 72px; animation: view-in .28s ease both; }
.app-view[hidden] { display: none !important; }
@keyframes view-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

.eyebrow { margin: 0 0 12px; color: var(--coral-text); font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { margin-top: 0; }
h1 { margin-bottom: 18px; font-family: "STKaiti", "KaiTi", "PingFang SC", sans-serif; font-size: clamp(38px, 5vw, 66px); line-height: 1.12; letter-spacing: -.04em; }
h1 em { position: relative; color: var(--green); font-style: normal; white-space: nowrap; }
h1 em::after { position: absolute; right: 1%; bottom: -7px; left: 2%; height: 8px; border-radius: 50%; background: var(--yellow); content: ""; opacity: .62; transform: rotate(-1deg); }
h2 { margin-bottom: 10px; font-size: clamp(25px, 3vw, 36px); letter-spacing: -.025em; }
h3 { margin-bottom: 6px; font-size: 18px; }
p { line-height: 1.75; }

.hero-grid { display: grid; min-height: 470px; grid-template-columns: 1.05fr .95fr; align-items: center; gap: clamp(30px, 6vw, 90px); padding: 22px 0 58px; }
.hero-copy { padding: 24px 0; }
.hero-lede { max-width: 610px; margin: 0; color: var(--ink-soft); font-size: 17px; }
.hero-pills { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 30px; }
.hero-pills span { padding: 9px 15px; border: 1px solid var(--line); border-radius: 999px; color: var(--green-deep); background: rgba(255, 255, 255, .7); font-size: 12px; font-weight: 700; }
.hero-pills span::before { margin-right: 7px; color: var(--coral); content: "●"; font-size: 7px; vertical-align: 2px; }

.hero-art { position: relative; min-height: 395px; border-radius: 48% 52% 46% 54% / 43% 45% 55% 57%; background: var(--green-soft); box-shadow: inset 0 0 0 1px rgba(11, 107, 98, .06), var(--shadow-lg); }
.hero-art svg { position: absolute; z-index: 2; inset: 32px 2% auto; width: 96%; overflow: visible; }
.sun-orb { position: absolute; top: -20px; right: 18px; width: 88px; height: 88px; border-radius: 50%; background: var(--yellow-soft); box-shadow: inset 0 0 0 18px rgba(245, 198, 91, .17); }
.spark { position: absolute; z-index: 3; color: var(--coral); font-size: 25px; }
.spark-one { top: 76px; left: 38px; }.spark-two { top: 115px; right: 35px; color: var(--yellow); font-size: 17px; }
.plate-shadow { fill: rgba(11, 82, 76, .12); }
.plate { fill: #fffdfa; stroke: rgba(11, 107, 98, .11); stroke-width: 3; }
.plate-inner { fill: #f1eadc; }
.art-leaf { stroke: var(--green); stroke-width: 2; }.leaf-back { fill: #66b797; }.leaf-front { fill: #94cfad; }
.art-stem { fill: none; stroke: var(--green-deep); stroke-width: 5; stroke-linecap: round; }
.food-carrot { fill: var(--coral); }.food-leaf { fill: #4a9a70; }
.food-grape { fill: var(--purple); stroke: var(--purple-soft); stroke-width: 3; }.grape-b, .grape-d { fill: #8e7dbf; }
.fork { fill: none; stroke: var(--ink); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; opacity: .76; }
.food-tomato { fill: #df5f47; stroke: #f6a28e; stroke-width: 3; }.tomato-stem { fill: none; stroke: var(--green); stroke-width: 4; stroke-linecap: round; }
.art-caption { position: absolute; z-index: 4; right: 24px; bottom: 20px; display: flex; flex-direction: column; min-width: 185px; padding: 14px 18px; border: 1px solid rgba(255, 255, 255, .7); border-radius: 16px; background: rgba(255, 255, 255, .83); box-shadow: var(--shadow-sm); backdrop-filter: blur(10px); transform: rotate(1deg); }
.art-caption span { color: var(--ink-soft); font-size: 11px; }.art-caption b { margin-top: 3px; font-size: 14px; }

.section-heading, .teacher-header, .questionnaire-intro, .summary-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; }
.section-heading { margin-bottom: 20px; padding-top: 12px; }
.section-heading h2, .teacher-header h1, .questionnaire-intro h1 { margin-bottom: 0; }
.section-hint { max-width: 390px; margin: 0 0 4px; color: var(--ink-soft); font-size: 13px; }

.selection-layout { display: grid; grid-template-columns: 1fr; gap: 18px; }
.group-picker, .member-picker { min-width: 0; padding: 26px; border: 1px solid rgba(23, 59, 58, .1); border-radius: var(--radius-md); background: rgba(255, 255, 255, .75); box-shadow: var(--shadow-sm); }
.mini-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.mini-heading h3, .mini-heading p { margin: 0; }.mini-heading p { margin-top: 3px; color: var(--ink-soft); font-size: 12px; line-height: 1.4; }
.step-number { display: grid; flex: 0 0 auto; width: 38px; height: 38px; place-items: center; border-radius: 50%; color: var(--green-deep); background: var(--green-soft); font-size: 14px; font-weight: 800; }

.group-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.group-card { position: relative; display: flex; min-height: 94px; align-items: center; gap: 12px; padding: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; text-align: left; background: var(--paper); cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.group-card::after { position: absolute; right: -12px; bottom: -20px; width: 65px; height: 65px; border-radius: 50%; background: var(--group-soft); content: ""; }
.group-card:hover { transform: translateY(-2px); border-color: var(--group-color); box-shadow: 0 8px 20px rgba(31, 70, 61, .09); }
.group-card.is-selected { border-color: var(--group-color); box-shadow: inset 0 0 0 2px var(--group-color); }
.group-card.group-1 { --group-color: #d76545; --group-soft: #f9dfd4; }.group-card.group-2 { --group-color: #288a76; --group-soft: #dcefe8; }.group-card.group-3 { --group-color: #92752e; --group-soft: #f7e9b8; }.group-card.group-4 { --group-color: #7162a0; --group-soft: #e8e2f4; }
.group-badge { position: relative; z-index: 1; display: grid; flex: 0 0 auto; width: 45px; height: 45px; place-items: center; border-radius: 15px; color: var(--white); background: var(--group-color); font-family: Georgia, serif; font-size: 21px; font-weight: 700; }
.group-card-text { position: relative; z-index: 1; display: flex; min-width: 0; flex-direction: column; }.group-card-text strong { font-size: 15px; }.group-card-text small { margin-top: 4px; color: var(--ink-soft); font-size: 11px; }
.group-progress-ring { position: relative; z-index: 1; display: grid; flex: 0 0 auto; width: 37px; height: 37px; margin-left: auto; place-items: center; border-radius: 50%; background: conic-gradient(var(--group-color) var(--progress), var(--cream-deep) 0); font-size: 9px; font-weight: 800; }
.group-progress-ring::before { position: absolute; width: 28px; height: 28px; border-radius: 50%; background: var(--paper); content: ""; }.group-progress-ring span { position: relative; z-index: 1; }

.member-list { display: grid; min-height: 134px; grid-template-columns: repeat(5, minmax(48px, 1fr)); gap: 9px; align-content: start; }
.member-placeholder { grid-column: 1 / -1; display: grid; min-height: 134px; place-items: center; border: 1px dashed var(--line); border-radius: 17px; color: var(--ink-soft); background: var(--cream); font-size: 13px; }
.member-button { position: relative; display: flex; min-height: 58px; flex-direction: column; align-items: center; justify-content: center; padding: 7px 4px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); cursor: pointer; }
.member-button:hover { border-color: var(--green); background: var(--green-soft); }.member-button.is-selected { color: var(--white); border-color: var(--green); background: var(--green); box-shadow: 0 7px 18px rgba(11, 107, 98, .18); }
.member-number { font-size: 17px; font-weight: 800; }.member-state { margin-top: 2px; color: var(--ink-soft); font-size: 9px; }.member-button.is-selected .member-state { color: rgba(255,255,255,.8); }
.member-button.has-submission:not(.is-selected)::after { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: #38a57b; content: ""; }
.member-button.has-draft:not(.is-selected)::after { background: var(--yellow); }
.selection-cta { display: flex; min-height: 56px; align-items: center; justify-content: space-between; gap: 14px; margin-top: 17px; padding-top: 17px; border-top: 1px solid var(--line); }
.selection-cta p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }.selection-cta strong { display: block; color: var(--ink); font-size: 13px; }

.primary-button, .secondary-button { min-height: 46px; padding: 0 21px; border-radius: 13px; cursor: pointer; font-weight: 800; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.primary-button { border: 1px solid var(--green); color: var(--white); background: var(--green); box-shadow: 0 8px 18px rgba(11, 107, 98, .18); }
.primary-button:hover { background: var(--green-deep); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(11, 107, 98, .24); }
.primary-button:disabled { cursor: not-allowed; opacity: .45; transform: none; box-shadow: none; }
.secondary-button { border: 1px solid var(--line); color: var(--ink); background: var(--white); }
.secondary-button:hover { border-color: var(--green); color: var(--green-deep); background: var(--green-soft); transform: translateY(-1px); }
.text-button { min-height: 44px; padding: 4px 7px; border: 0; color: var(--green); background: transparent; cursor: pointer; font-weight: 750; }
.text-button:hover { color: var(--green-deep); text-decoration: underline; text-underline-offset: 4px; }

.safety-strip { display: flex; align-items: center; gap: 16px; margin-top: 22px; padding: 18px 22px; border: 1px solid rgba(235, 116, 77, .15); border-radius: var(--radius-md); background: linear-gradient(100deg, var(--coral-soft), rgba(255, 241, 201, .7)); }
.safety-icon { display: grid; flex: 0 0 auto; width: 42px; height: 42px; place-items: center; border-radius: 50%; color: var(--white); background: var(--coral); font-size: 17px; }
.safety-strip strong { font-size: 13px; }.safety-strip p { margin: 2px 0 0; color: #73594d; font-size: 12px; line-height: 1.6; }.safety-arrow { margin-left: auto; color: var(--coral); font-size: 23px; }

/* Questionnaire */
.questionnaire-topline { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; color: var(--ink-soft); font-size: 13px; }
#questionnaire-location { font-weight: 700; }
.questionnaire-intro { align-items: center; margin-bottom: 30px; padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.questionnaire-intro h1 { font-size: clamp(34px, 5vw, 54px); }.questionnaire-intro p:not(.eyebrow) { margin: 10px 0 0; color: var(--ink-soft); }
.answer-progress { flex: 0 0 245px; padding: 18px 20px; border: 1px solid rgba(11, 107, 98, .12); border-radius: 18px; background: var(--green-soft); }
.answer-progress span { color: var(--ink-soft); font-size: 11px; }.answer-progress strong { float: right; font-size: 14px; }
.progress-track { clear: both; height: 7px; margin-top: 14px; overflow: hidden; border-radius: 999px; background: rgba(11, 107, 98, .14); }.progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--green); transition: width .22s ease; }

#questionnaire-form { display: grid; gap: 18px; }
.question-card { display: grid; grid-template-columns: minmax(230px, .77fr) minmax(0, 1.23fr); gap: 30px; padding: clamp(22px, 3.5vw, 36px); border: 1px solid rgba(23, 59, 58, .1); border-radius: var(--radius-md); background: rgba(255, 255, 255, .83); box-shadow: var(--shadow-sm); }
.question-prompt { align-self: start; }.question-index { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 16px; color: var(--coral-text); font-size: 11px; font-weight: 800; letter-spacing: .13em; }.question-index::before { width: 21px; height: 2px; background: var(--coral); content: ""; }
.question-prompt h2 { margin-bottom: 12px; font-size: clamp(21px, 2.6vw, 29px); line-height: 1.45; }.question-prompt p { margin: 0; color: var(--ink-soft); font-size: 12px; }
.question-options { display: grid; gap: 9px; border: 0; padding: 0; margin: 0; min-width: 0; }
.option-label { position: relative; display: grid; min-height: 58px; grid-template-columns: 38px minmax(0, 1fr) auto 22px; align-items: center; gap: 12px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); cursor: pointer; transition: border-color .17s ease, background .17s ease, transform .17s ease; }
.option-label:hover { border-color: var(--mint); background: #f4faf7; transform: translateX(2px); }.option-label:has(input:checked) { border-color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green); }
.option-label:has(input:focus-visible) { outline: 3px solid rgba(235, 116, 77, .42); outline-offset: 2px; }
.option-label input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.option-letter { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; color: var(--green-deep); background: var(--cream); font-family: Georgia, serif; font-weight: 800; }.option-label:has(input:checked) .option-letter { color: var(--white); background: var(--green); }
.option-copy { font-size: 14px; font-weight: 650; line-height: 1.55; }.option-copy small { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 10px; font-weight: 500; }
.option-count { min-width: 48px; padding: 6px 8px; border: 1px solid rgba(11, 107, 98, .14); border-radius: 9px; color: var(--green-deep); background: var(--white); font-size: 11px; font-weight: 800; text-align: center; white-space: nowrap; }
.count-option { grid-template-columns: 38px minmax(0, 1fr) auto; cursor: default; }
.count-option:hover { border-color: var(--line); background: var(--paper); transform: none; }
.count-input-wrap { display: flex; align-items: center; gap: 5px; color: var(--green-deep); font-size: 12px; font-weight: 800; }
.option-label .count-input { position: static; width: 72px; height: 44px; min-height: 44px; padding: 6px 8px; border: 2px solid #cfe3df; border-radius: 11px; color: var(--green-deep); background: var(--white); font-size: 19px; font-weight: 800; text-align: center; opacity: 1; appearance: auto; }
.count-input:focus { border-color: var(--green); outline: 3px solid rgba(11, 107, 98, .14); }
.question-total { margin-top: 10px; padding: 9px 12px; border-radius: 10px; color: var(--ink-soft); background: var(--cream); font-size: 12px; text-align: right; }
.question-total strong { color: var(--green-deep); font-size: 15px; }.question-total.is-invalid { color: var(--danger); background: #fff0ec; }.question-total.is-invalid strong { color: var(--danger); }
.option-check { position: relative; width: 20px; height: 20px; border: 1.5px solid var(--line); border-radius: 50%; background: var(--white); }.option-label:has(input:checked) .option-check { border-color: var(--green); background: var(--green); }.option-label:has(input:checked) .option-check::after { position: absolute; top: 4px; left: 7px; width: 4px; height: 8px; border: solid var(--white); border-width: 0 2px 2px 0; content: ""; transform: rotate(45deg); }
.skip-row { display: flex; justify-content: flex-end; margin-top: 8px; }.skip-button { min-height: 40px; padding: 5px 9px; border: 0; color: var(--ink-soft); background: transparent; cursor: pointer; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }.skip-button:hover { color: var(--danger); }

.submit-dock { position: sticky; z-index: 10; bottom: 14px; display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 24px; padding: 17px 19px; border: 1px solid rgba(23, 59, 58, .12); border-radius: 18px; background: rgba(255, 253, 248, .94); box-shadow: 0 16px 50px rgba(31, 70, 61, .16); backdrop-filter: blur(16px); }
.submit-dock > div { display: flex; flex-direction: column; }.submit-status { font-size: 13px; font-weight: 800; }.submit-dock small { margin-top: 3px; color: var(--ink-soft); font-size: 10px; }
.submit-dock .primary-button { min-width: 190px; }

/* Teacher view */
.teacher-header { align-items: center; margin-bottom: 27px; }.teacher-header h1 { font-size: clamp(36px, 5vw, 56px); }.teacher-header p:not(.eyebrow) { max-width: 680px; margin: 12px 0 0; color: var(--ink-soft); }
.teacher-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }.danger-link { color: var(--danger); }

.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.metric-card { position: relative; min-width: 0; padding: 19px; overflow: hidden; border: 1px solid rgba(23, 59, 58, .1); border-radius: 18px; background: var(--white); box-shadow: var(--shadow-sm); }
.metric-card::after { position: absolute; right: -18px; bottom: -28px; width: 80px; height: 80px; border-radius: 50%; background: var(--metric-tint, var(--green-soft)); content: ""; }
.metric-card span, .metric-card small, .metric-card strong { position: relative; z-index: 1; display: block; }.metric-card span { color: var(--ink-soft); font-size: 11px; }.metric-card strong { margin-top: 9px; font-family: Georgia, serif; font-size: 28px; }.metric-card small { margin-top: 4px; color: var(--ink-soft); font-size: 10px; }.metric-card:nth-child(2) { --metric-tint: var(--yellow-soft); }.metric-card:nth-child(3) { --metric-tint: var(--coral-soft); }.metric-card:nth-child(4) { --metric-tint: var(--purple-soft); }

.teacher-tabs-wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.teacher-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.teacher-tab { min-height: 42px; padding: 0 17px; border: 0; border-radius: 12px; color: var(--ink-soft); background: transparent; cursor: pointer; font-size: 13px; font-weight: 750; }.teacher-tab:hover { background: var(--cream); }.teacher-tab[aria-selected="true"] { color: var(--white); background: var(--green); }
.tab-hint { margin: 0; color: var(--ink-soft); font-size: 11px; text-align: right; }
.analytics-content { display: grid; gap: 22px; }

.analysis-question { padding: clamp(20px, 3vw, 30px); border: 1px solid rgba(23, 59, 58, .1); border-radius: var(--radius-md); background: rgba(255, 255, 255, .8); box-shadow: var(--shadow-sm); break-inside: avoid; }
.analysis-question-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 21px; }
.analysis-number { display: inline-flex; margin-bottom: 8px; color: var(--coral-text); font-size: 10px; font-weight: 800; letter-spacing: .14em; }.analysis-question h2 { margin: 0; font-size: clamp(19px, 2.3vw, 25px); line-height: 1.45; }
.safe-answer { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; color: var(--green-deep); background: var(--green-soft); font-size: 10px; font-weight: 800; }
.charts-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.charts-grid.single-chart { grid-template-columns: minmax(280px, 430px) minmax(300px, 1fr); align-items: center; }
.group-chart { min-width: 0; padding: 13px 12px 12px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); }
.group-chart-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 7px; }.group-chart-header strong { font-size: 13px; }.group-chart-header span { color: var(--ink-soft); font-size: 9px; }
.chart-plot { position: relative; display: grid; height: 180px; grid-template-columns: repeat(4, 1fr); gap: 7px; align-items: end; padding: 30px 7px 0; border-bottom: 1px solid #bdb6aa; background: repeating-linear-gradient(to top, transparent 0, transparent 36px, rgba(23, 59, 58, .075) 37px); }
.bar-column { display: grid; height: 149px; grid-template-rows: 125px 24px; align-items: end; text-align: center; }
.bar-track { position: relative; display: flex; height: 125px; align-items: flex-end; justify-content: center; }
.bar-fill { position: relative; width: min(33px, 75%); min-height: 3px; height: var(--bar-height); border-radius: 9px 9px 3px 3px; background: var(--coral); transition: height .28s ease; }
.bar-fill.is-safe { background: var(--green); }.bar-fill.is-watch { background: var(--yellow); }
.bar-value { position: absolute; top: -23px; left: 50%; color: var(--ink); font-size: 11px; font-weight: 800; transform: translateX(-50%); }
.bar-letter { align-self: center; font-family: Georgia, serif; font-size: 12px; font-weight: 800; }
.chart-caption { display: flex; justify-content: space-between; gap: 8px; margin-top: 9px; color: var(--ink-soft); font-size: 9px; }

.option-breakdown { display: grid; gap: 7px; }
.breakdown-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 46px; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.breakdown-row:last-child { border-bottom: 0; }.breakdown-letter { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 10px; color: var(--green-deep); background: var(--cream); font-family: Georgia, serif; font-weight: 800; }.breakdown-row.is-safe .breakdown-letter { color: var(--white); background: var(--green); }.breakdown-copy { color: var(--ink-soft); font-size: 11px; line-height: 1.5; }.breakdown-row strong { white-space: nowrap; font-size: 13px; }
.option-key { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px 14px; margin-top: 17px; padding-top: 13px; border-top: 1px dashed var(--line); }
.option-key > span { display: flex; gap: 7px; color: var(--ink-soft); font-size: 10px; line-height: 1.5; }.option-key > span > span { display: block; }.option-key b { flex: 0 0 auto; color: var(--ink); font-family: Georgia, serif; }.option-key small, .breakdown-copy small { display: block; margin-top: 2px; color: #7f6936; font-size: 9px; }

.teacher-summary-section { margin-top: 28px; padding: clamp(22px, 3.5vw, 36px); border-radius: var(--radius-lg); color: #ecf8f4; background: var(--green-deep); box-shadow: var(--shadow-lg); break-inside: avoid; }
.teacher-summary-section .eyebrow { color: #f5c65b; }.teacher-summary-section h2 { margin-bottom: 0; color: var(--white); }.teacher-summary-section .secondary-button { border-color: rgba(255,255,255,.28); color: var(--white); background: rgba(255,255,255,.08); }.teacher-summary-section .secondary-button:hover { background: rgba(255,255,255,.15); }
.auto-summary { margin: 24px 0; padding: 20px; border: 1px solid rgba(255,255,255,.15); border-radius: 18px; background: rgba(255,255,255,.07); }
.auto-summary p { margin: 0; color: #dceee9; font-size: 13px; }.auto-summary p + p { margin-top: 8px; }.auto-summary strong { color: var(--white); }
.empty-summary { color: #dceee9; }
.notes-label { display: block; margin-bottom: 9px; color: var(--white); font-size: 12px; font-weight: 750; }
#teacher-notes { display: block; width: 100%; min-height: 126px; resize: vertical; padding: 15px 16px; border: 1px solid rgba(255,255,255,.2); border-radius: 15px; color: var(--ink); background: #fffdf8; line-height: 1.7; }
.print-notes { display: none; }
.notes-saved { min-height: 18px; margin: 7px 0 0; color: #b9ddd2; font-size: 10px; }

.site-footer { display: flex; justify-content: space-between; gap: 20px; width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 20px 0 32px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 10px; }
.toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; max-width: min(370px, calc(100vw - 44px)); padding: 13px 17px; border-radius: 13px; color: var(--white); background: var(--ink); box-shadow: var(--shadow-lg); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity .2s ease, transform .2s ease; }.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1000px) {
  .site-header { grid-template-columns: 1fr auto; }.main-nav { order: 3; grid-column: 1 / -1; justify-self: center; margin-top: 9px; }.header-note { display: none; }
  .hero-grid { min-height: 420px; gap: 26px; }.hero-art { min-height: 340px; }.hero-art svg { top: 23px; }.art-caption { right: 16px; bottom: 12px; }
  .selection-layout { grid-template-columns: 1fr; }.group-list { grid-template-columns: repeat(4, 1fr); }.group-card { min-height: 86px; }.group-progress-ring { display: none; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }.charts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  main, .site-footer { width: min(100% - 28px, 1180px); }
  .site-header { padding: 10px 14px; }.brand small { display: none; }.brand-mark { width: 40px; height: 40px; }.brand-mark svg { width: 30px; }.main-nav { width: 100%; }.nav-link { flex: 1; padding: 0 10px; }
  .app-view { padding: 30px 0 55px; }.hero-grid { grid-template-columns: 1fr; min-height: 0; padding: 2px 0 45px; }.hero-copy { padding: 10px 0 0; }.hero-art { min-height: 320px; width: min(480px, 100%); margin: 0 auto; }.hero-lede { font-size: 15px; }
  .section-heading, .teacher-header, .questionnaire-intro, .summary-heading { align-items: flex-start; flex-direction: column; gap: 12px; }.section-hint { margin: 0; }.group-list { grid-template-columns: repeat(2, 1fr); }.group-card { min-height: 80px; }.group-progress-ring { display: grid; }
  .group-picker, .member-picker { padding: 20px; }.member-list { grid-template-columns: repeat(5, minmax(42px, 1fr)); }.selection-cta { align-items: stretch; flex-direction: column; }.selection-cta .primary-button { width: 100%; }
  .safety-arrow { display: none; }
  .questionnaire-topline { align-items: flex-start; flex-direction: column; gap: 4px; }.questionnaire-intro { align-items: stretch; }.answer-progress { flex-basis: auto; width: 100%; }
  .question-card { grid-template-columns: 1fr; gap: 19px; }.option-label { grid-template-columns: 36px minmax(0, 1fr) auto 20px; gap: 10px; }.submit-dock { bottom: 8px; align-items: stretch; flex-direction: column; }.submit-dock .primary-button { width: 100%; }
  .teacher-header { margin-bottom: 20px; }.teacher-actions { justify-content: flex-start; }.teacher-tabs-wrap { align-items: flex-start; flex-direction: column; }.tab-hint { text-align: left; }.teacher-tabs { width: 100%; }.teacher-tab { flex: 1 1 auto; }
  .charts-grid.single-chart { grid-template-columns: 1fr; }.option-key { grid-template-columns: 1fr; }
  .summary-heading .secondary-button { width: 100%; }
}

@media (max-width: 480px) {
  h1 { font-size: 39px; }.hero-art { min-height: 275px; }.hero-art svg { top: 18px; }.sun-orb { width: 67px; height: 67px; }.art-caption { min-width: 160px; padding: 10px 13px; }
  .hero-pills { margin-top: 22px; }.hero-pills span { padding: 8px 11px; }
  .group-list { grid-template-columns: 1fr; }.group-card { min-height: 74px; }.group-progress-ring { display: grid; }
  .member-list { grid-template-columns: repeat(5, 1fr); gap: 6px; }.member-button { min-height: 53px; padding: 5px 2px; }
  .question-card { padding: 19px 15px; }.option-label { grid-template-columns: 34px minmax(0, 1fr) auto; padding: 8px 9px; }.option-copy { font-size: 13px; }.option-check { display: none; }.option-count { min-width: 44px; padding: 5px 6px; }.option-label .count-input { width: 58px; height: 42px; min-height: 42px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 8px; }.metric-card { padding: 15px; }.metric-card strong { font-size: 23px; }
  .charts-grid { grid-template-columns: 1fr; }.analysis-question { padding: 18px 14px; }.analysis-question-header { align-items: flex-start; flex-direction: column; gap: 8px; }.group-chart { padding: 11px 9px; }.chart-plot { height: 172px; }
  .teacher-summary-section { padding: 22px 16px; }
  .site-footer { align-items: flex-start; flex-direction: column; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  :root { --shadow-sm: none; --shadow-lg: none; }
  body { background: #fff; }
  .site-header, #survey-view, #questionnaire-view, .teacher-actions, .teacher-tabs-wrap, .summary-heading button, .notes-label, #teacher-notes, .notes-saved, .site-footer, .toast { display: none !important; }
  main { width: 100%; }.app-view { padding: 0; }#teacher-view { display: block !important; }
  .teacher-header { display: block; margin-bottom: 14px; }.teacher-header h1 { font-size: 30px; }.teacher-header p { font-size: 11px; }
  .metrics-grid { grid-template-columns: repeat(4, 1fr); }.metric-card, .analysis-question { background: #fff; box-shadow: none; }
  .analytics-content { gap: 12px; }.analysis-question { padding: 14px; page-break-inside: avoid; }.charts-grid { grid-template-columns: repeat(4, 1fr); }
  .teacher-summary-section { margin-top: 14px; padding: 18px; color: #173b3a; background: #edf6f2; box-shadow: none; }.teacher-summary-section h2, .teacher-summary-section .auto-summary strong { color: #173b3a; }.auto-summary p { color: #355a56; }
  .print-notes:not(:empty) { display: block; margin-top: 14px; padding-top: 12px; border-top: 1px solid #aac8be; color: #173b3a; font-size: 12px; line-height: 1.7; white-space: pre-wrap; }
}
