:root{--pwa-success:#32825d;--pwa-warning:#b8862b;--pwa-danger:#b5443e;--pwa-shadow:0 8px 24px #21372b12;--pwa-radius:18px}
body[data-pwa-theme="daftarche"]{--pwa-page:#f5efe3;--pwa-card:#fffdf8;--pwa-ink:#3b2f25;--pwa-muted:#75685c;--pwa-accent:#b5442e;--pwa-border:#e4d9c8;--pwa-tint:#f3e7d5;--pwa-success:#477b58;--pwa-warning:#a77725;--pwa-danger:#a73d32;--pwa-shadow:0 5px 16px #3b2f2510;--pwa-radius:12px}
body[data-pwa-theme="takhtesabz"]{--pwa-page:#e9f0ea;--pwa-card:#f8fcf8;--pwa-ink:#1e3a32;--pwa-muted:#60766e;--pwa-accent:#b89a32;--pwa-border:#cbd9ce;--pwa-tint:#dfe9df;--pwa-success:#43845f;--pwa-warning:#b88a27;--pwa-danger:#b45757;--pwa-shadow:0 6px 18px #1e3a3212;--pwa-radius:16px}
body[data-pwa-theme="ketabkhane"]{--pwa-page:#f1e6c8;--pwa-card:#fff8e5;--pwa-ink:#2b1d14;--pwa-muted:#74634d;--pwa-accent:#b8862b;--pwa-border:#d9c9a3;--pwa-tint:#e9dcb9;--pwa-success:#55714e;--pwa-warning:#a97a1b;--pwa-danger:#a94335;--pwa-shadow:0 7px 20px #3d2d1718;--pwa-radius:10px}
body[data-pwa-theme="masire-yadgiri"]{--pwa-page:#f1efed;--pwa-card:#fffdfb;--pwa-ink:#423932;--pwa-muted:#766d66;--pwa-accent:#d98255;--pwa-border:#e3d9d2;--pwa-tint:#f4e4da;--pwa-success:#54856b;--pwa-warning:#c9823e;--pwa-danger:#b95d50;--pwa-shadow:0 8px 22px #42393212;--pwa-radius:15px}
body[data-pwa-theme="sobh-aram"]{--pwa-page:#edf5f8;--pwa-card:#fbfeff;--pwa-ink:#304653;--pwa-muted:#687e8a;--pwa-accent:#4389a8;--pwa-border:#d4e2e8;--pwa-tint:#e1edf2;--pwa-success:#5c9877;--pwa-warning:#c28b3e;--pwa-danger:#bd6257;--pwa-shadow:0 10px 28px #30465311;--pwa-radius:22px}
body[data-pwa-theme]{background-color:var(--pwa-page);color:var(--pwa-ink);transition:background-color .24s ease,color .24s ease}
body[data-pwa-theme] .topbar,body[data-pwa-theme] .bottom-nav,body[data-pwa-theme] .family-shell,body[data-pwa-theme] .family-composer,body[data-pwa-theme] .family-room-card,body[data-pwa-theme] .family-parent-room-card,body[data-pwa-theme] .family-message,body[data-pwa-theme] .channel-info-panel,body[data-pwa-theme] .info-card,body[data-pwa-theme] .mini-card,body[data-pwa-theme] .answer-row,body[data-pwa-theme] .progress-card,body[data-pwa-theme] .focus-card,body[data-pwa-theme] .auth-card,body[data-pwa-theme] .success-card{background-color:var(--pwa-card);border-color:var(--pwa-border);color:var(--pwa-ink);border-radius:var(--pwa-radius)}
body[data-pwa-theme] .page,body[data-pwa-theme] .family-shell,body[data-pwa-theme] .family-chat-surface{color:var(--pwa-ink)}body[data-pwa-theme] .page p,body[data-pwa-theme] .family-last-message,body[data-pwa-theme] .family-room-copy,body[data-pwa-theme] .family-heading p,body[data-pwa-theme] .channel-notice{color:var(--pwa-muted)}
body[data-pwa-theme] .family-primary,body[data-pwa-theme] .btn.primary,body[data-pwa-theme] .teacher-actions .family-contact-action{background:var(--pwa-accent);border-color:var(--pwa-accent);color:#fff}body[data-pwa-theme] .family-unread-pill{background:var(--pwa-accent);color:#fff}body[data-pwa-theme] input,body[data-pwa-theme] textarea,body[data-pwa-theme] select{border-color:var(--pwa-border)}
body[data-pwa-mode="dark"]{--pwa-page:#171a18;--pwa-card:#222724;--pwa-ink:#f0eee8;--pwa-muted:#b1b9b2;--pwa-border:#3b443e;--pwa-tint:#2c352f;--pwa-shadow:0 8px 24px #0005;color-scheme:dark}
body[data-pwa-mode="dark"][data-pwa-theme="daftarche"]{--pwa-page:#1f1b16;--pwa-card:#2a241e;--pwa-ink:#f2e9dc;--pwa-muted:#c1b4a4;--pwa-accent:#dc8067;--pwa-border:#4c4034;--pwa-tint:#382d24}
body[data-pwa-mode="dark"][data-pwa-theme="takhtesabz"]{--pwa-page:#14231e;--pwa-card:#1d3029;--pwa-ink:#e8f2e9;--pwa-muted:#b0c5b6;--pwa-accent:#e0c458;--pwa-border:#365044;--pwa-tint:#263b31}
body[data-pwa-mode="dark"][data-pwa-theme="ketabkhane"]{--pwa-page:#211a14;--pwa-card:#30251b;--pwa-ink:#f3e6cd;--pwa-muted:#c9b796;--pwa-accent:#d4a94f;--pwa-border:#51402e;--pwa-tint:#3a2d20}
body[data-pwa-mode="dark"][data-pwa-theme="masire-yadgiri"]{--pwa-page:#241b16;--pwa-card:#30251f;--pwa-ink:#f4e9df;--pwa-muted:#c9b8aa;--pwa-accent:#e89b70;--pwa-border:#4b3a30;--pwa-tint:#3c2c22;--pwa-success:#85c296;--pwa-warning:#ffb45f}
body[data-pwa-mode="dark"][data-pwa-theme="sobh-aram"]{--pwa-page:#17232a;--pwa-card:#202f38;--pwa-ink:#e8f2f6;--pwa-muted:#b5c8d1;--pwa-accent:#82bdd3;--pwa-border:#374c57;--pwa-tint:#293e48}
@media(prefers-color-scheme:dark){body[data-pwa-mode="system"]{--pwa-page:#171a18;--pwa-card:#222724;--pwa-ink:#f0eee8;--pwa-muted:#b1b9b2;--pwa-border:#3b443e;--pwa-tint:#2c352f;--pwa-shadow:0 8px 24px #0005;color-scheme:dark}body[data-pwa-mode="system"][data-pwa-theme="daftarche"]{--pwa-page:#1f1b16;--pwa-card:#2a241e;--pwa-ink:#f2e9dc;--pwa-muted:#c1b4a4;--pwa-accent:#dc8067;--pwa-border:#4c4034;--pwa-tint:#382d24}body[data-pwa-mode="system"][data-pwa-theme="takhtesabz"]{--pwa-page:#14231e;--pwa-card:#1d3029;--pwa-ink:#e8f2e9;--pwa-muted:#b0c5b6;--pwa-accent:#e0c458;--pwa-border:#365044;--pwa-tint:#263b31}body[data-pwa-mode="system"][data-pwa-theme="ketabkhane"]{--pwa-page:#211a14;--pwa-card:#30251b;--pwa-ink:#f3e6cd;--pwa-muted:#c9b796;--pwa-accent:#d4a94f;--pwa-border:#51402e;--pwa-tint:#3a2d20}body[data-pwa-mode="system"][data-pwa-theme="masire-yadgiri"]{--pwa-page:#241b16;--pwa-card:#30251f;--pwa-ink:#f4e9df;--pwa-muted:#c9b8aa;--pwa-accent:#e89b70;--pwa-border:#4b3a30;--pwa-tint:#3c2c22;--pwa-success:#85c296;--pwa-warning:#ffb45f}body[data-pwa-mode="system"][data-pwa-theme="sobh-aram"]{--pwa-page:#17232a;--pwa-card:#202f38;--pwa-ink:#e8f2f6;--pwa-muted:#b5c8d1;--pwa-accent:#82bdd3;--pwa-border:#374c57;--pwa-tint:#293e48}}
@media(prefers-reduced-motion:reduce){body[data-pwa-theme]{transition:none}}

/* Local school wallpapers for the five existing themes; source proportions are preserved. */
body[data-pwa-theme="daftarche"]{--pwa-wallpaper:url("../img/pwa-themes/daftarche.webp")}
body[data-pwa-theme="takhtesabz"]{--pwa-wallpaper:url("../img/pwa-themes/takhtesabz.webp")}
body[data-pwa-theme="ketabkhane"]{--pwa-wallpaper:url("../img/pwa-themes/ketabkhane.webp")}
body[data-pwa-theme="masire-yadgiri"]{--pwa-wallpaper:url("../img/pwa-themes/masire-yadgiri.webp")}
body[data-pwa-theme="sobh-aram"]{--pwa-wallpaper:url("../img/pwa-themes/sobh-aram.webp")}
body[data-pwa-theme]{--pwa-wallpaper-wash:rgba(255,255,255,.78);background-image:linear-gradient(var(--pwa-wallpaper-wash),var(--pwa-wallpaper-wash)),var(--pwa-wallpaper);background-position:center,top center;background-size:auto,min(100vw,1500px) auto;background-repeat:repeat,no-repeat;background-attachment:fixed,fixed}
body[data-pwa-mode="dark"]{--pwa-wallpaper-wash:rgba(10,15,13,.78)}
@media(prefers-color-scheme:dark){body[data-pwa-mode="system"]{--pwa-wallpaper-wash:rgba(10,15,13,.78)}}
@media(min-width:900px){body[data-pwa-theme]{background-size:auto,min(100vw,1500px) auto}}
.theme-preview[data-theme="daftarche"]{--pv-wallpaper:url("../img/pwa-themes/daftarche-preview.webp")}
.theme-preview[data-theme="takhtesabz"]{--pv-wallpaper:url("../img/pwa-themes/takhtesabz-preview.webp")}
.theme-preview[data-theme="ketabkhane"]{--pv-wallpaper:url("../img/pwa-themes/ketabkhane-preview.webp")}
.theme-preview[data-theme="masire-yadgiri"]{--pv-wallpaper:url("../img/pwa-themes/masire-yadgiri-preview.webp")}
.theme-preview[data-theme="sobh-aram"]{--pv-wallpaper:url("../img/pwa-themes/sobh-aram-preview.webp")}
.theme-preview{--pv-wallpaper-wash:rgba(255,255,255,.40);background-image:linear-gradient(var(--pv-wallpaper-wash),var(--pv-wallpaper-wash)),var(--pv-wallpaper);background-position:center,center;background-size:auto,120px auto;background-repeat:no-repeat,repeat}
.theme-preview[data-mode="dark"]{--pv-wallpaper-wash:rgba(8,12,10,.58)}
@media(prefers-color-scheme:dark){.theme-preview[data-mode="system"]{--pv-wallpaper-wash:rgba(8,12,10,.58)}}
.teacher-theme-page{max-width:1000px;margin:22px auto 40px;padding:0 16px;color:#253c35}.teacher-theme-back{display:inline-block;margin-bottom:12px;color:#527166;font-weight:700}.teacher-theme-heading{display:flex;align-items:center;gap:14px;padding:18px;border:1px solid #dce9df;border-radius:20px;background:linear-gradient(120deg,#eff8f1,#fff8ed)}.teacher-theme-mark{display:grid;place-items:center;width:48px;height:48px;border-radius:15px;background:#24715a;color:#fff;font-size:1.6rem}.teacher-theme-heading p{margin:0;color:#678276;font-size:.8rem}.teacher-theme-heading h1{margin:0;font-size:1.45rem}.teacher-theme-heading span:last-child{color:#687b72;font-size:.86rem}.theme-choice-field,.theme-mode-field{margin:16px 0 0;padding:15px;border:1px solid #dce7df;border-radius:18px;background:#fff}.theme-choice-field legend,.theme-mode-field legend{padding:0 7px;font-weight:800}.theme-choice-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px}.theme-choice{display:grid;gap:7px;cursor:pointer}.theme-choice>input{position:absolute;opacity:0}.theme-choice-name{font-size:.82rem;font-weight:700;line-height:1.5}.theme-preview{--pv-bg:#fbf8f3;--pv-card:#fff;--pv-ink:#3e352d;--pv-muted:#81766b;--pv-accent:#f4a261;--pv-border:#eee3d8;display:block;overflow:hidden;min-height:128px;border:2px solid var(--pv-border);border-radius:14px;background:var(--pv-bg);color:var(--pv-ink);transition:background .2s,color .2s,border .2s}.theme-preview[data-theme="daftarche"]{--pv-bg:#f5efe3;--pv-card:#fffdf8;--pv-ink:#3b2f25;--pv-muted:#75685c;--pv-accent:#b5442e;--pv-border:#e4d9c8}.theme-preview[data-theme="takhtesabz"]{--pv-bg:#e9f0ea;--pv-card:#f8fcf8;--pv-ink:#1e3a32;--pv-muted:#60766e;--pv-accent:#b89a32;--pv-border:#cbd9ce}.theme-preview[data-theme="ketabkhane"]{--pv-bg:#f1e6c8;--pv-card:#fff8e5;--pv-ink:#2b1d14;--pv-muted:#74634d;--pv-accent:#b8862b;--pv-border:#d9c9a3}.theme-preview[data-theme="masire-yadgiri"]{--pv-bg:#f1efed;--pv-card:#fffdfb;--pv-ink:#423932;--pv-muted:#766d66;--pv-accent:#d98255;--pv-border:#e3d9d2}.theme-preview[data-theme="sobh-aram"]{--pv-bg:#edf5f8;--pv-card:#fbfeff;--pv-ink:#304653;--pv-muted:#687e8a;--pv-accent:#4389a8;--pv-border:#d4e2e8}.theme-preview[data-mode="dark"]{--pv-bg:#1a1714;--pv-card:#27211c;--pv-ink:#f3eee7;--pv-muted:#c5b9ab;--pv-border:#44382e}.theme-preview[data-mode="dark"][data-theme="daftarche"]{--pv-bg:#1f1b16;--pv-card:#2a241e;--pv-ink:#f2e9dc;--pv-muted:#c1b4a4;--pv-accent:#dc8067;--pv-border:#4c4034}.theme-preview[data-mode="dark"][data-theme="takhtesabz"]{--pv-bg:#14231e;--pv-card:#1d3029;--pv-ink:#e8f2e9;--pv-muted:#b0c5b6;--pv-accent:#e0c458;--pv-border:#365044}.theme-preview[data-mode="dark"][data-theme="ketabkhane"]{--pv-bg:#211a14;--pv-card:#30251b;--pv-ink:#f3e6cd;--pv-muted:#c9b796;--pv-accent:#d4a94f;--pv-border:#51402e}.theme-preview[data-mode="dark"][data-theme="masire-yadgiri"]{--pv-bg:#241b16;--pv-card:#30251f;--pv-ink:#f4e9df;--pv-muted:#c9b8aa;--pv-accent:#e89b70;--pv-border:#4b3a30}.theme-preview[data-mode="dark"][data-theme="sobh-aram"]{--pv-bg:#17232a;--pv-card:#202f38;--pv-ink:#e8f2f6;--pv-muted:#b5c8d1;--pv-accent:#82bdd3;--pv-border:#374c57}.preview-top{display:flex;gap:4px;padding:9px;background:var(--pv-card);border-bottom:1px solid var(--pv-border)}.preview-top i{width:6px;height:6px;border-radius:50%;background:var(--pv-accent)}.preview-body{display:grid;gap:8px;padding:10px}.preview-body>b{font-size:.68rem}.preview-row{display:flex;align-items:center;gap:7px;padding:7px;border:1px solid var(--pv-border);border-radius:9px;background:var(--pv-card)}.preview-row>i{width:22px;height:22px;border-radius:50%;background:var(--pv-accent)}.preview-row span{display:grid;font-size:.64rem}.preview-row small{color:var(--pv-muted)}.preview-button{justify-self:start;padding:3px 12px;border-radius:7px;background:var(--pv-accent);color:#fff;font-size:.62rem}.theme-choice input:checked+.theme-preview{border-color:#28775c;box-shadow:0 0 0 2px #28775c35}.theme-mode-options{display:flex;flex-wrap:wrap;gap:8px}.theme-mode-options label{display:flex;align-items:center;gap:7px;padding:9px 13px;border:1px solid #dce7df;border-radius:12px;background:#fafcfb}.theme-form-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:16px 0}.theme-form-actions button{min-height:46px;padding:0 18px;border:0;border-radius:12px;background:#176d57;color:white;font:inherit;font-weight:800;cursor:pointer}.theme-form-actions span{color:#718078;font-size:.82rem}.teacher-theme-flash,.teacher-theme-error{padding:10px 14px;border-radius:12px;background:#eaf6ee;color:#256044}.teacher-theme-error{background:#fff0ed;color:#9a3b32}@media(max-width:560px){.teacher-theme-page{margin:12px auto 28px;padding:0 10px}.theme-choice-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.theme-choice-field,.theme-mode-field{padding:11px}.theme-preview{min-height:118px}.theme-choice-name{font-size:.75rem}.teacher-theme-heading{padding:13px}.teacher-theme-heading h1{font-size:1.2rem}}

/* Inbox scrolling, sticky search, translucent dock and browser install bubble. */
body.teacher-inbox-surface>.page{height:100dvh}
.teacher-inbox-page{display:flex;flex-direction:column;overflow:hidden}
.teacher-inbox-toolbar{position:sticky;top:0;z-index:20;flex:0 0 auto}
.teacher-inbox-scroll{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#c8d5cd transparent;padding-bottom:88px}
.teacher-inbox-list{min-height:auto;overflow:visible;overscroll-behavior:auto}
.teacher-inbox-tabs,.teacher-inbox-result-count,.teacher-inbox-pagination{flex-shrink:0}
.teacher-inbox-bottom{background:color-mix(in srgb,var(--pwa-card,#fff) 38%,transparent);backdrop-filter:blur(13px);-webkit-backdrop-filter:blur(13px)}
.teacher-inbox-score{flex-basis:42px;width:42px;height:44px}
.teacher-inbox-score img{width:40px;height:40px;object-fit:contain}
.inbox-toolbar{position:sticky;top:0;z-index:20;padding:5px 8px;background:color-mix(in srgb,var(--pwa-card,#fff) 92%,transparent);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
.inbox-score{flex-basis:42px;width:42px;height:42px}
.inbox-score img{display:block;width:38px;height:38px;object-fit:contain}
.family-inbox-surface .page{padding-bottom:calc(14px + env(safe-area-inset-bottom))}
.family-inbox-surface .pwa-bottom-nav{background:color-mix(in srgb,var(--pwa-card,#fff) 46%,transparent);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}
.pwa-install-nudge{position:fixed;z-index:120;inset-inline-start:14px;top:calc(env(safe-area-inset-top) + 76px);min-height:38px;padding:7px 14px;border:1px solid #d6e5dc;border-radius:12px;background:rgba(255,255,255,.92);color:#286b55;box-shadow:0 5px 18px #15281d18;font:inherit;font-size:.82rem;font-weight:750;cursor:pointer;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
.pwa-install-help{position:fixed;z-index:121;top:calc(env(safe-area-inset-top) + 120px);inset-inline-start:12px;width:min(340px,calc(100vw - 24px));padding:14px;border:1px solid #d9e6df;border-radius:16px;background:var(--pwa-card,#fff);color:var(--pwa-ink,#21382f);box-shadow:0 10px 30px #10251b26;font-size:.88rem;line-height:1.7}
.pwa-install-help-close{display:block;margin:9px 0 0 auto;padding:5px 12px;border:0;border-radius:9px;background:#e9f3ed;color:#24654f;font:inherit;font-weight:700}
@media(max-width:600px){.teacher-inbox-toolbar{min-height:56px}.teacher-inbox-brand img{width:20px;height:34px}.teacher-inbox-brand strong{font-size:.79rem}.teacher-inbox-score{flex-basis:36px;width:36px}.teacher-inbox-score img{width:34px;height:34px}.teacher-inbox-tabs{padding-top:6px}.inbox-score{flex-basis:34px;width:34px;height:36px}.inbox-score img{width:32px;height:32px}}
@media(prefers-reduced-transparency:reduce){.teacher-inbox-bottom,.family-inbox-surface .pwa-bottom-nav,.inbox-toolbar{background:var(--pwa-card,#fff);backdrop-filter:none;-webkit-backdrop-filter:none}}
