:root{font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;color:#243b36;background:#f5f5ed;font-size:16px;line-height:1.65;--green:#245d4c;--muted:#687970;--line:#dce4d9}*{box-sizing:border-box}body{margin:0}main{margin:auto;padding:54px 22px}.parent{max-width:730px}.workspace{max-width:1180px}header{padding:10px 0 32px;border-bottom:1px solid var(--line);margin-bottom:28px}.eyebrow{font-size:11px;letter-spacing:2px;font-weight:700;color:var(--green)}h1{font-size:clamp(32px,5vw,46px);line-height:1.3;letter-spacing:-1px;font-weight:650;margin:22px 0 15px}h2{font-size:20px;line-height:1.5;margin:6px 0 16px}h3{font-size:18px}p{margin:10px 0 18px;color:var(--muted)}.notice{border-left:3px solid #b99b5f;padding:4px 18px;margin-bottom:25px}.notice p{font-size:13px;margin-bottom:0}.card{background:#fffefa;border:1px solid var(--line);border-radius:16px;padding:28px;margin:22px 0;min-width:0}fieldset{margin-inline:0}legend{font-size:12px;font-weight:700;letter-spacing:1px;color:var(--green);padding:0 8px}.choice{display:inline-flex;align-items:center;gap:10px;padding:11px 14px;background:#f5f7f1;border:1px solid var(--line);border-radius:9px;margin:4px 8px 5px 0;cursor:pointer}.choice:has(input:checked){background:#e4eee2;border-color:#518464}input[type=checkbox]{accent-color:var(--green);width:18px;height:18px;flex-shrink:0}input:not([type=checkbox]),textarea,select{font:inherit;color:inherit;width:100%;border:1px solid #cbd7cb;border-radius:8px;background:white;padding:12px;margin:7px 0 14px}textarea{resize:vertical}small,.fine{font-size:12px;color:var(--muted)}button,.secondary{font:inherit;font-weight:600;border-radius:8px;padding:12px 18px;cursor:pointer;display:inline-block;text-decoration:none;border:1px solid #b9cdbb;background:#f0f5eb;color:var(--green)}button:hover,.secondary:hover{filter:brightness(.96)}button:disabled{opacity:.5;cursor:wait}.primary{background:var(--green);color:white;border:0;width:100%;padding:16px}.quiet{border:0;background:transparent;padding:8px}.danger{color:#9b4937}.check{display:flex;align-items:flex-start;font-size:13px;gap:10px;margin:10px 0 20px}footer{font-size:12px;color:var(--muted);margin:32px 0;text-align:center}footer a{display:block;color:inherit;margin-top:10px}a{color:var(--green)}#status{font-size:14px;color:var(--green);padding:10px 0}#message{color:#9b4937;min-height:1em}.admin-header,.section-heading{display:flex;align-items:center;justify-content:space-between;gap:20px}.admin-header a{font-size:13px}.toolbar{display:flex;align-items:end;gap:12px;flex-wrap:wrap}.toolbar label{flex:1;min-width:170px}.toolbar input,.toolbar select{margin-bottom:0}.metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:20px}.metric{padding:26px;background:#e8efdf;border-radius:12px}.metric span{font-size:13px;display:block}.metric strong{font-size:32px;display:block;margin-top:10px}.charts{display:grid;grid-template-columns:1fr 1fr;gap:20px}.charts .card{margin:0}.section-heading{margin:32px 0 12px}.section-heading p{font-size:12px;margin:0}.section-heading h2{margin:0}.bar-row{display:grid;grid-template-columns:1fr auto;margin:18px 0;gap:5px}.bar-row b{font-size:12px;font-weight:500}.bar-row span{font-size:14px}progress{width:100%;height:9px;grid-column:1/-1;accent-color:#628c56}progress::-webkit-progress-bar{background:#edf1e9;border-radius:10px}progress::-webkit-progress-value{background:#628c56;border-radius:10px}.feedback{padding:22px 0;border-top:1px solid var(--line);overflow-wrap:anywhere}.feedback p{white-space:pre-wrap;color:#344d40}.tag{font-size:12px;color:#688051!important}pre{font:inherit;white-space:pre-wrap;overflow-wrap:anywhere;background:#f6f7ef;padding:20px;border-radius:8px;font-size:14px}.login{max-width:430px;margin:30px auto}.login label{display:block}.login button{margin-top:12px}summary{cursor:pointer;font-weight:600}:focus-visible{outline:3px solid #b99b5f;outline-offset:3px}[hidden]{display:none!important}@media(max-width:650px){main{padding:28px 17px}.card{padding:22px 18px}.choice{font-size:14px;padding:10px}.charts{grid-template-columns:1fr}.metrics{gap:8px}.metric{padding:16px 10px}.metric strong{font-size:24px}.admin-header,.section-heading{align-items:flex-start;flex-direction:column;gap:8px}.toolbar button{flex:1}.toolbar{gap:10px}h1{font-size:34px}}

/* A cheerful classroom palette shared by the questionnaire and dashboard. */
:root {
  color: #35334d;
  background: #fff9f1;
  --green: #6050a1;
  --muted: #706b7f;
  --line: #e9e0ef;
}
body {
  background:
    radial-gradient(ellipse at 0 8%, #ffe6d680, transparent 38%),
    radial-gradient(ellipse at 100% 30%, #e0eaff90, transparent 40%),
    radial-gradient(ellipse at 10% 80%, #e5f4d780, transparent 35%);
}
header {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #fff0d9;
  border: 1px solid #f5dbad;
  border-radius: 28px;
  padding: 34px 30px;
}
header::before, header::after {
  content: '';
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}
header::before {
  width: 160px;
  height: 160px;
  right: -45px;
  top: -55px;
  background: #f3b9b6;
  box-shadow: -110px 220px 0 25px #d4e7c5;
}
header::after {
  width: 72px;
  height: 72px;
  right: 70px;
  bottom: -26px;
  background: #cfc8ed;
}
h1 { color: #514371; font-weight: 750; }
.eyebrow {
  display: inline-block;
  color: #805425;
  background: #ffffffb8;
  border-radius: 20px;
  padding: 5px 10px;
  letter-spacing: 1px;
}
header p { color: #785b48; }
.notice {
  background: #eaf3ff;
  border: 1px solid #cfdef6;
  border-left: 5px solid #86ace2;
  border-radius: 15px;
  padding: 18px 20px;
  color: #345683;
}
.notice p { color: #516682; }
.card {
  background: #fffefd;
  border-radius: 22px;
  box-shadow: 0 6px 0 #b1a5bf0a;
}
[data-theme=growth] { --accent: #ac5a3d; --soft: #fff0e6; --edge: #f1c9ae; --selected: #ffddc7; }
[data-theme=activities] { --accent: #42754a; --soft: #edf6e6; --edge: #c4dfb5; --selected: #d6ecc5; }
[data-theme=family] { --accent: #8c4b78; --soft: #fff0f7; --edge: #ebc5dc; --selected: #f7d5e8; }
[data-theme=cooperation] { --accent: #446e9f; --soft: #ecf3ff; --edge: #bed3ef; --selected: #d6e6fd; }
.card[data-theme] { background: var(--soft); border-color: var(--edge); }
.card[data-theme] h2, .card[data-theme] h3, .card[data-theme] legend { color: var(--accent); }
legend { background: #fffdf8; border: 1px solid var(--edge, var(--line)); border-radius: 20px; padding: 5px 13px; }
.choice { background: #ffffffba; border-color: var(--edge); border-radius: 14px; transition: background .15s, border-color .15s; }
.choice:has(input:checked) { background: var(--selected); border-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent, #7560aa); }
input:not([type=checkbox]), textarea, select { border-color: #d9cfe3; border-radius: 12px; }
button, .secondary { border-radius: 14px; background: #f0eafa; border-color: #d7c9eb; color: #605088; }
.primary { background: #7456a2; color: white; box-shadow: 0 5px 0 #59417e; }
.primary:hover { background: #684a95; }
.quiet { background: transparent; }
.danger { color: #a34348; }
.volunteer { background: #fff5de; border-color: #eddbad; }
.volunteer h2 { color: #866222; }
#success { background: #edf7e7; border-color: #bedbb0; }
#success h2 { color: #42754a; }
.metric { border: 1px solid #e2c7df; background: #f8e8f3; color: #814870; border-radius: 20px; }
.metric:nth-child(2) { background: #e9f1ff; border-color: #c7d8ef; color: #416a9b; }
.metric:nth-child(3) { background: #fff1d4; border-color: #ead7a8; color: #88632b; }
progress { accent-color: var(--accent, #7560aa); height: 10px; }
progress::-webkit-progress-bar { background: #ffffffa8; }
progress::-webkit-progress-value { background: var(--accent, #7560aa); }
pre { background: #f3eefb; }
.feedback p { color: #49415a; }
.tag { color: #82619b !important; }
:focus-visible { outline-color: #a280c5; }
@media (max-width: 650px) {
  header { padding: 28px 22px; border-radius: 24px; }
  header::before { width: 120px; height: 120px; right: -50px; }
  header::after { width: 55px; height: 55px; right: 35px; }
  .eyebrow { font-size: 10px; }
  .metric { border-radius: 16px; }
}

/* Import review and questionnaire controls share the existing responsive cards. */
input[type=radio] { accent-color: var(--accent, #7560aa); width: 18px; height: 18px; padding: 0; margin: 0; flex-shrink: 0; }
.choice:has(input[type=radio]:checked) { background: var(--selected); border-color: var(--accent); }
.import-panel > .section-heading { margin-top: 0; }
.import-question { margin: 18px 0; box-shadow: none; }
.import-question > label { display: block; }
.import-question > .check { display: flex; }
#import-status { color: #77508e; white-space: pre-wrap; }
#import-warnings { background: #fff2d8; border-radius: 12px; padding: 14px 18px 14px 34px; font-size: 13px; }
#import-warnings:empty { display: none; }
#import-confirm { flex-shrink: 0; }
#survey-description { white-space: pre-wrap; }

/* Families may complete the first section and skip any other section. */
.required-section > h2 { padding: 16px 18px; background: #ffe9cb; border-radius: 16px; color: #805829; }
.optional-section { margin: 14px 0; border: 1px solid var(--edge, #d9cfe3); border-radius: 18px; background: #fffdfa; padding: 18px; }
.optional-section > summary { color: #605088; font-size: 16px; line-height: 1.65; }
.optional-section[open] > summary { margin-bottom: 16px; }
.optional-section > p { font-size: 13px; }
.optional-section .card { box-shadow: none; padding: 20px 16px; }
.optional-section:not([open]) { background: #f1effb; }
.optional-section:nth-of-type(3n):not([open]) { background: #edf5e8; }
.optional-section:nth-of-type(3n + 1):not([open]) { background: #fff0e8; }
.rank-answer { max-width: 100%; }
.other-note { display: block; margin-top: 16px; font-size: 13px; }
.other-answer { background: #ffffffcc; }
.section-participation { font-size: 13px; color: var(--muted); }
.participation-call { background: #fff0dc; border-radius: 14px; padding: 16px 18px; color: #825528; font-size: 14px; }

/* The default admin view answers class-level questions; details stay available. */
.analysis-overview { margin: 30px 0; }
.analysis-overview h2 { margin-top: 12px; font-size: 25px; }
.report-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.insight-findings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.insight-findings .card { margin: 0; padding: 22px; background: #f2edf9; }
.insight-findings .card:nth-child(3n + 2) { background: #eaf3e6; }
.insight-findings .card:nth-child(3n) { background: #fff0df; }
.insight-findings h3 { margin: 0 0 12px; }
.insight-findings p { font-size: 14px; margin-bottom: 0; }
.analysis-preferences { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.analysis-preferences .card { margin: 0; }
.preference-item { border-top: 1px solid var(--line); padding: 12px 0; }
.preference-item p { margin: 5px 0; font-size: 14px; }
.discussion-item { border-top: 1px solid var(--line); padding: 18px 0; }
.discussion-item h4 { margin: 0 0 8px; }
.discussion-item p { margin: 6px 0; font-size: 14px; }
.table-scroll { overflow-x: auto; }
.comparison-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
.comparison-table th, .comparison-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); }
.comparison-table th { color: #756184; font-weight: 600; }
.comparison-table td:first-child { font-weight: 600; }
#ranking-overview { margin-top: 22px; background: #faf1e1; border-radius: 12px; padding: 16px; }
#ranking-overview:empty { display: none; }
#question-statistics > summary, #raw-panel > summary, #management-panel > summary, #report-preview > summary { color: #605088; }
#question-statistics > .section-heading { margin-top: 20px; }
#management-panel .import-panel { padding-top: 16px; }
@media (max-width: 650px) {
  .insight-findings, .analysis-preferences { grid-template-columns: 1fr; }
  .report-actions { width: 100%; }
  .report-actions > * { width: 100%; text-align: center; }
  .comparison-table th, .comparison-table td { padding: 10px 6px; font-size: 12px; }
}
.comparison-table progress { display: block; width: 100%; height: 7px; margin: 7px 0 0; }
.comparison-table th:nth-child(2) { color: #a5623f; }
.comparison-table th:nth-child(3) { color: #486eaa; }
.comparison-table td:nth-child(2) progress { accent-color: #c18b61; }
.comparison-table td:nth-child(3) progress { accent-color: #6e94c5; }
.comparison-table td:nth-child(2) progress::-webkit-progress-value { background: #c18b61; }
.comparison-table td:nth-child(3) progress::-webkit-progress-value { background: #6e94c5; }

.choice.choice-disabled { opacity: .48; cursor: not-allowed; }
.choice input:disabled { cursor: not-allowed; }

/* One question per page, with large controls for family members of all ages. */
.parent #wizard { scroll-margin-top: 12px; }
.wizard-progress { background: #fff8e9; padding: 16px 20px; border-radius: 16px; border: 1px solid #eddab9; }
#step-label { margin: 0 0 8px; font-size: 20px; font-weight: 700; color: #66513c; }
.pending-note { margin: 8px 0 0; color: #9a542b; font-size: 16px; }
#step-progress { height: 12px; }
.parent #questions > .card { margin-top: 22px; }
.parent #questions h2, #review-step h2 { font-size: 24px; line-height: 1.6; }
.parent .choice { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; font-size: 19px; padding: 14px 16px; box-sizing: border-box; }
.parent input[type=radio], .parent input[type=checkbox] { width: 23px; height: 23px; flex-shrink: 0; }
.parent #wizard textarea, .parent #wizard select { font-size: 18px; }
.parent #wizard .fine, .parent .other-note { font-size: 16px; }
.step-section { color: #77618b; font-size: 16px; margin: 0 0 10px; }
.wizard-nav { position: sticky; bottom: 0; background: #fffaf4f5; padding: 14px 0 max(14px, env(safe-area-inset-bottom)); display: flex; gap: 12px; z-index: 3; }
.wizard-nav button { min-height: 58px; font-size: 19px; font-weight: 700; }
.wizard-nav .primary { flex: 1; width: auto; }
.wizard-nav .secondary { flex: 0 0 auto; }
#step-error { padding: 16px; margin-top: 16px; border: 2px solid #b8503c; border-radius: 12px; background: #fff0e9; color: #8b3024; font-size: 18px; }
#review-step { background: #fff0da; border: 2px solid #dfb16c; }
#review-step p, #start-card p { font-size: 18px; line-height: 1.8; }
@media(max-width: 420px) { .wizard-nav button { font-size: 17px; padding: 14px 12px; } .parent #questions h2 { font-size: 22px; } }

/* Short, readable welcome for older family members; scoped to the parent page. */
.parent #survey-intro header { padding: 0 0 18px; margin-bottom: 20px; }
.parent #survey-intro .eyebrow { font-size: 18px; letter-spacing: 0; color: #60507c; }
.parent #survey-intro h1 { font-size: clamp(30px, 6vw, 38px); line-height: 1.45; margin: 14px 0 10px; letter-spacing: 0; overflow-wrap: anywhere; }
.parent #survey-intro .welcome-line { font-size: 21px; line-height: 1.7; margin-bottom: 0; color: #464052; }
.parent #survey-intro .notice { padding: 8px 16px; margin-bottom: 14px; }
.parent #survey-intro .notice p { font-size: 20px; line-height: 1.8; margin: 0; color: #494252; }
.parent .privacy-details { margin: 12px 0 20px; }
.parent .privacy-details summary { font-size: 19px; padding: 10px 0; color: #514179; }
.parent .privacy-details p { font-size: 18px; line-height: 1.8; color: #494252; }
.parent #start-card { padding: 22px; margin-top: 16px; background: #f2ecfc; border-color: #d9cae8; }
.parent #start-card h2 { font-size: 25px; }
.parent #start-card p { font-size: 20px; color: #494252; line-height: 1.8; }
.parent #start { min-height: 64px; font-size: 24px; }
.parent #status:empty { display: none; }
.parent #status { font-size: 20px; }
.parent footer { font-size: 17px; }
@media(max-width: 650px) { .parent { padding-top: 24px; } .parent #start-card { padding: 20px 18px; } }
