/* Alpha Gen · Crescent Public School — design tokens from the school logo */
:root{
  --green:#4cae3f; --green-d:#36882c; --green-t:#eaf6e6;
  --blue:#1f56a3; --blue-d:#163f7a; --blue-t:#e8eff9;
  --lime:#c3d52b; --yellow:#f3dc3a; --orange:#f39a1e; --orange-t:#fff2df;
  --ink:#17263b; --ink-2:#3b4a5f; --muted:#6a7687; --line:#e3e8e0; --line-2:#eef1ec;
  --bg:#f5f7f2; --card:#ffffff;
  --shine:#2f8f3a; --bloom:#7fae1f; --grow:#e98a12; --seed:#8a6fc7;
  --radius:16px; --radius-sm:11px;
  --shadow:0 1px 2px rgba(23,38,59,.05),0 6px 20px rgba(23,38,59,.06);
  --top:58px; --bottom:64px; --side:250px;
  --safe-b:env(safe-area-inset-bottom,0px);
  --c:var(--blue);
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
a,button,label,summary,input,select,textarea{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
body{margin:0;background:var(--bg);color:var(--ink);font:500 15px/1.5 Nunito,system-ui,-apple-system,"Segoe UI",sans-serif;min-height:100dvh;overflow-x:hidden}
a{color:var(--blue)}
img{max-width:100%}
h1,h2,h3{margin:0;line-height:1.2;font-weight:900;color:var(--ink)}
h1{font-size:clamp(1.35rem,2.4vw,1.8rem)}
h2{font-size:1.12rem}
h3{font-size:1rem}
p{margin:0}
.muted{color:var(--muted)}
.small{font-size:.85rem}
.hide{display:none!important}

/* ---------- App shell ---------- */
.sidebar{position:fixed;inset:0 auto 0 0;width:var(--side);background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column;padding:18px 14px;z-index:30}
.side-brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--ink);padding:4px 6px 18px;border-bottom:1px solid var(--line-2);margin-bottom:12px}
.side-brand img{width:46px;height:46px;object-fit:contain}
.side-brand b{display:block;font-size:1.15rem;font-weight:900;color:var(--blue)}
.side-brand small{display:block;font-size:.72rem;font-weight:800;color:var(--green-d);letter-spacing:.02em}
.side-nav{display:flex;flex-direction:column;gap:3px;flex:1}
.side-nav a{display:flex;align-items:center;gap:12px;padding:11px 12px;border-radius:12px;text-decoration:none;color:var(--ink-2);font-weight:800}
.side-nav a i{font-size:1.15rem;width:22px;text-align:center}
.side-nav a:hover{background:var(--line-2)}
.side-nav a.active{background:var(--blue-t);color:var(--blue)}
.side-user{display:flex;align-items:center;gap:8px;padding:12px 4px 0;border-top:1px solid var(--line-2)}
.side-user .who{flex:1;min-width:0}
.side-user b{display:block;font-size:.88rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.side-user small{display:block;font-size:.72rem;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.icon-btn{display:inline-grid;place-items:center;width:38px;height:38px;border-radius:11px;color:var(--ink-2);text-decoration:none;font-size:1.1rem;border:0;background:transparent;cursor:pointer}
.icon-btn:hover{background:var(--line-2)}
.topbar,.bottomnav{display:none}
.app .main{margin-left:var(--side);min-height:100dvh;padding:22px clamp(16px,3vw,32px) 28px}
.bare .main{min-height:100dvh}

/* tablet: icon rail */
@media (max-width:1100px) and (min-width:768px){
  :root{--side:84px}
  .sidebar{padding:16px 10px;align-items:center}
  .side-brand{padding:0 0 14px;justify-content:center}
  .side-brand span,.side-nav a span,.side-user .who{display:none}
  .side-nav a{justify-content:center;padding:13px;flex-direction:column;gap:2px}
  .side-nav a span{display:block;font-size:.62rem}
  .side-user{flex-direction:column}
}
/* phone: top bar + bottom tab bar */
@media (max-width:767px){
  .sidebar{display:none}
  .topbar{display:flex;position:sticky;top:0;z-index:30;height:var(--top);align-items:center;justify-content:space-between;padding:0 10px 0 14px;background:rgba(255,255,255,.94);backdrop-filter:blur(10px);border-bottom:1px solid var(--line)}
  .top-brand{display:flex;align-items:center;gap:8px;text-decoration:none;font-weight:900;color:var(--blue);font-size:1.05rem}
  .top-brand img{width:34px;height:34px;object-fit:contain}
  .bottomnav{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:30;height:calc(var(--bottom) + var(--safe-b));padding-bottom:var(--safe-b);background:#fff;border-top:1px solid var(--line)}
  .bottomnav a{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;text-decoration:none;color:var(--muted);font-size:.68rem;font-weight:800}
  .bottomnav a i{font-size:1.25rem}
  .bottomnav a.active{color:var(--blue)}
  .bottomnav a.active i{background:var(--blue-t);border-radius:20px;padding:1px 16px}
  .app .main{margin-left:0;min-height:calc(100dvh - var(--top));padding:16px 16px calc(var(--bottom) + var(--safe-b) + 18px)}
}

/* ---------- Layout helpers ---------- */
.page{max-width:1200px;margin:0 auto;display:flex;flex-direction:column;gap:18px}
.page.narrow{max-width:640px}
.page.mid{max-width:900px}
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;flex-wrap:wrap}
.page-head .eyebrow{margin-bottom:4px}
.eyebrow{font-size:.72rem;font-weight:900;letter-spacing:.1em;text-transform:uppercase;color:var(--green-d)}
.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.spread{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
.grid{display:grid;gap:16px}
.g2{grid-template-columns:repeat(2,minmax(0,1fr))}
.g3{grid-template-columns:repeat(3,minmax(0,1fr))}
.g4{grid-template-columns:repeat(4,minmax(0,1fr))}
.split{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:16px;align-items:start}
@media (max-width:1180px){.split{grid-template-columns:minmax(0,1fr)}}
@media (max-width:900px){.g3{grid-template-columns:minmax(0,1fr)}.g4{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:560px){.g2{grid-template-columns:minmax(0,1fr)}}

.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:18px;box-shadow:var(--shadow);min-width:0}
.card-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px;flex-wrap:wrap}
.card.flush{padding:0;overflow:hidden}
.empty{text-align:center;padding:34px 18px;display:flex;flex-direction:column;align-items:center;gap:8px}
.empty>i{font-size:2.2rem;color:var(--muted)}

/* ---------- Buttons ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:0 18px;border-radius:12px;border:1px solid transparent;background:var(--blue);color:#fff;font:800 .95rem Nunito,sans-serif;text-decoration:none;cursor:pointer;white-space:nowrap;transition:background .15s,transform .1s}
.btn:hover{background:var(--blue-d)}
.btn:active{transform:translateY(1px)}
.btn.green{background:var(--green)}.btn.green:hover{background:var(--green-d)}
.btn.orange{background:var(--orange)}.btn.orange:hover{background:#d9840f}
.btn.ghost{background:#fff;color:var(--ink);border-color:var(--line)}.btn.ghost:hover{background:var(--line-2)}
.btn.sm{min-height:36px;padding:0 13px;font-size:.85rem;border-radius:10px}
.btn.lg{min-height:52px;padding:0 24px;font-size:1.02rem}
.btn.block{width:100%}
.btn[disabled]{opacity:.45;cursor:not-allowed}

/* ---------- Pills, dots, avatars ---------- */
.pill{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border-radius:30px;font-size:.75rem;font-weight:800;white-space:nowrap}
.pill-new{background:#eef1f4;color:#55606e}
.pill-progress{background:var(--blue-t);color:var(--blue)}
.pill-review{background:var(--orange-t);color:#b4650a}
.pill-ready{background:var(--green-t);color:var(--green-d)}
.tier{display:inline-block;padding:2px 9px;border-radius:20px;font-size:.74rem;font-weight:800;color:#fff}
.tier-shine{background:var(--shine)}.tier-bloom{background:var(--bloom)}.tier-grow{background:var(--grow)}.tier-seed{background:var(--seed)}
.pill-done{background:#e3f1fb;color:#14628f}
.pill .bi{font-size:.85em}
.prog{display:inline-flex;align-items:center;gap:7px;font-size:.78rem;font-weight:700;color:var(--muted);white-space:nowrap}
.prog b{color:var(--ink)}
.prog .bar,.booth-tile .bar{display:block;width:64px;height:6px;border-radius:6px;background:var(--line-2);overflow:hidden}
.prog .bar span,.booth-tile .bar span{display:block;height:100%;background:var(--green);border-radius:6px}
.avatar{width:42px;height:42px;border-radius:50%;object-fit:cover;display:inline-grid;place-items:center;flex:none;background:linear-gradient(135deg,var(--green),var(--blue));color:#fff;font-weight:900;font-size:.9rem;font-style:normal}
.avatar.sm{width:34px;height:34px;font-size:.75rem}
.avatar.lg{width:76px;height:76px;font-size:1.4rem}
.avatar.xl{width:110px;height:110px;font-size:2rem;border-radius:24px}
.avatar.photo{width:52px;height:52px;border-radius:14px;font-size:1rem}
.chip{display:inline-flex;align-items:center;gap:6px;padding:5px 11px;border-radius:30px;background:var(--line-2);font-size:.8rem;font-weight:800;color:var(--ink-2)}
.chip.ok{background:#e3f1fb;color:#14628f}
.back{font-weight:800;text-decoration:none;font-size:.9rem;align-self:flex-start;padding:4px 0}

/* ---------- Dashboard ---------- */
.welcome{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.welcome h1{font-size:clamp(1.4rem,2.6vw,1.9rem)}
.stats{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}
.stat{display:flex;flex-direction:column;gap:2px;padding:16px;border-radius:var(--radius);background:#fff;border:1px solid var(--line);box-shadow:var(--shadow);text-decoration:none;color:var(--ink);transition:transform .12s,border-color .12s;min-width:0}
.stat:hover{transform:translateY(-2px);border-color:#cfd8cb}
.stat i{font-size:1.25rem;width:40px;height:40px;border-radius:12px;display:grid;place-items:center;margin-bottom:6px;background:var(--line-2);color:var(--ink-2)}
.stat b{font-size:1.7rem;font-weight:900;line-height:1.05}
.stat small{color:var(--muted);font-weight:800;font-size:.82rem;line-height:1.2}
.st-all i{background:var(--blue-t);color:var(--blue)}
.st-progress i{background:#eef1f4;color:#55606e}
.st-review i{background:var(--orange-t);color:#b4650a}
.st-ready i{background:var(--green-t);color:var(--green-d)}
.st-done i{background:#e3f1fb;color:#14628f}
@media (max-width:900px){.stats{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:560px){.stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.stats .st-all{grid-column:1/-1;flex-direction:row;align-items:center;gap:12px}.stats .st-all i{margin:0}.stat{padding:13px}}
.flag-strip{display:flex;align-items:center;gap:10px;padding:12px 16px;border-radius:14px;background:#fdeceb;color:#b2342e;font-weight:800;text-decoration:none}
.flag-strip .bi-chevron-right{margin-left:auto}
.card-head.pad{padding:16px 16px 4px;margin:0}
.card-head h2{display:flex;align-items:center;gap:8px}
.booth-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
@media (max-width:900px){.booth-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
.booth-tile{position:relative;display:flex;flex-direction:column;gap:8px;padding:14px;border-radius:14px;border:1px solid var(--line);background:#fff;text-decoration:none;color:var(--ink);transition:transform .12s,border-color .12s;min-width:0}
a.booth-tile:hover{transform:translateY(-2px);border-color:#cfd8cb}
.booth-tile .top{display:flex;align-items:center;gap:10px}
.booth-tile .bi-ic{width:38px;height:38px;border-radius:11px;display:grid;place-items:center;font-size:1.15rem;color:var(--blue);background:var(--blue-t);flex:none}
.booth-tile .no{font-size:.72rem;font-weight:900;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.booth-tile .nm{font-weight:900;font-size:.98rem;line-height:1.2;overflow-wrap:anywhere;hyphens:auto}
.booth-tile .meta{font-size:.8rem;color:var(--muted);font-weight:700}
.booth-tile .meta b{color:var(--ink)}
.booth-tile .bar{width:100%}
.booth-tile.done{border-color:#bfe0b8;background:#f6fbf4}
.booth-tile .check{margin-left:auto;color:var(--green);font-size:1.15rem}
.booth-tile .check.flag-dot{color:#d0453f}
.booth-tile.mine{border-color:var(--blue);box-shadow:0 0 0 1px var(--blue)}

/* ---------- Lists (children etc.) ---------- */
.list{display:flex;flex-direction:column}
.list-item{display:flex;align-items:center;gap:12px;padding:12px 14px 12px 16px;border-top:1px solid var(--line-2);text-decoration:none;color:var(--ink);min-width:0}
.list-item:first-child{border-top:0}
a.list-item:hover{background:#fafcf8}
.list-item .grow{flex:1;min-width:0}
.list-item .t{font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.list-item .s{font-size:.8rem;color:var(--muted);font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.list-item .end{display:flex;flex-direction:column;align-items:flex-end;gap:5px;flex:none}
.list-item .meta-row{display:flex;align-items:center;gap:8px;margin-top:4px;flex-wrap:wrap}
.list-item .chev{color:#b5bdc6;flex:none}
.list-item.hide{display:none}
.search{position:relative;flex:1;min-width:0;margin:0}
.search i{position:absolute;left:13px;top:50%;transform:translateY(-50%);color:var(--muted)}
.search input{padding-left:38px}
.tabs{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;padding-bottom:2px}
.tabs::-webkit-scrollbar{display:none}
.tabs a{flex:none;padding:9px 14px;border-radius:30px;background:#fff;border:1px solid var(--line);text-decoration:none;color:var(--ink-2);font-weight:800;font-size:.85rem}
.tabs a span{display:inline-block;min-width:20px;padding:0 6px;margin-left:4px;border-radius:10px;background:var(--line-2);font-size:.75rem;text-align:center}
.tabs a.active{background:var(--ink);border-color:var(--ink);color:#fff}
.tabs a.active span{background:rgba(255,255,255,.2)}
@media (max-width:767px){.tabs{margin:0 -16px;padding:0 16px 2px}}
@media (min-width:768px){.tabs{flex-wrap:wrap}}

/* ---------- Forms ---------- */
label,.label{display:block;font-weight:800;font-size:.88rem;margin:0 0 6px;color:var(--ink-2)}
input,select,textarea{width:100%;min-height:46px;padding:10px 13px;border:1.5px solid var(--line);border-radius:12px;background:#fff;font:600 1rem Nunito,sans-serif;color:var(--ink);outline:none;transition:border-color .15s,box-shadow .15s}
textarea{min-height:96px;resize:vertical;line-height:1.45}
input:focus,select:focus,textarea:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(31,86,163,.12)}
.field{margin-bottom:14px}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px}
.form-grid .full{grid-column:1/-1}
@media (max-width:620px){.form-grid{grid-template-columns:minmax(0,1fr)}}
.alert{padding:11px 14px;border-radius:12px;background:#fdecef;color:#a3233f;font-weight:700;display:flex;gap:8px;align-items:flex-start}
.alert.ok{background:var(--green-t);color:var(--green-d)}
.alert.info{background:var(--blue-t);color:var(--blue-d)}

/* ---------- Toast ---------- */
.toast{position:fixed;left:50%;top:16px;transform:translateX(-50%);z-index:60;background:var(--ink);color:#fff;padding:11px 18px;border-radius:14px;font-weight:800;box-shadow:0 10px 30px rgba(0,0,0,.2);display:flex;gap:8px;align-items:center;transition:opacity .4s,transform .4s;max-width:calc(100vw - 32px)}
.toast i{color:#8fe07f}
.toast.hide{opacity:0;transform:translate(-50%,-12px);pointer-events:none}

/* ---------- Child header / profile ---------- */
.child-bar{display:flex;align-items:center;gap:12px;min-width:0}
.child-bar .grow{min-width:0}
.child-bar .nm{font-weight:900;font-size:1.05rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.child-bar .sub{font-size:.8rem;color:var(--muted);font-weight:700}
.profile{display:flex;gap:18px;align-items:center;flex-wrap:wrap}
.profile .info{flex:1;min-width:200px}
.kv{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px 18px;margin-top:10px}
.kv div small{display:block;color:var(--muted);font-weight:800;font-size:.72rem;text-transform:uppercase;letter-spacing:.06em}
.kv div b{font-weight:800}

/* ---------- Booth: picker ---------- */
.booth-hero{display:flex;align-items:center;gap:14px;padding:16px 18px;border-radius:18px;background:#fff;border:1px solid var(--line)}
.booth-hero .bi-ic{width:52px;height:52px;border-radius:15px;display:grid;place-items:center;font-size:1.5rem;color:#fff;background:var(--c);flex:none}
.booth-hero .no{font-size:.72rem;font-weight:900;letter-spacing:.1em;color:var(--muted)}
.booth-hero h1{font-size:clamp(1.2rem,2.2vw,1.55rem)}
.booth-hero p{color:var(--ink-2);font-size:.9rem;margin-top:2px}
.picker{max-height:min(62dvh,560px);overflow:auto}

/* ---------- Booth: wizard ---------- */
.wizard{--c:var(--blue);display:flex;flex-direction:column;gap:14px;max-width:880px;margin:0 auto}
.wz-top{display:flex;align-items:center;gap:12px;justify-content:space-between;flex-wrap:wrap}
.stepper{display:flex;gap:6px;flex-wrap:wrap}
.stepper button{width:34px;height:34px;border-radius:50%;border:2px solid var(--line);background:#fff;font:900 .85rem Nunito;color:var(--muted);cursor:pointer;display:grid;place-items:center}
.stepper button.cur{border-color:var(--c);color:#fff;background:var(--c)}
.stepper button.ok{border-color:var(--c);color:var(--c)}
.stepper button.bad{border-color:#e05a5a;color:#e05a5a}
.wz-progress{height:6px;border-radius:6px;background:var(--line-2);overflow:hidden}
.wz-progress span{display:block;height:100%;background:var(--c);transition:width .25s}
.step{display:flex;flex-direction:column;gap:12px}
.js .step{display:none}
.js .step.cur{display:flex}
.step-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;flex-wrap:wrap}
.step-head .k{font-size:.72rem;font-weight:900;letter-spacing:.1em;color:var(--c);text-transform:uppercase}
.step-head h2{font-size:1.3rem}
.legend{font-size:.8rem;color:var(--muted);font-weight:700;background:var(--line-2);padding:7px 11px;border-radius:10px}
.tag{display:inline-block;font-size:.68rem;font-weight:900;padding:1px 7px;border-radius:6px;margin-right:6px;vertical-align:2px}
.tag-F{background:#e1f4f1;color:#0b7d72}.tag-A{background:#fff0d6;color:#a86400}
.q{background:#fff;border:1px solid var(--line);border-radius:14px;padding:14px}
.q.missing{border-color:#e98a8a;box-shadow:0 0 0 3px rgba(224,90,90,.1)}
.q-label{font-weight:800;margin-bottom:10px;font-size:.98rem}
.seg{display:flex;gap:8px;flex-wrap:wrap}
.seg label{margin:0;flex:1 1 0;min-width:64px;cursor:pointer}
.seg input{position:absolute;opacity:0;width:1px;height:1px;min-height:0}
.seg span{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:50px;padding:6px 8px;border:1.5px solid var(--line);border-radius:12px;font-weight:900;font-size:.95rem;color:var(--ink-2);text-align:center;line-height:1.15;transition:all .12s;background:#fff}
.seg span small{font-size:.66rem;font-weight:800;color:var(--muted);margin-top:2px}
.seg label:hover span{border-color:#9db3d6}
.seg input:checked+span{background:var(--c);border-color:var(--c);color:#fff}
.seg input:checked+span small{color:rgba(255,255,255,.85)}
.seg input:focus-visible+span{box-shadow:0 0 0 3px rgba(31,86,163,.25)}
.seg.multi input:checked+span::before{content:"✓ ";}
.seg.wide label{flex:1 1 140px}
.wz-foot{position:sticky;bottom:0;z-index:5;display:flex;gap:10px;justify-content:space-between;align-items:center;padding:12px 0 4px;background:linear-gradient(to top,var(--bg) 75%,rgba(245,247,242,0))}
@media (max-width:767px){.wz-foot{bottom:calc(var(--bottom) + var(--safe-b))}}
.wz-foot .btn{flex:1;max-width:240px}
.no-js-save{margin-top:8px}
.js .no-js-save{display:none}
.total-badge{font-weight:900;color:var(--c)}
.summary-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:8px}
.summary-list div{display:flex;justify-content:space-between;gap:8px;padding:8px 11px;border-radius:10px;background:var(--line-2);font-size:.85rem;font-weight:700}
.summary-list div b{white-space:nowrap}
details.drawer{background:#fff;border:1px solid var(--line);border-radius:14px}
details.drawer summary{cursor:pointer;padding:12px 16px;font-weight:900;list-style:none;display:flex;justify-content:space-between;align-items:center}
details.drawer summary::-webkit-details-marker{display:none}
details.drawer summary::after{content:"\F282";font-family:bootstrap-icons;transition:transform .2s}
details.drawer[open] summary::after{transform:rotate(180deg)}
details.drawer .inner{padding:0 16px 14px}
.instructions{margin:0;padding-left:20px;font-size:.88rem;color:var(--ink-2)}
.instructions li{margin:3px 0}

/* ---------- Results (review / profile) ---------- */
.res-booth{--c:var(--blue);border:1px solid var(--line);border-radius:14px;background:#fff;overflow:hidden}
.res-booth>summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:12px;padding:12px 14px}
.res-booth>summary::-webkit-details-marker{display:none}
.res-booth .bi-ic{width:38px;height:38px;border-radius:11px;display:grid;place-items:center;color:#fff;background:var(--c);flex:none}
.res-booth .grow{flex:1;min-width:0}
.res-booth .t{font-weight:900}
.res-booth .s{font-size:.8rem;color:var(--muted);font-weight:700}
.res-body{padding:4px 14px 14px;border-top:1px solid var(--line-2)}
.res-sec{margin-top:10px}
.res-sec h4{margin:0 0 6px;font-size:.78rem;text-transform:uppercase;letter-spacing:.08em;color:var(--c)}
.res-row{display:flex;justify-content:space-between;gap:12px;padding:6px 0;border-bottom:1px dashed var(--line-2);font-size:.9rem}
.res-row:last-child{border-bottom:0}
.res-row b{text-align:right;flex:none;max-width:55%}
.res-row b.txt{font-weight:600;max-width:60%}
.remarks{margin-top:10px;padding:10px 12px;border-radius:10px;background:var(--orange-t);font-size:.9rem}
.internal-badge{font-size:.66rem;font-weight:900;color:#8a5a00;background:#ffefc7;padding:1px 6px;border-radius:5px;margin-left:6px;letter-spacing:.04em}

/* ---------- Tables ---------- */
.table-wrap{overflow-x:auto}
table{width:100%;border-collapse:collapse;font-size:.9rem}
th,td{text-align:left;padding:10px 12px;border-bottom:1px solid var(--line-2);vertical-align:middle}
th{font-size:.72rem;text-transform:uppercase;letter-spacing:.07em;color:var(--muted);font-weight:900}

/* ---------- Login ---------- */
.login-wrap{min-height:100dvh;display:grid;grid-template-columns:1.1fr 1fr}
.login-art{background:linear-gradient(150deg,#f3f9ee 0%,#e9f2fb 100%);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;padding:32px;text-align:center;position:relative;overflow:hidden}
.login-art::before{content:"";position:absolute;width:480px;height:480px;border-radius:50%;border:22px solid rgba(76,174,63,.12);left:-160px;bottom:-200px}
.login-art img{width:min(300px,60%);position:relative}
.login-art p{max-width:380px;color:var(--ink-2);font-weight:700;position:relative}
.login-form{display:flex;align-items:center;justify-content:center;padding:32px 20px;background:#fff}
.login-form .box{width:100%;max-width:380px}
@media (max-width:820px){
  .login-wrap{grid-template-columns:1fr;grid-template-rows:auto 1fr}
  .login-art{padding:28px 20px 18px}
  .login-art img{width:150px}
  .login-art p{font-size:.9rem}
  .login-art::before{display:none}
  .login-form{align-items:flex-start;padding-top:22px;border-radius:24px 24px 0 0;margin-top:-14px;position:relative}
}

/* ---------- Photo capture (register) ---------- */
.photo-box{display:flex;gap:14px;align-items:center;flex-wrap:wrap}
.photo-prev{width:96px;height:96px;border-radius:22px;background:var(--line-2);display:grid;place-items:center;overflow:hidden;flex:none;color:var(--muted);font-size:2rem}
.photo-prev img{width:100%;height:100%;object-fit:cover}
.sr-file{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden;pointer-events:none;min-height:0;padding:0;border:0}
.camera{display:none;margin-top:12px}
.camera.on{display:block}
.camera video{width:100%;max-width:420px;max-height:60dvh;object-fit:cover;border-radius:14px;background:#111;display:block;margin-bottom:10px}

/* ---------- Report ---------- */
.report{max-width:900px;margin:0 auto;background:#fff;border-radius:20px;border:1px solid var(--line);box-shadow:var(--shadow);overflow:hidden}
.report-cover{padding:28px 30px 22px;text-align:center;background:linear-gradient(160deg,#f5faef,#eef4fb);border-bottom:4px solid var(--green)}
.report-cover img{width:110px}
.report-cover .school{font-weight:900;letter-spacing:.12em;color:var(--blue);font-size:.85rem;margin-top:6px}
.report-cover h1{font-size:clamp(1.6rem,3.4vw,2.2rem);color:var(--green-d);margin:6px 0 2px}
.report-cover .tag-line{font-weight:800;color:var(--ink-2)}
.report-body{padding:24px 30px 30px;display:flex;flex-direction:column;gap:22px}
.report h2{color:var(--blue);font-size:1.2rem;margin-bottom:8px;display:flex;align-items:center;gap:8px}
.report p{line-height:1.65}
.rep-child{display:flex;gap:16px;align-items:center;flex-wrap:wrap}
.rep-booths{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:10px}
@media (max-width:600px){.rep-booths{grid-template-columns:repeat(2,minmax(0,1fr))}.report-body{padding:18px}.report-cover{padding:22px 18px}}
.rep-booths div{--c:var(--blue);padding:9px 10px;border-radius:12px;background:var(--blue-t);border:1px solid var(--line);font-size:.8rem;font-weight:800}
.rep-booths div i{color:var(--c);margin-right:4px}
.rep-booth{--c:var(--blue);border-left:4px solid var(--c);padding:4px 0 4px 14px;margin-bottom:14px;break-inside:avoid}
.rep-booth h3{color:var(--c);margin-bottom:4px}
.rep-box{padding:16px 18px;border-radius:14px;break-inside:avoid}
.rep-box.strength{background:var(--green-t)}
.rep-box.nurture{background:var(--orange-t)}
.rep-box.expert{background:var(--blue-t)}
.rep-box ul{margin:8px 0;padding-left:20px}
.rep-box h4{margin:10px 0 4px}
.draft-banner{background:#fff4d6;color:#8a5a00;font-weight:800;padding:10px 16px;text-align:center}
.disclaimer{font-size:.78rem;color:var(--muted);border-top:1px solid var(--line);padding-top:12px}

@media print{
  @page{size:A4;margin:12mm}
  body{background:#fff;font-size:12px}
  .sidebar,.topbar,.bottomnav,.no-print,.toast{display:none!important}
  .app .main{margin:0;padding:0}
  .report{border:0;box-shadow:none;border-radius:0;max-width:none}
  .report-cover,.rep-box,.rep-booths div{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .rep-booth,.rep-box{page-break-inside:avoid}
}

/* wide screens: question + answers on one line to minimise scrolling */
@media (min-width:900px){
  .q.inline{display:grid;grid-template-columns:minmax(0,1fr) minmax(300px,48%);align-items:center;gap:14px;padding:10px 14px}
  .q.inline .q-label{margin:0}
  .q.inline .seg span{min-height:44px}
}
.area-list{margin:8px 0;padding-left:18px;line-height:1.6}.area-list li{margin:3px 0}

@media (max-width:767px){
  .welcome{flex-direction:column;align-items:stretch;gap:12px}
  .welcome h1{font-size:1.35rem}
  .welcome .actions .btn{width:100%}
  .stat b{font-size:1.45rem}
  .card{padding:14px}
  .booth-tile{padding:12px}
  .booth-tile .bi-ic{width:34px;height:34px;font-size:1.05rem}
  .page{gap:14px}
  .child-bar .sub{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .wz-top{gap:8px}
  .step-head h2{font-size:1.15rem}
}

/* scorecard + red flag */
.scorecard{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.scorecard div{background:#fff;border:1px solid var(--line);border-radius:12px;padding:10px 12px}
.scorecard small{display:block;font-size:.72rem;font-weight:800;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}
.scorecard b{font-size:1.15rem;font-weight:900;color:var(--c)}
.flagbox{border-style:dashed}
.flagbox.on{border-color:#d0453f;background:#fff6f5}
.switch{display:flex;gap:12px;align-items:flex-start;cursor:pointer;margin:0}
.switch input{position:absolute;opacity:0;width:1px;height:1px;min-height:0}
.switch .track{flex:none;width:46px;height:26px;border-radius:20px;background:#d5dae0;position:relative;transition:background .2s;margin-top:2px}
.switch .track::after{content:"";position:absolute;left:3px;top:3px;width:20px;height:20px;border-radius:50%;background:#fff;transition:transform .2s;box-shadow:0 1px 3px rgba(0,0,0,.2)}
.switch input:checked+.track{background:#d0453f}
.switch input:checked+.track::after{transform:translateX(20px)}
.switch input:focus-visible+.track{box-shadow:0 0 0 3px rgba(208,69,63,.25)}
.switch b{display:block;color:#b2342e}
.switch small{display:block;color:var(--muted);font-weight:700;font-size:.8rem;margin-top:2px}
.flag-suggest{margin-top:10px;padding:8px 11px;border-radius:10px;background:#fff4d6;color:#8a5a00;font-size:.85rem;font-weight:700}
.pill-flag{background:#fdeceb;color:#b2342e}
.flag-dot{color:#d0453f}

/* at-a-glance score bars */
.glance{display:flex;flex-direction:column;gap:8px}
.gl-row{display:grid;grid-template-columns:130px minmax(0,1fr) 92px 200px;align-items:center;gap:12px;padding:6px 0;border-bottom:1px dashed var(--line-2)}
.gl-name{font-weight:800;font-size:.9rem;white-space:nowrap}
.gl-name i{color:var(--c)}
.gl-bar{position:relative;height:12px;border-radius:8px;background:var(--line-2)}
.gl-bar .fill{position:absolute;left:0;top:0;bottom:0;border-radius:8px;background:var(--c)}
.gl-bar .mark{position:absolute;top:-5px;bottom:-5px;width:3px;margin-left:-1px;border-radius:2px;background:var(--ink)}
.gl-score{font-size:.85rem;font-weight:700;line-height:1.1}
.gl-score b{font-size:1.05rem}
.gl-score small{display:block;color:var(--muted);font-size:.72rem}
.gl-level{display:flex;gap:5px;flex-wrap:wrap}
.gl-key{display:flex;align-items:center;gap:6px;margin-top:4px}
.gl-key .kfill{width:18px;height:8px;border-radius:5px;background:var(--blue)}
.gl-key .kmark{width:3px;height:14px;background:var(--ink);margin-left:12px;border-radius:2px}
@media (max-width:700px){
  .gl-row{grid-template-columns:minmax(0,1fr) auto;gap:6px 10px}
  .gl-bar{grid-column:1/-1;order:3}
  .gl-level{grid-column:1/-1;order:4}
}
/* report areas */
.rep-area{--c:var(--blue);border:1px solid var(--line);border-left:5px solid var(--c);border-radius:14px;padding:14px 16px;margin-bottom:12px;break-inside:avoid}
.rep-area-head{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:6px}
.rep-area h3{color:var(--c);display:flex;gap:8px;align-items:center}
.rep-cols{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:10px}
@media (max-width:600px){.rep-cols{grid-template-columns:minmax(0,1fr)}}
.rep-cols div{background:var(--line-2);border-radius:10px;padding:9px 11px;font-size:.88rem}
.rep-cols b{display:block;font-size:.75rem;text-transform:uppercase;letter-spacing:.06em;color:var(--ink-2);margin-bottom:3px}
.rep-cols ul{margin:0;padding-left:17px}
.rep-note{margin-top:8px;font-size:.88rem;font-style:italic;color:var(--ink-2)}
.howto{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
@media (max-width:700px){.howto{grid-template-columns:minmax(0,1fr)}}
.howto div{background:var(--line-2);border-radius:12px;padding:10px 12px;font-size:.85rem}
.howto b{display:block;margin-bottom:2px}
.sign{display:flex;justify-content:space-between;gap:20px;flex-wrap:wrap;margin-top:18px}
.sign div{min-width:180px;border-top:1.5px solid var(--ink-2);padding-top:6px;font-size:.82rem;font-weight:800;color:var(--ink-2)}
.pdf-mode .report{border:0;box-shadow:none;border-radius:0}

/* report hand-over */
.handover{display:flex;align-items:center;gap:14px;padding:14px 16px;border-radius:14px;background:#fff;border:1px solid var(--line);flex-wrap:wrap}
.handover>i{font-size:1.4rem;color:#14628f;width:42px;height:42px;border-radius:12px;background:#e3f1fb;display:grid;place-items:center;flex:none}
.handover .grow{flex:1;min-width:200px}
.handover b{display:block}
.handover span{font-size:.88rem;color:var(--muted);font-weight:700}
.topbar .btn.sm{min-height:36px}
@media (max-width:767px){
  .bottomnav a{font-size:.64rem;min-width:0}
  .bottomnav a span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
  .list-item{padding:12px}
  .list-item .end .pill{font-size:.7rem;padding:3px 8px}
}
/* dashboard: button + widgets only */
.main-action{align-self:flex-start;min-width:280px}
@media (max-width:767px){
  .app .main{padding-left:12px;padding-right:12px;padding-top:12px}
  .dash{gap:12px}
  .main-action{align-self:stretch;min-width:0;min-height:56px;font-size:1.05rem}
  .dash .stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .dash .stat{flex-direction:row;align-items:center;gap:10px;padding:12px;box-shadow:none}
  .dash .stat i{margin:0;width:38px;height:38px;flex:none}
  .dash .stat b{font-size:1.4rem}
  .dash .stat small{font-size:.76rem}
  .dash .stats .st-all{grid-column:1/-1}
  .dash .stats .st-all small{font-size:.85rem}
  .dash>.card{padding:12px;box-shadow:none}
  .dash .booth-grid{gap:8px}
  .dash .booth-tile{padding:11px;gap:6px}
  .dash .booth-tile .bi-ic{width:30px;height:30px;font-size:.95rem;border-radius:9px}
  .dash .booth-tile .nm{font-size:.9rem}
  .dash .booth-tile .meta{font-size:.74rem}
}
/* staff page: inline manage + password */
.staff-row{border-top:1px solid var(--line-2)}
.staff-row:first-child{border-top:0}
.staff-row.off{opacity:.6}
.staff-row>summary{list-style:none;cursor:pointer;border-top:0}
.staff-row>summary::-webkit-details-marker{display:none}
.staff-row[open]>summary{background:#fafcf8}
.staff-panel{display:flex;gap:8px;flex-wrap:wrap;padding:4px 16px 14px 62px;background:#fafcf8}
.pw-form{display:flex;gap:8px;flex:1 1 300px;min-width:0}
.pw-form input{min-height:36px;padding:6px 11px;font-size:.95rem}
@media (max-width:560px){.staff-panel{padding:4px 12px 12px}.staff-row .lbl{display:none}}
.st-m{display:none}
@media (max-width:560px){.list-item .end{display:none}.st-m{display:inline-flex}.list-item .meta-row{gap:6px 8px}}
.booth-tile .bar{margin-top:auto}

/* In-page camera: full screen on phones & tablets, inline on desktop */
.camera .cam-bar{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
@media (max-width:900px),(pointer:coarse){
  .camera.on{position:fixed;inset:0;z-index:100;background:#000;display:flex;flex-direction:column;margin:0;padding:env(safe-area-inset-top,0) 0 0}
  .camera.on video{flex:1 1 auto;width:100%;max-width:none;max-height:none;height:0;min-height:0;border-radius:0;margin:0;object-fit:contain;background:#000}
  .camera .cam-bar{justify-content:space-between;flex-wrap:nowrap;padding:14px 16px calc(14px + env(safe-area-inset-bottom,0))}
  .camera .cam-bar .btn.ghost{background:rgba(255,255,255,.16);color:#fff;border-color:transparent}
  .camera .cam-bar{gap:8px}
  .camera .cam-bar .btn{flex:0 0 auto;padding-left:14px;padding-right:14px}
  .camera .cam-bar #snap{flex:1 1 auto;min-width:0;max-width:240px;justify-content:center}
  .camera .cam-bar #flip .lbl{display:none}
  body.cam-open{overflow:hidden}
}
