:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --ink: #18352c;
  --muted: #687d75;
  --line: #dce5e1;
  --green: #176c53;
  --green-soft: #e8f5ef;
  --blue: #2b6f9f;
  --blue-soft: #edf4f9;
  --orange: #c76022;
  --danger: #9b2f2f;
  --shadow: 0 18px 46px rgba(19, 54, 43, 0.17);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; letter-spacing: 0; }
body { margin: 0; min-width: 300px; min-height: 100vh; background: var(--bg); }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.family-auth { display: grid; grid-template-columns: minmax(340px, 560px) minmax(320px, 1fr); min-height: 100vh; background: var(--surface); }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: clamp(28px, 7vw, 88px); border-right: 1px solid var(--line); }
.family-brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.family-brand > span { display: grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; color: #fff; background: var(--green); border-radius: 7px; font-weight: 900; }
.family-brand > div { display: grid; gap: 1px; }
.family-brand strong { font-size: 0.94rem; }
.family-brand small { color: var(--muted); font-size: 0.7rem; }
.auth-copy { margin: clamp(54px, 9vh, 94px) 0 30px; }
.kicker { margin: 0 0 7px; color: var(--green); font-size: 0.68rem; font-weight: 900; text-transform: uppercase; }
.auth-copy h1 { max-width: 470px; margin: 0; font-size: clamp(2rem, 5vw, 3.45rem); line-height: 1.02; }
.auth-copy > p:last-child { max-width: 490px; margin: 18px 0 0; color: var(--muted); font-size: 1rem; line-height: 1.6; }
.google-button { display: grid; grid-template-columns: 34px 1fr; min-height: 52px; align-items: center; gap: 8px; max-width: 420px; padding: 8px 16px 8px 10px; color: #24312c; background: #fff; border: 1px solid #b9c9c3; border-radius: 6px; text-align: center; text-decoration: none; }
.google-button:hover { border-color: var(--green); box-shadow: 0 4px 14px rgba(23, 108, 83, 0.12); }
.google-button > span { display: grid; width: 34px; height: 34px; place-items: center; color: #295ca7; background: #f2f5fa; border-radius: 50%; font-weight: 900; }
.google-button strong { padding-right: 34px; font-size: 0.86rem; }
.auth-message { min-height: 20px; max-width: 420px; margin: 10px 0 0; color: var(--danger); font-size: 0.75rem; }
.privacy-copy { max-width: 420px; margin: 20px 0 0; color: var(--muted); font-size: 0.7rem; line-height: 1.5; }
.auth-visual { position: relative; display: grid; min-height: 520px; place-items: end center; overflow: hidden; padding: 30px 30px 0; background: #dfeee8; }
.auth-visual::before { position: absolute; inset: 9% 10% auto; height: 38%; content: ""; background: #edf5f1; border: 1px solid #caddd5; border-radius: 50%; }
.auth-visual img { position: relative; z-index: 1; width: min(90%, 760px); max-height: 86vh; object-fit: contain; object-position: bottom; }
.auth-visual > div { position: absolute; z-index: 2; right: clamp(18px, 5vw, 70px); bottom: clamp(18px, 5vw, 55px); display: grid; gap: 3px; max-width: 280px; padding: 13px 15px; color: #fff; background: #174e65; border-radius: 7px; box-shadow: var(--shadow); }
.auth-visual > div strong { font-size: 0.84rem; }
.auth-visual > div span { font-size: 0.7rem; line-height: 1.4; }

.family-app { min-height: 100vh; }
.family-header { position: sticky; z-index: 20; top: 0; display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 20px; padding: 9px clamp(16px, 4vw, 56px); background: #fff; border-bottom: 1px solid var(--line); }
.family-account { display: flex; align-items: center; gap: 12px; text-align: right; }
.family-account > div { display: grid; gap: 1px; }
.family-account strong { font-size: 0.78rem; }
.family-account small { color: var(--muted); font-size: 0.68rem; }
.family-shell { display: grid; grid-template-columns: minmax(245px, 300px) minmax(0, 1fr); min-height: calc(100vh - 68px); }
.family-sidebar { padding: 24px 18px; background: #eef3f1; border-right: 1px solid var(--line); }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sidebar-heading > strong { display: grid; min-width: 25px; height: 25px; place-items: center; color: #fff; background: var(--blue); border-radius: 13px; font-size: 0.68rem; }
.student-list { display: grid; gap: 6px; }
.student-choice { display: grid; grid-template-columns: 38px minmax(0, 1fr) 16px; align-items: center; gap: 9px; width: 100%; min-width: 0; padding: 9px; color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 7px; text-align: left; cursor: pointer; }
.student-choice:hover, .student-choice.active { background: #fff; border-color: #bed4cc; }
.student-choice > span { display: grid; width: 38px; height: 38px; place-items: center; color: #fff; background: var(--blue); border-radius: 50%; font-weight: 900; }
.student-choice.grade-4 > span { background: var(--orange); }
.student-choice > div { display: grid; min-width: 0; gap: 2px; }
.student-choice strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.77rem; }
.student-choice small { color: var(--muted); font-size: 0.63rem; line-height: 1.35; }
.student-choice i { color: var(--muted); font-size: 1.2rem; font-style: normal; }
.link-learner { margin-top: 22px; padding-top: 18px; border-top: 1px solid #cddbd6; }
.link-learner h2 { margin: 0; font-size: 1rem; }
.link-learner > p { margin: 5px 0 13px; color: var(--muted); font-size: 0.7rem; line-height: 1.45; }
.link-learner form { display: grid; gap: 8px; }
.link-learner label, .form-grid label, .report-form label { display: grid; gap: 5px; font-size: 0.68rem; font-weight: 800; }
input, select, textarea { width: 100%; color: var(--ink); background: #fff; border: 1px solid #bed0ca; border-radius: 6px; }
input, select { min-height: 42px; padding: 8px 10px; }
textarea { min-height: 94px; padding: 10px; resize: vertical; }
#inviteCode { font-weight: 800; text-transform: uppercase; }
.adult-check { display: grid !important; grid-template-columns: 17px 1fr; align-items: start; gap: 7px !important; color: #526961; font-weight: 600 !important; line-height: 1.35; }
.adult-check input { width: 16px; min-height: 16px; margin: 2px 0 0; }
.form-message { min-height: 17px; margin: 0; color: var(--danger); font-size: 0.7rem; line-height: 1.4; }
.form-message.success { color: var(--green); }

.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; padding: 8px 13px; border-radius: 6px; font-size: 0.76rem; font-weight: 850; text-decoration: none; cursor: pointer; }
.button.primary { color: #fff; background: var(--green); border: 1px solid var(--green); }
.button.primary:hover { filter: brightness(0.94); }
.button.secondary { color: var(--ink); background: #fff; border: 1px solid var(--line); }
.button.secondary:hover { color: var(--green); border-color: var(--green); }
.button.danger { color: var(--danger); background: #fff; border: 1px solid #e7b7b4; }
.button:disabled { cursor: wait; opacity: 0.6; }
.icon-button { display: grid; width: 38px; height: 38px; place-items: center; padding: 0; color: var(--muted); background: transparent; border: 0; border-radius: 50%; font-size: 1.5rem; cursor: pointer; }
.icon-button:hover { color: var(--ink); background: var(--bg); }
.button:focus-visible, .icon-button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .student-choice:focus-visible, .google-button:focus-visible { outline: 3px solid #f3af3f; outline-offset: 2px; }

.family-content { min-width: 0; padding: 28px clamp(18px, 4vw, 56px) 64px; }
.sync-notice { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; padding: 13px 15px; background: var(--blue-soft); border-left: 4px solid var(--blue); }
.sync-notice > div { display: grid; gap: 3px; }
.sync-notice strong { font-size: 0.82rem; }
.sync-notice span { color: var(--muted); font-size: 0.72rem; }
.family-welcome { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.family-welcome h1 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.25rem); line-height: 1.1; }
.family-welcome > div > p:last-child { max-width: 670px; margin: 7px 0 0; color: var(--muted); line-height: 1.5; }
.family-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.dashboard { display: grid; gap: 24px; padding-top: 24px; }
.loading, .blank { display: grid; min-height: 390px; place-content: center; justify-items: center; gap: 10px; color: var(--muted); text-align: center; }
.loading span { width: 34px; height: 34px; border: 4px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin 800ms linear infinite; }
.blank > span { font-size: 3rem; }
.blank h2 { margin: 0; color: var(--ink); }
.blank p { max-width: 440px; margin: 0; line-height: 1.5; }
.report-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.report-head h2 { margin: 0; font-size: 1.45rem; }
.report-meta { margin: 5px 0 0; color: var(--muted); font-size: 0.75rem; }
.grade-badge { display: inline-flex; min-height: 34px; align-items: center; padding: 6px 11px; color: #15533e; background: #dff1e9; border: 1px solid #b9dacd; border-radius: 17px; font-size: 0.72rem; font-weight: 900; }
.grade-badge.grade-4 { color: #814117; background: #fff0e5; border-color: #efc9ac; }
.metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: #fff; border: 1px solid var(--line); }
.metrics > div { display: grid; gap: 4px; min-width: 0; padding: 15px; border-right: 1px solid var(--line); }
.metrics > div:last-child { border-right: 0; }
.metrics strong { overflow-wrap: anywhere; color: var(--green); font-size: 1.35rem; }
.metrics span { color: var(--muted); font-size: 0.65rem; font-weight: 750; }
.recommend { display: flex; align-items: flex-start; gap: 11px; padding: 16px 18px; background: var(--green-soft); border-left: 4px solid var(--green); }
.recommend > span { font-size: 1.4rem; }
.recommend p { margin: 4px 0 0; color: #526961; line-height: 1.45; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.report-section { min-width: 0; padding-top: 18px; border-top: 2px solid var(--line); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.section-head h3 { margin: 0; font-size: 1rem; }
.section-head > strong { color: var(--muted); font-size: 0.7rem; }
.section-head > div { min-width: 0; }
.section-copy { margin: 4px 0 0; color: var(--muted); font-size: 0.7rem; font-weight: 500; line-height: 1.4; }
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; min-height: 31px; align-items: center; padding: 5px 9px; color: #15533e; background: #e4f2ec; border: 1px solid #c2ded2; border-radius: 16px; font-size: 0.7rem; font-weight: 750; }
.pill.focus { color: #7b421c; background: #fff2e8; border-color: #efd0b7; }
.curated-path-list { display: grid; border: 1px solid var(--line); background: #fff; }
.curated-path-row { display: grid; grid-template-columns: 42px minmax(0, 1.25fr) minmax(220px, 0.9fr); align-items: stretch; border-bottom: 1px solid var(--line); }
.curated-path-row:last-child { border-bottom: 0; }
.path-rank { display: grid; place-items: center; color: #fff; background: var(--green); font-size: 0.85rem; }
.path-main { display: grid; gap: 7px; min-width: 0; padding: 14px 16px; }
.path-main > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.path-main > div span { color: var(--blue); font-size: 0.68rem; font-weight: 900; white-space: nowrap; }
.path-main h4 { margin: 0; font-size: 0.82rem; }
.path-cadence { margin: 0; color: var(--muted); font-size: 0.68rem; line-height: 1.4; }
.path-topic-list { display: flex; flex-wrap: wrap; gap: 5px; }
.path-topic-list span { padding: 4px 7px; color: #15533e; background: #e4f2ec; border: 1px solid #c2ded2; border-radius: 12px; font-size: 0.65rem; font-weight: 750; }
.path-future { display: grid; align-content: center; gap: 6px; min-width: 0; padding: 14px 16px; background: var(--blue-soft); border-left: 1px solid var(--line); }
.path-future > strong { color: var(--blue); font-size: 0.7rem; }
.path-future p { margin: 0; color: #405c52; font-size: 0.7rem; line-height: 1.45; }
.path-future small { color: var(--muted); font-size: 0.64rem; line-height: 1.4; }
.activity-chart { display: grid; grid-template-columns: repeat(14, minmax(16px, 1fr)); align-items: end; gap: 6px; height: 150px; padding-top: 14px; border-bottom: 1px solid #b9c9c3; }
.activity-chart > div { display: grid; height: 100%; grid-template-rows: 1fr 18px; align-items: end; justify-items: center; gap: 4px; }
.activity-chart i { display: block; width: min(24px, 70%); min-height: 4px; background: var(--blue); border-radius: 3px 3px 0 0; }
.activity-chart span { color: var(--muted); font-size: 0.58rem; }
.mastery-list { display: grid; gap: 10px; }
.mastery-row { display: grid; grid-template-columns: minmax(120px, 1.25fr) minmax(100px, 1fr) 42px; align-items: center; gap: 10px; }
.mastery-row > div:first-child { display: grid; min-width: 0; }
.mastery-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8rem; }
.mastery-row span { color: var(--muted); font-size: 0.65rem; }
.mastery-row > b { color: var(--muted); font-size: 0.72rem; text-align: right; }
.mastery-track { height: 7px; overflow: hidden; background: var(--line); border-radius: 4px; }
.mastery-track i { display: block; height: 100%; background: var(--green); }
.assessment-list { display: grid; }
.assessment-list article { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid #e2e9e6; }
.assessment-list article > div { display: grid; gap: 2px; }
.assessment-list span { color: var(--muted); font-size: 0.7rem; }
.diary-upload-list { display: grid; gap: 10px; }
.diary-upload-card { display: grid; gap: 10px; padding: 14px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: 7px; }
.diary-upload-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.diary-upload-head > div { display: grid; gap: 3px; min-width: 0; }
.diary-upload-head strong { overflow-wrap: anywhere; font-size: 0.82rem; }
.diary-upload-head span, .diary-plan-preview { color: var(--muted); font-size: 0.68rem; }
.diary-upload-head b { color: var(--green); font-size: 0.68rem; white-space: nowrap; }
.diary-subjects { display: flex; flex-wrap: wrap; gap: 5px; }
.diary-subjects span { padding: 4px 7px; color: #69411f; background: #fff3e8; border: 1px solid #efd0b7; border-radius: 12px; font-size: 0.65rem; font-weight: 750; }
.diary-upload-card .review-diary { justify-self: start; }
.school-report-list { display: grid; gap: 16px; }
.school-report { padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 7px; }
.school-report > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-bottom: 12px; border-bottom: 1px solid #e2e9e6; }
.school-report > header span { color: var(--green); font-size: 0.64rem; font-weight: 900; }
.school-report h4 { margin: 2px 0 3px; font-size: 1rem; }
.school-report header p { margin: 0; color: var(--muted); font-size: 0.7rem; }
.school-report header > strong { color: var(--blue); font-size: 1.4rem; }
.report-subjects { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 12px 0; border: 1px solid #e2e9e6; }
.report-subjects > div { display: grid; gap: 3px; padding: 10px; border-right: 1px solid #e2e9e6; }
.report-subjects span { color: var(--muted); font-size: 0.68rem; }
.report-subjects b { color: var(--green); font-size: 0.8rem; }
.ai-guidance { padding: 14px; background: var(--blue-soft); border-left: 4px solid var(--blue); }
.ai-guidance h5 { margin: 0 0 4px; font-size: 0.85rem; }
.ai-guidance .summary { margin: 0; color: #405c52; line-height: 1.5; }
.ai-guidance .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 18px; margin-top: 10px; }
.ai-guidance .actions p { position: relative; margin: 0; padding-left: 16px; color: #526961; font-size: 0.73rem; line-height: 1.4; }
.ai-guidance .actions p::before { position: absolute; left: 0; content: "\2022"; color: var(--blue); font-weight: 900; }
.school-report > footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 11px; }
.school-report > footer small { max-width: 70%; color: var(--muted); line-height: 1.4; }
.table-wrap { overflow: auto; border: 1px solid var(--line); }
.table-wrap table { width: 100%; border-collapse: collapse; background: #fff; font-size: 0.73rem; }
.table-wrap th, .table-wrap td { padding: 9px 11px; border-bottom: 1px solid #e5ece9; text-align: left; white-space: nowrap; }
.table-wrap th { color: #526961; background: #eef3f1; font-size: 0.65rem; text-transform: uppercase; }
.empty-row { padding: 24px; color: var(--muted); text-align: center; background: var(--bg); border: 1px dashed var(--line); border-radius: 7px; }
.privacy-note { margin: 14px 0 0; padding: 11px 13px; color: var(--muted); background: var(--bg); border-left: 3px solid var(--blue); font-size: 0.72rem; line-height: 1.5; }

.modal { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(8, 28, 23, 0.75); }
.modal-panel { width: min(780px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.modal-panel > header { position: sticky; z-index: 2; top: 0; display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px; background: #fff; border-bottom: 1px solid var(--line); }
.modal-panel > header > div { display: flex; min-width: 0; align-items: center; gap: 10px; }
.modal-panel h2 { margin: 0; font-size: 1.3rem; }
.modal-icon { display: grid; width: 38px; height: 38px; place-items: center; background: var(--green-soft); border-radius: 50%; font-size: 1.2rem; }
.modal-body { padding: 20px; }
.form-grid, .report-form { display: grid; gap: 14px; }
.diary-upload-form, .diary-review-form { display: grid; gap: 14px; }
.upload-fields { display: grid; grid-template-columns: 180px 1fr; gap: 12px; }
.upload-fields label, .diary-review-form > label, .diary-review-row label { display: grid; gap: 5px; font-size: 0.68rem; font-weight: 800; }
.upload-preview { display: grid; min-height: 90px; place-items: center; overflow: hidden; padding: 10px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; font-size: 0.75rem; }
.upload-preview img { display: block; max-width: 100%; max-height: 280px; object-fit: contain; }
.pipeline-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 0; padding: 0; list-style: none; background: var(--line); border: 1px solid var(--line); }
.pipeline-steps li { display: grid; grid-template-columns: 24px 1fr; align-items: center; gap: 7px; min-width: 0; padding: 9px; background: #fff; }
.pipeline-steps b { display: grid; width: 24px; height: 24px; place-items: center; color: #fff; background: var(--blue); border-radius: 50%; font-size: 0.64rem; }
.pipeline-steps span { font-size: 0.65rem; font-weight: 750; }
.ocr-summary { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 12px; background: var(--blue-soft); border-left: 4px solid var(--blue); }
.ocr-summary > div { display: grid; min-width: 0; gap: 2px; }
.ocr-summary strong { overflow-wrap: anywhere; font-size: 0.8rem; }
.ocr-summary span { color: var(--muted); font-size: 0.68rem; }
.ocr-summary b { color: var(--blue); font-size: 0.7rem; white-space: nowrap; }
.diary-review-rows { display: grid; gap: 10px; }
.diary-review-row { position: relative; display: grid; grid-template-columns: minmax(130px, 0.8fr) 1.35fr 1.35fr 1fr 38px; align-items: start; gap: 8px; margin: 0; padding: 12px; background: var(--bg); border: 1px solid var(--line); }
.diary-review-row legend { padding: 0 5px; color: var(--green); font-size: 0.63rem; font-weight: 900; }
.diary-review-row textarea { min-height: 68px; }
.diary-review-row > .icon-button { margin-top: 20px; color: var(--danger); border: 1px solid #e7b7b4; border-radius: 6px; }
.ocr-raw summary { color: var(--blue); cursor: pointer; font-size: 0.72rem; font-weight: 800; }
.ocr-raw pre { max-height: 220px; overflow: auto; padding: 11px; background: #f3f5f4; border: 1px solid var(--line); white-space: pre-wrap; font: 0.68rem/1.5 Consolas, monospace; }
.profile-grid, .report-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wide { grid-column: 1 / -1; }
.subject-results { display: grid; gap: 7px; }
.subject-row { display: grid; grid-template-columns: minmax(130px, 1.6fr) minmax(74px, 0.8fr) minmax(74px, 0.8fr) minmax(66px, 0.7fr) 36px; align-items: end; gap: 7px; }
.subject-row .icon-button { color: var(--danger); border: 1px solid #e7b7b4; border-radius: 6px; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  .family-auth { grid-template-columns: minmax(340px, 1fr) minmax(300px, 0.85fr); }
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metrics > div:nth-child(3) { border-right: 0; }
  .metrics > div:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 760px) {
  .family-auth { display: block; min-height: 100vh; }
  .auth-panel { min-height: 100vh; border-right: 0; }
  .auth-visual { display: none; }
  .family-account > div { display: none; }
  .family-shell { display: block; }
  .family-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .student-list { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
  .family-content { padding-top: 20px; }
  .family-welcome, .sync-notice { align-items: flex-start; flex-direction: column; }
  .family-actions { justify-content: flex-start; }
  .two-column, .ai-guidance .actions { grid-template-columns: 1fr; }
  .curated-path-row { grid-template-columns: 36px minmax(0, 1fr); }
  .path-future { grid-column: 2; padding-top: 10px; border-top: 1px solid var(--line); border-left: 0; }
  .subject-row { grid-template-columns: 1fr 1fr; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  .subject-row .icon-button { grid-column: 2; justify-self: end; }
  .diary-review-row { grid-template-columns: 1fr 1fr; }
  .diary-review-row > .icon-button { grid-column: 2; justify-self: end; margin-top: 0; }
  .pipeline-steps { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .auth-panel { padding: 24px 18px; }
  .auth-copy { margin-block: 48px 26px; }
  .family-header { padding-inline: 12px; }
  .family-brand strong { font-size: 0.79rem; }
  .family-content { padding-inline: 13px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metrics > div:nth-child(2n) { border-right: 0; }
  .metrics > div:nth-child(3) { border-right: 1px solid var(--line); }
  .metrics > div:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  .report-head { align-items: flex-start; }
  .profile-grid, .report-fields { grid-template-columns: 1fr; }
  .upload-fields, .diary-review-row { grid-template-columns: 1fr; }
  .diary-review-row > .icon-button { grid-column: auto; justify-self: end; }
  .pipeline-steps { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  .school-report > footer { align-items: flex-start; flex-direction: column; }
  .school-report > footer small { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; } }

@media print {
  .family-header, .family-sidebar, .family-welcome, .sync-notice, .add-report, .button.danger, .privacy-note { display: none !important; }
  .family-shell { display: block; }
  .family-content { padding: 0; }
  .dashboard { gap: 15px; padding: 0; }
}
