@import url(../fonts/fonts.css);

:root {
  color-scheme: light;
  --bg: #f8faf7;
  --surface: #ffffff;
  --surface-2: #f4f7f3;
  --line: #e3e9e2;
  --line-2: #cfd8ce;
  --ink: #13211a;
  --ink-2: #4a5850;
  --muted: #7d8981;

  /* from the logo: leaf green #41B649, orange #F59E0B, deep green #0F5132 */
  --brand: #1e7b34;          /* buttons + links: 5.3:1 on white */
  --brand-ink: #0f5132;
  --brand-wash: #eaf6ea;
  --leaf: #41b649;           /* decoration only, never text */
  --accent: #f59e0b;         /* decoration only, never text */
  --accent-ink: #a34a04;
  --accent-wash: #fef3dc;

  --good: #1f9d55;
  --good-ink: #146c3a;
  --good-wash: #e7f6ec;
  --warn: #f0a500;
  --warn-ink: #7a5300;
  --warn-wash: #fdf3d6;
  --crit: #d8453b;
  --crit-ink: #b0281f;
  --crit-wash: #fdebe9;
  --neutral-bar: #b7c2bb;

  --radius: 16px;
  --shadow: 0 1px 2px rgba(20, 32, 26, .04), 0 6px 24px rgba(20, 32, 26, .05);
  --font: "IBM Plex Sans Thai", "Leelawadee UI", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --emoji: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; top: -60px; left: 16px; z-index: 100; padding: 9px 14px; border-radius: 10px; background: var(--ink); color: #fff; }
.skip-link:focus { top: 8px; }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid { display: grid; gap: 16px; }
:focus-visible { outline: 3px solid rgba(20, 108, 67, .35); outline-offset: 2px; }

/* ---------------- header ---------------- */
.app-header {
  position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .95); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.hdr-row { display: flex; align-items: center; gap: 22px; padding: 8px 28px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.brand-mark { width: 42px; height: 42px; flex: none; }
.brand-name { font-weight: 800; font-size: 20px; line-height: 1.05; letter-spacing: -0.01em; }
.brand-sub { font-size: 12px; color: var(--muted); }
.wordmark .w1 { color: var(--brand-ink); }
.wordmark .w2 { color: var(--accent); }

/* grade switcher: every grade has its own dashboard */
.grade-bar { display: flex; align-items: center; gap: 6px; padding: 8px 28px; border-top: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.grade-bar .lbl { font-size: 12px; font-weight: 600; color: var(--muted); margin-right: 4px; white-space: nowrap; }
.gchip {
  position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 600;
  text-decoration: none; white-space: nowrap; cursor: pointer;
}
.gchip:hover { border-color: var(--line-2); color: var(--ink); }
.gchip.on { background: var(--brand-ink); border-color: var(--brand-ink); color: #fff; }
.gchip .gd { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.gd.crit { background: var(--crit); }
.gd.warn { background: var(--warn); }
.gd.info { background: var(--brand); }
.gd.good { background: var(--good); }
.gchip.on .gd { box-shadow: 0 0 0 2px #fff; }
.gchip.sep { margin-left: 6px; }
.header-navigation { display: flex; align-items: center; gap: 4px; min-width: 0; }
.nav { display: flex; align-items: center; gap: 4px; min-width: 0; }
.nav > a, .tools > summary {
  position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px; border-radius: 10px;
  color: var(--ink-2); font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; list-style: none;
}
.tools > summary::-webkit-details-marker { display: none; }
.nav > a:hover, .tools > summary:hover { background: var(--surface-2); }
.nav > a.active { background: var(--brand-wash); color: var(--brand-ink); font-weight: 600; }
.nav .alert-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--crit); }
.tools { position: relative; flex: none; }
.tools > summary { touch-action: manipulation; }
.tools[open] > summary, .tools.active > summary { background: var(--surface-2); color: var(--ink); }
.tools-menu {
  position: absolute; top: calc(100% + 6px); right: 0; width: 300px; max-width: calc(100vw - 32px); padding: 6px; border-radius: 12px;
  max-height: calc(100vh - 180px); max-height: calc(100dvh - 180px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(20, 32, 26, .12); z-index: 40;
}
.tools-menu a { display: block; min-height: 44px; padding: 10px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; touch-action: manipulation; }
.tools-menu a:hover, .tools-menu a.active { background: var(--brand-wash); color: var(--brand-ink); }
.tools-menu small { display: block; color: var(--muted); font-size: 12px; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); font-size: 13px; text-decoration: none; white-space: nowrap;
}
.status-pill:hover { border-color: var(--line-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.on { background: var(--good); box-shadow: 0 0 0 3px var(--good-wash); }
.dot.sim { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-wash); }
.dot.off { background: var(--crit); box-shadow: 0 0 0 3px var(--crit-wash); }
.lang { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.lang button { border: 0; background: transparent; padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

/* ---------------- page ---------------- */
main { max-width: 1320px; margin: 0 auto; padding: 28px 28px 72px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 28px; font-weight: 700; }
.page-head .sub { color: var(--ink-2); margin-top: 4px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--brand); margin-bottom: 2px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card.flat { box-shadow: none; }
.card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.card-head h2 { font-size: 17px; font-weight: 700; }
.card-head .aside { margin-left: auto; font-size: 13px; color: var(--muted); }
.section-label { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }

/* ---------------- controls ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer;
  text-decoration: none; transition: background .15s ease, transform .05s ease; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-ink); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn.lg { padding: 14px 24px; font-size: 16px; border-radius: 14px; }
.btn.block { width: 100%; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap;
}
.chip.good { background: var(--good-wash); color: var(--good-ink); border-color: transparent; }
.chip.warn { background: var(--warn-wash); color: var(--warn-ink); border-color: transparent; }
.chip.crit { background: var(--crit-wash); color: var(--crit-ink); border-color: transparent; }
.chip.brand { background: var(--brand-wash); color: var(--brand-ink); border-color: transparent; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
input[type=number], input[type=text], select { padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; min-width: 0; font-size: 15px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }

/* ---------------- food tile ---------------- */
.food { display: grid; place-items: center; flex: none; border-radius: 22px; font-family: var(--emoji); line-height: 1; background: linear-gradient(145deg, #fff4dd, #ffe2b8); }
.food.c1 { background: linear-gradient(145deg, #eaf7e6, #cdeccd); }
.food.c2 { background: linear-gradient(145deg, #fff1dc, #ffd9a8); }
.food.c3 { background: linear-gradient(145deg, #fdeaea, #f8cdc6); }
.food.c4 { background: linear-gradient(145deg, #e9f1fb, #cfe0f6); }
.food.xl { width: 128px; height: 128px; font-size: 68px; border-radius: 28px; }
.food.lg { width: 88px; height: 88px; font-size: 46px; }
.food.md { width: 56px; height: 56px; font-size: 30px; border-radius: 16px; }
.food.sm { width: 40px; height: 40px; font-size: 22px; border-radius: 12px; }

/* ---------------- hero ---------------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 0; padding: 0; overflow: hidden; }
.hero-main { display: flex; gap: 22px; align-items: center; padding: 26px 28px; }
.hero-main h1 { font-size: 32px; font-weight: 700; }
.hero-main .alt-name { color: var(--muted); margin: 2px 0 12px; }
.hero-side { padding: 26px 28px; border-left: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.big-metric .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.big-metric .value { font-size: 52px; font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; }
.big-metric .value .unit { font-size: 20px; color: var(--ink-2); font-weight: 600; margin-left: 2px; }
.big-metric .caption { font-size: 12px; color: var(--muted); }
.nutri-top { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 24px; margin-bottom: 12px; }
.nutri .macros { display: flex; flex-wrap: wrap; gap: 8px; }
.nutri .macro { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; min-width: 96px; }
.nutri .macro .k { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.nutri .macro .v { font-size: 24px; font-weight: 700; line-height: 1.15; }
.nutri .macro .v .unit { font-size: 13px; color: var(--ink-2); font-weight: 600; margin-left: 2px; }
.nutri .macro .n { font-size: 11px; color: var(--muted); }
.nutri .macro .n .chip { margin-top: 4px; }
.nutri .lunch-verdict { display: flex; flex-direction: column; gap: 2px; border-left: 3px solid var(--line); padding: 4px 0 4px 10px; margin: 0 0 12px; }
.nutri .lunch-verdict.good { border-left-color: var(--brand, #2e7d4f); }
.nutri td .chip { margin-top: 4px; white-space: nowrap; }
.nutri .m-only { display: none; }
.nutri .nutri-basis { margin: -4px 0 12px; }
.nutri .food-path { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.nutri .food-path h3 { font-size: 15px; margin: 0 0 4px; }
.nutri .path-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.nutri .path-list li { display: grid; gap: 2px; }
.nutri .path-list .row { gap: 8px; align-items: center; }
@media (max-width: 640px) {
  .nutri .m-only { display: block; }
  .nutri .t .col-kcal, .nutri .t .col-std { display: none; }
}
.nutri .t td { vertical-align: top; }

/* ---------------- stepper ---------------- */
.steps { list-style: none; margin: 16px 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.steps li { position: relative; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); min-height: 70px; }
.steps .n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 12px; font-weight: 700; border: 2px solid var(--line-2); color: var(--muted); margin-right: 6px; }
.steps .t { font-weight: 600; color: var(--muted); font-size: 14px; }
.steps .v { font-size: 13px; color: var(--muted); margin-top: 4px; }
.steps li.done .n { background: var(--brand); border-color: var(--brand); color: #fff; }
.steps li.done .t { color: var(--ink); }
.steps li.done .v { color: var(--ink-2); }
.steps li.current { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-wash); }
.steps li.current .n { border-color: var(--brand); color: var(--brand); }
.steps li.current .t { color: var(--brand-ink); }
.steps li.current .v { color: var(--ink-2); }
.steps li.alert { border-color: var(--crit); box-shadow: 0 0 0 3px var(--crit-wash); }
.steps li.alert .n { border-color: var(--crit); color: var(--crit); }
.steps li.alert .t { color: var(--crit-ink); }
.steps li.skip { opacity: .6; }

/* ---------------- metrics ---------------- */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.metric .label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.metric .value { font-size: 30px; font-weight: 700; line-height: 1.2; margin-top: 4px; letter-spacing: -0.01em; }
.metric .value .unit { font-size: 15px; color: var(--ink-2); font-weight: 500; margin-left: 3px; }
.metric .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.metric.crit .value { color: var(--crit-ink); }

/* ---------------- layout grids ---------------- */
.cols-main { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.cols-list { grid-template-columns: 340px minmax(0, 1fr); align-items: start; }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------------- notices ---------------- */
.notice { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.notice .ico { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; flex: none; background: var(--line); color: var(--ink-2); }
.notice b { display: block; }
.notice.good { background: var(--good-wash); border-color: transparent; }
.notice.good .ico { background: var(--good); color: #fff; }
.notice.warn { background: var(--warn-wash); border-color: transparent; }
.notice.warn .ico { background: var(--warn); color: #3a2a00; }
.notice.crit { background: var(--crit-wash); border-color: transparent; }
.notice.crit .ico { background: var(--crit); color: #fff; }
.notice.info { background: var(--brand-wash); border-color: transparent; }
.notice.info .ico { background: var(--brand); color: #fff; }

/* ---------------- gauge (vs school normal) ---------------- */
.gauge { position: relative; height: 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); margin: 34px 0 30px; }
.gauge .zone { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px 0 0 999px; background: #cfeedb; }
.gauge .mark { position: absolute; top: -8px; bottom: -8px; width: 0; border-left: 2px solid var(--crit); }
.gauge .mark span, .gauge .pin span { position: absolute; transform: translateX(-50%); white-space: nowrap; font-size: 12px; color: var(--ink-2); }
.gauge .mark span { top: 26px; }
.gauge .pin { position: absolute; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--ink); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.gauge .pin span { bottom: 22px; left: 50%; font-weight: 700; color: var(--ink); font-size: 13px; }
.gauge .pin.crit { background: var(--crit); }
.gauge .pin.good { background: var(--good); }

/* ---------------- tables ---------------- */
.table-scroll { max-width: 100%; overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t .r { text-align: right; }

/* ---------------- live scales ---------------- */
.live-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.live-row:last-child { border-bottom: 0; }
.live-row .name { font-weight: 500; }
.live-row .meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.live-row .val { margin-left: auto; font-family: var(--mono); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.live-row .val small { font-family: var(--font); font-size: 13px; color: var(--ink-2); margin-left: 3px; font-weight: 500; }
.scale-val { font-family: var(--mono); font-size: 32px; font-weight: 600; font-variant-numeric: tabular-nums; }
.scale-val .unit { font-family: var(--font); font-size: 15px; color: var(--ink-2); margin-left: 4px; font-weight: 500; }
.stable-tag { display: inline-flex; align-items: center; gap: 6px; }

/* ---------------- bars ---------------- */
.bar-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 44px; align-items: center; gap: 10px; font-size: 14px; }
.bar-row + .bar-row { margin-top: 9px; }
.bar-track { position: relative; height: 10px; border-radius: 999px; background: var(--surface-2); }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--neutral-bar); }
.bar-fill.flag { background: var(--crit); }
.bar-fill.calm { background: #a8d5b7; }
.bar-thr { position: absolute; top: -4px; bottom: -4px; border-left: 1.5px dashed var(--ink-2); }
.bar-row b { text-align: right; }

/* ---------------- ask-the-kids ---------------- */
.ask { border: 2px solid var(--crit-wash); }
.ask .tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ask .tile { background: var(--surface-2); border-radius: 12px; padding: 14px 16px; }
.ask .tile .k { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.ask .tile .big { font-size: 20px; font-weight: 700; line-height: 1.3; }

/* ---------------- menu list / trends ---------------- */
.menu-list { display: flex; flex-direction: column; gap: 8px; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; text-align: left; }
.menu-item:hover { border-color: var(--line-2); }
.menu-item.active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-wash); }
.menu-item .nm { font-weight: 600; line-height: 1.3; }
.menu-item .sb { font-size: 12px; color: var(--muted); }
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--ink-2); }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; }
.legend .ln { display: inline-block; width: 16px; border-top: 2px solid; vertical-align: 3px; margin-right: 6px; }
.tooltip { position: absolute; pointer-events: none; z-index: 5; min-width: 150px; background: var(--ink); color: #fff; border-radius: 10px; padding: 8px 12px; font-size: 13px; transform: translate(-50%, calc(-100% - 12px)); }

/* ---------------- action ---------------- */
.problem { display: flex; align-items: center; gap: 18px; }
.problem h2 { font-size: 24px; font-weight: 700; }
.evidence { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.ev { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.ev .q { font-size: 13px; font-weight: 600; color: var(--muted); }
.ev .a { font-size: 22px; font-weight: 700; margin: 4px 0 10px; line-height: 1.3; }
.ev .a.crit { color: var(--crit-ink); }
.seq { font-family: var(--mono); font-weight: 600; }
.seq .hi { color: var(--crit-ink); }
.reco { border: 2px solid var(--brand); box-shadow: 0 0 0 5px var(--brand-wash); }
.reco-head { display: flex; gap: 18px; align-items: center; margin-bottom: 16px; }
.reco-head h2 { font-size: 26px; font-weight: 700; }
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 4px 0 18px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.check .mk { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; margin-top: 1px; }
.check.ok .mk { background: var(--good); color: #fff; }
.check.no .mk { background: var(--crit); color: #fff; }
.check.na .mk { background: var(--line-2); color: var(--ink-2); }
.check b { display: block; font-size: 14px; }
.check span { font-size: 13px; color: var(--ink-2); }
.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.opt { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; }
.opt:hover { border-color: var(--line-2); }
.opt.sel { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-wash); }
.opt b { display: block; line-height: 1.3; }
.opt small { color: var(--muted); font-size: 12px; }
.never { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--crit-wash); color: var(--crit-ink); font-weight: 600; font-size: 14px; }
.capa.verified { border: 2px solid var(--good); }
.capa.testing { border: 2px solid var(--brand); }
.capa.not_verified { border: 2px solid var(--crit); }
details.more { margin-top: 16px; }
details.more > summary { cursor: pointer; font-weight: 600; color: var(--ink-2); padding: 6px 0; }
.rej { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.rej:last-child { border-bottom: 0; }
.rej .x { color: var(--crit); font-weight: 700; }

/* ---------------- QC ---------------- */
.qc-result { display: grid; grid-template-columns: repeat(3, 1fr) 150px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-top: 10px; }
.qc-result > div { padding: 14px 16px; border-right: 1px solid var(--line); }
.qc-result > div:last-child { border-right: 0; display: grid; place-items: center; }
.qc-result .v { font-family: var(--mono); font-size: 26px; font-weight: 600; }
.qc-result .ok { background: var(--good-wash); color: var(--good-ink); font-weight: 800; font-size: 22px; }
.qc-result .no { background: var(--crit-wash); color: var(--crit-ink); font-weight: 800; font-size: 22px; }
.wz { display: inline-flex; padding: 5px 12px; border-radius: 999px; font-size: 13px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.wz.on { background: var(--brand-wash); color: var(--brand-ink); border-color: transparent; font-weight: 600; }
.wz.done { color: var(--good-ink); }

/* ---------------- menu library ---------------- */
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.lib .card { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.lib .top { display: flex; gap: 14px; align-items: center; }
.lib h3 { font-size: 16px; font-weight: 700; }
.kv { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.kv div { background: var(--surface-2); border-radius: 10px; padding: 6px 8px; text-align: center; }
.kv b { display: block; font-size: 15px; }
.kv small { font-size: 11px; color: var(--muted); }

/* ---------------- misc ---------------- */
.learning { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 14px; background: var(--warn-wash); color: var(--warn-ink); margin-bottom: 16px; }
.meter { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.empty { padding: 36px 20px; text-align: center; color: var(--ink-2); }
.empty .big { font-size: 40px; font-family: var(--emoji); }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 500; z-index: 100; transition: all .2s ease; pointer-events: none; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--crit-ink); }
.footer-note { margin-top: 32px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------------- whole school: one card per grade ---------------- */
.day-head { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 0; padding: 0; overflow: hidden; }
.day-head .hero-main { padding: 22px 26px; }
.day-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-left: 1px solid var(--line); background: var(--surface-2); }
.day-kpis > div { padding: 18px 22px; display: flex; flex-direction: column; justify-content: center; }
.day-kpis > div:nth-child(even) { border-left: 1px solid var(--line); }
.day-kpis > div:nth-child(n+3) { border-top: 1px solid var(--line); }
.day-kpis .k { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.day-kpis .v { font-size: 28px; font-weight: 700; line-height: 1.15; }
.day-kpis .v small { font-size: 14px; font-weight: 500; color: var(--ink-2); margin-left: 2px; }
.day-kpis .s { font-size: 12px; color: var(--muted); }
.rounds { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.round {
  display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); text-decoration: none; color: var(--ink); border-top: 4px solid var(--line-2); transition: box-shadow .15s ease;
}
.round:hover { box-shadow: 0 6px 20px rgba(20, 32, 26, .08); }
.round.normal { border-top-color: var(--good); }
.round.high { border-top-color: var(--crit); }
.round.open { border-top-color: var(--brand); }
.round.planned { border-top-color: var(--line-2); }
.round .top { display: flex; align-items: center; gap: 8px; }
.round .gname { font-weight: 700; font-size: 16px; }
.round .big { font-size: 30px; font-weight: 700; line-height: 1.1; }
.round .big small { font-size: 14px; color: var(--ink-2); font-weight: 500; margin-left: 2px; }
.round .sub { font-size: 12px; color: var(--muted); }
.round .foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.round .ico { font-family: var(--emoji); font-size: 20px; }

/* ---------------- heatmap: menu x grade ---------------- */
.heat-wrap { overflow-x: auto; }
table.heat { border-collapse: separate; border-spacing: 3px; width: 100%; min-width: 760px; font-variant-numeric: tabular-nums; }
table.heat th { font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 6px 4px; text-align: center; white-space: nowrap; }
table.heat th.m { text-align: left; }
table.heat td.m { padding: 4px 8px 4px 0; white-space: nowrap; }
table.heat td.m .row { gap: 8px; }
table.heat td.m b { font-weight: 600; font-size: 14px; }
.hc {
  display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 58px; height: 46px; border-radius: 10px;
  background: var(--surface-2); color: var(--muted); font-size: 14px; font-weight: 600; border: 2px solid transparent; cursor: pointer; width: 100%;
}
.hc small { font-size: 10px; font-weight: 600; line-height: 1; }
.hc.normal { background: var(--good-wash); color: var(--good-ink); }
.hc.high { background: var(--warn-wash); color: var(--warn-ink); }
.hc.repeated_high { background: var(--crit); color: #fff; }
.hc.testing { border-color: var(--brand); }
.hc.verified { border-color: var(--good); }
.hc:hover { filter: brightness(.97); }

/* ---------------- whole-school to-do list ---------------- */
.issue { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); }
.issue + .issue { margin-top: 8px; }
.issue:hover { border-color: var(--line-2); box-shadow: 0 4px 16px rgba(20, 32, 26, .06); }
.issue .g { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--brand-wash); color: var(--brand-ink); font-weight: 800; font-size: 15px; }
.issue.decide .g { background: var(--crit-wash); color: var(--crit-ink); }
.issue.verified .g { background: var(--good-wash); color: var(--good-ink); }
.issue b { display: block; font-size: 15px; }
.issue .small { color: var(--ink-2); }
.stage-title { font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 18px 0 8px; text-transform: none; }

/* A successful fix starts fresh trials in other grades. */
.reuse-card { border: 1px solid #b8d9b9; background: linear-gradient(130deg, var(--brand-wash), var(--surface) 65%); margin-bottom: 16px; }
.reuse-card h2 { margin: 12px 0 8px; }
.reuse-card > p { max-width: 850px; margin-bottom: 12px; }
.reuse-grades { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.reuse-grades > div { display: grid; gap: 3px; padding: 10px 16px; background: white; border: 1px solid var(--line); border-radius: 12px; }
.reuse-card > .btn { white-space: normal; text-align: left; }
.reuse-sent { display: grid; gap: 10px; margin-top: 16px; }
.reuse-blocked { display: grid; gap: 8px; margin-top: 12px; }
.reuse-blocked > div { display: flex; align-items: baseline; gap: 14px; font-size: 13px; }
.reuse-blocked a { flex-shrink: 0; font-weight: 600; }
.reuse-origin { padding: 8px 12px; background: var(--brand-wash); border-radius: 8px; margin-bottom: 12px; }

/* ---------------- 4 food groups ---------------- */
.g4 { display: flex; flex-wrap: wrap; gap: 6px; }
.g4 span { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--good-wash); color: var(--good-ink); }
.g4 span.miss { background: var(--crit-wash); color: var(--crit-ink); }
.g4 span i { font-style: normal; font-family: var(--emoji); }

/* ---------------- menu library + detail ---------------- */
.lib .actions { display: flex; gap: 8px; margin-top: auto; }
.lib .card.add { align-items: center; justify-content: center; text-align: center; border-style: dashed; color: var(--ink-2); cursor: pointer; min-height: 180px; background: var(--surface-2); }
.lib .card.add:hover { border-color: var(--brand); color: var(--brand-ink); }
.lib .card.add .plus { font-size: 34px; line-height: 1; }
.md-hero { display: flex; gap: 22px; align-items: center; }
.md-hero h1 { font-size: 30px; font-weight: 700; }
.recipe-ing { width: 100%; border-collapse: collapse; }
.recipe-ing td { padding: 8px 6px; border-bottom: 1px dashed var(--line); }
.recipe-ing td.q { text-align: right; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.recipe-ing td.u { color: var(--ink-2); width: 60px; }
ol.steps-list { margin: 0; padding: 0; list-style: none; counter-reset: s; }
ol.steps-list li { position: relative; padding: 8px 0 8px 40px; counter-increment: s; }
ol.steps-list li::before { content: counter(s); position: absolute; left: 0; top: 7px; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-wash); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.tip { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--accent-wash); color: var(--accent-ink); font-size: 14px; margin-top: 12px; }
.serv-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.serv-row input { width: 110px; }

/* ---------------- editors ---------------- */
textarea { padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; font-size: 15px; width: 100%; min-height: 70px; resize: vertical; }
input[type=text], input[type=number] { width: 100%; }
.editor { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.editor .two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.editor .four-col { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.editor fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 14px; margin: 0; }
.editor legend { font-size: 13px; font-weight: 700; padding: 0 6px; color: var(--ink); }
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-pick button { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-family: var(--emoji); font-size: 22px; cursor: pointer; }
.icon-pick button[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-wash); }
.ing-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 90px 40px; gap: 8px; align-items: center; }
.ing-row + .ing-row { margin-top: 8px; }
.ing-row .x, .step-row .x { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--muted); }
.ing-row .x:hover, .step-row .x:hover { color: var(--crit-ink); border-color: var(--crit); }
.step-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 40px; gap: 8px; align-items: start; }
.step-row + .step-row { margin-top: 8px; }
.step-row .n { width: 28px; height: 28px; border-radius: 50%; background: var(--brand-wash); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; font-size: 13px; margin-top: 8px; }
.step-row textarea { min-height: 44px; }
.check-line { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 15px; font-weight: 500; color: var(--ink); }
.check-line input { width: 20px; height: 20px; accent-color: var(--brand); }
.sticky-save { position: sticky; bottom: 0; background: linear-gradient(180deg, rgba(248, 250, 247, 0), var(--bg) 30%); padding: 18px 0 6px; display: flex; gap: 10px; justify-content: flex-end; }
.lang-note { font-size: 12px; color: var(--muted); }

/* ---------------- responsive ---------------- */
@media (max-width: 1280px) {
  .app-header .hdr-row { flex-wrap: wrap; gap: 10px; }
  /* Only the links scroll. Keep the tools disclosure outside the clipping area. */
  .header-navigation { order: 3; width: 100%; }
  .header-navigation .nav { flex: 1; overflow-x: auto; scrollbar-width: thin; }
}
@media (max-width: 1200px) {
  .hdr-row { flex-wrap: wrap; padding: 8px 16px; gap: 10px; }
  .cols-main, .cols-list { grid-template-columns: minmax(0, 1fr); }
  .hero, .day-head { grid-template-columns: minmax(0, 1fr); }
  .hero-side { border-left: 0; border-top: 1px solid var(--line); }
  .day-kpis { border-left: 0; border-top: 1px solid var(--line); }
  .brand-sub { display: none; }
}
@media (max-width: 900px) {
  .hdr-row { flex-wrap: wrap; padding: 8px 16px; gap: 10px; }
  .grade-bar { padding: 8px 16px; }
  .editor .four-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md-hero { flex-direction: column; align-items: flex-start; }
  main { padding: 18px 16px 56px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .evidence, .cols-3, .cols-2, .ask .tiles, .checks { grid-template-columns: minmax(0, 1fr); }
  .hero-main { flex-direction: column; align-items: flex-start; }
  .qc-result { grid-template-columns: 1fr 1fr; }
  .qc-result > div:nth-child(2) { border-right: 0; }
  .qc-result > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .problem { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; }
  .problem .food { width: 64px; height: 64px; font-size: 38px; }
  .problem h2 { font-size: 21px; }
  .problem .spacer { display: none; }
  .problem .seq { grid-column: 1 / -1; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .big-metric .value { font-size: 42px; }
  .hero-main h1 { font-size: 26px; }
  .food.xl { width: 96px; height: 96px; font-size: 52px; }
  .status-pill .txt { display: none; }
  .editor .two-col { grid-template-columns: minmax(0, 1fr); }
  .ing-row { grid-template-columns: minmax(0, 1fr) 80px 70px 40px; }
  .issue { grid-template-columns: auto minmax(0, 1fr); }
  .issue > :nth-child(2) { display: none; }
  .issue > :last-child { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.data-notice { display:flex; align-items:flex-start; gap:14px; flex-wrap:wrap; background:#fff9ec; border:1px solid #ebd59e; border-radius:14px; padding:14px 18px; margin-bottom:22px; color:#665021; font-size:12px; }
.data-notice > div { flex:1; min-width:210px; }
.data-notice p { margin:4px 0 0; line-height:1.6; }
.data-notice a { color:#1e6933; white-space:nowrap; font-weight:700; }
.provenance-card { margin-bottom:20px; }
.provenance-card dl { margin:12px 0; }
.provenance-card dl > div { display:grid; grid-template-columns:minmax(140px,1fr) 3fr; gap:12px; padding:9px 0; border-bottom:1px solid var(--line); font-size:13px; }
.provenance-card dt { font-weight:600; color:var(--ink2); }
.provenance-card dd { margin:0; overflow-wrap:anywhere; }
.reference-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:16px 0; }
.reference-list a { display:block; padding:14px; border:1px solid var(--line); border-radius:12px; color:var(--brand-ink); text-decoration:none; }
.reference-list a:hover { background:var(--brand-wash); }
.reference-list small { display:block; margin-top:6px; color:var(--ink2); }
@media (max-width:600px) { .reference-list { grid-template-columns:1fr; } .provenance-card dl > div { grid-template-columns:1fr; gap:4px; } }

/* ---------------- clarity pass: plain rules, labelled numbers ---------------- */
.rules3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: -4px 0 16px; }
.rules3 > div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.rules3 b { display: block; font-size: 14px; color: var(--brand-ink); }
.rules3 span { display: block; font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.lib-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lib-facts > div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.lib-facts small { display: block; font-size: 12px; color: var(--muted); }
.lib-facts b { font-size: 18px; margin-right: 6px; }
.lib-facts span { font-size: 12px; color: var(--muted); }
.lib-facts .bad { color: var(--crit-ink); }
.seq-box { text-align: right; }
.seq-box small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.rule-group { border-top: 1px solid var(--line); padding: 14px 0 6px; }
.rule-group:first-of-type { border-top: 0; padding-top: 0; }
.rule-group h3 { font-size: 15px; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
label.rule { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 15px; color: var(--ink); padding: 6px 0; font-weight: 400; }
label.rule input { width: 84px; text-align: center; font-weight: 700; }
.rule-eg { font-size: 13px; color: var(--ink-2); background: var(--surface-2); border-radius: 8px; padding: 6px 10px; margin: 2px 0 6px; }
table.t.mini th, table.t.mini td { padding: 5px 8px; font-size: 13px; }
table.t.mini th small { font-weight: 500; color: var(--muted); }
@media (max-width: 900px) { .rules3 { grid-template-columns: minmax(0, 1fr); } }

/* ---------------- kids' opinions: six big answers a teacher taps (kitchen + teacher page) ---------------- */
.op-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.op-btn {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "i b" "t t"; align-items: center; gap: 6px 10px; min-height: 88px; padding: 10px 14px;
  border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: 15px;
  text-align: left; cursor: pointer; touch-action: manipulation;
}
.op-btn:hover { border-color: var(--brand); }
.op-btn:active { transform: scale(.98); background: var(--brand-wash); }
.op-btn:disabled { opacity: .5; cursor: not-allowed; }
.op-btn .i { grid-area: i; font-family: var(--emoji); font-size: 28px; line-height: 1; }
.op-btn .t { grid-area: t; line-height: 1.3; }
.op-btn b { grid-area: b; justify-self: end; min-width: 38px; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); text-align: center; font-size: 17px; font-variant-numeric: tabular-nums; }
@media (min-width: 600px) { .o .op-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.op-foot { margin-top: 12px; font-weight: 600; }
.sort-scale { margin: 10px 0 4px; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); }
@media (max-width: 380px) { .op-grid { grid-template-columns: minmax(0, 1fr); } }

/* PIN box (real school data: saving needs the role's PIN) */
#pin-dialog { max-width: 340px; width: calc(100% - 32px); padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); }
#pin-dialog::backdrop { background: rgba(20, 30, 24, 0.45); }
#pin-dialog h2 { margin: 0 0 6px; font-size: 18px; }
#pin-dialog input { width: 100%; margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 22px; letter-spacing: 0.3em; text-align: center; }
#pin-dialog .pin-err { min-height: 1.4em; margin: 6px 0 0; color: var(--crit-ink, #a32d2d); }
#pin-dialog .pin-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* Kitchen: an open round in three stages (before serving · while eating · after the trays come back) */
.k-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.stage { margin-top: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.stage > summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; }
.stage > summary::-webkit-details-marker { display: none; }
.stage > summary small { margin-left: auto; color: var(--ink-2); font-size: 12.5px; text-align: right; }
.stage-t { font-weight: 600; }
.stage-n { display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); font-weight: 700; font-size: 13px; }
.stage.now { border-color: var(--brand); }
.stage.now .stage-n { background: var(--brand); color: #fff; }
.stage[open] > summary { border-bottom: 1px solid var(--line); }
.stage > :not(summary) { margin-left: 12px; margin-right: 12px; }
.stage > :last-child { margin-bottom: 12px; }
.stage-line { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 16px; color: var(--ink-2); font-size: 14px; }

/* Who is signed in: next to the language switch on every school screen; tap to switch role or sign out */
.role-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 13.5px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.role-chip:hover { border-color: var(--brand); color: var(--brand); }
.role-chip + .lang { margin-left: 8px; }
.who > .role-chip + .lang { margin-left: 0; }

/* The principal's monthly report */
.rep-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.rep-tiles .big-metric { display: flex; flex-direction: column; gap: 6px; padding: 18px; }
.rep-tiles .big-metric .value { font-size: 40px; }
.rep-tiles .big-metric .value.rep-money { font-size: 30px; }
.rep-sec { margin-bottom: 16px; }
.rep-note { margin-top: 10px; line-height: 1.6; }
.rep-up { color: var(--good-ink); font-weight: 600; }
.rep-down { color: var(--crit-ink); font-weight: 600; }
.rep-total td { border-top: 2px solid var(--line-2); font-weight: 600; }
.rep-fix + .rep-fix { margin-top: 14px; }
.rep-fix h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-bottom: 6px; }
.rep-fix ul, .rep-advice { margin: 0; padding-left: 20px; line-height: 1.8; }
.rep-ageing { border-color: var(--brand); }
.rep-ageing-grid, .rep-trust { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.rep-ageing-grid > div, .rep-trust > div { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.rep-ageing-grid b, .rep-trust b { font-size: 24px; }
.rep-ageing-grid span, .rep-trust span { font-size: 13px; color: var(--ink-2); }
.rep-foot { margin-top: 8px; }
@media (max-width: 900px) { .rep-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .rep-tiles, .rep-ageing-grid, .rep-trust { grid-template-columns: minmax(0, 1fr); } }
@media print {
  @page { size: A4; margin: 12mm; }
  body:has(.rep) #header, body:has(.rep) .data-notice, .rep-tools, #toast { display: none !important; }
  body:has(.rep) { background: #fff; }
  .rep .card { box-shadow: none; break-inside: avoid; }
  .rep-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rep .table-scroll { overflow: visible; }
  .rep .chip { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
