@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&display=swap');

:root {
  color-scheme: light;
  --paper: #f8f5eb;
  --surface: #fffefa;
  --ink: #183b3e;
  --ink-soft: #526967;
  --line: #e5e0d4;
  --green: #234e52;
  --green-dark: #183b3e;
  --green-pale: #e7f0e8;
  --sun: #f2b134;
  --sun-pale: #fff1ca;
  --tomato-pale: #f9e6dc;
  --tomato: #aa4a31;
  --blue-pale: #e8edf8;
  --shadow: 0 18px 48px rgba(35, 78, 82, .08);
  font-family: "Atkinson Hyperlegible", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
* { box-sizing: border-box; }
body { min-width: 320px; margin: 0; background: var(--paper); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .58; cursor: wait; }
.container { width: min(1160px, calc(100% - 48px)); margin-inline: auto; }
.site-header { padding: 18px 0; border-bottom: 1px solid rgba(229, 224, 212, .75); background: rgba(255, 254, 250, .72); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 15px; color: var(--green); background: var(--sun); box-shadow: inset 0 -3px 0 rgba(120, 72, 0, .12); font-size: 23px; }
.brand strong { display: block; font-size: 1.05rem; line-height: 1.1; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 4px; color: var(--ink-soft); font-size: .78rem; }
.demo-flag { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid #e6ddc8; border-radius: 999px; color: #705520; background: #fff8e7; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.flag-dot { width: 8px; height: 8px; border-radius: 50%; background: #d39a23; }
main { padding-bottom: 44px; }
.home-main { padding-top: 12px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(320px, .78fr); align-items: center; gap: clamp(34px, 6vw, 82px); padding: 52px 0 54px; }
.eyebrow { margin: 0 0 12px; color: var(--green); font-size: .82rem; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; }
h1, h2, h3, h4, p { margin-top: 0; }
.hero h1 { max-width: 690px; margin-bottom: 16px; font-size: clamp(2.45rem, 5.5vw, 4.25rem); line-height: 1.02; letter-spacing: -.045em; }
.highlight { white-space: nowrap; background-image: linear-gradient(transparent 67%, rgba(242, 177, 52, .78) 67%); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.lead { max-width: 590px; margin-bottom: 23px; color: var(--ink-soft); font-size: 1.08rem; line-height: 1.65; }
.steps { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; color: var(--green); font-size: .86rem; font-weight: 700; }
.steps span { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid #d9e3d7; border-radius: 999px; background: rgba(255,255,255,.65); }
.steps b { color: #8c9b92; }
.login-card { padding: 25px; border: 1px solid rgba(220, 214, 201, .95); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.section-kicker { margin-bottom: 7px; color: #8b691c; font-size: .77rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.login-card h2 { margin-bottom: 8px; font-size: 1.35rem; letter-spacing: -.02em; }
.login-card > p, .muted { color: var(--ink-soft); line-height: 1.5; }
.login-card > p { margin-bottom: 20px; font-size: .91rem; }
.field-label { display: grid; gap: 7px; margin-bottom: 14px; font-size: .86rem; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #d8d9d1; border-radius: 10px; outline: none; color: var(--ink); background: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
textarea { resize: vertical; min-height: 72px; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: #8b9892; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(35, 78, 82, .13); }
input[type="radio"], input[type="checkbox"] { width: 18px; min-height: 18px; height: 18px; margin: 0; accent-color: var(--green); }
.form-message { min-height: 1.2em; margin: 9px 0 0; color: var(--tomato); font-size: .85rem; line-height: 1.4; }
.form-message:empty { display: none; }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 9px; padding: 10px 15px; border: 1px solid transparent; border-radius: 11px; font-size: .9rem; font-weight: 700; text-decoration: none; transition: background .15s ease, transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #d49923; outline-offset: 3px; }
.button-primary { color: white; background: var(--green); }
.button-primary:hover { background: var(--green-dark); box-shadow: 0 7px 17px rgba(35,78,82,.15); }
.button-soft { border-color: #cedbd1; color: var(--green); background: #f4f8f2; }
.button-soft:hover { border-color: #abc4b0; background: #eaf3e9; }
.button-danger { border-color: #ead4c9; color: #8f3825; background: #fff4ef; }
.button-danger:hover { background: #f8e6de; }
.button-ghost { border-color: var(--line); color: var(--ink-soft); background: transparent; }
.button-wide { width: 100%; margin-top: 6px; }
.button-small { min-height: 34px; padding: 6px 10px; font-size: .78rem; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.notice { display: flex; flex-direction: column; gap: 5px; padding: 13px 15px; border: 1px solid #dce4d8; border-radius: 13px; line-height: 1.45; }
.notice strong { font-size: .9rem; }
.notice span { color: inherit; font-size: .84rem; }
.notice-warm { border-color: #ecddba; color: #6c5424; background: #fff8e8; }
.notice-soft { border-color: #dce4d8; color: var(--green); background: #f1f6ef; }
.notice-success { border-color: #cfe0cf; color: #27603f; background: #edf7eb; }
.notice-error { border-color: #e8c9bc; color: #873d2c; background: #fff2ec; }
.notice .button { align-self: flex-start; margin-top: 6px; }
.home-main > .notice { margin-bottom: 28px; }
.section-block { padding: 31px 0 38px; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.03em; }
.section-heading > p { max-width: 390px; margin: 0; color: var(--ink-soft); font-size: .9rem; line-height: 1.5; }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.profile-card { padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 7px 22px rgba(35,78,82,.035); }
.profile-student { grid-row: span 2; }
.profile-title { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.emoji { display: grid; flex: 0 0 auto; width: 44px; height: 44px; place-items: center; border-radius: 14px; background: var(--green-pale); font-size: 23px; }
.profile-student .emoji { background: var(--sun-pale); }
.profile-title h3 { margin: 0 0 3px; font-size: 1.12rem; }
.profile-title small, .profile-card p { color: var(--ink-soft); }
.profile-title small { font-size: .78rem; }
.profile-card > p { margin: 0 0 15px; font-size: .89rem; line-height: 1.5; }
.account-card { margin-top: 10px; padding: 12px; border: 1px solid #e6e4dc; border-radius: 12px; background: #fff; }
.account-card > div:first-child strong { display: block; font-size: .88rem; line-height: 1.35; }
.account-card small { display: block; margin-top: 3px; color: var(--ink-soft); font-size: .76rem; line-height: 1.4; }
.account-credentials, .credentials-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0; color: #52635f; font-size: .76rem; }
.account-credentials span, .credentials-row span { display: inline-flex; gap: 5px; padding: 5px 7px; border-radius: 7px; background: #f1f2ec; }
.account-credentials b, .credentials-row b { color: var(--ink); }
.profile-student .button { margin-top: 4px; }
.site-footer { padding: 19px 0 27px; border-top: 1px solid var(--line); color: #6d7c75; font-size: .78rem; }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.footer-row p { margin: 0; line-height: 1.45; }
.login-page { display: grid; min-height: 68vh; align-items: center; padding-top: 34px; padding-bottom: 55px; }
.login-page-card { width: min(610px, 100%); margin: 0 auto; }
.login-page-card .profile-title { align-items: flex-start; margin: 18px 0 12px; }
.login-page-card h1 { margin: 3px 0 0; font-size: clamp(1.8rem, 4vw, 2.5rem); }
.login-page-card .notice { margin: 15px 0; }
.back-link { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font-size: .86rem; font-weight: 700; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.credentials-note { margin-top: 14px; color: var(--ink-soft); font-size: .83rem; }
.credentials-note code { padding: 3px 6px; border-radius: 5px; color: var(--ink); background: #eef1ea; font-family: inherit; font-weight: 700; }
.loading-state { display: grid; min-height: 65vh; place-items: center; color: var(--ink-soft); font-size: 1rem; }
.app-banner { padding: 9px 24px; color: #6b5424; background: #fff5da; text-align: center; font-size: .78rem; }
.app-layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); width: min(1440px, 100%); min-height: calc(100vh - 130px); margin: 0 auto; }
.sidebar { display: flex; flex-direction: column; gap: 16px; padding: 24px 16px; border-right: 1px solid var(--line); background: rgba(255,254,250,.58); }
.sidebar-profile { display: flex; align-items: center; gap: 10px; padding: 0 5px 14px; border-bottom: 1px solid var(--line); }
.sidebar-avatar { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 12px; background: var(--sun-pale); font-size: 20px; }
.sidebar-profile strong, .sidebar-profile small { display: block; }
.sidebar-profile strong { font-size: .9rem; }
.sidebar-profile small { max-width: 160px; margin-top: 3px; overflow: hidden; color: var(--ink-soft); font-size: .74rem; text-overflow: ellipsis; white-space: nowrap; }
.side-nav { display: grid; gap: 4px; }
.nav-link { display: flex; min-height: 43px; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: #4d625d; font-size: .84rem; text-decoration: none; transition: background .14s ease, color .14s ease; }
.nav-link:hover { background: #eef3eb; }
.nav-link.is-active { color: var(--green-dark); background: #e5efe4; font-weight: 700; }
.nav-link .emoji { width: 25px; height: 25px; border-radius: 8px; background: transparent; font-size: 17px; }
.logout-button { width: 100%; margin-top: auto; }
.app-main { min-width: 0; padding: 24px clamp(18px, 3vw, 38px) 30px; }
.mobile-nav { display: none; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-heading .eyebrow { margin-bottom: 4px; }
.page-heading h1 { margin: 0 0 4px; font-size: clamp(1.7rem, 3.4vw, 2.3rem); letter-spacing: -.035em; }
.page-heading p { margin-bottom: 0; font-size: .84rem; }
.page-date { padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-soft); background: rgba(255,255,255,.6); font-size: .77rem; white-space: nowrap; }
#page-content { display: grid; gap: 16px; }
.panel { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 5px 17px rgba(35,78,82,.025); }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.panel-heading h2 { margin: 0; font-size: 1.07rem; letter-spacing: -.015em; }
.panel-heading p { margin: 5px 0 0; color: var(--ink-soft); font-size: .8rem; line-height: 1.45; }
.panel > p:last-child { margin-bottom: 0; }
.menu-feature { overflow: hidden; border: 1px solid #e7e3d7; border-radius: 15px; background: #fff; }
.menu-feature-top { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px; background: linear-gradient(120deg, #f3f7ee, #fff8e5); }
.menu-feature-top h2 { margin: 10px 0 5px; font-size: 1.25rem; }
.menu-feature-top p { max-width: 520px; margin: 0; color: var(--ink-soft); line-height: 1.5; }
.menu-feature-top img, .meal-placeholder { display: grid; flex: 0 0 auto; width: 92px; height: 92px; place-items: center; object-fit: cover; border-radius: 15px; background: var(--sun-pale); font-size: 42px; }
.menu-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 15px 17px; }
.menu-details > div { display: grid; gap: 5px; }
.menu-details small { color: var(--ink-soft); font-size: .75rem; font-weight: 700; }
.menu-details strong { font-size: .87rem; font-weight: 400; line-height: 1.45; }
.answer-form h3, .acceptance-form h3 { margin-bottom: 5px; font-size: 1rem; }
.answer-form > p, .acceptance-form > p { color: var(--ink-soft); font-size: .84rem; }
.choice-grid, .portion-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.choice-card, .portion-option { position: relative; display: grid; gap: 6px; padding: 14px; border: 1px solid #dfe4da; border-radius: 13px; background: #fff; cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.choice-card:hover, .portion-option:hover { border-color: #abc4b0; transform: translateY(-1px); }
.choice-card.selected:has(input:checked), .portion-option:has(input:checked) { border-color: var(--green); background: #edf5eb; box-shadow: inset 0 0 0 1px var(--green); }
.choice-card input, .portion-option input { position: absolute; top: 12px; right: 12px; }
.choice-icon { font-size: 1.45rem; }
.choice-card strong, .portion-option strong { padding-right: 16px; font-size: .9rem; }
.choice-card small, .portion-option small { color: var(--ink-soft); font-size: .78rem; line-height: 1.4; }
.portion-choice { margin: 14px 0; }
.portion-choice[hidden] { display: none; }
.portion-choice h4 { margin-bottom: 9px; font-size: .91rem; }
.portion-option > span { font-size: 1.2rem; }
.small { font-size: .77rem !important; }
.acceptance-form { padding-top: 15px; border-top: 1px solid var(--line); }
.rating-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.rating-option { display: grid; place-items: center; gap: 4px; padding: 10px 6px; border: 1px solid var(--line); border-radius: 11px; background: white; cursor: pointer; }
.rating-option input { width: 15px; min-height: 15px; height: 15px; }
.rating-option span { font-size: 1.45rem; }
.rating-option small { color: var(--ink-soft); text-align: center; font-size: .69rem; }
.rating-option:has(input:checked) { border-color: var(--green); background: var(--green-pale); }
.badge-row { display: flex; flex-wrap: wrap; gap: 7px; }
.badge { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 8px; border-radius: 999px; color: #27603f; background: #eaf3e6; font-size: .72rem; font-weight: 700; line-height: 1.25; }
.badge-warm { color: #76591e; background: #fff1ce; }
.badge-red { color: #8d3b29; background: #fae8df; }
.badge-blue { color: #495c83; background: var(--blue-pale); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin: 12px 0; }
.stat-card { display: flex; min-height: 114px; flex-direction: column; justify-content: space-between; gap: 7px; padding: 14px; border: 1px solid #e2e5dc; border-radius: 14px; background: #fff; }
.stat-card > span { color: var(--ink-soft); font-size: .75rem; line-height: 1.35; }
.stat-card strong { font-size: clamp(1.45rem, 2.3vw, 2rem); line-height: 1; letter-spacing: -.04em; }
.stat-card small { color: #75847c; font-size: .72rem; line-height: 1.3; }
.stat-green strong { color: #27603f; }
.stat-red strong { color: var(--tomato); }
.stat-blue strong { color: #495c83; }
.recommendation { display: flex; align-items: baseline; gap: 10px; }
.recommendation strong, .metric-large { color: var(--green); font-size: clamp(3.3rem, 9vw, 5.2rem); line-height: 1; font-weight: 700; }
.recommendation span { color: var(--ink-soft); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 12px; color: var(--ink-soft); font-size: .74rem; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.legend-secondary { background: var(--sun); }
.bar-chart { display: flex; min-height: 150px; align-items: stretch; gap: 6px; overflow-x: auto; padding: 5px 2px 0; }
.bar-group { display: flex; flex: 1 0 28px; flex-direction: column; align-items: center; justify-content: end; gap: 7px; min-width: 28px; }
.bar-stack { display: flex; width: 100%; min-height: 114px; align-items: end; justify-content: center; gap: 3px; border-bottom: 1px solid #dde2d9; }
.bar { display: block; width: min(15px, 40%); min-height: 2px; border-radius: 4px 4px 0 0; }
.bar-primary { background: var(--green); }
.bar-secondary { background: var(--sun); }
.bar-group small { color: #7b8880; font-size: .64rem; }
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; min-width: 560px; border-collapse: collapse; text-align: left; }
th, td { padding: 10px 9px; border-bottom: 1px solid #ecebe4; vertical-align: middle; }
th { color: var(--ink-soft); font-size: .72rem; font-weight: 700; }
td { font-size: .82rem; line-height: 1.4; }
td small { display: block; margin-top: 3px; color: var(--ink-soft); font-size: .72rem; }
tbody tr:last-child td { border-bottom: 0; }
.empty-state { display: grid; justify-items: center; gap: 5px; padding: 26px 12px; border: 1px dashed #d8ded4; border-radius: 13px; color: var(--ink-soft); text-align: center; }
.empty-state > span { margin-bottom: 3px; font-size: 1.8rem; }
.empty-state strong { color: var(--ink); font-size: .94rem; }
.empty-state p { max-width: 420px; margin: 0; font-size: .82rem; line-height: 1.5; }
.points-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px; border: 1px solid #d4e1d4; border-radius: 17px; background: linear-gradient(120deg, #eaf4e8, #fff5d9); }
.points-hero h2 { margin: 0 0 6px; color: var(--green); font-size: 2.8rem; letter-spacing: -.04em; }
.points-hero p:last-child { margin: 0; color: var(--ink-soft); }
.points-rank { display: grid; justify-items: center; color: var(--green); font-size: 2.4rem; font-weight: 700; }
.points-rank small { font-size: .72rem; font-weight: 400; }
.progress-track { height: 12px; overflow: hidden; border-radius: 999px; background: #e9eee5; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #58855c, var(--green)); }
.rules-list { display: grid; gap: 10px; }
.rules-list > div { display: flex; align-items: center; gap: 10px; min-height: 40px; padding-bottom: 9px; border-bottom: 1px solid #eeece4; }
.rules-list > div:last-child { padding-bottom: 0; border-bottom: 0; }
.rules-list > div > span:nth-child(2) { flex: 1; font-size: .84rem; }
.rules-list small { display: block; margin-top: 3px; color: var(--ink-soft); font-size: .76rem; }
.steps-list { display: grid; gap: 13px; }
.steps-list > div { display: flex; align-items: flex-start; gap: 12px; }
.steps-list > div > b { display: grid; flex: 0 0 auto; width: 32px; height: 32px; place-items: center; border-radius: 10px; color: var(--green); background: var(--green-pale); }
.steps-list strong, .steps-list small { display: block; }
.steps-list small { margin-top: 4px; color: var(--ink-soft); font-size: .83rem; line-height: 1.45; }
.body-copy { color: var(--ink-soft); line-height: 1.65; }
.body-list { display: grid; gap: 8px; padding-left: 20px; color: var(--ink-soft); line-height: 1.5; }
.quick-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.quick-link { display: flex; min-height: 60px; align-items: center; gap: 8px; padding: 10px; border: 1px solid #dfe4da; border-radius: 12px; color: var(--green); background: #fff; font-size: .81rem; font-weight: 700; text-decoration: none; }
.quick-link:hover { background: #edf5eb; }
.quick-link > span:nth-child(2) { flex: 1; }
.record-card { padding: 13px; border: 1px solid #e5e5dc; border-radius: 13px; background: #fff; }
.record-summary { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.record-summary strong, .record-summary small { display: block; }
.record-summary strong { font-size: .88rem; line-height: 1.4; }
.record-summary small { margin-top: 3px; color: var(--ink-soft); font-size: .75rem; line-height: 1.4; }
details { margin-top: 10px; padding-top: 9px; border-top: 1px solid #eeece4; }
summary { width: fit-content; color: var(--green); font-size: .8rem; font-weight: 700; cursor: pointer; }
details > .button { margin-top: 10px; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px 12px; }
.form-grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-span { grid-column: 1 / -1; }
.form-grid .field-label { margin-bottom: 8px; }
.filter-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.filter-form .field-label { flex: 1 1 190px; margin: 0; }
.filter-form .button { flex: 0 0 auto; }
.forecast-list { display: grid; gap: 8px; }
.forecast-list > div { display: grid; grid-template-columns: minmax(150px, 1fr) auto; gap: 3px 12px; padding: 10px; border: 1px solid #e8e8df; border-radius: 10px; }
.forecast-list b { color: var(--green); }
.forecast-list small { grid-column: 1 / -1; color: var(--ink-soft); }
.progress-row { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid #eeece4; }
.progress-row > div:first-child { display: flex; justify-content: space-between; gap: 10px; }
.progress-row strong { font-size: .86rem; }
.progress-row b { color: var(--green); font-size: .82rem; }
.progress-row small { color: var(--ink-soft); font-size: .74rem; }
.app-footer { padding: 23px 0 5px; color: #728078; font-size: .76rem; text-align: center; }
.toast { position: fixed; z-index: 20; right: 18px; bottom: 18px; max-width: min(420px, calc(100% - 36px)); padding: 12px 16px; border: 1px solid #cfe0cf; border-radius: 12px; color: #27603f; background: #edf7eb; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(9px); transition: opacity .2s ease, transform .2s ease; }
.toast.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.toast-error { border-color: #e8c9bc; color: #873d2c; background: #fff2ec; }
hr { height: 1px; margin: 15px 0; border: 0; background: var(--line); }

@media (max-width: 980px) {
  .app-layout { grid-template-columns: 205px minmax(0, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .container { width: min(100% - 32px, 600px); }
  .site-header { padding: 14px 0; }
  .brand-mark { width: 39px; height: 39px; border-radius: 12px; }
  .brand strong { font-size: .95rem; }
  .brand small { font-size: .71rem; }
  .demo-flag { padding: 7px 9px; font-size: .72rem; }
  .hero { grid-template-columns: 1fr; gap: 25px; padding: 34px 0 35px; }
  .hero h1 { max-width: 570px; font-size: clamp(2.45rem, 10.5vw, 3.65rem); }
  .highlight { white-space: normal; }
  .lead { font-size: .99rem; }
  .login-card { padding: 20px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .profile-grid { grid-template-columns: 1fr; gap: 12px; }
  .profile-student { grid-row: auto; }
  .app-banner { padding-inline: 12px; font-size: .72rem; }
  .app-layout { display: block; min-height: 0; }
  .sidebar { display: none; }
  .app-main { padding: 16px 16px 25px; }
  .mobile-nav { display: flex; gap: 5px; overflow-x: auto; margin: 0 -16px 17px; padding: 0 16px 8px; scrollbar-width: thin; }
  .mobile-nav .nav-link { flex: 0 0 auto; min-height: 37px; padding: 6px 9px; border: 1px solid #e4e7dd; background: rgba(255,255,255,.7); font-size: .75rem; white-space: nowrap; }
  .mobile-nav .nav-link.is-active { border-color: #cbdcca; background: #e5efe4; }
  .mobile-nav .nav-link .emoji { width: 19px; height: 19px; font-size: 14px; }
  .page-heading { align-items: flex-start; margin-bottom: 15px; }
  .page-heading h1 { font-size: 1.7rem; }
  .page-heading .muted { font-size: .78rem; }
  .page-date { display: none; }
  #page-content { gap: 12px; }
  .panel { padding: 16px; border-radius: 14px; }
  .menu-details { grid-template-columns: 1fr; }
  .menu-feature-top { align-items: flex-start; padding: 13px; }
  .menu-feature-top img, .meal-placeholder { width: 70px; height: 70px; border-radius: 12px; font-size: 32px; }
  .menu-feature-top h2 { font-size: 1.05rem; }
  .choice-card, .portion-option { padding: 12px 10px; }
  .choice-card strong, .portion-option strong { font-size: .83rem; }
  .choice-card small, .portion-option small { font-size: .72rem; }
  .rating-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat-card { min-height: 100px; padding: 11px; }
  .stat-card strong { font-size: 1.5rem; }
  .quick-links { grid-template-columns: 1fr 1fr; }
  .form-grid-two { grid-template-columns: 1fr; }
  .field-span { grid-column: auto; }
  .filter-form { display: grid; grid-template-columns: 1fr; }
  .filter-form .button { width: 100%; }
  table { min-width: 650px; }
  .footer-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .points-hero h2 { font-size: 2.3rem; }
  .points-rank { font-size: 2rem; }
}
@media (max-width: 390px) {
  .container { width: calc(100% - 24px); }
  .steps { gap: 5px; font-size: .72rem; }
  .steps span { padding: 7px; }
  .app-main { padding-inline: 12px; }
  .mobile-nav { margin-inline: -12px; padding-inline: 12px; }
  .choice-grid, .portion-grid { gap: 7px; }
  .choice-card, .portion-option { padding: 11px 8px; }
  .choice-card input, .portion-option input { top: 9px; right: 8px; }
  .stat-card strong { font-size: 1.34rem; }
  .quick-links { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
@media print {
  .site-header, .site-footer, .sidebar, .mobile-nav, .app-banner, .button, .filter-form { display: none !important; }
  .app-layout { display: block; }
  .app-main { padding: 0; }
  .panel { break-inside: avoid; box-shadow: none; }
  body { background: #fff; }
}

.password-help { margin-top: 16px; color: var(--ink-soft); font-size: .84rem; line-height: 1.55; }
.access-link { margin: 14px 0 0; text-align: center; font-size: .84rem; }
.access-link a { color: var(--green); font-weight: 700; }
.activation-code-result { margin-top: 14px; }
.activation-code-result code { display: block; overflow-wrap: anywhere; margin: 8px 0; padding: 12px; border: 1px dashed #a9bfad; border-radius: 9px; color: var(--green-dark); background: #fff; font-size: 1rem; font-weight: 700; letter-spacing: .04em; }

.access-link { margin: 16px 0 0; text-align: center; font-size: .9rem; }
.access-link a { color: var(--green); font-weight: 700; text-underline-offset: 3px; }
.password-help { margin: 18px 0 0; color: var(--ink-soft); font-size: .86rem; line-height: 1.55; }
.activation-code-result { display: grid; gap: 10px; margin-top: 16px; }
.activation-code-result code { display: block; overflow-wrap: anywhere; padding: 14px; border: 1px dashed var(--green); border-radius: 12px; color: var(--green-dark); background: var(--surface); font-size: 1.12rem; font-weight: 700; letter-spacing: .03em; user-select: all; }
.activation-code-result span { line-height: 1.5; }

.pdt-class-list { display: grid; gap: 7px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.pdt-class-list legend { padding-inline: 5px; color: var(--ink); font-size: .86rem; font-weight: 700; }
.pdt-class-option { display: flex; align-items: flex-start; gap: 9px; padding: 8px 9px; border-radius: 9px; background: #f8f8f2; }
.pdt-class-option input { flex: 0 0 auto; margin-top: 2px; }
.pdt-class-option span { font-size: .82rem; line-height: 1.35; }
.attendance-status { min-width: 145px; }
.attendance-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.attendance-tools .field-label { flex: 1 1 170px; margin: 0; }
.pdt-student-actions { display: grid; gap: 8px; min-width: 220px; }
.pdt-student-actions details { margin: 0; padding: 0; border: 0; }
.pdt-student-actions summary { margin-bottom: 7px; }
.attendance-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.attendance-summary .badge { min-height: 30px; padding: 6px 10px; }
.pagination-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.pagination-row p { margin: 0; color: var(--ink-soft); font-size: .82rem; }
@media (max-width: 760px) {
  .pdt-student-actions { min-width: 190px; }
  .pagination-row { align-items: stretch; flex-direction: column; }
  .pagination-row .button-row { display: grid; grid-template-columns: 1fr 1fr; }
}

/* Login clarity, privacy information and mobile-friendly student preview */
input::placeholder, textarea::placeholder { color: #63736f; opacity: 1; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-links a, .access-help a, .privacy-summary a { color: var(--green-dark); font-weight: 700; text-underline-offset: 3px; }
.access-help { display: grid; gap: 7px; margin-top: 17px; padding-top: 13px; border-top: 1px solid var(--line); font-size: .85rem; line-height: 1.5; }
.access-help p { margin: 0; }
.home-explainer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr); align-items: center; gap: 24px; margin: 8px 0 25px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.home-explainer h2 { max-width: 520px; margin-bottom: 9px; font-size: clamp(1.35rem, 2.5vw, 1.9rem); line-height: 1.2; }
.home-explainer .muted { margin-bottom: 0; }
.sample-answer { padding: 18px; border: 1px solid #dfe4da; border-radius: 14px; background: #fff; }
.sample-answer > p { margin: 0 0 11px; color: var(--ink-soft); font-size: .78rem; font-weight: 700; }
.sample-answer h3 { margin: 0 0 12px; font-size: 1rem; }
.sample-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 11px; }
.sample-choices > span { padding: 10px 9px; border: 1px solid var(--line); border-radius: 10px; font-size: .82rem; line-height: 1.4; }
.sample-choices > span:first-child { border-color: #abc4b0; background: #edf5eb; }
.sample-answer small { color: var(--ink-soft); line-height: 1.45; }
.privacy-summary a { align-self: flex-start; margin-top: 5px; }
.privacy-page-card { display: grid; gap: 17px; }
.privacy-page-card h1 { margin: 2px 0 0; font-size: clamp(1.8rem, 4vw, 2.5rem); }
.privacy-page-card .lead { max-width: 70ch; margin-bottom: 0; }
.privacy-page-card section { padding-top: 16px; border-top: 1px solid var(--line); }
.privacy-page-card section h2 { margin-bottom: 8px; font-size: 1.1rem; }
.privacy-page-card section p { color: var(--ink-soft); line-height: 1.6; }
.privacy-page-card .notice { margin-top: 12px; }
@media (max-width: 760px) {
  .home-explainer { grid-template-columns: 1fr; gap: 16px; margin-top: 2px; padding: 17px; }
  .sample-choices { grid-template-columns: 1fr; }
  .steps b { display: none; }
  .access-help { text-align: left; }
  .footer-links { gap: 12px; }
}
