/* Shared workspace */
:root {
  --green: #176451;
  --green-dark: #104b3e;
  --green-pale: #e4f1e9;
  --edge: #dbe5df;
  --muted: #53665e;
  --ink: #183e34;
}
.icon-library { position: absolute; pointer-events: none; }
.ui-icon { display: inline-block; width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
button:disabled { cursor: default; }
summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

@media screen {
  :root { background: #f6f7f2; color: #233a33; }
  .app-layout { grid-template-columns: 14.5rem minmax(0, 1fr); }
  .sidebar {
    background: #163e35; color: #f7faf5; border: 0; padding: 1.55rem 1rem;
    position: sticky; top: 0; align-self: start; height: 100dvh; overflow-y: auto;
  }
  .brand-row { display: flex; align-items: center; justify-content: space-between; }
  .sidebar .brand { gap: .7rem; margin: 0 .6rem 1.9rem; color: #fbf8eb; font-weight: 750; letter-spacing: -.045em; }
  .sidebar .brand-symbol { background: #e6edc2; border-radius: .8rem .8rem .8rem .24rem; }
  .sidebar nav { display: grid; gap: .3rem; }
  .sidebar nav a { display: flex; align-items: center; gap: .72rem; color: #dce9df; font-size: .93rem; border-radius: .65rem; }
  .sidebar nav a:hover { background: #245044; color: #fff; }
  .sidebar nav a[aria-current="page"] { color: #fff; background: #306354; border-color: #487a69; }
  .sidebar nav a .ui-icon { width: 1.16rem; height: 1.16rem; }
  .class-nav { display: grid; gap: .2rem; border-top: 1px solid #416457; margin-top: .9rem; padding-top: 1rem; }
  .sidebar nav .class-nav-heading { min-height: 1.8rem; color: #bfd3bc; font-size: .78rem; font-weight: 700; }
  .topbar { min-height: 4.15rem; padding: .63rem clamp(1rem, 3vw, 2.8rem); background: #fdfefb; }
  .scope { display: inline-flex; align-items: center; gap: .65rem; font-size: .96rem; color: var(--ink); }
  .school-icon { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: .6rem; color: #346457; background: #eaf1e7; }
  .school-icon svg { width: 1.15rem; height: 1.15rem; }
  .account-menu { position: relative; z-index: 6; }
  .account-menu summary { cursor: pointer; display: flex; align-items: center; gap: .55rem; border-radius: .6rem; }
  .account-menu summary::-webkit-details-marker { display: none; }
  .account-menu summary > .ui-icon { width: .85rem; }
  .profile-avatar { width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border: 1px solid #d4e2cf; border-radius: 50%; background: #eaf0df; color: #345d47; font-size: .78rem; font-weight: 720; }
  .session-person { padding: 0; gap: .12rem; }
  .session-person span { font-size: .76rem; }
  .account-actions { position: absolute; inset: calc(100% + .6rem) 0 auto auto; min-width: 11rem; padding: .35rem; background: white; border: 1px solid var(--edge); border-radius: .7rem; box-shadow: 0 8px 24px #173a291c; }
  .account-actions a, .account-actions button { padding: .6rem .7rem; display: flex; align-items: center; gap: .6rem; background: transparent; border: 0; border-radius: .4rem; color: var(--ink); text-decoration: none; width: 100%; font-size: .9rem; }
  .account-actions :is(a,button):hover { background: #edf5ee; }
  .workspace { max-width: 82rem; padding: clamp(1rem, 2.5vw, 2.3rem) clamp(1rem, 3vw, 2.8rem) 3rem; }
  .panel { box-shadow: 0 3px 12px #193a2c06; }
  .page-head h1 { color: var(--ink); }
  .mobile-nav-toggle { display: inline-flex; align-items: center; gap: .4rem; background: transparent; border: 1px solid #638273; padding: .42rem .75rem; border-radius: .6rem; color: #f4f8ef; }
  .mobile-tabbar { display: none; }
}
@media screen and (max-width: 1050px) and (min-width: 841px) {
  .app-layout { grid-template-columns: 11.8rem minmax(0, 1fr); }
  .sidebar { padding-inline: .65rem; }
}
@media screen and (max-width: 840px) {
  :root { --mobile-bar-height: calc(3.85rem + env(safe-area-inset-bottom)); }
  .app-layout { display: block; }
  .sidebar { position: sticky; top: 0; z-index: 20; height: auto; max-height: 85dvh; padding: .5rem .85rem; box-shadow: 0 2px 10px #102a2224; }
  .sidebar .brand { margin: 0; font-size: 1.12rem; }
  .sidebar .brand-symbol { scale: .84; }
  .sidebar nav { display: flex; gap: .25rem; flex-wrap: wrap; padding: .5rem 0 .2rem; }
  .sidebar nav a { min-height: 2.65rem; }
  .class-nav { display: flex; align-items: center; flex-wrap: wrap; width: 100%; margin: 0; padding: .35rem 0 0; }
  .topbar { min-height: 3.1rem; padding-block: .48rem; }
  body:has(.mobile-tabbar) .workspace { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); }
  body:has(.mobile-tabbar) .has-changes .roll-footer,
  body:has(.mobile-tabbar) .has-changes .growth-save {
    position: sticky; bottom: var(--mobile-bar-height); z-index: 4;
    padding-bottom: .7rem; box-shadow: 0 -4px 14px #14362814;
  }
  .mobile-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: .15rem;
    padding: .35rem .4rem max(.4rem, env(safe-area-inset-bottom));
    background: #fdfefb; border-top: 1px solid var(--edge); box-shadow: 0 -4px 16px #14362814;
  }
  .mobile-tabbar a {
    display: grid; justify-items: center; align-content: center; gap: .16rem;
    min-height: 3rem; padding: .24rem .2rem; border-radius: .6rem;
    color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 620; line-height: 1.1;
  }
  .mobile-tabbar a .ui-icon { width: 1.2rem; height: 1.2rem; }
  .mobile-tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-tabbar a[aria-current="page"] { color: var(--green-dark); background: var(--green-pale); font-weight: 740; }
  /* Prevent iOS Safari auto-zoom when focusing inputs smaller than 16px */
  .field input:not([type="checkbox"]), .field select, .field textarea,
  .roll-search input, .roll-date-form input { font-size: 1rem; }
  .roll-date-form .day-arrow { width: 2.65rem; min-height: 2.65rem; }
}
@media screen and (max-width: 540px) {
  .topbar { flex-wrap: nowrap; gap: .5rem; }
  .scope { font-size: .84rem; }
  .account-menu summary .session-person { position: absolute; clip-path: inset(100%); width: 1px; height: 1px; overflow: hidden; }
}

/* Attendance */
.rollcall { display: grid; gap: 1.05rem; }
.crumbs { display: flex; align-items: center; gap: .38rem; font-size: .79rem; color: #495c54; }
.crumbs a { text-decoration: none; color: #56685f; }
.crumbs a:hover, .pupil-name:hover { text-decoration: underline; }
.crumbs .ui-icon { width: .75rem; opacity: .7; }
.roll-hero {
  isolation: isolate; position: relative; overflow: hidden; background: #e3f1e8;
  border: 1px solid #cfe4d5; border-radius: 1.2rem;
  display: flex; align-items: center; min-height: 10.3rem;
}
.hero-copy { position: relative; z-index: 1; padding: 1.3rem clamp(1.2rem, 2.5vw, 2.1rem); width: 62%; }
.roll-date { display: inline-flex; align-items: center; gap: .45rem; color: #325c4e; font-size: .8rem; font-weight: 650; }
.roll-date .ui-icon { width: 1rem; }
.roll-date time::first-letter { text-transform: uppercase; }
.hero-copy h1 { color: #173f34; font-size: clamp(2.15rem, 3.1vw, 3.05rem); letter-spacing: -.055em; margin: .28rem 0 .45rem; }
.hero-class { display: flex; align-items: baseline; flex-wrap: wrap; gap: .45rem; font-size: .9rem; color: #49685a; overflow-wrap: anywhere; }
.hero-class strong { color: #345645; font-weight: 650; }
.class-separator { align-self: center; width: .22rem; height: .22rem; border-radius: 50%; background: #7a9a84; }
.school-scene { position: absolute; z-index: 0; bottom: 0; right: 0; width: 42%; height: 100%; overflow: hidden; pointer-events: none; }
.school-scene i { display: block; position: absolute; }
.scene-sun { width: 3.4rem; height: 3.4rem; border-radius: 50%; right: 24%; top: 13%; background: #f7cc76; }
.scene-cloud { height: .45rem; width: 2.1rem; border-radius: 2rem; background: #fff9ed; }
.scene-cloud::before { content: ""; position: absolute; border-radius: 50%; width: 48%; height: .8rem; background: inherit; bottom: 0; left: 22%; }
.cloud-near { top: 34%; right: 11%; }.cloud-far { top: 21%; right: 54%; transform: scale(.78); }
.scene-hill { width: 110%; height: 60%; border-radius: 100% 60% 0 0; bottom: -38%; }
.hill-far { background: #c6debd; right: -9%; bottom: -27%; transform: rotate(-6deg); }
.hill-near { background: #a3c8a1; right: -17%; transform: rotate(5deg); }
.scene-school { position: absolute; width: 9.2rem; height: 5.5rem; bottom: 13%; right: 29%; }
.school-wing { width: 47%; height: 45%; bottom: 0; background: #f7ddb2; border-top: .43rem solid #bf7150; border-radius: .12rem; box-shadow: inset 0 -.22rem #d5af83; }
.wing-left { left: 0; }.wing-right { right: 0; }
.school-wing::after { content: ""; position: absolute; left: 13%; top: 27%; width: .55rem; height: .75rem; background: #528679; box-shadow: .83rem 0 #528679, 1.66rem 0 #528679; border-radius: .12rem .12rem 0 0; }
.school-tower { bottom: 0; left: 33%; width: 34%; height: 63%; background: #ffedc7; z-index: 1; }
.school-tower::before { content: ""; position: absolute; left: 37%; top: 14%; width: 25%; aspect-ratio: 1; border-radius: 50%; background: #f7cd72; box-shadow: inset 0 0 0 2px #bd8257; }
.school-tower::after { content: ""; position: absolute; bottom: 0; left: 30%; width: 40%; height: 47%; border-radius: 1rem 1rem 0 0; background: #497568; }
.school-roof { bottom: 61%; left: 27%; width: 46%; height: 34%; background: #d5865e; clip-path: polygon(50% 0,100% 95%,100% 100%,0 100%,0 95%); z-index: 2; }
.school-flag { height: 1.25rem; width: 2px; background: #527863; bottom: 93%; left: 50%; }
.school-flag::after { content: ""; position: absolute; top: 0; width: .87rem; height: .57rem; background: #dd9857; clip-path: polygon(0 0,100% 8%,83% 50%,100% 90%,0 100%); }
.scene-tree { bottom: 13%; width: 2.15rem; height: 4.5rem; }
.scene-tree::before { content: ""; position: absolute; top: 0; width: 100%; height: 73%; background: #71a489; border-radius: 55% 55% 42% 42%; }
.scene-tree::after { content: ""; position: absolute; left: 48%; width: .13rem; height: 51%; bottom: 0; background: #50775e; }
.tree-front { right: 15%; transform: scale(1.13); }.tree-back { right: 69%; bottom: 10%; transform: scale(.81); }
.tree-back::before { background: #92b68b; }
.scene-bush { width: 2.7rem; height: .9rem; bottom: 6%; right: 9%; background: #739d7b; border-radius: 3rem 3rem .25rem .25rem; }
.scene-fence { width: 3rem; height: .85rem; background: repeating-linear-gradient(90deg,#faf2dd 0 3px,transparent 3px 9px); bottom: 8%; right: 51%; transform: rotate(-2deg); }
.scene-fence::after { content: ""; position: absolute; width: 100%; top: 36%; height: 2px; background: #faf2dd; }

.roll-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .8rem; }
.roll-stat {
  min-width: 0; display: flex; align-items: center; gap: .8rem; text-align: left; color: var(--ink);
  border: 1px solid var(--edge); border-radius: .95rem; background: white; padding: 1rem;
}
.roll-stat[aria-pressed="true"] { border-color: #80a995; box-shadow: inset 0 0 0 1px #80a995; }
.roll-stat:enabled:hover { background: #fafcf8; }
.stat-icon { width: 2.65rem; height: 2.65rem; display: grid; place-items: center; border-radius: .8rem; flex: none; }
.stat-icon svg { width: 1.35rem; height: 1.35rem; }
.stat-all .stat-icon { background: #e0ebe6; color: #446c61; }
.stat-present .stat-icon { background: #e5efcc; color: #527032; }
.stat-away .stat-icon { background: #fae5d8; color: #a95030; }
.stat-unmarked .stat-icon { background: #eee8f7; color: #756096; }
.stat-copy { display: grid; gap: .05rem; }
.stat-copy span { font-size: .78rem; color: #53665d; font-weight: 600; }
.stat-copy strong { font-size: 1.65rem; line-height: 1.15; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }

.roll-panel { background: #fff; border: 1px solid var(--edge); border-radius: 1.05rem; box-shadow: 0 4px 16px #23432d06; }
.roll-heading, .roll-tools, .roll-footer, .roll-row { display: flex; gap: .7rem 1rem; align-items: center; justify-content: space-between; padding: .88rem clamp(.9rem,2vw,1.55rem); }
.roll-heading { flex-wrap: wrap; padding-block: 1.1rem; }
.roll-heading h2 { font-size: 1.18rem; color: var(--ink); }
.roll-date-form { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.roll-date-form input { border: 1px solid #cad8ce; padding: .43rem .55rem; border-radius: .5rem; background: #fff; color: #274b3a; min-width: 0; }
.roll-date-form input, .roll-date-form .button { font-size: .85rem; min-height: 2.35rem; }
.day-arrow {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 2.65rem; min-height: 2.65rem; border: 1px solid #c9d7ce; border-radius: .52rem;
  background: #fff; color: var(--ink); text-decoration: none;
}
.roll-date-form .day-arrow { width: 2.35rem; min-height: 2.35rem; }
.day-arrow.previous svg { transform: rotate(180deg); }
.day-arrow:hover { background: #f0f5ef; }
.day-arrow.disabled { color: #adbbb3; background: #f7faf8; cursor: default; }
.day-nav-control { align-items: end; }
.profile-google-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem;
  background: #f5f9f6; border-bottom: 1px solid var(--edge);
}
.today-link { font-size: .82rem; }
.locked-note, .save-hint { display: inline-flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .83rem; }
.roll-tools { flex-wrap: wrap; background: #f9fbf7; border-block: 1px solid #e2e9df; padding-block: .65rem; }
.roll-search { display: flex; align-items: center; gap: .5rem; width: min(15rem,100%); border-radius: .6rem; border: 1px solid #d0ddd3; padding: 0 .63rem; background: #fff; color: #647a6a; }
.roll-search input { width: 100%; min-width: 0; padding: .52rem 0; border: 0; background: transparent; color: var(--ink); font-size: .86rem; }
.roll-search input:focus-visible { outline: none; }
.roll-search:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.roll-tool-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .9rem; }
.bulk-action, .meal-shortcut, .row-undo, .reset-filter { display: inline-flex; align-items: center; gap: .32rem; font-size: .81rem; font-weight: 650; text-decoration: none; color: #2e6751; border: 0; background: transparent; padding: .4rem .1rem; }
.bulk-action:hover, .meal-shortcut:hover, .row-undo:hover, .reset-filter:hover { text-decoration: underline; }
.roll-list { list-style: none; margin: 0; padding: 0; }
.roll-row { min-height: 4.65rem; border-bottom: 1px solid #e9eee8; }
.roll-row.is-dirty { box-shadow: inset 3px 0 #c59243; background: #fffdf6; }
.pupil { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.pupil-avatar { width: 2.5rem; height: 2.5rem; border-radius: .85rem; display: grid; place-items: center; flex: none; font-size: .79rem; font-weight: 720; }
.tone-peach { background: #fae7d9; color: #8a5134; }.tone-sage { background: #e0ecdc; color: #416747; }
.tone-violet { background: #eee6f5; color: #6d5286; }.tone-sky { background: #e2edf6; color: #496a84; }
.tone-ochre { background: #f6edcc; color: #7c6632; }
.pupil-name { color: var(--ink); text-decoration: none; font-size: .96rem; font-weight: 700; overflow-wrap: anywhere; }
.pupil-info { min-width: 0; }
.pupil-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.pupil-state { display: inline-flex; gap: .28rem; align-items: center; color: #617366; font-size: .75rem; }
.pupil-state::before { content: ""; width: .38rem; height: .38rem; border-radius: 50%; background: currentColor; }
.pupil-state[data-state="present"] { color: #397054; }.pupil-state[data-state="absent"] { color: #a14d3e; }
.row-undo { font-size: .72rem; text-decoration: underline; padding: .1rem .25rem; }
.mark-options { display: inline-flex; align-items: stretch; gap: .25rem; flex: none; background: #f5f7f4; border: 1px solid #e2e8e1; padding: .22rem; border-radius: .65rem; }
.mark-options button { display: inline-flex; align-items: center; justify-content: center; gap: .28rem; font-size: .82rem; font-weight: 620; min-height: 2.15rem; padding: .3rem .78rem; color: #526359; background: transparent; border: 1px solid transparent; border-radius: .45rem; }
.mark-options button:hover { background: #fff; }
.mark-options [data-mark="present"][aria-pressed="true"] { color: #20563e; background: #d9ecdd; border-color: #b9d6c1; }
.mark-options [data-mark="absent"][aria-pressed="true"] { color: #863e31; background: #fae1d9; border-color: #e6c2b6; }
.roll-footer { background: #fafcf8; border-top: 1px solid #dce6dc; border-radius: 0 0 1rem 1rem; }
.has-changes .roll-footer { position: sticky; bottom: 0; z-index: 2; box-shadow: 0 -4px 12px #23432d09; }
.roll-footer .ui-icon { width: 1.05rem; height: 1.05rem; }
.save-roll:disabled { color: #445f50; background: #e3ece3; }
.save-roll:disabled:hover { background: #e3ece3; color: #445f50; }
.roll-empty { padding: 1.4rem; text-align: center; color: var(--muted); }
.review-filter[aria-pressed="true"] { color: #745024; background: #fff0cc; }
.review-filter { border-radius: .4rem; padding-inline: .4rem; }
.today-hero { min-height: 8.4rem; }
.today-totals { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .75rem; }
.today-totals dl { margin: 0; }
.today-totals dt { font-size: .83rem; color: var(--muted); }
.today-totals dd { margin: .1rem 0 0; font-size: 1.55rem; font-weight: 720; color: var(--ink); line-height: 1.25; }
.today-classes .record { display: grid; grid-template-columns: minmax(7rem,1fr) minmax(9rem,1fr) minmax(16rem,1fr); }
.today-progress progress { width: min(100%,16rem); height: .56rem; accent-color: var(--green); }
.today-actions { justify-content: flex-end; }
.today-actions .today-review { background: #fff6e6; border-color: #edd8b6; color: #745024; }
.parent-today-row .badge { font-size: .78rem; }
.task-heading { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding: clamp(1rem,2.4vw,1.8rem); border-radius: 1.1rem; border: 1px solid #e5decd; background: #f6eedf; }
.task-heading h1 { color: var(--ink); font-size: clamp(1.9rem,3vw,2.8rem); }
.task-heading p { margin-top: .35rem; color: #526658; }
.meal-task .button { background: #fffdf7; }
.roster-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .45rem; padding: .65rem 1.15rem; border-bottom: 1px solid var(--edge); }
.family-task { margin-bottom: 1rem; min-height: 8rem; position: relative; overflow: hidden; background: #e3f1e8; border-color: #cfe4d5; }
.family-task h1 { position: relative; z-index: 1; }
.family-actions { position: relative; z-index: 1; }
.family-actions a { display: inline-block; margin-top: .4rem; font-size: .87rem; font-weight: 650; }
.profile-facts { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,10rem),1fr)); gap: .85rem 1.2rem; padding: 1rem 1.15rem; margin: 0; }
.profile-facts dt { color: var(--muted); font-size: .82rem; }
.profile-facts dd { margin: .12rem 0 0; color: var(--ink); font-weight: 650; overflow-wrap: anywhere; }
.profile-edit summary { padding: .75rem 1.15rem; color: var(--green); font-weight: 700; cursor: pointer; }
.profile-edit:not(.panel) { border-top: 1px solid var(--edge); }
.parent-profile-facts { margin-bottom: 1.15rem; }
.contact-email { overflow-wrap: anywhere; }
.family-task .school-scene { width: 34%; }
.invite-panel { align-self: start; }
.invite-panel summary { display: flex; align-items: center; gap: .6rem; padding: 1rem 1.15rem; color: var(--ink); font-weight: 700; cursor: pointer; }
.invite-panel summary::-webkit-details-marker { display: none; }
.invite-panel summary svg:last-child { margin-inline-start: auto; }
.invite-panel[open] summary { border-bottom: 1px solid var(--edge); }
.invite-panel[open] summary svg:last-child { transform: rotate(180deg); }
@media (max-width: 1050px) {
  .roll-stat { gap: .55rem; padding: .8rem; }
  .stat-icon { width: 2.15rem; height: 2.15rem; }
}
@media (max-width: 680px) {
  .roll-hero.today-hero { min-height: 7rem; }
  .today-totals { gap: .4rem; }
  .today-totals .roll-stat { display: grid; align-content: start; gap: .4rem; }
  .today-totals .stat-icon { position: static; }
  .today-totals dt { min-height: 2.25em; line-height: 1.15; }
  .today-classes .record { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .today-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .today-progress { align-self: center; }
  .family-panels .first-link { order: -1; }
  .family-task { min-height: 6.5rem; }
  .family-task > div:first-child { width: 65%; }
  .meal-task .actions { gap: .4rem; }
  .meal-task .button { font-size: .82rem; }
  .rollcall { gap: .75rem; }
  .hero-copy { padding: 1.05rem; width: 63%; }
  .roll-hero { min-height: 7rem; }
  .school-scene { width: 37%; height: 85%; }
  .scene-school { transform: scale(.7); transform-origin: bottom right; right: 12%; }
  .scene-sun { width: 2.3rem; height: 2.3rem; right: 16%; }
  .tree-front { right: 0; transform: scale(.6); transform-origin: bottom; }
  .tree-back { right: 72%; transform: scale(.55); transform-origin: bottom; }
  .roll-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .45rem; }
  .roll-stat { padding: .65rem; }
  .stat-copy strong { font-size: 1.4rem; }
  .roll-row { flex-direction: row; align-items: center; gap: .5rem; min-height: 3.45rem; padding: .55rem .8rem; }
  .roll-row .pupil { flex: 1 1 auto; min-width: 0; gap: .5rem; }
  .roll-row .pupil-name { font-size: .92rem; line-height: 1.25; }
  .roll-row .mark-options { flex: none; gap: .18rem; padding: .18rem; }
  .roll-row .mark-options button { flex: 0 0 auto; white-space: nowrap; min-height: 2.45rem; padding: .28rem .55rem; font-size: .8rem; gap: .22rem; }
  .roll-row .mark-options button svg { width: .88rem; }
  .roll-row .mark-fallback { flex: none; width: 7.4rem; }
  .roll-search { flex: 1 1 100%; width: 100%; }
  .roll-tool-actions { width: 100%; justify-content: space-between; }
  .tool-extra { display: none; }
  .roll-heading, .roll-tools { gap: .4rem; padding-block: .65rem; }
  .roll-footer { flex-wrap: wrap; padding-bottom: max(.8rem,env(safe-area-inset-bottom)); }
  .save-roll { min-height: 2.75rem; }
}
@media (min-width: 541px) and (max-width: 680px) {
  .roll-metrics { grid-template-columns: repeat(4,minmax(0,1fr)); gap: .35rem; }
  .roll-stat { position: relative; padding: .55rem .45rem; }
  .stat-copy { display: flex; flex-direction: column-reverse; gap: .25rem; height: 100%; }
  .stat-copy span { font-size: .73rem; line-height: 1.25; }
  .roll-metrics .stat-icon { position: absolute; right: .38rem; top: .45rem; height: 1.45rem; width: 1.45rem; border-radius: .44rem; }
  .stat-icon svg { width: .93rem; height: .93rem; }
  .stat-copy strong { margin-bottom: auto; }
}
@media (max-width: 540px) {
  .workspace { padding: .85rem .75rem calc(5.5rem + env(safe-area-inset-bottom)); }
  .panel-head, .panel-body, .empty { padding-inline: .95rem; }
  .record { padding: .85rem .95rem; gap: .55rem .75rem; }
  .record > div { flex: 1 1 100%; }
  .record > .actions { width: 100%; }
  .record > .actions .button { flex: 1 1 auto; }
  .meal-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem .85rem; padding: .75rem .95rem; }
  .meal-summary dd { font-size: 1.18rem; }
  .roll-hero, .roll-hero.today-hero, .family-task { min-height: 5.5rem; }
  .hero-copy, .family-task > div:first-child { width: 100%; padding: .95rem 1rem; }
  .hero-copy h1, .task-heading h1 { font-size: clamp(1.5rem, 6.2vw, 1.95rem); }
  .school-scene, .family-task .school-scene { width: 48%; height: 90%; opacity: .34; }
  .roll-row .pupil-avatar { display: none; }
  .roll-row { padding: .52rem .7rem; gap: .45rem; }
  .roll-row .mark-options button { padding: .26rem .5rem; font-size: .78rem; }
  .roll-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
  .roll-stat { gap: .55rem; padding: .7rem .75rem; }
  .stat-icon { width: 2.15rem; height: 2.15rem; }
  .stat-copy span { font-size: .78rem; line-height: 1.2; }
  .stat-copy strong { font-size: 1.38rem; }
  .today-totals .roll-stat { padding: .6rem .55rem; gap: .35rem; }
  .today-totals .stat-icon { width: 1.85rem; height: 1.85rem; }
  .today-totals dt { font-size: .76rem; min-height: 2.3em; }
  .today-totals dd { font-size: 1.32rem; }
  .roll-date-form {
    width: 100%; display: grid;
    grid-template-columns: 2.65rem minmax(0, 1fr) 2.65rem;
    gap: .4rem; align-items: center;
  }
  .roll-date-form input { width: 100%; }
  .roll-date-form .button { grid-column: 1 / -1; width: 100%; }
  .roll-date-form .today-link { grid-column: 1 / -1; justify-self: start; }
  .roll-date-form .errorlist { grid-column: 1 / -1; }
  .day-nav-control {
    width: 100%; display: grid;
    grid-template-columns: 2.65rem minmax(0, 1fr) 2.65rem;
    gap: .45rem; align-items: end;
  }
  .day-nav-control .field { min-width: 0; }
  .day-nav-control .button { grid-column: 1 / -1; width: 100%; }
  .day-nav-control .today-link { grid-column: 1 / -1; justify-self: start; }
  .date-control:not(.day-nav-control) { width: 100%; }
  .date-control:not(.day-nav-control) .field { flex: 1 1 100%; min-width: 0; }
  .date-control:not(.day-nav-control) .button { width: 100%; }
  .roll-footer, .growth-save { gap: .45rem; padding: .6rem .85rem; }
  .roll-footer .save-roll, .growth-save .button { width: 100%; }
}
@media (max-width: 600px) {
  .parent-jump-links, .announcement-filters, .growth-sessions, .growth-filter-group {
    flex-wrap: nowrap; overflow-x: auto; max-width: 100%;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: .15rem;
  }
  .parent-jump-links::-webkit-scrollbar,
  .announcement-filters::-webkit-scrollbar,
  .growth-sessions::-webkit-scrollbar,
  .growth-filter-group::-webkit-scrollbar { display: none; }
  .parent-jump-links > *, .announcement-filters > *, .growth-sessions > *, .growth-filter-group > * {
    flex: 0 0 auto; white-space: nowrap;
  }
  .growth-filter-group { width: 100%; }
}
@media (max-width: 400px) {
  .roll-row .pupil-name { font-size: .88rem; }
  .roll-row .mark-options button { font-size: .75rem; padding: .24rem .44rem; gap: .16rem; }
  .roll-row .mark-options button svg { width: .8rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .roll-stat, .mark-options button, .sidebar nav a, .button { transition: background-color .14s ease, border-color .14s ease; }
}

/* Monthly reporting */
@media screen {
  .report-head { gap: 1rem; margin-bottom: 1.25rem; }
  .report-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; }
  .report-heading h1 { font-size: clamp(1.6rem, 3vw, 2.18rem); }
  .report-nav { display: flex; border-bottom: 1px solid #cddad2; gap: 1.35rem; }
  .report-nav a { display: inline-flex; gap: .45rem; align-items: center; justify-content: center; min-height: 2.85rem; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 590; font-size: .93rem; }
  .report-nav a:hover { color: var(--green); border-bottom-color: #9bb9a8; }
  .report-nav a[aria-current="page"], .meal-print-report .report-nav a[aria-current="page"] { background: transparent; color: var(--green-dark); border-bottom-color: var(--green); font-weight: 730; }
  .period-control { display: inline-flex; align-items: stretch; position: relative; background: #fff; border: 1px solid #c9d7ce; border-radius: .7rem; color: var(--ink); }
  .period-control summary, .period-arrow { min-height: 2.75rem; display: inline-flex; align-items: center; justify-content: center; color: inherit; }
  .period-arrow { width: 2.75rem; border-radius: .65rem; }
  .period-arrow.previous svg { transform: rotate(180deg); }
  .period-arrow.disabled { color: #adbbb3; }
  .period-control summary { cursor: pointer; gap: .45rem; padding-inline: .55rem; font-size: .93rem; font-weight: 660; list-style: none; }
  .period-control summary::-webkit-details-marker { display: none; }
  .period-control summary svg:last-child { width: .8rem; }
  .period-control a:hover, .period-control summary:hover { background: #f0f5ef; }
  .period-menu { position: absolute; z-index: 5; right: 0; top: calc(100% + .4rem); width: min(17rem, 100vw - 2.5rem); background: white; border: 1px solid var(--edge); border-radius: .85rem; box-shadow: 0 10px 30px #123c3022; padding: .85rem; }
  .period-year { display: flex; align-items: center; justify-content: space-between; }
  .period-year input[type="number"] { width: 6rem; }
  .period-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .2rem; margin-top: .55rem; }
  .period-grid button { background: #fff; border: 0; color: var(--ink); min-height: 2.75rem; border-radius: .45rem; font-weight: 580; }
  .period-grid button:hover { background: #edf4ed; }
  .period-grid button[aria-current="date"] { background: var(--green); color: white; }
  .period-grid button:disabled { background: #fff; color: #87938b; }
  .period-today { display: block; text-align: center; margin-top: .5rem; border-top: 1px solid var(--edge); padding: .6rem 0 .15rem; font-size: .88rem; }
  .collection-overview { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(16rem, 1fr); gap: 1rem; }
  .collection-state, .kitchen-snapshot { padding: clamp(1.1rem, 2.25vw, 2rem); }
  .collection-state { background: linear-gradient(115deg, #fff 45%, #f3f7eb); }
  .state-symbol { display: grid; place-items: center; width: 2.8rem; height: 2.8rem; margin-bottom: 1rem; color: #426348; background: #e4edd9; border-radius: .8rem; }
  .state-symbol svg { width: 1.5rem; height: 1.5rem; }
  .collection-state h2 { color: var(--ink); font-size: clamp(1.18rem, 2.1vw, 1.55rem); line-height: 1.28; }
  .collection-state p { margin: .55rem 0 1.25rem; max-width: 55ch; color: var(--muted); }
  .kitchen-snapshot { display: flex; flex-direction: column; }
  .kitchen-snapshot h2, .kitchen-snapshot > a, .recent-reports a span { display: flex; gap: .5rem; align-items: center; }
  .kitchen-snapshot h2 { font-size: 1.05rem; color: var(--ink); }
  .kitchen-snapshot h2 svg { color: #647b60; }
  .kitchen-snapshot dl { margin: .9rem 0; }
  .kitchen-snapshot dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; padding-block: .6rem; border-bottom: 1px solid var(--edge); }
  .kitchen-snapshot dt { color: var(--muted); font-size: .91rem; }
  .kitchen-snapshot dd { margin: 0; color: var(--ink); font-size: 1.55rem; font-weight: 720; font-variant-numeric: tabular-nums; }
  .kitchen-snapshot > a { margin-top: auto; width: fit-content; min-height: 2.75rem; font-size: .91rem; font-weight: 650; text-decoration: none; }
  .kitchen-snapshot > a:hover, .recent-reports a:hover span { text-decoration: underline; }
  .recent-reports { margin-top: 1.1rem; }
  .recent-reports li + li { border-top: 1px solid var(--edge); }
  .recent-reports li a { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .85rem; padding: .85rem 1.18rem; text-decoration: none; font-weight: 640; }
  .recent-reports li a small { color: var(--muted); font-weight: 450; }
  .recent-reports li a > svg { margin-left: auto; }
  .collection-ledger .panel-head, .collection-filters { flex-wrap: wrap; gap: .75rem; }
  .collection-filters { display: flex; align-items: end; justify-content: space-between; padding: .9rem 1.18rem; }
  .collection-filters .date-control { max-width: 100%; }
  .collection-filters .field { min-width: 0; }
  .collection-filters .field select { min-width: min(13rem, 100%); }
  .collection-amounts { background: #edf4eb; border-block: 1px solid #d7e3d7; flex-wrap: wrap; }
  .collection-amounts > div:first-child dd { color: #104b3e; font-size: 1.55rem; }
}
@media screen and (max-width: 740px) {
  .collection-overview { grid-template-columns: minmax(0, 1fr); }
  .kitchen-snapshot dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
  .kitchen-snapshot dl > div { flex-direction: column-reverse; }
  .collection-table th:first-child { position: sticky; left: 0; background: white; min-width: 8rem; max-width: 9rem; overflow-wrap: anywhere; }
  .collection-table thead th:first-child { background: #f5f9f6; }
}
@media screen and (max-width: 550px) {
  .report-heading { flex-direction: column; align-items: flex-start; }
  .period-menu { right: auto; left: 0; }
  .report-nav { display: grid; grid-template-columns: 1fr .85fr 1.15fr; gap: .18rem; }
  .report-nav a { font-size: .84rem; text-align: center; line-height: 1.25; }
  .report-nav a .ui-icon { display: none; }
  .collection-filters .date-control { width: 100%; }
  .collection-ledger .meal-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .collection-amounts > div:first-child { grid-column: 1 / -1; }
}

.growth-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem 1rem; }
.growth-date { align-items: end; }
.growth-upload { max-width: 43rem; }
.growth-sessions { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; padding: .7rem 1.18rem; border-bottom: 1px solid var(--edge); background: #fafdfb; }
.growth-session-pill { display: inline-flex; align-items: center; gap: .25rem; padding: .24rem .62rem; border-radius: 999px; border: 1px solid #c6d9ce; background: #fff; color: #245844; font-size: .84rem; font-weight: 600; text-decoration: none; }
.growth-session-pill:hover { background: var(--green-pale); }
.growth-session-pill span { color: var(--muted); font-weight: 450; }
.growth-session-pill[aria-current="date"] { background: var(--green); border-color: var(--green); color: #fff; }
.growth-session-pill[aria-current="date"] span { color: #e2f1e8; }
.growth-kpi-strip dd { display: flex; align-items: baseline; gap: .38rem; flex-wrap: wrap; }
.growth-kpi-strip dd small { color: var(--muted); font-size: .82rem; font-weight: 500; }
.growth-class-table th.growth-col-index, .growth-class-table td.growth-col-index { min-width: 2.5rem; width: 3rem; text-align: center; }
.growth-class-table .growth-col-name { min-width: 11.5rem; text-align: left; white-space: normal; }
.growth-class-table .growth-col-center { text-align: center; }
.growth-class-table .growth-col-status, .growth-import-table .growth-status-cell { text-align: left; white-space: normal; min-width: 10.5rem; }
.growth-class-table .growth-col-note, .growth-summary-table .growth-col-note { text-align: left; white-space: normal; min-width: 9rem; }
.growth-compact-meta { display: none; }
.growth-class-table tbody tr.is-dirty { background: #fffdf5; }
.growth-class-table tbody tr.is-dirty td:first-child { box-shadow: inset 3px 0 #c59243; }
.growth-summary-empty { display: none; }
.growth-summary-details[open] summary, .growth-danger[open] summary { border-bottom: 1px solid var(--edge); }
.growth-cell-field input { min-height: 2.3rem; padding: .35rem .5rem; min-width: 5.5rem; text-align: right; }
.growth-note-field input { min-width: 9.5rem; text-align: left; }
.growth-edit-link { display: inline-block; margin-inline-start: .5rem; font-size: .86rem; white-space: nowrap; }
.growth-tone-normal { background: #e5f2ea; color: #19533c; }
.growth-tone-warn { background: #fff3db; color: #754a10; }
.growth-tone-alert { background: #fceae8; color: #8c2822; }
.growth-tone-muted { background: #edf1ef; color: #4e645b; }
.growth-tone-new { background: #e6f0fb; color: #1e4d7b; }
.growth-summary-table th:first-child { min-width: 14rem; }
.growth-who-hint { padding-block: .7rem; border-bottom: 1px solid var(--edge); background: #fafdfb; }
.growth-who-hint p { margin: 0; }
.growth-history-head { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.growth-delta { color: var(--muted); font-weight: 500; font-size: .84rem; }
.growth-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(14rem, 19rem); align-items: center; gap: .65rem 1rem; padding: .7rem 1.18rem; }
.growth-row + .growth-row { border-top: 1px solid var(--edge); }
.growth-row .badge { display: inline-block; margin-inline-start: .32rem; font-size: .76rem; }
.growth-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: .5rem; }
.growth-inputs .field { min-width: 0; }
.growth-inputs label { color: var(--muted); font-size: .82rem; }
.growth-metrics { display: flex; flex-wrap: wrap; gap: .36rem .85rem; align-items: baseline; font-variant-numeric: tabular-nums; font-size: .93rem; }
.growth-metrics span { font-weight: 620; }
.growth-save { background: #f9fcf8; border-top: 1px solid var(--edge); border-radius: 0 0 var(--radius) var(--radius); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .65rem; }
@media screen and (min-width: 841px) {
  .growth-save { position: sticky; bottom: 0; z-index: 2; }
}
.growth-save p, .growth-review p { margin: 0; }
.growth-review { display: grid; gap: .6rem; }
.growth-review:empty { display: none; }
.growth-import-table th:last-child, .growth-import-table td:last-child { text-align: left; white-space: normal; min-width: 9.5rem; }
.growth-history > div:first-child { overflow-wrap: anywhere; }
.growth-charts-panel { margin-bottom: 1.15rem; }
.growth-charts-embedded { border-bottom: 1px solid var(--edge); }
.growth-charts-embedded-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .45rem 1rem; padding: .8rem 1.18rem 0; }
.growth-charts-embedded-head p { margin: 0; }
.growth-chart-legend { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: .82rem; color: var(--muted); }
.growth-chart-legend span { display: inline-flex; align-items: center; gap: .38rem; }
.legend-band { width: 1rem; height: .65rem; border-radius: .2rem; background: #d6ecdf; border: 1px solid #9cc8b1; display: inline-block; }
.legend-median { width: 1rem; height: 0; border-top: 2px dashed #5d8d76; display: inline-block; }
.legend-child { width: 1rem; height: 2.5px; background: #145a43; display: inline-block; border-radius: 2px; }
.growth-charts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.growth-chart-card { margin: 0; padding: .8rem .95rem .65rem; border: 1px solid var(--edge); border-radius: .75rem; background: #fcfefd; }
.growth-chart-caption { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .35rem .75rem; margin-bottom: .45rem; font-size: .92rem; }
.growth-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: #e3ece6; stroke-width: 1; }
.chart-axis-text { fill: #556c62; font-size: 10.5px; font-variant-numeric: tabular-nums; }
.chart-who-band { fill: #d8eee1; fill-opacity: .68; }
.chart-who-bound { fill: none; stroke: #9ac5af; stroke-width: 1; }
.chart-who-median { fill: none; stroke: #5a8c74; stroke-width: 1.3; stroke-dasharray: 4 3; }
.chart-who-label { fill: #4f7764; font-size: 9px; font-weight: 620; font-variant-numeric: tabular-nums; }
.chart-series-weight { fill: none; stroke: #145a43; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chart-series-height { fill: none; stroke: #186475; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chart-point circle { stroke: #fff; stroke-width: 1.8; }
.chart-point-normal circle { fill: #145a43; }
.chart-point-warn circle { fill: #c2780e; }
.chart-point-alert circle { fill: #b02d27; }
.chart-point-muted circle { fill: #4e645b; }
.chart-point-label { fill: #192c26; font-size: 10.5px; font-weight: 680; font-variant-numeric: tabular-nums; paint-order: stroke; stroke: #fcfefd; stroke-width: 3px; stroke-linejoin: round; }
.parent-jump-links { align-items: center; gap: .4rem; }
.parent-growth-snippet { margin-top: .32rem; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .35rem; }
.parent-growth-snippet .badge { font-size: .76rem; padding: .08rem .44rem; }
.growth-school-table .growth-col-center, .growth-attention-table .growth-col-center { text-align: center; }
.growth-attention-table .growth-col-status { text-align: left; white-space: normal; min-width: 10rem; }
.growth-attention-table .growth-col-note { text-align: left; white-space: normal; min-width: 8rem; }
.growth-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .75rem; padding: .75rem 1.18rem; border-bottom: 1px solid var(--edge); background: #fff; }
.growth-filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: .38rem; }
.growth-filter-pill { display: inline-flex; align-items: center; gap: .32rem; min-height: 2.3rem; padding: .28rem .68rem; border: 1px solid #c6d9ce; border-radius: 999px; background: #f8fbf9; color: #245844; font-size: .84rem; font-weight: 600; }
.growth-filter-pill:hover { background: var(--green-pale); }
.growth-filter-pill[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.growth-filter-pill strong { font-variant-numeric: tabular-nums; }
.growth-filter-result { margin-inline-start: auto; }
.growth-class-table tbody tr.is-filtered-out { display: none; }
.growth-danger summary { color: #962b25; }
.button.danger { background: #a83029; color: #fff; }
.button.danger:hover { background: #89241e; color: #fff; }
.parent-meal-table th:first-child { min-width: 9rem; }
.announcement-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.announcement-filters a[aria-current="page"] { background: var(--green); border-color: var(--green); color: #fff; }
.announcement-badges { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-bottom: .32rem; }
.announcement-badges .badge { font-size: .78rem; }
.announcement-scope-school { background: #e3f0e8; color: #144d38; }
.announcement-scope-campus { background: #ece9fb; color: #3f3078; }
.announcement-scope-classroom { background: #e6f2f6; color: #194d5c; }
.announcement-item { align-items: flex-start; gap: .8rem 1rem; }
.announcement-item.is-pinned { background: #f8fbf9; }
.announcement-item.needs-ack { border-inline-start: 3px solid #c9861d; }
.announcement-main { flex: 1 1 20rem; min-width: 0; }
.announcement-title { display: inline-block; font-size: 1.02rem; }
.announcement-excerpt { margin: .28rem 0 .35rem; color: #314840; font-size: .93rem; overflow-wrap: anywhere; }
.announcement-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.announcement-body { font-size: .98rem; line-height: 1.65; overflow-wrap: anywhere; }
.announcement-ack-bar { margin-top: 1.15rem; padding-top: .95rem; border-top: 1px solid var(--edge); }
.announcement-ack-bar .badge { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .75rem; font-size: .9rem; }
.announcement-receipt-split { gap: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.receipt-column { min-width: 0; }
.receipt-column + .receipt-column { border-left: 1px solid var(--edge); }
.receipt-column h3 { margin: 0; font-size: .96rem; color: var(--ink); }
@media screen and (max-width: 920px) {
  .growth-class-table .growth-col-meta { display: none; }
  .growth-compact-meta { display: block; }
  .growth-class-table .growth-col-name { position: sticky; left: 0; z-index: 1; background: #fff; min-width: 9.5rem; max-width: 11rem; }
  .growth-class-table thead .growth-col-name { background: #f5f9f6; z-index: 2; }
  .growth-class-table tbody tr.is-dirty .growth-col-name { background: #fffdf5; }
}
@media screen and (max-width: 640px) {
  .growth-class-table thead, .growth-class-table .growth-col-index { display: none; }
  .growth-class-table, .growth-class-table tbody { display: block; width: 100%; }
  .growth-class-table tbody tr {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem .7rem; padding: .9rem .95rem; border-bottom: 1px solid var(--edge);
  }
  .growth-class-table tbody tr.is-filtered-out { display: none; }
  .growth-class-table tbody tr.is-dirty { box-shadow: inset 3px 0 #c59243; background: #fffdf5; }
  .growth-class-table tbody tr.is-dirty td:first-child { box-shadow: none; }
  .growth-class-table tbody tr > * { border: 0; padding: 0; min-width: 0; text-align: left; white-space: normal; }
  .growth-class-table .growth-col-name { grid-column: 1 / -1; position: static; max-width: none; background: transparent !important; }
  .growth-class-table tbody tr[data-measured="0"] .growth-col-bmi,
  .growth-class-table tbody tr[data-measured="0"] .growth-col-pending-status { display: none; }
  .growth-class-table .growth-col-weight::before,
  .growth-class-table .growth-col-height::before,
  .growth-class-table .growth-col-bmi::before,
  .growth-class-table .growth-col-note[data-label]::before {
    content: attr(data-label); display: block; color: var(--muted);
    font-size: .78rem; font-weight: 600; margin-bottom: .18rem;
  }
  .growth-class-table .growth-col-status, .growth-class-table .growth-col-note { grid-column: 1 / -1; }
  .growth-class-table .growth-cell-field input { width: 100%; min-width: 0; min-height: 2.65rem; text-align: left; }
}
@media (max-width: 720px) {
  .announcement-receipt-split { grid-template-columns: minmax(0, 1fr); }
  .receipt-column + .receipt-column { border-left: 0; border-top: 1px solid var(--edge); }
}
@media (max-width: 820px) {
  .growth-charts-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .growth-row { grid-template-columns: minmax(0, 1fr); padding-inline: .85rem; }
  .growth-save { padding: .65rem .85rem; }
  .growth-sessions, .growth-tools { padding-inline: .85rem; }
  .growth-filter-result { margin-inline-start: 0; }
  .growth-date { width: 100%; }
  .growth-date .field { min-width: 8rem; }
  .announcement-actions, .parent-row-actions { width: 100%; }
  .announcement-actions form { display: flex; flex: 1 1 auto; }
  .announcement-actions form .button, .announcement-actions > .button, .parent-row-actions > .button { flex: 1 1 auto; width: 100%; }
}
@media print {
  .growth-report .growth-print-header { display: block; text-align: center; margin-bottom: .45rem; }
  .growth-report .growth-print-header h1 { font-size: 13pt; margin-bottom: .15rem; }
  .growth-report .growth-print-header p { font-size: 9.5pt; color: #333; }
  .growth-report .badge { background: transparent; color: #000; border: 0; padding: 0; font-weight: 600; white-space: normal; }
  .growth-report .growth-summary-panel { break-inside: avoid; margin-top: .5rem; }
  .growth-report .growth-summary-empty { display: block; }
  .growth-report .growth-summary-details summary { padding: .2rem 0; color: #000; list-style: none; }
  .growth-report .growth-summary-details summary::-webkit-details-marker { display: none; }
  .growth-report .growth-class-table tbody tr.is-filtered-out { display: table-row; }
}

/* PWA install, Zalo in-app browser warning, and Web Push controls */
.pwa-banner {
  display: grid; gap: .45rem;
  padding: .75rem .9rem; margin-bottom: .85rem;
  border-radius: .9rem; border: 1px solid var(--edge); background: #fff;
  box-shadow: 0 2px 10px #193a2c08;
}
.pwa-banner[hidden] { display: none; }
.pwa-banner-soft { background: #f2f8f4; border-color: #cbe1d3; }
.pwa-banner-warn { background: #fff8ea; border-color: #eed29a; color: #5b3806; }
.pwa-banner-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; }
.pwa-banner-top strong { color: var(--ink); font-size: .92rem; line-height: 1.35; }
.pwa-banner-warn .pwa-banner-top strong { color: #6c3e05; }
.pwa-banner-head { display: flex; align-items: center; gap: .42rem; min-width: 0; }
.pwa-banner-icon { display: inline-flex; color: var(--green); flex: none; }
.pwa-banner-desc { margin: 0; font-size: .84rem; color: var(--muted); line-height: 1.45; }
.pwa-banner-warn .pwa-banner-desc { color: #6b4811; }
.pwa-banner-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; margin-top: .15rem; }
.pwa-banner-actions[hidden] { display: none; }
.pwa-banner-actions .button { min-height: 2.3rem; padding: .42rem .85rem; font-size: .86rem; }
.pwa-banner-dismiss {
  appearance: none; background: transparent; border: 0; border-radius: .45rem; flex: none;
  color: var(--muted); font-size: 1.2rem; line-height: 1; width: 1.85rem; height: 1.85rem;
  margin: -.2rem -.3rem 0 0; display: inline-grid; place-items: center; cursor: pointer;
}
.pwa-banner-dismiss:hover { background: #0000000d; color: var(--ink); }
.pwa-quick-details { margin-top: .1rem; }
.pwa-quick-details[hidden] { display: none; }
.pwa-quick-summary {
  display: inline-flex; align-items: center; gap: .32rem; cursor: pointer; list-style: none;
  font-size: .85rem; font-weight: 650; color: var(--green-dark); padding: .2rem 0;
}
.pwa-quick-summary::-webkit-details-marker { display: none; }
.pwa-quick-summary .ui-icon { width: .95rem; height: .95rem; transition: transform .15s ease; }
.pwa-quick-details[open] .pwa-quick-summary .ui-icon { transform: rotate(180deg); }
.pwa-quick-link { display: inline-block; font-size: .84rem; font-weight: 620; color: var(--green-dark); text-decoration: none; margin-top: .45rem; }
.pwa-quick-link:hover { text-decoration: underline; }
.pwa-banner-actions .pwa-quick-link { margin-top: 0; }
.pwa-mini-steps { margin: .4rem 0 0; padding-left: 1.2rem; display: grid; gap: .25rem; font-size: .84rem; color: var(--ink); line-height: 1.45; }
.pwa-mini-steps .ui-icon { vertical-align: -.15em; width: .95em; height: .95em; }
.pwa-inline-status { margin: .1rem 0 0; font-weight: 600; font-size: .84rem; color: var(--green-dark); }
.pwa-inline-status[data-tone="error"] { color: #9c2b23; }
.pwa-section-stack { display: grid; gap: 1.25rem; }
.pwa-subsection { display: grid; gap: .55rem; }
.pwa-subsection + .pwa-subsection { padding-top: 1.1rem; border-top: 1px solid var(--edge); }
.pwa-subhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.pwa-subhead strong { display: inline-flex; align-items: center; gap: .45rem; color: var(--ink); font-size: .96rem; }
.pwa-guide { border: 1px solid var(--edge); border-radius: .75rem; background: #fafcf9; padding: .6rem .85rem; }
.pwa-guide summary { cursor: pointer; font-weight: 640; font-size: .9rem; color: var(--ink); }
.pwa-steps { margin: .65rem 0 .2rem; padding-left: 1.25rem; display: grid; gap: .4rem; font-size: .89rem; color: #2b423a; line-height: 1.5; }
.pwa-steps .ui-icon { vertical-align: -.15em; width: 1em; height: 1em; }
.pwa-state-hint { margin: 0; font-size: .88rem; }
.pwa-push-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .2rem; }
.pwa-device-list { border: 1px solid var(--edge); border-radius: .75rem; overflow: hidden; }
.pwa-device-list .record { padding: .75rem .9rem; }
@media screen and (max-width: 600px) {
  .pwa-push-actions .button { flex: 1 1 auto; width: 100%; }
}
@media print {
  .pwa-banner, .pwa-profile-panel { display: none !important; }
}

/* Admin principal lifecycle cards */
.school-principal-row { display: grid; gap: .12rem; }
.school-principal-row + .school-principal-row { margin-top: .35rem; padding-top: .35rem; border-top: 1px dashed var(--edge); }
.principal-card { display: grid; gap: .75rem; align-items: stretch; }
.principal-card.is-locked { background: #fafbf9; }
.principal-card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .6rem 1rem; }
.principal-card-controls { display: grid; gap: .55rem; }
.principal-unlock-form { display: flex; }

/* Custom school icon & preview */
.brand-symbol.has-custom-icon {
  display: inline-grid; place-items: center; overflow: hidden; padding: 2px;
  background: #fff; border: 1px solid #d5e2d8;
}
.sidebar .brand-symbol.has-custom-icon { background: #fff; border-color: #ffffff26; }
.brand-symbol.has-custom-icon img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: inherit; }
.school-icon-preview-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1rem 1.25rem; }
.homescreen-tile { display: grid; justify-items: center; gap: .38rem; width: 5.5rem; flex: none; }
.homescreen-badge {
  width: 4.1rem; height: 4.1rem; border-radius: 1rem; overflow: hidden; background: #fff;
  border: 1px solid var(--edge); box-shadow: 0 6px 16px #1436281c;
  display: grid; place-items: center;
}
.homescreen-badge img { width: 100%; height: 100%; object-fit: contain; display: block; }
.homescreen-badge img[hidden] { display: none; }
.homescreen-label {
  font-size: .74rem; font-weight: 620; color: var(--ink); text-align: center;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.school-icon-upload-fields { flex: 1 1 14rem; min-width: 0; display: grid; gap: .45rem; }
.school-icon-reset-form { padding-top: .5rem; border-top: 1px solid var(--edge); }
