:root { --g: #2F4A2B; --g2: #E8EBD8; --ink: #1d2a24; --mute: #5A5444; --line: #C3B091; --warn: #b4531a; --bad: #b3261e; --bg: #F4EEDC; --gold: #B8862B; --on-gold: #1d2a24; --card: #fff; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 17px/1.5 system-ui, -apple-system, "Noto Sans Thai", "Thonburi", "Sarabun", sans-serif; color: var(--ink); background: var(--bg); }
#app { max-width: 720px; margin: 0 auto; padding: 0 12px 96px; }
header.top { position: sticky; top: 0; z-index: 5; background: var(--g); color: #fff; margin: 0 -12px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; }
header.top img.logo { width: 38px; height: 38px; border-radius: 50%; flex: none; background: #fff; }
header.top h1 { font-size: 17px; margin: 0; flex: 1; line-height: 1.25; font-weight: 600; }
header.top small { display: block; font-weight: 400; opacity: .85; font-size: 13px; }
header.top button { background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.35); font-weight: 400; padding: 8px 12px; border-radius: 8px; font: inherit; font-size: 14px; min-height: 40px; }
h2 { font-size: 19px; margin: 20px 0 8px; }
h3 { font-size: 16px; margin: 16px 0 6px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.card.tap { display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.card.tap:active { background: var(--g2); }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--mute); font-size: 14px; }
.badge { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: 13px; background: var(--g2); color: var(--g); }
.badge.guide { background: #fbe9f1; color: #9b2a62; }
.badge { border: 1px solid var(--line); }
.badge.warn { background: #fff0e0; color: var(--warn); }
.bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; background: var(--g); }
.bar.full > i { background: var(--warn); }
button, .btn { font: inherit; font-weight: 600; min-height: 44px; padding: 8px 16px; border-radius: 10px; border: 1px solid #8F6416; background: var(--gold); color: var(--on-gold); cursor: pointer; }
button.ghost { background: #fff; color: var(--g); border-color: var(--g); font-weight: 400; }
button.danger { background: #fff; color: var(--bad); border-color: var(--bad); }
button.small { min-height: 36px; padding: 4px 12px; font-size: 15px; }
button:disabled { opacity: .45; cursor: default; }
input, select { font: inherit; width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
label { display: block; font-size: 14px; color: var(--mute); margin: 10px 0 4px; }
.tabs { display: flex; gap: 6px; margin: 12px 0; overflow-x: auto; }
.tabs button { flex: 1; white-space: nowrap; background: #fff; color: var(--ink); border-color: var(--line); font-weight: 400; }
.tabs button.on { background: var(--g); color: #fff; border-color: var(--g); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.pills button { font-weight: 400; background: #fff; color: var(--ink); border-color: var(--line); min-width: 64px; }
.pills button.on { background: var(--g); color: #fff; border-color: var(--g); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 99px; background: var(--g2); color: var(--g); margin: 3px 4px 3px 0; font-size: 15px; border: 0; min-height: 36px; }
.chip.x::after { content: "\00d7"; font-weight: 700; margin-left: 2px; }
.list { margin: 8px 0; }
.item { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 6px 0; display: flex; align-items: center; gap: 10px; }
.item.off { opacity: .5; }
.no { min-width: 58px; font-weight: 600; color: var(--g); }
.err { color: var(--bad); margin: 8px 0; }
.ok { color: var(--g); }
.warnbox { background: #fff0e0; border: 1px solid #f0c9a0; color: #7a3a0b; border-radius: 10px; padding: 8px 12px; margin: 8px 0; font-size: 15px; }
.banner { background: #fff0e0; color: #7a3a0b; margin: 0 -12px; padding: 8px 14px; font-size: 15px; }
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet > div { background: var(--bg); width: 100%; max-width: 720px; max-height: 92vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 14px 14px calc(18px + env(safe-area-inset-bottom)); }
.sheet .head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.sheet .head h2 { margin: 0; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; font-size: 15px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { background: var(--g2); color: var(--g); font-weight: 600; }
td.num, th.num { text-align: right; }
.login { max-width: 420px; margin: 8vh auto 0; }
.login { text-align: center; }
.login img { width: 96px; height: 96px; border-radius: 50%; display: block; margin: 0 auto 10px; box-shadow: 0 0 0 3px var(--line); }
.login h1 { font-size: 21px; margin: 0 0 2px; color: var(--g); }
.login .school { font-weight: 600; }
.login label, .login .err { text-align: left; }
#toast { position: fixed; left: 50%; top: 64px; pointer-events: none; transform: translateX(-50%) translateY(-160px); background: #24342c; color: #fff; padding: 10px 18px; border-radius: 99px; transition: transform .2s; z-index: 50; max-width: 90vw; text-align: center; font-size: 15px; }
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.bad { background: var(--bad); }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { min-width: 40px; padding: 0; }
.stepper input { width: 64px; text-align: center; }
.sm-in { width: 90px; }
@media (min-width: 640px) { .sheet { align-items: center; } .sheet > div { border-radius: 18px; } }
