:root{color-scheme:light;--blue:#182e7c;--mid:#3652a5;--red:#ce333c;--bg:#f6f8fb;--ink:#1e2b43;--muted:#687690;--line:#dde4ef;--card:#fff;--shadow:0 4px 18px #24315e0d}*{box-sizing:border-box}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--ink);font-size:15px}h1,h2,h3,p{margin:0}h1{font-size:29px;margin:8px 0}h2{font-size:24px;letter-spacing:-.03em;margin-bottom:6px}h3{font-size:16px;margin-bottom:10px}p{line-height:1.5}button,input,select,textarea{font:inherit}button{cursor:pointer;border:0}button:disabled{opacity:.55;cursor:wait}.primary{background:var(--blue);color:#fff;border-radius:12px;padding:13px 16px;font-weight:650}.secondary{background:#edf1fb;color:var(--blue);padding:12px 15px;border-radius:12px;font-weight:650}.danger{background:#fff0f0;color:#b5222e;padding:10px 14px;border-radius:10px}.full{width:100%}.muted,.subtitle{color:var(--muted)}.subtitle{margin-bottom:18px}.hint{font-size:13px;color:var(--muted)}.footnote{font-size:12px;color:var(--muted);line-height:1.5;margin-top:12px}.eyebrow{font-size:11px;font-weight:700;letter-spacing:.065em;color:var(--blue)}.lock-screen{min-height:100dvh;display:grid;place-items:center;padding:26px 15px;background:linear-gradient(160deg,#eaf0fb,white 50%,#f8f8fb)}.lock-card{width:min(100%,440px);padding:28px 22px;background:white;border-radius:22px;border:1px solid var(--line);box-shadow:var(--shadow)}.brand-pair{display:flex;align-items:center;gap:15px;margin-bottom:15px}.brand-pair img:first-child{width:84px;height:85px;object-fit:contain}.brand-pair img:last-child{width:65px;height:65px;object-fit:contain}label{display:block;font-size:13px;font-weight:650;color:#34435e;margin:14px 0 8px}input:not([type=file]),select,textarea{display:block;width:100%;background:#fff;border:1px solid #ccd5e5;padding:12px;border-radius:11px;color:var(--ink);margin-top:6px;outline-offset:2px}input:focus,select:focus,textarea:focus{border-color:var(--mid)}input[type=file]{width:100%;padding:10px 0;font-size:13px}.lock-card form{margin-top:18px}.lock-card button{margin-top:15px}.topbar{position:sticky;top:0;z-index:5;background:#fff;border-bottom:1px solid var(--line);padding:10px 14px;padding-top:max(10px,env(safe-area-inset-top));display:flex;align-items:center;justify-content:space-between;gap:8px}.header-brand{display:flex;align-items:center;gap:6px;min-width:0}.header-brand img{width:38px;height:38px;object-fit:contain}.header-brand img:nth-child(2){width:31px;height:31px}.header-brand small{font-size:9px;letter-spacing:-.02em;color:var(--muted);display:block;white-space:nowrap}.header-brand strong{font-size:14px;color:var(--blue);white-space:nowrap}.offline-chip{background:#e6f7ee;color:#18764a;font-weight:700;font-size:10px;white-space:nowrap;padding:6px;border-radius:50px}.page{max-width:760px;margin:auto;padding:20px 13px 110px}.tab{display:none}.tab.active{display:block}.panel{background:var(--card);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow);padding:16px;margin:13px 0}.panel label:first-child{margin-top:0}.stat-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.stat{background:#fff;border:1px solid var(--line);border-radius:14px;padding:15px}.stat strong{display:block;font-size:27px;color:var(--blue);font-variant-numeric:tabular-nums}.stat span{font-size:12px;color:var(--muted)}.card-item{padding:13px 14px;border:1px solid var(--line);border-radius:13px;background:white;margin:8px 0}.card-head{display:flex;justify-content:space-between;gap:8px;align-items:center}.card-head strong{font-size:14px}.small{font-size:12px;color:var(--muted);margin-top:4px}.pill{background:#edf1fb;color:var(--blue);border-radius:99px;padding:4px 9px;font-size:11px;font-weight:700}.pill.high{background:#fff0ed;color:#a52c2a}.pill.mid{background:#fff8e7;color:#a66a0d}.card-item p{font-size:13px;margin-top:6px;overflow-wrap:anywhere}.button-row{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}.button-row>*{flex:1 1 125px}.photo-picker{background:#f0f4fb;border:1px dashed #8aa1cf;padding:11px 14px;border-radius:13px}.photo-preview{display:flex;gap:8px;overflow-x:auto}.photo-preview img,.evidence img{width:90px;height:90px;object-fit:cover;border-radius:10px;border:1px solid var(--line)}.evidence{display:flex;gap:7px;overflow-x:auto;margin-top:8px}.bottomnav{position:fixed;z-index:6;bottom:0;left:0;right:0;background:rgba(255,255,255,.97);border-top:1px solid var(--line);display:grid;grid-template-columns:repeat(6,1fr);padding-bottom:max(8px,env(safe-area-inset-bottom));backdrop-filter:blur(10px)}.bottomnav button{background:none;color:#77829a;padding:7px 1px 6px;font-size:10px;font-weight:600;display:flex;gap:2px;flex-direction:column;align-items:center;white-space:nowrap}.bottomnav button span{font-size:21px;line-height:26px}.bottomnav button.selected{color:var(--blue)}.caution{border-color:#ebcda2;background:#fffbf4}.empty{padding:23px;text-align:center;border-radius:12px;border:1px dashed var(--line);color:var(--muted);font-size:13px;background:#fff}#toast{position:fixed;bottom:92px;left:50%;transform:translateX(-50%);background:#142448;color:white;border-radius:12px;padding:12px 16px;font-size:13px;max-width:90vw;z-index:20;display:none;box-shadow:0 7px 24px #0003}#toast.show{display:block}.report-row{display:flex;justify-content:space-between;gap:10px;padding:8px 0;border-bottom:1px solid var(--line);font-size:13px}.report-row strong{font-variant-numeric:tabular-nums}.report-row:last-child{border-bottom:0}@media(min-width:600px){.page{padding:28px 20px 120px}.stat-grid{grid-template-columns:repeat(4,1fr)}.header-brand img{width:47px;height:47px}.header-brand strong{font-size:17px}.header-brand small{font-size:11px}}@media(max-width:370px){.header-brand img{width:30px;height:31px}.header-brand img:nth-child(2){width:25px}.header-brand small{font-size:8px}.header-brand strong{font-size:12px}.offline-chip{font-size:9px}.bottomnav button{font-size:9px}}

[hidden]{display:none!important}

/* v2 – giao diện tập trung, ưu tiên một tay và màn hình iPhone */
:root{--shadow:0 2px 10px #1227630c}
body{font-size:15px;-webkit-text-size-adjust:100%}
h1{font-size:25px;margin:5px 0 4px}h2{font-size:22px;margin-bottom:15px}h3{font-size:16px}
.lock-card{padding:22px 18px}.lock-card .brand-pair{justify-content:center;gap:20px;margin-bottom:10px}.lock-card h1,.lock-card>.muted{text-align:center}
.lock-card .muted{font-size:13px}.lock-card #lock-description{margin:14px 0 4px;text-align:center}
.topbar{padding:8px 13px;padding-top:max(9px,env(safe-area-inset-top))}.header-brand small{font-size:9px}.header-brand strong{font-size:15px}
.icon-action{width:44px;height:44px;flex:none;background:#eef2fa;color:var(--blue);font-size:24px;border-radius:12px;display:grid;place-items:center}
.page{padding:16px 13px 94px}.panel{padding:15px;margin:12px 0}.stat{padding:12px}.stat strong{font-size:24px}.stat span{font-size:12px;line-height:1.3;display:block;margin-top:3px}
label{font-size:13px;margin:12px 0 7px;line-height:1.4}
input:not([type=file],[type=checkbox]),select,textarea{font-size:16px;min-height:45px;max-width:100%;margin-top:6px}
button{min-height:44px;max-width:100%;line-height:1.25;white-space:normal;overflow-wrap:anywhere}
.primary,.secondary,.danger{font-size:14px;padding:11px 12px;display:inline-flex;align-items:center;justify-content:center;text-align:center}
.button-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.button-row>*{min-width:0;width:100%}
.card-head{align-items:start}.card-head .pill{flex:none;max-width:47%;text-align:center;white-space:normal}
.toolbar-line{display:flex;justify-content:space-between;align-items:center;gap:8px;margin:-7px 0 12px}.toolbar-line p{font-size:12px}
.text-action{background:transparent;color:var(--mid);padding:6px 3px;min-height:36px;font-size:13px;font-weight:700}
.photo-picker{display:block;padding:11px 13px;margin-top:9px;color:var(--blue);text-align:center;border-style:solid;font-size:14px}
.photo-picker input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.photo-preview>div{flex:0 0 auto;display:flex;flex-direction:column;align-items:center;gap:3px}.photo-preview button{min-height:30px;padding:5px 9px;font-size:12px}
.bottomnav{grid-template-columns:repeat(5,minmax(0,1fr))}.bottomnav button{font-size:11px;min-width:0;min-height:56px;padding:6px 2px}.bottomnav button span{font-size:20px;line-height:22px}
.password-wrap{position:relative}.password-wrap input{padding-right:64px!important}.eye-toggle{position:absolute;right:5px;top:9px;background:#eef2f9;color:var(--blue);font-size:12px;font-weight:700;padding:0 9px;border-radius:8px;min-height:38px}
.check-line{display:flex;align-items:center;gap:9px;font-weight:500;font-size:13px}.check-line input{width:18px;height:18px;flex:none;accent-color:var(--blue)}
.form-error{border:1px solid #f3c1c4;background:#fff5f5;border-radius:9px;padding:9px 10px;color:#a12028;font-size:13px;margin-top:12px}
.brief-hint{font-size:12px;color:var(--muted);margin:11px 0 0;line-height:1.45}
.profile-panel{border-color:#b8c8ed}.profile-advice{font-size:13px;line-height:1.45;background:#f0f4fe;border-radius:10px;padding:10px;margin:12px 0}
.bottom-actions{margin:18px 0;text-align:center}
@media(max-width:360px){.header-brand small{font-size:8px}.header-brand strong{font-size:13px}.header-brand img{width:29px;height:29px}.icon-action{width:40px;height:40px}.bottomnav button{font-size:10px}.stat strong{font-size:22px}}

.photo-picker{position:relative;overflow:hidden}.photo-picker input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;pointer-events:auto}

.header-brand>div{min-width:0;max-width:100%}.header-brand small,.header-brand strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.card-head>strong{min-width:0;overflow-wrap:anywhere}.panel input[type=file]{max-width:100%;font-size:13px}
@media(max-width:390px){.header-brand{flex:1}.header-brand small{max-width:190px}.header-brand strong{max-width:190px}}

.journal-options{display:flex;justify-content:space-between;align-items:center;gap:8px}.journal-options label{margin:0}.voided{background:#f7f7f7;opacity:.78}.history-heading{margin:18px 0 4px;font-size:15px}.profile-panel .small{overflow-wrap:anywhere}

/* v3 – chọn ngày gọn, nhất quán trên iPhone */
.date-range{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;max-width:344px;align-items:end}
.date-range label{margin:0 0 11px;min-width:0}
.date-range input[type="date"]{width:100%;max-width:160px;min-width:0;min-height:42px;height:42px;padding:7px 6px;font-size:14px;box-sizing:border-box;border-radius:10px}
@media(max-width:350px){.date-range{max-width:100%;gap:8px}.date-range input[type="date"]{font-size:13px;padding:5px 4px}}

/* GVCN phản hồi đã nhập vào máy ghi nhận */
.gvcn-response{background:#f0f6f2;border:1px solid #cde0d1;padding:10px 12px;border-radius:10px;margin-top:10px;font-size:13px}.gvcn-response strong{color:#15543b}.gvcn-response p{margin:5px 0;line-height:1.5}

/* Hybrid sync settings; no overlay or fixed-height buttons. */
.sync-panel{margin-top:16px}.sync-panel label{display:block;margin:11px 0;min-width:0}
.sync-panel input{width:100%;max-width:100%;box-sizing:border-box;font-size:16px;min-height:43px}
.sync-panel button{max-width:100%;width:100%;margin:6px 0;min-height:44px}
.sync-note,#sync-status,#sync-pending{font-size:13px;line-height:1.5;overflow-wrap:anywhere}
#sync-status{font-weight:650}.sync-conflict{padding:10px;margin-top:10px;border:1px solid #ce8e8e;border-radius:10px}
.sync-conflict button{font-size:13px}


/* v7 – Bộ chọn tuần rõ ràng, thao tác một tay */
.week-widget{display:flex;flex-direction:column;align-items:stretch;gap:7px}
.week-label{font-size:14px;font-weight:750;margin:0}
.week-nav{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;gap:8px;align-items:center;max-width:375px}
.week-nav .week-arrow{height:44px;min-height:44px;max-width:none;padding:0;border-radius:11px;background:#edf2fc;border:1px solid #d2daec;color:var(--blue);font-size:27px;font-weight:600}
.week-nav .week-arrow:disabled{opacity:.33}
.week-nav select{margin:0;min-height:44px;height:44px;font-size:16px;font-weight:700;text-align:center;text-align-last:center;border-color:#b9c9e8;color:var(--blue);min-width:0}
.week-subtitle{font-size:12px;color:var(--muted);line-height:1.5;margin:1px 0 0;overflow-wrap:anywhere}
.week-today{background:none;border:0;color:var(--mid);font-size:13px;font-weight:750;min-height:35px;align-self:flex-start;padding:4px 2px}
.report-advanced{margin:11px 0 13px;border-top:1px solid var(--line);padding-top:9px}
.report-advanced summary{cursor:pointer;list-style-position:outside;font-size:13px;color:var(--blue);font-weight:700;min-height:35px;padding:7px 3px}
.report-advanced .date-range{margin-top:10px}.report-advanced .week1-label{max-width:176px;font-weight:650;font-size:12px}
.report-advanced #report-week1{min-width:0;max-width:175px;height:42px;font-size:13px;padding:7px}
.week-help{color:var(--muted);font-size:11px;line-height:1.45;margin:8px 0}
@media(max-width:350px){.week-nav{grid-template-columns:40px minmax(0,1fr) 40px;gap:6px}.week-nav .week-arrow{width:40px;min-height:42px;height:42px}.week-nav select{font-size:15px}}

/* Teacher communication: class-specific messages visible in settings. */
[hidden]{display:none!important}
.chat-thread{display:flex;flex-direction:column;gap:9px;min-height:150px;max-height:46vh;overflow-y:auto;padding:10px;border:1px solid #d8e4ef;border-radius:12px;background:#f7f9fd}
.chat-bubble{background:white;align-self:flex-start;padding:10px 12px;max-width:92%;border:1px solid #d8e4ef;border-radius:12px;overflow-wrap:anywhere}
.chat-bubble.mine{align-self:flex-end;background:#eaf2fc;border-color:#c1d5ed}
.chat-author{font-size:11px;color:#526983;font-weight:700}
.chat-text{font-size:14px;white-space:pre-wrap;margin:5px 0}
.chat-state,.chat-bubble small{display:block;font-size:11px;color:#64758a;margin-top:4px}
#chat-text{font-size:16px;width:100%;max-width:100%;box-sizing:border-box;min-height:86px}
#recorder-chat-panel{overflow-wrap:anywhere}
/* iOS Safari intrinsic date width must never exceed the form card. */
#occurred{display:block;width:100%;max-width:100%;min-width:0;box-sizing:border-box;min-height:48px;height:48px}
#record-form,#record-form label{min-width:0;max-width:100%}
