:root{--bg:#080808;--panel:#111;--panel2:#151515;--line:#252525;--muted:#929292;--text:#f5f5f5;--white:#fff;--green:#b8f36b;--red:#ef6666;--yellow:#e8c76a}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:14px Inter,system-ui,-apple-system,Segoe UI,Arial,sans-serif}button,input,select,textarea{font:inherit}button{cursor:pointer}.app-shell{min-height:100vh}.sidebar{width:214px;position:fixed;inset:0 auto 0 0;background:#050505;border-right:1px solid #202020;padding:20px 12px;display:flex;flex-direction:column;z-index:5}.brand{display:flex;align-items:center;gap:10px;padding:0 7px 22px}.brand-mark{width:42px;height:42px;border:1px solid #444;border-radius:12px;display:grid;place-items:center;font-weight:900;font-size:24px;background:linear-gradient(145deg,#242424,#050505)}.brand b{display:block;letter-spacing:2px;font-size:13px}.brand small,.profile-mini small{display:block;color:var(--muted);font-size:10px;margin-top:3px}.profile-mini{display:flex;align-items:center;gap:10px;background:#141414;border:1px solid #222;border-radius:12px;padding:10px;margin-bottom:17px}.profile-mini b{font-size:12px}.avatar{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:#f5f5f5;color:#111;font-weight:800}nav{display:grid;gap:5px}.nav-item{border:0;background:transparent;color:#d2d2d2;text-align:left;padding:11px 10px;border-radius:9px;font-size:12px;display:flex;gap:11px;align-items:center}.nav-item span{width:15px;text-align:center;font-size:15px}.nav-item:hover,.nav-item.active{background:#242424;color:#fff}.nav-item.active{box-shadow:inset 2px 0 #fff}.sidebar-bottom{margin-top:auto}.mini-goal{padding:13px;background:#101010;border:1px solid #242424;border-radius:11px;margin-bottom:10px}.mini-goal small{color:var(--muted);font-size:10px}.mini-goal b{display:block;font-size:21px;margin:5px 0}.progress{height:5px;background:#303030;border-radius:10px;overflow:hidden}.progress i{display:block;height:100%;width:0;background:#eee;border-radius:10px}.main{margin-left:214px;min-height:100vh}.topbar{height:76px;border-bottom:1px solid #1e1e1e;display:flex;align-items:center;justify-content:space-between;padding:0 34px;background:#090909;position:sticky;top:0;z-index:3}.topbar b{display:block;font-size:16px;margin-top:3px}.eyebrow{font-size:9px;letter-spacing:1.5px;color:#888}.top-actions{display:flex;align-items:center;gap:18px}.today{color:#888;font-size:11px}.btn{border:1px solid #333;border-radius:9px;padding:10px 15px;background:#171717;color:#eee;font-weight:650;font-size:12px}.btn:hover{filter:brightness(1.2)}.btn.light{background:#f4f4f4;color:#111;border-color:#f4f4f4}.btn.primary{background:#f5f5f5;color:#111;border-color:#fff}.btn.danger{color:#ff8d8d;border-color:#5b2929}.btn.full{width:100%;padding:13px}.content{max-width:1500px;margin:auto;padding:30px 34px 60px}.welcome{display:flex;justify-content:space-between;align-items:center;margin-bottom:22px}.welcome h1{font-size:25px;margin:0 0 6px}.welcome p{color:#929292;margin:0;font-size:12px}.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:13px;margin-bottom:18px}.stat-card,.panel,.subject-card,.admin-card{background:linear-gradient(145deg,#141414,#0d0d0d);border:1px solid #262626;border-radius:13px}.stat-card{padding:17px}.stat-head{display:flex;justify-content:space-between;color:#aaa;font-size:10px;text-transform:uppercase;letter-spacing:.4px}.stat-icon{font-size:16px;color:#bbb}.stat-value{font-size:25px;font-weight:800;margin:8px 0 3px}.stat-foot{font-size:10px;color:#888}.dashboard-grid{display:grid;grid-template-columns:minmax(0,1.8fr) minmax(280px,.9fr);gap:18px}.panel{padding:17px;margin-bottom:16px}.panel-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:15px}.panel-title h3{font-size:13px;margin:0}.panel-title span{font-size:10px;color:#888}.chart{height:205px;display:flex;align-items:end;gap:10px;padding:12px 6px 0;border-bottom:1px solid #555;background:repeating-linear-gradient(to bottom,transparent 0,transparent 49px,#242424 50px)}.chart-col{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:end;height:100%;gap:8px}.chart-bar{width:min(28px,70%);background:linear-gradient(#eee,#777);border-radius:5px 5px 0 0;min-height:2px}.chart-col small{color:#777;font-size:10px}.level-card{padding:17px}.level-row{display:flex;gap:12px;align-items:center}.level-icon{width:42px;height:42px;border-radius:12px;background:#eee;color:#111;display:grid;place-items:center;font-size:20px}.level-row b{display:block}.level-row small{color:#999;font-size:10px}.level-progress{margin:14px 0 5px}.level-meta{display:flex;justify-content:space-between;color:#888;font-size:9px}.mission{border:1px solid #292929;padding:11px;border-radius:10px;margin-top:9px}.mission-top{display:flex;justify-content:space-between;font-size:11px}.mission-top span:last-child{color:#ddd;font-weight:700}.mission small{color:#777;font-size:9px}.mission .progress{margin:8px 0 4px}.section-head{display:flex;justify-content:space-between;align-items:flex-end;margin-bottom:19px;gap:15px}.section-head h1{font-size:23px;margin:0 0 5px}.section-head p{margin:0;color:#888;font-size:12px}.toolbar{display:flex;gap:8px;flex-wrap:wrap}.input,select,textarea{width:100%;background:#090909;border:1px solid #333;color:#eee;border-radius:8px;padding:11px;outline:none}.input:focus,select:focus,textarea:focus{border-color:#aaa}.toolbar .input,.toolbar select{width:auto;min-width:150px}.cards-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px}.subject-card{padding:16px}.subject-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:13px}.subject-icon{width:38px;height:38px;border-radius:10px;background:#252525;display:grid;place-items:center;font-size:18px}.subject-card h3{margin:0 0 5px;font-size:14px}.subject-card p{margin:0 0 13px;color:#888;font-size:11px}.tag{font-size:9px;padding:5px 8px;border:1px solid #333;border-radius:20px;color:#bbb}.subject-actions{display:flex;gap:7px;margin-top:13px}.subject-actions .btn{flex:1;padding:8px}.empty{padding:35px;text-align:center;color:#888;border:1px dashed #333;border-radius:12px}.empty b{display:block;color:#ddd;margin-bottom:5px}.table-wrap{overflow:auto}.data-table{width:100%;border-collapse:collapse;min-width:600px}.data-table th,.data-table td{text-align:left;padding:12px;border-bottom:1px solid #262626;font-size:11px}.data-table th{color:#888;font-weight:600}.pill{padding:4px 7px;border-radius:20px;background:#242424;color:#ddd;font-size:9px}.question-box{max-width:850px;margin:0 auto}.question-meta{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}.question-text{font-size:18px;line-height:1.55;margin:18px 0}.option{display:flex;gap:11px;align-items:flex-start;padding:13px;border:1px solid #303030;border-radius:9px;margin:9px 0;cursor:pointer;background:#101010}.option:hover{border-color:#777}.option.selected{border-color:#eee;background:#1c1c1c}.option.correct{border-color:#6b9d48;background:#172015}.option.wrong{border-color:#a64e4e;background:#241414}.option-key{width:24px;height:24px;flex:none;border:1px solid #555;border-radius:7px;display:grid;place-items:center;font-size:10px}.explanation{padding:14px;border:1px solid #394b2c;background:#141c10;border-radius:10px;margin-top:15px;color:#c8d9bc;font-size:12px;line-height:1.5}.timer{font-variant-numeric:tabular-nums;font-size:18px;font-weight:800}.metric-row{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.metric{padding:16px;background:#111;border:1px solid #292929;border-radius:10px}.metric small{color:#888;font-size:10px}.metric b{display:block;font-size:24px;margin-top:7px}.bar-row{display:grid;grid-template-columns:130px 1fr 45px;align-items:center;gap:12px;margin:13px 0;font-size:11px}.bar-track{height:8px;background:#292929;border-radius:10px;overflow:hidden}.bar-track i{display:block;height:100%;background:#ddd}.form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}.field label{display:block;color:#aaa;font-size:11px;margin-bottom:7px}.field.full-field{grid-column:1/-1}.field textarea{min-height:90px;resize:vertical}.modal-backdrop{position:fixed;inset:0;background:#000b;z-index:10;display:grid;place-items:center;padding:18px}.modal{width:min(620px,100%);max-height:90vh;overflow:auto;background:#121212;border:1px solid #393939;border-radius:14px;padding:22px}.modal-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}.modal-head h2{font-size:17px;margin:0}.close{border:0;background:transparent;color:#aaa;font-size:22px}.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:17px}.toast{position:fixed;bottom:22px;right:22px;background:#eee;color:#111;padding:12px 17px;border-radius:9px;font-size:12px;z-index:30;opacity:0;transform:translateY(10px);transition:.2s;pointer-events:none}.toast.show{opacity:1;transform:translateY(0)}.auth-screen{position:fixed;inset:0;z-index:20;background:#050505;display:grid;place-items:center;padding:20px}.auth-screen.hidden{display:none}.auth-card{width:min(430px,100%);background:#111;border:1px solid #333;border-radius:18px;padding:30px}.auth-card h1{text-align:center;letter-spacing:5px;font-size:23px;margin:15px 0 5px}.auth-card>p{text-align:center;color:#888;font-size:12px;margin:0 0 25px}.brand-mark.big{width:78px;height:78px;margin:auto;font-size:40px}.auth-card label{display:block;font-size:11px;margin:14px 0;color:#ddd}.auth-card input{display:block;width:100%;margin-top:7px}.auth-card small{display:block;color:#777;text-align:center;margin-top:16px;font-size:10px}.tabs{display:flex;background:#090909;border-radius:9px;padding:4px;margin-bottom:18px}.tab{flex:1;border:0;background:transparent;color:#999;padding:9px;border-radius:7px;font-size:11px}.tab.active{background:#292929;color:#fff}.hidden{display:none!important}.mobile-only{display:none}
@media(max-width:1050px){.stats-grid{grid-template-columns:repeat(2,1fr)}.cards-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-grid{grid-template-columns:1fr}.content{padding:24px}}
@media(max-width:700px){.sidebar{transform:translateX(-100%);transition:.25s;width:250px}.sidebar.open{transform:translateX(0)}.main{margin-left:0}.mobile-only{display:inline-block}.topbar{padding:0 16px;height:66px}.top-actions{gap:8px}.today{display:none}.content{padding:20px 14px 45px}.welcome{align-items:flex-start;gap:10px}.welcome h1{font-size:20px}.welcome .btn{font-size:10px;padding:9px}.stats-grid{gap:8px}.stat-card{padding:12px}.stat-value{font-size:21px}.cards-grid{grid-template-columns:1fr}.form-grid{grid-template-columns:1fr}.field.full-field{grid-column:auto}.metric-row{gap:7px}.metric{padding:11px}.metric b{font-size:20px}.bar-row{grid-template-columns:95px 1fr 35px}.section-head{align-items:flex-start;flex-direction:column}.toolbar{width:100%}.toolbar .input,.toolbar select{flex:1;min-width:0}.auth-card{padding:22px}}

.import-panel{display:flex;align-items:center;gap:18px;border-style:dashed;padding:22px;margin-bottom:18px}.import-icon{width:58px;height:58px;border-radius:14px;background:#242424;display:grid;place-items:center;font-size:27px;flex:none}.import-copy h3{margin:0 0 7px;font-size:15px}.import-copy p{color:#999;font-size:11px;line-height:1.6;margin:0 0 12px;max-width:720px}.import-copy small{display:block;color:#777;font-size:10px;margin-top:9px}.upload-label{display:inline-block;cursor:pointer}@media(max-width:600px){.import-panel{align-items:flex-start;flex-direction:column}}

/* Ciclo de metas diárias */
.activity-card{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px;border:1px solid #2a2a2a;background:#101010;border-radius:11px;margin:9px 0}
.activity-main{display:grid;gap:5px;min-width:0}.activity-main b{font-size:13px;line-height:1.4}.activity-main small{font-size:10px;color:#888}
.activity-type{font-size:9px;letter-spacing:.8px;color:#aaa;font-weight:700}.activity-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap;justify-content:flex-end}
.activity-done{opacity:.68;border-color:#36502a}.activity-done .activity-main b{text-decoration:line-through;color:#999}
.activity-card .btn{padding:8px 10px;font-size:10px;white-space:nowrap}
@media(max-width:600px){.activity-card{align-items:flex-start;flex-direction:column}.activity-actions{width:100%;justify-content:flex-start}.activity-actions .btn{flex:1}}

/* Navegação superior estilo O Estuda */
.sidebar{display:none!important}.main{margin-left:0!important}.site-header{position:sticky;top:0;z-index:20;background:#080808;border-bottom:1px solid #252525;padding:12px 24px 0;display:grid;grid-template-columns:1fr auto;align-items:center;gap:10px 20px}.site-header .brand{padding:0;display:flex}.header-user{display:flex;align-items:center;gap:10px;color:#ddd;font-size:11px}.top-nav{grid-column:1/-1;display:flex;align-items:center;gap:4px;overflow-x:auto;white-space:nowrap;border-top:1px solid #242424;padding-top:8px}.top-nav .nav-item{font-size:11px;padding:10px 12px;border-radius:7px 7px 0 0;flex:0 0 auto}.top-nav .nav-item.active{background:#242424;box-shadow:inset 0 -2px #fff}.topbar{height:56px;padding:0 28px}.content{max-width:1600px;padding:28px 28px 60px}.hidden{display:none!important}.header-user .btn{padding:7px 10px}.admin-only{border-left:1px solid #333}
body.light-theme{--bg:#f4f5f7;--panel:#fff;--panel2:#fff;--line:#dedfe3;--muted:#687080;--text:#17191f;background:#fff;color:#17191f}
body.light-theme .site-header,body.light-theme .topbar{background:#fff;border-color:#e1e3e8;color:#17191f}
body.light-theme .site-header .brand-mark{background:#f4f4f4;color:#111;border-color:#ddd}
body.light-theme .top-nav{border-color:#e1e3e8}
body.light-theme .nav-item{color:#343944}
body.light-theme .nav-item:hover,body.light-theme .nav-item.active{background:#eceef2;color:#111}
body.light-theme .panel,body.light-theme .stat-card,body.light-theme .subject-card,body.light-theme .admin-card{background:#fff;border-color:#e0e2e7;color:#17191f}
body.light-theme .btn{background:#f0f1f4;color:#17191f;border-color:#d9dce2}
body.light-theme .btn.light{background:#17191f;color:#fff;border-color:#17191f}
body.light-theme input,body.light-theme select,body.light-theme textarea{background:#fff;color:#17191f;border-color:#d9dce2}
body.light-theme .today,body.light-theme .welcome p,body.light-theme .stat-foot{color:#687080}
@media(max-width:760px){.site-header{padding:10px 12px 0;grid-template-columns:1fr;gap:8px}.header-user{position:absolute;right:12px;top:13px}.header-user #sideName{display:none}.top-nav{gap:2px}.top-nav .nav-item{padding:10px 9px;font-size:10px}.topbar{padding:0 14px}.content{padding:20px 14px 40px}.stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-grid{grid-template-columns:1fr}}

/* Identidade clara e agenda semanal */
body.light-theme{--bg:#ffffff;--panel:#ffffff;--panel2:#f7f9fc;--line:#e2e8f0;--muted:#64748b;--text:#173b68;background:#fff;color:#173b68}
body.light-theme .site-header{background:#fff;border-color:#e5eaf1;box-shadow:0 2px 8px rgba(15,40,70,.04)}
body.light-theme .site-header .brand-mark{background:#fff;color:#174477;border:1px solid #e3e8ef}
body.light-theme .brand b{color:#173b68}
body.light-theme .brand small,body.light-theme .header-user{color:#64748b}
body.light-theme .top-nav{border-color:#e7ebf1}
body.light-theme .top-nav .nav-item{color:#64748b}
body.light-theme .top-nav .nav-item:hover,body.light-theme .top-nav .nav-item.active{background:#f1f5fb;color:#174b86;box-shadow:inset 0 -2px #e85b27}
body.light-theme .topbar{background:#fff;border-color:#edf0f4}
body.light-theme .topbar b,body.light-theme .welcome h1,body.light-theme .section-head h1,body.light-theme h1,body.light-theme h2,body.light-theme h3{color:#173b68}
body.light-theme .eyebrow,body.light-theme .today,body.light-theme .welcome p,body.light-theme .stat-foot,body.light-theme .section-head p{color:#64748b}
body.light-theme .stat-card,body.light-theme .panel,body.light-theme .subject-card,body.light-theme .admin-card{background:#fff;border-color:#e2e8f0;box-shadow:0 1px 3px rgba(20,45,75,.06);color:#173b68}
body.light-theme .mission,body.light-theme .activity-card,body.light-theme .option{background:#f8fafc;border-color:#e2e8f0;color:#173b68}
body.light-theme .btn{background:#fff;color:#174b86;border-color:#dbe3ed}
body.light-theme .btn.primary,body.light-theme .btn.light{background:#245ca6;color:#fff;border-color:#245ca6}
body.light-theme .input,body.light-theme select,body.light-theme textarea{background:#fff;color:#173b68;border-color:#dbe3ed}
body.light-theme .progress{background:#e8eef7}body.light-theme .progress i{background:#245ca6}
body.light-theme .data-table th,body.light-theme .data-table td{border-color:#e8edf3;color:#24476e}
body.light-theme .tag,body.light-theme .pill{background:#f1f5f9;border-color:#dbe3ed;color:#45617f}
.subnav{grid-column:1/-1;display:flex;justify-content:center;gap:0;min-height:34px;border-top:1px solid #e7ebf1;background:#fff}
.subnav-item{border:0;border-bottom:2px solid transparent;background:transparent;color:#718096;padding:9px 26px 8px;font-size:11px;cursor:pointer;min-width:150px}
.subnav-item.active{color:#d65a2d;border-bottom-color:#d65a2d;font-weight:700}
.agenda-head{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:18px}
.agenda-head h1{font-size:22px;margin:0 0 12px;color:#173b68}
.agenda-legend{display:flex;gap:14px;flex-wrap:wrap;color:#64748b;font-size:10px}
.agenda-legend span{display:flex;align-items:center;gap:5px}
.legend-dot{width:9px;height:9px;border-radius:50%;display:inline-block}
.legend-dot.done{background:#b9ddc3}.legend-dot.progress{background:#f3d98a}.legend-dot.pending{background:#efc7bd}
.agenda-controls{display:flex;gap:8px}.agenda-controls .btn{border-radius:20px;padding:7px 13px;font-size:10px}
.agenda-grid{display:grid;grid-template-columns:repeat(7,minmax(145px,1fr));gap:2px;border-radius:12px;overflow:hidden;border:1px solid #e5eaf0;background:#e5eaf0}
.agenda-day{background:#fff;min-height:350px;min-width:0}
.agenda-day>header{background:#df501c;color:#fff;padding:12px 9px;font-size:11px;font-weight:700;min-height:48px}
.agenda-day>header small{display:block;margin-top:4px;font-size:10px;font-weight:500}
.agenda-day-items{padding:7px;display:grid;align-content:start;gap:7px}
.agenda-event{padding:9px 8px;border-radius:5px;display:grid;gap:6px;font-size:10px;line-height:1.4;border:1px solid transparent}
.agenda-event b{font-size:10px;font-weight:650}
.agenda-event small{font-size:9px;color:#718096}
.agenda-event.done{background:#e2f0e5;border-color:#c9e3d0;color:#315c3e}
.agenda-event.progress{background:#fff2cf;border-color:#f3dfaa;color:#735a1d}
.agenda-event.pending{background:#fbe4dc;border-color:#f2d0c4;color:#85452f}
.agenda-event button{justify-self:start;border:0;background:transparent;color:#245ca6;padding:0;font-size:9px;font-weight:700}
.agenda-event span{font-size:9px;color:#477354}
.agenda-empty{padding:12px 5px;color:#9aa5b4;font-size:9px;line-height:1.5}
.agenda-footer{display:flex;justify-content:flex-end;gap:9px;margin-top:16px}
.subscription-card{max-width:720px;padding:28px}
.subscription-card h2{font-size:25px;margin:10px 0}
.subscription-card p{color:#64748b;line-height:1.6}
.subscription-card .btn{display:inline-block;text-decoration:none;margin:8px 0}
@media(max-width:1100px){.agenda-grid{overflow-x:auto;grid-template-columns:repeat(7,minmax(165px,1fr))}}
@media(max-width:760px){.site-header{grid-template-columns:1fr auto}.subnav{justify-content:flex-start;overflow-x:auto}.subnav-item{min-width:max-content;padding:10px 16px}.agenda-head{align-items:flex-start;flex-direction:column}.agenda-grid{overflow-x:auto;grid-template-columns:repeat(7,minmax(165px,1fr))}.agenda-controls{width:100%;justify-content:space-between}.agenda-footer{flex-wrap:wrap}.agenda-footer .btn{flex:1}}

/* Ciclo inteligente: componentes do questionário */
.cycle-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:16px 0}
.cycle-summary-grid>div{padding:14px;border:1px solid var(--line);border-radius:10px;background:var(--panel2)}
.cycle-summary-grid small{display:block;color:var(--muted);font-size:9px;letter-spacing:.5px;margin-bottom:7px}
.cycle-summary-grid b{font-size:18px;color:var(--text)}
.wizard-progress{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin:0 0 18px}
.wizard-progress i{height:6px;border-radius:9px;background:var(--line)}
.wizard-progress i[style*="width"]{background:#2862ad}
.choice-row,.day-choice{display:flex;gap:8px;flex-wrap:wrap}
.choice{flex:1;min-width:70px;padding:10px;border:1px solid var(--line);border-radius:8px;background:var(--panel2);color:var(--text);font-size:11px}
.choice.selected{background:#245ca6;border-color:#245ca6;color:white}
.hours-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:7px;margin:10px 0}
.hours-grid label{font-size:10px;color:var(--muted);text-align:center}
.hours-grid input{display:block;width:100%;margin-top:6px;text-align:center;padding:9px 3px}
.hours-grid input:disabled{opacity:.35}
.cycle-subject-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-height:290px;overflow:auto;margin:12px 0 18px;padding-right:4px}
.cycle-subject{display:flex;align-items:center;gap:10px;border:1px solid var(--line);border-radius:9px;padding:12px;background:var(--panel2);cursor:pointer}
.cycle-subject input{width:auto}
.cycle-subject b,.cycle-subject small{display:block}
.cycle-subject small{font-size:10px;color:var(--muted);margin-top:4px}
.priority-list{display:grid;gap:9px;margin:14px 0}
.priority-option{position:relative;text-align:left;border:1px solid var(--line);border-radius:10px;padding:14px;background:var(--panel2);color:var(--text)}
.priority-option b,.priority-option small{display:block}
.priority-option small{color:var(--muted);margin-top:5px}
.priority-option.selected{border-color:#2862ad;background:color-mix(in srgb,#2862ad 12%,var(--panel))}
.priority-option span{position:absolute;right:12px;top:12px;font-size:9px;color:#2862ad;font-weight:700}
body.light-theme .cycle-summary-grid>div,body.light-theme .cycle-subject,body.light-theme .priority-option,body.light-theme .choice{background:#f8fafc;color:#173b68;border-color:#dce5f0}
body.light-theme .choice.selected{background:#245ca6;color:#fff;border-color:#245ca6}
body.light-theme .priority-option.selected{background:#edf4ff;border-color:#2862ad}
body.light-theme .priority-option span{color:#245ca6}
@media(max-width:760px){.cycle-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.hours-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.cycle-subject-list{grid-template-columns:1fr}}

/* Correção de contraste consistente nos dois temas */
body.light-theme{--bg:#fff;--panel:#fff;--panel2:#f7f9fc;--line:#dfe6ef;--muted:#64748b;--text:#173b68;background:#fff;color:#173b68}
body.light-theme .metric,body.light-theme .mission,body.light-theme .activity-card,body.light-theme .option,body.light-theme .explanation,body.light-theme .level-icon,body.light-theme .subject-icon{background:#f7f9fc!important;border-color:#dfe6ef!important;color:#173b68}
body.light-theme .metric small,body.light-theme .field label,body.light-theme .mission small,body.light-theme .panel-title span,body.light-theme .stat-foot,body.light-theme .activity-type{color:#64748b}
body.light-theme .metric b,body.light-theme .mission-top,body.light-theme .activity-main b,body.light-theme .question-text{color:#173b68}
body.light-theme .modal{background:#fff;color:#173b68;border-color:#dfe6ef;box-shadow:0 18px 60px #0f274022}
body.light-theme .modal-head h2,body.light-theme .modal .field label{color:#173b68}
body.light-theme .modal-backdrop{background:#14243b66}
body.light-theme .modal .input,body.light-theme .modal input,body.light-theme .modal select,body.light-theme .modal textarea{background:#f7f9fc;color:#173b68;border-color:#d9e2ef}
body.light-theme .data-table th{background:#f3f6fa;color:#355477}
body.light-theme .data-table td{color:#24476e;border-color:#e6edf5}
body.light-theme .tag,body.light-theme .pill{background:#f1f5f9;color:#45617f;border-color:#dbe3ed}
body.light-theme .bar-track,body.light-theme .progress{background:#e7edf5}
body.light-theme .chart{background:repeating-linear-gradient(to bottom,transparent 0,transparent 49px,#e8edf4 50px);border-color:#a8b8ca}
body.light-theme .chart-col small{color:#64748b}
body.light-theme .chart-bar{background:linear-gradient(#245ca6,#7da5d7)}
body.light-theme .option{background:#fff!important}
body.light-theme .option.selected{background:#edf4ff!important;border-color:#245ca6!important}
body.light-theme .option.correct{background:#edf8f0!important;border-color:#58a66b!important}
body.light-theme .option.wrong{background:#fff1f1!important;border-color:#d66!important}
body.light-theme .explanation{background:#f0f7ef!important;color:#315a38!important;border-color:#cfe4cf!important}
body.light-theme .activity-card{background:#fff!important}
body.light-theme .activity-done{background:#f0f8f1!important}
body.light-theme .btn{background:#fff;color:#24558e;border-color:#d7e1ed}
body.light-theme .btn.primary,body.light-theme .btn.light{background:#245ca6;color:#fff;border-color:#245ca6}
body.light-theme .btn.danger{color:#b42332;border-color:#e7b8be;background:#fff}
body.light-theme .auth-screen{background:#eef3f9}
body.light-theme .auth-card{background:#fff;color:#173b68;border-color:#dfe6ef}
body.light-theme .auth-card label{color:#355477}
body.light-theme .auth-card>p,body.light-theme .auth-card small{color:#64748b}
body.light-theme .tabs{background:#f1f5f9}
body.light-theme .tab{color:#64748b}
body.light-theme .tab.active{background:#245ca6;color:#fff}
body.light-theme .brand-mark{background:#173b68;color:#fff;border-color:#173b68}
body.light-theme .activity-card .btn{background:#245ca6;color:#fff}
body:not(.light-theme) .modal{background:#121820;color:#eef4fb;border-color:#344255}
body:not(.light-theme) .modal .field label{color:#c2cedd}
body:not(.light-theme) .modal input,body:not(.light-theme) .modal select,body:not(.light-theme) .modal textarea{background:#0c121b;color:#eef4fb;border-color:#344255}
body:not(.light-theme) .cycle-summary-grid>div,body:not(.light-theme) .cycle-subject,body:not(.light-theme) .priority-option,body:not(.light-theme) .choice{background:#151e2b;color:#eaf1fb;border-color:#344255}
body:not(.light-theme) .choice.selected{background:#245ca6;color:#fff;border-color:#245ca6}
body:not(.light-theme) .priority-option.selected{background:#1b304b;border-color:#4c8bd1}
body:not(.light-theme) .stat-foot,body:not(.light-theme) .field label{color:#aebbd0}

body.light-theme .agenda-day{background:#fff;border-color:#dfe6ef;color:#173b68}
body.light-theme .agenda-day>header{background:#e85b27;color:#fff}
body.light-theme .agenda-event{background:#fff;border-color:#dfe6ef;color:#173b68}
body.light-theme .agenda-event small{color:#64748b}
body.light-theme .agenda-event.done{background:#eff8f1;border-color:#c7e5ce}
body.light-theme .agenda-event.progress{background:#fff8e8;border-color:#f1dca6}
body.light-theme .agenda-event.pending{background:#fff1eb;border-color:#f1c8b8}
body.light-theme .agenda-empty{color:#94a3b8}
body.light-theme .subnav{background:#fff;border-color:#e5eaf1}
body:not(.light-theme) .agenda-day{background:#101722;border-color:#344255;color:#eef4fb}
body:not(.light-theme) .agenda-day>header{background:#245ca6;color:#fff}
body:not(.light-theme) .agenda-event{background:#151e2b;border-color:#344255;color:#eef4fb}
body:not(.light-theme) .agenda-event small{color:#aebbd0}

/* Conquistas e gamificação */
.achievements-panel{margin-top:18px}
.achievement-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}
.achievement-card{min-height:104px;border:1px solid var(--line);border-radius:13px;padding:13px 8px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;text-align:center;background:var(--panel2)}
.achievement-icon{position:relative;font-size:25px;line-height:1.2;color:#91a2ba}
.achievement-icon small{position:absolute;font-size:10px;right:-8px;bottom:-3px;color:var(--muted)}
.achievement-card span{font-size:10px;color:var(--text);line-height:1.3}
.achievement-card>small{font-size:9px;color:var(--muted)}
.achievement-card.locked{opacity:.66;filter:saturate(.45)}
.achievement-card.unlocked{background:color-mix(in srgb,#2d9c63 9%,var(--panel));border-color:#5aa77a}
.achievement-card.unlocked .achievement-icon{color:#27945a}
body.light-theme .achievement-card{background:#fbfcfe;border-color:#e2e9f2}
body.light-theme .achievement-card.unlocked{background:#eff9f2;border-color:#a9d7b7}
body.light-theme .achievement-card span{color:#173b68}
@media(max-width:1000px){.achievement-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:600px){.achievement-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.achievement-card{min-height:92px}}

/* Flashcards: catálogo oficial e baralhos particulares */
.flashcard-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:18px 0}
.flashcard-metrics .stat-card{min-width:0}
.flashcard-tabs{display:inline-flex;gap:5px;padding:4px;background:var(--panel2);border-radius:12px;margin:6px 0 18px}
.tab-btn{border:0;background:transparent;color:var(--muted);padding:9px 13px;border-radius:9px;cursor:pointer;font:inherit}
.tab-btn.active{background:var(--panel);color:var(--text);box-shadow:0 1px 5px #00000012}
.tab-btn small{opacity:.7;margin-left:5px}
.flashcard-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0 0 18px}
.flashcard-toolbar p{margin:0;color:var(--muted);font-size:13px}
.flashcard-search{margin-bottom:16px}
.flashcard-search input{width:100%;box-sizing:border-box}
.flashcard-deck-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.flashcard-deck-card{width:100%;display:flex;align-items:center;gap:14px;text-align:left;border:1px solid var(--line);background:var(--panel);color:var(--text);border-radius:16px;padding:18px;cursor:pointer;min-height:76px}
.flashcard-deck-card:hover{border-color:var(--accent);transform:translateY(-1px)}
.deck-icon{font-size:24px;color:var(--muted)}
.deck-copy{display:flex;flex:1;flex-direction:column;gap:4px;min-width:0}
.deck-copy b{font-size:14px;font-weight:600}
.deck-copy small{font-size:11px;color:var(--muted)}
.deck-arrow{font-size:24px;color:var(--muted)}
.flashcard-empty{padding:36px 16px;text-align:center;line-height:2}
.flashcard-empty .btn{margin-top:14px}
.flashcard-study-wrap{max-width:780px;margin:22px auto;padding:20px;border:1px solid var(--line);border-radius:18px;background:var(--panel)}
.flashcard-study-meta{display:flex;justify-content:space-between;color:var(--muted);font-size:12px;margin-bottom:14px}
.flashcard-study-card{width:100%;min-height:300px;padding:32px;border:1px solid var(--line);border-radius:16px;background:var(--panel2);color:var(--text);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;text-align:center;cursor:pointer}
.flashcard-study-card small{font-size:11px;letter-spacing:.12em;color:var(--muted)}
.flashcard-study-card strong{font-size:clamp(20px,3vw,28px);line-height:1.45;white-space:pre-wrap}
.flashcard-study-card span{font-size:12px;color:var(--muted)}
.flashcard-study-card.revealed{border-color:var(--accent)}
.flashcard-study-controls{display:flex;justify-content:space-between;gap:12px;margin-top:16px}
.flashcard-study-controls button:disabled{opacity:.35;cursor:not-allowed}
.flashcard-rating{margin-top:18px;text-align:center}
.flashcard-rating p{font-size:13px;color:var(--muted);margin:0 0 12px}
.flashcard-rating button{border:1px solid var(--line);background:var(--panel);color:var(--text);border-radius:9px;padding:10px 15px;margin:4px;cursor:pointer}
.flashcard-rating button:hover{border-color:var(--accent)}
body.light-theme .flashcard-deck-card,body.light-theme .flashcard-study-wrap{background:#fff}
body.light-theme .flashcard-study-card{background:#f5f8fc;color:#173b68}
@media(max-width:760px){.flashcard-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.flashcard-deck-grid{grid-template-columns:1fr}.flashcard-toolbar{align-items:flex-start;flex-direction:column}.flashcard-study-wrap{padding:12px}.flashcard-study-card{min-height:250px;padding:20px}}


/* Central de revisões e modo de estudo inspirado nas referências */
.review-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:18px 0 22px}
.review-filters{display:flex;gap:12px;margin:20px 0 16px}
.review-filters select{min-width:210px;max-width:280px}
.review-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;padding:4px;border-radius:12px;background:var(--panel2);max-width:760px;margin-bottom:18px}
.review-tabs button{border:0;border-radius:9px;padding:11px 8px;background:transparent;color:var(--muted);font-weight:600;font-size:12px}
.review-tabs button.active{background:var(--bg);color:var(--text);box-shadow:0 1px 5px #00000016}
.review-list{display:grid;gap:10px;max-width:1100px}
.review-item{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:16px;border:1px solid var(--line);border-radius:13px;background:var(--panel)}
.review-item.overdue{border-left:3px solid #e34e4e}
.review-item.today{border-left:3px solid #4e91d8}
.review-item-main{display:grid;gap:5px;min-width:0}
.review-subject{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.6px}
.review-item-main b{font-size:14px}
.review-item-main small{font-size:11px;color:var(--muted)}
.review-item-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.review-empty{padding:54px 16px;text-align:center;color:var(--muted);font-size:13px}
.flash-review-shell{max-width:760px;margin:0 auto;padding:0 0 26px;color:var(--text)}
.flash-review-top{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:16px}
.flash-review-title small{display:block;color:var(--muted);font-size:11px;margin-bottom:4px}
.flash-review-title h1{font-size:18px;margin:0}
.flash-review-actions{display:flex;gap:8px}
.flash-review-actions button{width:34px;height:34px;border:0;background:transparent;color:var(--text);font-size:20px;border-radius:8px}
.flash-review-actions button:hover{background:var(--panel2)}
.flash-review-progress{display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:center;margin-bottom:18px;color:var(--muted);font-size:11px}
.flash-review-progress .progress{height:6px;background:var(--line)}
.flash-review-progress .progress i{background:#8aa9d4}
.flash-review-card{width:100%;min-height:380px;padding:38px 44px;border:1px solid var(--line);border-radius:20px;background:var(--panel);color:var(--text);display:flex;flex-direction:column;justify-content:space-between;align-items:center;gap:20px;text-align:center;cursor:pointer;box-shadow:0 8px 22px #00000008}
.flash-review-card small{align-self:flex-start;color:var(--muted);font-size:10px;letter-spacing:2px}
.flash-review-card strong{font-size:clamp(20px,3vw,26px);line-height:1.45;white-space:pre-wrap;max-width:620px;margin:auto}
.flash-review-card span{font-size:11px;color:var(--muted)}
.flash-review-card.revealed{border-color:#8aa9d4}
.flash-review-ratings{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:14px}
.flash-review-ratings button{min-height:48px;border:1px solid var(--line);border-radius:10px;background:var(--panel2);color:var(--text);font-weight:650;font-size:12px}
.flash-review-ratings button:disabled{opacity:.38;cursor:not-allowed}
.flash-review-ratings .rating-again:not(:disabled){background:#f3dede;color:#9a3030;border-color:#e8c4c4}
.flash-review-ratings .rating-hard:not(:disabled){background:#f5e8d2;color:#895b1b;border-color:#e8d5b8}
.flash-review-ratings .rating-good:not(:disabled),.flash-review-ratings .rating-easy:not(:disabled){background:#91acd2;color:#fff;border-color:#91acd2}
.flash-review-hint{text-align:center;color:var(--muted);font-size:11px;margin:10px 0 22px}
.flash-review-navigation{display:flex;justify-content:space-between;align-items:center}
.flash-review-navigation button{border:0;background:transparent;color:var(--text);padding:8px 12px;font-weight:600}
.flash-review-navigation button:disabled{opacity:.35;cursor:not-allowed}
body.light-theme .review-tabs{background:#f1f4f8}
body.light-theme .review-tabs button.active{background:#fff;color:#173b68}
body.light-theme .review-item{background:#fff}
body.light-theme .flash-review-card{background:#fff;color:#173b68;box-shadow:0 8px 24px rgba(25,55,90,.06)}
body.light-theme .flash-review-card.revealed{border-color:#91acd2}
body.light-theme .flash-review-actions button{color:#173b68}

/* Mobile navigation drawer */
.mobile-menu-toggle{display:none;border:0;background:transparent;color:var(--text);font-size:23px;width:38px;height:38px;border-radius:9px}
.mobile-nav-backdrop{display:none}
@media(max-width:760px){
 .site-header{grid-template-columns:38px minmax(0,1fr) auto;align-items:center;padding:9px 12px;gap:8px}
 .mobile-menu-toggle{display:inline-grid;place-items:center}
 .site-header .brand{grid-column:2;grid-row:1;padding:0;gap:8px}
 .site-header .brand-mark{width:36px;height:36px}
 .site-header .brand b{font-size:12px}
 .site-header .brand small{font-size:9px}
 .header-user{position:static;grid-column:3;grid-row:1;gap:6px}
 .header-user .btn{padding:7px 8px;font-size:10px}
 .top-nav{position:fixed;left:0;top:0;bottom:0;width:min(84vw,320px);height:100dvh;z-index:102;display:flex;flex-direction:column;align-items:stretch;gap:5px;overflow-y:auto;white-space:normal;padding:76px 14px 24px;background:var(--panel);border:0;border-right:1px solid var(--line);box-shadow:12px 0 36px #00000020;transform:translateX(-110%);transition:transform .24s ease}
 .top-nav.mobile-open{transform:translateX(0)}
 .top-nav .nav-item{width:100%;flex:none;padding:13px 12px;font-size:13px;border-radius:9px;white-space:normal}
 .top-nav .nav-item.active{box-shadow:inset 3px 0 #8aa9d4}
 .mobile-nav-backdrop.visible{display:block;position:fixed;inset:0;background:#0009;z-index:101}
 body.light-theme .top-nav{background:#f5f7fb}
 body.light-theme .mobile-menu-toggle{color:#173b68}
 .topbar{height:52px;padding:0 14px}
 .top-actions{gap:6px}
 .top-actions .btn{padding:8px 10px;font-size:10px}
 .content{width:100%;max-width:100%;padding:16px 12px 36px;overflow-x:hidden}
 .section-head{gap:12px}
 .section-head h1{font-size:22px}
 .stats-grid,.review-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .stat-card{padding:12px;min-width:0}
 .stat-value{font-size:22px}
 .dashboard-grid,.cycle-summary-grid{grid-template-columns:1fr}
 .panel{padding:13px;margin-bottom:12px}
 .panel-title{gap:8px;align-items:flex-start}
 .panel-title h3{line-height:1.4}
 .welcome{flex-direction:column}
 .welcome .btn{align-self:flex-start}
 .activity-card,.review-item{align-items:flex-start;flex-direction:column}
 .activity-actions,.review-item-actions{width:100%;justify-content:flex-start}
 .review-item-actions .btn{flex:1}
 .review-filters{display:grid;grid-template-columns:1fr;gap:8px}
 .review-filters select{width:100%;max-width:none;min-width:0}
 .review-tabs{width:100%;grid-template-columns:repeat(2,minmax(0,1fr))}
 .review-tabs button{font-size:11px}
 .flash-review-shell{width:100%;padding:0 2px 20px}
 .flash-review-top{margin-bottom:12px}
 .flash-review-card{min-height:340px;padding:24px 18px;border-radius:16px}
 .flash-review-card strong{font-size:21px}
 .flash-review-ratings{gap:6px}
 .flash-review-ratings button{font-size:11px;min-height:48px;padding:8px 4px}
 .flash-review-progress{gap:8px;font-size:10px}
 .flash-review-navigation button{padding:10px 4px}
 .table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
 .data-table{min-width:620px}
 .form-grid{grid-template-columns:1fr}
 .field,.field input,.field select,.field textarea,.input{min-width:0;max-width:100%}
 .modal-backdrop{padding:10px;align-items:flex-end}
 .modal{width:100%;max-width:100%;max-height:88dvh;overflow-y:auto;border-radius:18px 18px 12px 12px;padding:16px}
 .modal-actions{position:sticky;bottom:-16px;background:var(--panel);padding:12px 0 0}
 .agenda-head{align-items:flex-start;flex-direction:column;gap:12px}
 .agenda-controls{display:flex;width:100%;gap:8px}
 .agenda-controls .btn{flex:1;padding:9px 7px;font-size:10px}
 .agenda-grid{grid-template-columns:1fr!important}
 .agenda-day{min-width:0}
 .agenda-footer{display:flex;flex-direction:column;align-items:stretch}
 .agenda-footer .btn{width:100%}
 .flashcard-study-wrap{margin:12px auto;padding:12px}
 .flashcard-study-card{min-height:250px;padding:18px}
 .flashcard-study-controls .btn{flex:1}
 .import-panel{padding:14px}
 .chart{height:180px}
 .cards-grid,.flashcard-deck-grid{grid-template-columns:1fr}
 .subscription-card{padding:18px}
}
@media(max-width:390px){
 .site-header .brand small{display:none}
 .header-user .theme-toggle{font-size:0;width:34px;height:34px;padding:0}
 .header-user .theme-toggle:after{content:"◐";font-size:16px}
 .flash-review-card{min-height:300px}
 .flash-review-ratings{grid-template-columns:repeat(2,minmax(0,1fr))}
 .review-stats .stat-card{padding:10px}
 .review-stats .stat-value{font-size:20px}
 .content{padding-left:10px;padding-right:10px}
}


/* Configurações — identidade e componentes responsivos */
.settings-page{max-width:1120px;margin:0 auto}
.settings-section{padding:18px;margin-bottom:14px}
.settings-section>h3,.settings-danger h3{font-size:13px;margin:0 0 13px;color:var(--text)}
.settings-help,.settings-install p,.settings-danger p{font-size:11px;color:var(--muted);margin:0 0 14px}
.settings-access-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.settings-access-grid>div{padding:10px;border:1px solid var(--line);border-radius:9px;background:var(--panel2);display:grid;gap:3px;min-width:0}
.settings-access-grid small,.settings-level-head small{font-size:9px;color:var(--muted)}
.settings-access-grid b{font-size:11px;overflow-wrap:anywhere}
.settings-inline-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.settings-inline-actions .btn{font-size:10px}
.settings-install{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:18px;margin-bottom:14px}
.settings-install h3{font-size:13px;margin:0 0 6px}
.settings-install p{margin:0 0 6px}
.settings-install small{font-size:10px;color:var(--muted)}
.settings-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.settings-form-grid label,.settings-wide-label{display:grid;gap:6px;font-size:10px;color:var(--muted);min-width:0}
.settings-form-grid .input,.settings-wide-label .input{width:100%;min-width:0}
.settings-save-row{display:flex;justify-content:flex-end;margin-top:14px}
.settings-level{padding:17px;margin-bottom:14px}
.settings-level-head{display:flex;align-items:center;gap:12px;margin-bottom:12px}
.settings-level-head>div:last-child{display:grid;gap:3px}
.settings-level-head b{font-size:15px}
.settings-level-head span{font-size:10px;color:var(--muted)}
.settings-level-icon{width:48px;height:48px;display:grid;place-items:center;border-radius:12px;background:#245ca6;color:#fff;font-size:23px}
.settings-level>small{display:block;font-size:9px;color:var(--muted);margin-top:7px}
.settings-section-title{display:flex;justify-content:space-between;align-items:center}
.settings-section-title h3{margin:0}
.settings-section-title small{color:var(--muted);font-size:10px}
.settings-achievements{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;margin-top:13px}
.settings-achievement{min-height:78px;border:1px solid var(--line);border-radius:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;text-align:center;padding:8px;background:var(--panel2)}
.settings-achievement span{font-size:19px;color:var(--muted)}
.settings-achievement small{font-size:9px;color:var(--muted);line-height:1.3}
.settings-achievement.unlocked{border-color:#8aa9d4}
.settings-achievement.unlocked span{color:#3979c5}
.settings-pomodoro{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:13px 0;margin-top:10px;border-top:1px solid var(--line)}
.settings-pomodoro b{font-size:11px}
.settings-pomodoro p{font-size:10px;color:var(--muted);margin:4px 0 0}
.settings-switch{position:relative;display:inline-flex;flex:none}
.settings-switch input{position:absolute;opacity:0;width:1px;height:1px}
.settings-switch span{width:42px;height:23px;border-radius:30px;background:#777;display:block;transition:.2s;cursor:pointer}
.settings-switch span:after{content:"";position:absolute;left:3px;top:3px;width:17px;height:17px;border-radius:50%;background:#fff;transition:.2s}
.settings-switch input:checked+span{background:#245ca6}
.settings-switch input:checked+span:after{transform:translateX(19px)}
.settings-pomodoro-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.settings-pomodoro-fields label{display:grid;gap:5px;font-size:10px;color:var(--muted)}
.settings-danger{border:1px solid #d96b78;padding:16px;margin-bottom:18px}
.settings-danger h3{color:#d96b78}
.settings-danger .btn.danger{color:#c12e3b;border-color:#d96b78;background:transparent}

/* Drawer: keep the menu above its dimming layer on every mobile browser. */
@media(max-width:760px){
 .site-header{position:sticky;z-index:220;isolation:isolate}
 .site-header .top-nav{z-index:223!important;background:var(--panel)!important;color:var(--text);top:0;bottom:0;left:0;position:fixed;transform:translate3d(-110%,0,0);width:min(84vw,320px);height:100dvh;max-height:100dvh;overflow-y:auto;overscroll-behavior:contain;padding:74px 14px 28px;box-shadow:12px 0 36px #0005}
 .site-header .top-nav.mobile-open{transform:translate3d(0,0,0)}
 .site-header #mobileNavBackdrop{position:fixed;inset:0;z-index:222;background:rgba(0,0,0,.58);display:none}
 .site-header #mobileNavBackdrop.visible{display:block}
 .site-header .top-nav .nav-item{color:var(--text);text-align:left;justify-content:flex-start}
 .site-header .top-nav .nav-item.active{background:var(--panel2);color:var(--text);box-shadow:inset 3px 0 #e85b27}
 .mobile-menu-open{overflow:hidden}
}
@media(min-width:761px){.mobile-menu-toggle,.mobile-nav-backdrop{display:none!important}}
@media(max-width:760px){
 .settings-page{width:100%}
 .settings-access-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .settings-install{align-items:flex-start;flex-direction:column}
 .settings-form-grid,.settings-pomodoro-fields{grid-template-columns:1fr}
 .settings-achievements{grid-template-columns:repeat(3,minmax(0,1fr))}
 .settings-inline-actions{width:100%}
 .settings-inline-actions .btn{flex:1}
 .settings-save-row .btn{width:100%}
 .settings-section,.settings-level,.settings-install{padding:14px}
}

/* Dark mode: prevent legacy light-only surfaces from staying white. */
body:not(.light-theme){background:var(--bg);color:var(--text)}
body:not(.light-theme) .site-header,
body:not(.light-theme) .topbar,
body:not(.light-theme) .subnav{background:#090909;color:var(--text);border-color:var(--line)}
body:not(.light-theme) .subnav .subnav-item{background:transparent;color:var(--muted)}
body:not(.light-theme) .subnav .subnav-item.active{color:var(--text);background:#171717}
body:not(.light-theme) .agenda-day,
body:not(.light-theme) .agenda-event,
body:not(.light-theme) .flashcard-deck-card,
body:not(.light-theme) .flashcard-study-wrap,
body:not(.light-theme) .modal,
body:not(.light-theme) .auth-card,
body:not(.light-theme) .option,
body:not(.light-theme) .mission,
body:not(.light-theme) .activity-card{background:var(--panel);color:var(--text);border-color:var(--line)}
body:not(.light-theme) .agenda-day>header{background:#202a38;color:#f5f5f5}
body:not(.light-theme) .agenda-event.progress{background:#332a17;color:#f0d69a;border-color:#5b4a26}
body:not(.light-theme) .agenda-event.pending{background:#251c19;color:#f1c1ae;border-color:#54382e}
body:not(.light-theme) .flashcard-study-card{background:#111;color:#f5f5f5;border-color:#333}
body:not(.light-theme) .btn.light,
body:not(.light-theme) .btn.primary{background:#245ca6;color:#fff;border-color:#245ca6}
body:not(.light-theme) .input,
body:not(.light-theme) input,
body:not(.light-theme) select,
body:not(.light-theme) textarea{background:#151515;color:#f5f5f5;border-color:#343434}
body:not(.light-theme) .option.wrong{background:#351d20!important}
body:not(.light-theme) .option.correct{background:#1b3025!important}
body:not(.light-theme) .modal-backdrop{background:rgba(0,0,0,.76)}
body:not(.light-theme) .settings-access-grid>div,
body:not(.light-theme) .settings-achievement{background:#151515}
body:not(.light-theme) .settings-danger{background:#160d0f}
