*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:#f6f7fb;color:#171923;font-family:Inter,Arial,sans-serif}.orb{position:fixed;border-radius:50%;filter:blur(85px);opacity:.42;pointer-events:none;z-index:-1}.orb-a{width:330px;height:330px;background:#cfc4ff;right:-100px;top:70px}.orb-b{width:300px;height:300px;background:#bdeaff;left:-140px;bottom:30px}.topbar{height:74px;position:sticky;top:0;z-index:20;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:0 max(18px,calc((100vw - 1200px)/2));background:#ffffffd9;backdrop-filter:blur(18px);border-bottom:1px solid #e7e8ee}.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:#171923;min-width:190px}.brand-mark{width:40px;height:40px;border-radius:13px;background:#181a24;color:white;display:grid;place-items:center;font:800 23px Manrope,Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;box-shadow:0 8px 20px #181a2425}.brand b{display:block;font:800 15px Manrope,Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif}.brand small{font-size:10px;color:#8c8f99}.topbar nav{display:flex;gap:4px}.nav-btn{border:0;background:transparent;border-radius:11px;padding:10px 13px;color:#747782;font:700 12px Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;cursor:pointer}.nav-btn.active,.nav-btn:hover{background:#efedff;color:#6756d6}.streak{padding:9px 12px;border:1px solid #e3e4e9;border-radius:11px;background:white;font-size:11px;color:#777b86}.streak b{color:#20222a}main{max-width:1200px;margin:auto;padding:46px 22px 75px}.page{display:none}.page.active{display:block}.hero{display:grid;grid-template-columns:1.45fr .7fr;gap:45px;align-items:center;padding:35px 0 60px}.eyebrow{font-size:10px;letter-spacing:1.6px;font-weight:800;color:#725fd9}.hero h1{font:800 clamp(43px,5.3vw,70px)/1.03 Manrope,Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;letter-spacing:-3px;margin:12px 0 18px}.hero h1 em{color:#725fd9;font-style:normal}.hero p{max-width:650px;color:#737782;line-height:1.7;font-size:15px}.actions{display:flex;gap:10px;margin-top:26px}.btn{border:0;border-radius:12px;padding:13px 17px;font:700 12px Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;cursor:pointer;transition:.18s}.btn.primary{background:#191b25;color:white;box-shadow:0 10px 25px #191b2525}.btn.primary:hover{transform:translateY(-2px)}.btn.ghost{background:#fff;color:#30323b;border:1px solid #e1e2e8}.hero-progress{background:white;border:1px solid #e6e7ec;border-radius:23px;padding:28px;box-shadow:0 18px 50px #30334a0b}.mini-label{font-size:9px;letter-spacing:1.5px;color:#979aa4;font-weight:800}.progress-number{display:flex;align-items:end;gap:8px;margin:16px 0 12px}.progress-number strong{font:800 48px Manrope,Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;letter-spacing:-2px}.progress-number span{font-size:10px;color:#92959e;margin-bottom:8px}.progress{height:8px;border-radius:20px;background:#eeeeF3;overflow:hidden}.progress i{display:block;height:100%;width:0;border-radius:20px;background:linear-gradient(90deg,#8c76f2,#5d55d7);transition:.4s}.mini-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:23px}.mini-stats div{border-top:1px solid #eeeeF2;padding-top:12px}.mini-stats b{display:block;font-size:17px}.mini-stats small{color:#999ca6;font-size:9px}.section-title{margin:15px 0 18px}.section-title h2{font:800 26px Manrope,Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;margin:6px 0;letter-spacing:-1px}.feature-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.feature{border:1px solid #e5e6eb;border-radius:18px;background:white;padding:21px;display:grid;grid-template-columns:43px 1fr auto;gap:13px;text-align:left;cursor:pointer;transition:.2s}.feature:hover{transform:translateY(-3px);box-shadow:0 15px 35px #2c30400e}.feature>span{width:43px;height:43px;border-radius:13px;display:grid;place-items:center;font-weight:800}.feature b{font:800 14px Manrope,Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;display:block;margin:2px 0 6px}.feature small{font-size:10px;color:#898c97;line-height:1.55}.feature strong{color:#aaa;align-self:center}.violet>span{background:#eeeaff;color:#7059dc}.blue>span{background:#e5f5ff;color:#348fce}.orange>span{background:#fff0df;color:#d88935}.topics-title{margin-top:50px}.topic-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:10px}.topic{background:#fff;border:1px solid #e6e7ec;border-radius:16px;padding:17px;min-height:112px}.topic-icon{font-size:20px}.topic b{display:block;font-size:12px;margin:10px 0 5px}.topic small{color:#999ca5;font-size:9px;line-height:1.4}.source-card{margin-top:14px;border:1px solid #e1e4ec;background:#fff;border-radius:19px;padding:18px 20px;display:flex;align-items:center;justify-content:space-between;gap:15px}.source-card>div{display:flex;align-items:center;gap:12px}.source-icon{width:35px;height:35px;border-radius:11px;background:#edf8f0;color:#318151;display:grid;place-items:center;font-weight:800}.source-card b{font-size:12px}.source-card p{margin:4px 0 0;font-size:10px;color:#92959e}.page-title{display:flex;justify-content:space-between;align-items:end;margin:15px 0 28px}.page-title h1{font:800 42px Manrope,Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;letter-spacing:-1.6px;margin:7px 0 4px}.page-title p{margin:0;color:#858893;font-size:12px}.counter{font-size:10px;color:#8d909a;background:#fff;border:1px solid #e5e6eb;border-radius:10px;padding:9px 11px}.tabs{display:flex;gap:6px;margin-bottom:15px;flex-wrap:wrap}.tab{border:1px solid #e1e2e8;background:#fff;color:#747782;border-radius:11px;padding:10px 13px;font:700 11px Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;cursor:pointer}.tab.active{background:#191b25;color:#fff;border-color:#191b25}.formula-card{background:#fff;border:1px solid #e5e6eb;border-radius:22px;padding:28px;max-width:900px}.formula-card h2{font:800 22px Manrope,Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;margin:5px 0}.formula-card>p{font-size:11px;color:#8c8f99}.formula-editor{margin-top:20px;border:1px solid #dfe1e8;border-radius:14px;overflow:hidden;background:white}.toolbar{display:flex;flex-wrap:wrap;gap:5px;padding:8px;background:#f7f7fa;border-bottom:1px solid #e6e7ec}.tool{border:1px solid #dedfe5;background:white;border-radius:8px;padding:7px 9px;cursor:pointer;font-weight:700}.editor{min-height:74px;padding:18px;font:600 23px Georgia;outline:0}.editor:empty:before{content:"Введи формулу…";color:#b1b3bc}.frac{display:inline-flex;vertical-align:middle;flex-direction:column;align-items:center;line-height:1;margin:0 3px}.frac .num,.frac .den{padding:1px 5px;min-width:25px;text-align:center}.frac .num{border-bottom:1.5px solid #222}.frac .den{padding-top:2px}.sup{font-size:.65em;vertical-align:super}.sub{font-size:.65em;vertical-align:sub}.formula-actions{display:flex;gap:8px;margin-top:12px;align-items:center}.feedback{margin-top:12px;padding:12px;border-radius:11px;font-size:11px}.ok{background:#eaf8ef;color:#277644}.bad{background:#fff0f0;color:#b44848}.match-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:18px}.match-item{background:#fafafd;border:1px solid #e3e4ea;border-radius:13px;padding:15px;cursor:pointer;font-size:11px;line-height:1.45}.match-item.selected{border-color:#7460dc;background:#f5f2ff}.match-item.done{border-color:#5ca877;background:#edf8f1}.flashcard{max-width:680px;min-height:300px;border-radius:24px;background:#191b25;color:white;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:35px;cursor:pointer;box-shadow:0 20px 45px #191b2525}.flashcard strong{font:800 38px Manrope,Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;margin:17px 0}.flashcard p{color:#b8bbc5;font-size:11px}.catalog{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.formula-row{background:#fff;border:1px solid #e5e6eb;border-radius:14px;padding:15px;display:flex;align-items:center;justify-content:space-between;gap:15px}.formula-row b{font-size:12px}.formula-row small{display:block;color:#92959e;margin-top:4px;font-size:9px}.formula-math{font:700 19px Georgia;white-space:nowrap}.filterbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}.chips{display:flex;flex-wrap:wrap;gap:6px}.chip{border:1px solid #e0e1e7;background:#fff;border-radius:20px;padding:8px 11px;font:700 10px Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;color:#777a85;cursor:pointer}.chip.active{background:#7460dc;color:#fff;border-color:#7460dc}.fipi-link{font-size:10px;font-weight:800;color:#6655cf;text-decoration:none;white-space:nowrap}.task-shell{max-width:1000px}.task-card{background:#fff;border:1px solid #e4e5eb;border-radius:22px;padding:28px}.task-meta{display:flex;gap:6px}.tag{font-size:9px;font-weight:800;padding:6px 8px;border-radius:7px;background:#f0eeff;color:#6e5bd4}.tag.orange{background:#fff0de;color:#bd762c}.task-card h2{font:800 22px/1.4 Manrope,Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;margin:15px 0}.given{background:#f7f7fa;border-radius:13px;padding:17px;color:#555963;font-size:12px;line-height:1.65;margin:15px 0}.options{display:grid;grid-template-columns:repeat(2,1fr);gap:9px}.option{border:1px solid #dfe1e7;background:white;border-radius:12px;padding:15px;text-align:left;font:600 11px Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;cursor:pointer}.option:hover{border-color:#7562dc}.option.correct{background:#eaf8ef;border-color:#5ca877}.option.wrong{background:#fff0f0;border-color:#d77b7b}.task-foot{display:flex;justify-content:space-between;align-items:center;margin-top:16px}.task-foot small{color:#999ca6;font-size:9px}.exam-intro{background:#191b25;color:white;border-radius:23px;padding:27px;display:flex;justify-content:space-between;align-items:center;gap:25px}.exam-head{display:flex;align-items:center;gap:15px}.exam-icon{width:50px;height:50px;border-radius:15px;background:#2c2f3c;display:grid;place-items:center;font-size:22px}.exam-head h2{font:800 20px Manrope,Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;margin:0 0 5px}.exam-head p{margin:0;color:#a6a9b5;font-size:10px}.exam-settings{display:flex;align-items:end;gap:10px}.exam-settings label{font-size:9px;color:#9ea1ac;display:flex;flex-direction:column;gap:6px}.exam-settings select{background:#2a2c38;border:1px solid #414451;color:white;padding:10px;border-radius:9px;font-size:10px}.exam-question{max-width:1000px;background:#fff;border:1px solid #e4e5eb;border-radius:21px;padding:27px;margin-top:15px}.exam-top{display:flex;justify-content:space-between;font-size:9px;color:#999ca5}.exam-question h2{font:800 19px/1.5 Manrope,Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;margin:15px 0}.exam-nav{display:flex;justify-content:space-between;align-items:center;margin-top:16px}.exam-nav small{color:#999;font-size:9px}.exam-result{max-width:900px;background:white;border:1px solid #e4e5eb;border-radius:23px;padding:40px;text-align:center;margin-top:15px}.result-number{font:800 58px Manrope,Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;color:#6b58d7}.history-title{margin-top:45px}.history-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.history-card{background:#fff;border:1px solid #e4e5eb;border-radius:16px;padding:17px}.history-card .hist-top{display:flex;justify-content:space-between;font-size:9px;color:#999}.history-card strong{display:block;font:800 25px Manrope,Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;margin:11px 0 4px}.history-card small{font-size:9px;color:#8d9099}.history-card.good{border-color:#d5e9dc}.dashboard{display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:10px}.dash-card{background:#fff;border:1px solid #e4e5eb;border-radius:17px;padding:20px}.dash-card span{display:block;color:#8d9099;font-size:10px}.dash-card strong{display:block;font:800 31px Manrope,Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;margin:12px 0}.dash-card small{color:#9a9ca5;font-size:9px}.dash-card.big .progress{margin:10px 0}.weak-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:9px}.weak{background:#fff;border:1px solid #e4e5eb;border-radius:15px;padding:16px}.weak b{font-size:11px}.weak small{display:block;color:#999;font-size:9px;margin-top:7px}.progress-table{display:grid;gap:8px}.empty{background:#fff;border:1px dashed #dfe1e7;border-radius:16px;padding:25px;color:#92959e;text-align:center;font-size:11px}footer{border-top:1px solid #e6e7ec;padding:23px max(18px,calc((100vw - 1200px)/2));display:flex;justify-content:space-between;color:#999ca5;font-size:9px}@media(max-width:850px){.topbar nav{display:none}.hero{grid-template-columns:1fr}.feature-grid,.topic-grid{grid-template-columns:1fr 1fr}.dashboard{grid-template-columns:1fr 1fr}.weak-grid{grid-template-columns:1fr 1fr}.exam-intro{flex-direction:column;align-items:stretch}.exam-settings{align-items:stretch}.exam-settings .btn{margin-top:5px}.history-grid{grid-template-columns:1fr 1fr}}@media(max-width:560px){main{padding:28px 15px 55px}.hero h1{font-size:42px}.feature-grid,.topic-grid,.catalog,.match-grid,.options,.dashboard,.weak-grid,.history-grid{grid-template-columns:1fr}.page-title{align-items:start;gap:10px}.page-title h1{font-size:32px}.filterbar,.source-card{align-items:stretch;flex-direction:column}.exam-settings{flex-direction:column}.topbar{padding:0 13px}.brand{min-width:auto}.streak{padding:7px 9px;font-size:10px}.streak #streakWord{display:none}footer{flex-direction:column;gap:7px}}

/* Premium polish v4: сохраняем базовый визуальный стиль v2 */
.task-card{box-shadow:0 10px 35px rgba(30,32,45,.035);transition:box-shadow .2s,transform .2s}
.task-card:hover{box-shadow:0 16px 42px rgba(30,32,45,.06)}
.graph-box{margin:18px 0;padding:16px;border:1px solid #e5e6eb;border-radius:16px;background:linear-gradient(180deg,#fbfbfd,#f7f7fa);overflow:hidden}
.graph-box svg{display:block;width:100%;max-width:680px;height:auto;margin:auto}
.graph-box .axis{stroke:#7b7e88;stroke-width:2}
.graph-box .tick{stroke:#aeb1ba;stroke-width:1.5}
.graph-box .graph-line{fill:none;stroke:#705dd8;stroke-width:4;stroke-linecap:round;stroke-linejoin:round}
.graph-box text{font:11px Inter,Arial,sans-serif;fill:#777b86}
.answer-row{display:flex;align-items:center;gap:10px;max-width:520px;margin:16px 0 10px}
.answer-row input{flex:1;border:1px solid #dfe1e8;border-radius:12px;padding:14px 15px;font:600 14px Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;outline:none;background:#fff;transition:.2s}
.answer-row input:focus{border-color:#7562dc;box-shadow:0 0 0 4px rgba(117,98,220,.08)}
.answer-row span{font-size:11px;color:#888c97;font-weight:700;min-width:35px}
.long-answer{width:100%;min-height:150px;resize:vertical;border:1px solid #dfe1e8;border-radius:14px;padding:15px;font:500 13px/1.6 Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;outline:none;margin:10px 0 12px;box-sizing:border-box}
.long-answer:focus{border-color:#7562dc;box-shadow:0 0 0 4px rgba(117,98,220,.08)}
.feedback span{display:inline-block;margin-top:5px;line-height:1.55}
.exam-question .task-foot{border-top:1px solid #f0f0f3;padding-top:13px;margin-top:18px}
.exam-question .options{margin-top:16px}
@media(max-width:560px){.graph-box{padding:8px}.answer-row{max-width:none}}

/* v5 — подтверждение ответов и подробный разбор */
.option.selected{border-color:#7562dc;background:#f4f1ff;box-shadow:0 0 0 2px rgba(117,98,220,.08) inset}
.exam-controls{display:flex;align-items:center;justify-content:space-between;gap:9px;margin-top:18px;padding-top:16px;border-top:1px solid #f0f0f3}
.exam-controls .confirm-btn{min-width:180px}
.exam-controls button:disabled{opacity:.45;cursor:not-allowed;transform:none!important}
.timer-tag{margin-left:auto;background:#f2f2f6;color:#5d6070}
.feedback.neutral{background:#f4f4f7;color:#626572}
.feedback small{display:block;margin-top:7px;color:inherit;opacity:.8}
.result-summary{display:grid;grid-template-columns:repeat(3,1fr);max-width:520px;margin:22px auto 5px;border:1px solid #ececf1;border-radius:15px;overflow:hidden}
.result-summary div{padding:13px;border-right:1px solid #ececf1}.result-summary div:last-child{border-right:0}
.result-summary b{display:block;font:800 20px Manrope,Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif}.result-summary span{display:block;color:#9699a3;font-size:9px;margin-top:4px}
.result-note{color:#858893;font-size:10px;line-height:1.5;max-width:600px;margin:16px auto}
.detail-panel{background:#fff;border:1px solid #e4e5eb;border-radius:23px;padding:28px;margin-top:15px;box-shadow:0 14px 40px rgba(30,32,45,.045)}
.detail-head{display:flex;justify-content:space-between;gap:15px;align-items:start}.detail-head h2{font:800 28px Manrope,Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;margin:7px 0}.detail-head p{font-size:10px;color:#90939d;margin:0}
.detail-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:22px 0}.detail-stats div{background:#f7f7fa;border-radius:13px;padding:14px}.detail-stats b{display:block;font:800 20px Manrope,Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif}.detail-stats span{font-size:9px;color:#92959e}
.detail-list{display:grid;gap:9px}.detail-row{display:grid;grid-template-columns:48px 1fr 30px;gap:12px;border:1px solid #e7e8ed;border-radius:14px;padding:15px}.detail-row.good{border-color:#d7e9dc}.detail-row.bad{border-color:#f0dada}.detail-num{font:800 12px Manrope,Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;color:#6c5bd4}.detail-main>b{font-size:9px;color:#999ca5}.detail-main p{font-size:11px;line-height:1.5;margin:5px 0 10px}.detail-answers{display:grid;grid-template-columns:1fr 1fr;gap:8px}.detail-answers span{background:#f8f8fa;border-radius:9px;padding:9px;font-size:10px;line-height:1.45}.detail-answers i{display:block;font-style:normal;color:#9a9da6;font-size:8px;margin-bottom:4px}.detail-main>small{display:block;color:#888b95;font-size:9px;line-height:1.45;margin-top:9px}.detail-status{font-size:17px;text-align:right;color:#d26b6b}.detail-row.good .detail-status{color:#43a56a}
@media(max-width:700px){.exam-controls{flex-wrap:wrap}.exam-controls .confirm-btn{order:-1;width:100%}.result-summary{grid-template-columns:1fr}.result-summary div{border-right:0;border-bottom:1px solid #ececf1}.result-summary div:last-child{border-bottom:0}.detail-stats{grid-template-columns:1fr 1fr}.detail-answers{grid-template-columns:1fr}.detail-row{grid-template-columns:38px 1fr 25px}}

/* v6 — навигация по заданиям варианта, единый стиль с сайтом */
.exam-pager{max-width:1000px;margin:14px 0 0;background:#fff;border:1px solid #e4e5eb;border-radius:20px;padding:18px 20px;box-shadow:0 10px 35px rgba(30,32,45,.035)}
.pager-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px}
.pager-head b{font:800 13px Manrope,Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;color:#171923}
.pager-head small{font-size:10px;color:#8d909a;font-weight:600}
.pager-dots{display:grid;grid-template-columns:repeat(auto-fill,minmax(42px,1fr));gap:8px}
.pager-dot{height:42px;border-radius:12px;border:1px solid #e1e2e8;background:#fff;color:#747782;font:800 12px Manrope,Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;cursor:pointer;transition:.18s;padding:0}
.pager-dot:hover{border-color:#7562dc;color:#6756d6;transform:translateY(-2px);box-shadow:0 8px 18px rgba(117,98,220,.14)}
.pager-dot.draft{background:#fff7ec;border-color:#f0d3a8;color:#b9731f;border-style:dashed}
.pager-dot.saved{background:#f4f1ff;border-color:#cfc6fb;color:#6e5bd4}
.pager-dot.ok{background:#eaf8ef;border-color:#b9ddc5;color:#277644}
.pager-dot.err{background:#fff0f0;border-color:#efc4c4;color:#b44848}
.pager-dot.active{background:#191b25;border-color:#191b25;color:#fff;box-shadow:0 8px 20px rgba(25,27,37,.22)}
.pager-foot{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:16px;padding-top:14px;border-top:1px solid #f0f0f3;flex-wrap:wrap}
.pager-legend{display:flex;gap:14px;flex-wrap:wrap;font-size:10px;color:#8d909a}
.pager-legend span{display:inline-flex;align-items:center;gap:6px}
.lg{width:12px;height:12px;border-radius:4px;border:1px solid #e1e2e8;background:#fff;display:inline-block}
.lg.draft{background:#fff7ec;border:1px dashed #f0d3a8}.lg.saved{background:#f4f1ff;border-color:#cfc6fb}.lg.ok{background:#eaf8ef;border-color:#b9ddc5}.lg.err{background:#fff0f0;border-color:#efc4c4}
.option.locked{cursor:default}.option.locked:hover:not(.correct):not(.wrong):not(.selected){border-color:#dfe1e7}
.hint{font-size:10px;color:#8d909a;margin:14px 0 -2px;font-weight:600}
.answer-row input:disabled,.long-answer:disabled{background:#f7f7fa;color:#555963}
.history-card{display:block;width:100%;text-align:left;font-family:inherit;color:inherit;cursor:pointer;transition:.2s}
.history-card:hover{transform:translateY(-3px);box-shadow:0 15px 35px rgba(44,48,64,.08);border-color:#cfc6fb}
.detail-row.skip{border-color:#e7e8ed;background:#fafafd}.detail-row.skip .detail-status{color:#a2a5af}
@media(max-width:560px){.pager-dots{grid-template-columns:repeat(auto-fill,minmax(38px,1fr));gap:6px}.pager-dot{height:38px}.exam-pager{padding:14px}.pager-foot .btn{width:100%}}

/* v7 — аккаунты и обучающий блок формул (тот же визуальный язык сайта) */
.auth-box{display:flex;align-items:center;gap:6px}
.auth-btn{padding:10px 14px!important}
.topbar{gap:12px}
.user-chip{display:flex;align-items:center;gap:8px;border:1px solid #e3e4e9;background:#fff;border-radius:12px;padding:5px 12px 5px 5px;cursor:pointer;font:700 12px Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;color:#30323b;transition:.18s}
.user-chip:hover{border-color:#cfc6fb;box-shadow:0 8px 20px rgba(117,98,220,.12)}
.user-chip b{max-width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.avatar{width:30px;height:30px;border-radius:10px;background:#181a24;color:#fff;display:grid;place-items:center;font:800 13px Manrope,Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;flex:none}
.avatar.big{width:56px;height:56px;border-radius:17px;font-size:22px}
.account-card{margin:0 0 14px}
.source-icon.acc{background:#eeeaff;color:#7059dc}
.toast{position:fixed;left:50%;bottom:26px;transform:translate(-50%,20px);background:#191b25;color:#fff;padding:12px 18px;border-radius:12px;font-size:12px;font-weight:600;opacity:0;pointer-events:none;transition:.25s;z-index:80;box-shadow:0 14px 34px rgba(25,27,37,.28)}
.toast.show{opacity:1;transform:translate(-50%,0)}
.modal-back{position:fixed;inset:0;background:rgba(25,27,37,.45);backdrop-filter:blur(6px);display:grid;place-items:center;z-index:60;padding:16px;overflow-y:auto}
.modal{position:relative;background:#fff;border:1px solid #e4e5eb;border-radius:24px;padding:30px;width:min(440px,100%);box-shadow:0 30px 80px rgba(25,27,37,.25);max-height:calc(100vh - 32px);overflow-y:auto}
.modal.wide{width:min(520px,100%)}
.modal h2{font:800 25px Manrope,Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;letter-spacing:-.8px;margin:6px 0 4px}
.modal-sub{font-size:11px;color:#8d909a;line-height:1.55;margin:0 0 14px}
.modal-x{position:absolute;right:16px;top:14px;width:32px;height:32px;border-radius:10px;border:1px solid #e3e4e9;background:#fff;font-size:18px;color:#777b86;cursor:pointer;line-height:1}
.modal-x:hover{background:#f4f1ff;color:#6756d6}
.modal-note{font-size:10px;color:#9a9da6;line-height:1.55;margin:14px 0 0}
.auth-tabs{margin:6px 0 14px}.auth-tabs .tab{flex:1}
.auth-form{display:grid;gap:11px}
.field{display:grid;gap:6px;font-size:10px;font-weight:800;color:#6c6f7a;letter-spacing:.2px}
.field input{width:100%;border:1px solid #dfe1e8;border-radius:12px;padding:13px 14px;font:600 13px Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;outline:none;background:#fff;transition:.2s;color:#171923}
.field input:focus{border-color:#7562dc;box-shadow:0 0 0 4px rgba(117,98,220,.08)}
.pw{position:relative;display:block}.pw input{padding-right:44px}
.eye{position:absolute;right:6px;top:50%;transform:translateY(-50%);border:0;background:transparent;cursor:pointer;font-size:14px;opacity:.55;padding:6px 8px}
.row-inline{display:flex;gap:8px}.row-inline input{flex:1}
.check{display:flex;align-items:center;gap:8px;font-size:11px;color:#6c6f7a;cursor:pointer}
.check input{width:16px;height:16px;accent-color:#7562dc}
.field-hint{font-size:10px;color:#9a9da6;margin-top:-6px}
.pw-meter{height:5px;background:#eeeef3;border-radius:9px;overflow:hidden;margin-top:-4px}.pw-meter i{display:block;height:100%;width:0;transition:.25s}
.form-err{padding:11px 13px;border-radius:11px;background:#fff0f0;color:#b44848;font-size:11px;line-height:1.5}
.form-err.good{background:#eaf8ef;color:#277644}
.wide-btn{width:100%;padding:15px 17px;font-size:13px}.wide-btn:disabled{opacity:.6;cursor:wait}
.prof-head{display:flex;align-items:center;gap:14px;margin-bottom:6px}.prof-head h2{margin:0}.prof-head .modal-sub{margin:3px 0 0}
.prof-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:14px 0 18px}
.prof-stats div{background:#f7f7fa;border-radius:13px;padding:12px}.prof-stats b{display:block;font:800 18px Manrope,Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif}.prof-stats span{font-size:9px;color:#92959e}
.prof-actions{display:flex;flex-wrap:wrap;gap:8px}
.file-btn{display:inline-block;position:relative;overflow:hidden}.file-btn input{position:absolute;inset:0;opacity:0;cursor:pointer}
.pw-box{border:1px solid #e7e8ed;border-radius:13px;padding:12px 14px}.pw-box summary{font-size:11px;font-weight:800;color:#555963;cursor:pointer}.pw-box[open] summary{margin-bottom:10px}.pw-box .field{margin-bottom:10px}
.pw-box.danger summary{color:#b44848}.danger-btn{background:#d25a5a;color:#fff}.danger-btn:hover{background:#bf4a4a}
@media(max-width:560px){.auth-btn:first-child{display:none}.prof-stats{grid-template-columns:1fr 1fr}.modal{padding:24px 20px}.user-chip b{display:none}.user-chip{padding:5px}}

/* формулы: изучение */
.formula-card.learn{max-width:1000px}
.learn-prog{display:flex;align-items:center;gap:12px;margin-bottom:20px}.learn-prog .progress{flex:1}.learn-prog small{font-size:10px;color:#8d909a;font-weight:700;white-space:nowrap}
.learn-top{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;flex-wrap:wrap}
.jump{border:1px solid #dfe1e8;background:#fff;border-radius:11px;padding:10px 12px;font:600 11px Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;color:#4a4d58;max-width:260px;cursor:pointer}
.info{display:grid;gap:12px;margin-top:18px}
.info-top{background:#191b25;color:#fff;border-radius:18px;padding:24px;text-align:center}
.formula-big{font:700 34px Georgia;letter-spacing:.5px;margin-bottom:8px}
.info-top p{margin:0;color:#b8bbc5;font-size:12px;line-height:1.6}
.info-grid{display:grid;grid-template-columns:1.25fr 1fr;gap:12px}
.info-box{background:#fafafd;border:1px solid #e7e8ed;border-radius:16px;padding:16px 18px}
.info-box h4{margin:0 0 9px;font:800 10px Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;letter-spacing:1.2px;color:#725fd9;text-transform:uppercase}.info-box h4.mt{margin-top:14px}
.info-box p{margin:0;font-size:12px;line-height:1.6;color:#4a4d58}
.vars{width:100%;border-collapse:collapse;font-size:11px}
.vars th{text-align:left;font-size:9px;color:#9a9da6;font-weight:700;padding:0 8px 6px 0}
.vars td{padding:7px 8px 7px 0;border-top:1px solid #eeeef3;color:#4a4d58;vertical-align:top}
.vars .sym{font:700 15px Georgia;color:#171923;white-space:nowrap}.vars .unit{color:#7460dc;font-weight:700;white-space:nowrap}
.rev{display:flex;flex-wrap:wrap;gap:8px}.rev-chip{background:#fff;border:1px solid #cfc6fb;color:#4a3fb0;border-radius:10px;padding:8px 12px;font:700 15px Georgia}
.info-box.example{background:#f4f1ff;border-color:#e0dafc}
.sol{margin-top:10px;background:#fff;border-radius:11px;padding:11px 13px;font:700 14px Georgia;color:#171923;border-left:3px solid #7460dc}
.info-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.note{border-radius:16px;padding:14px 16px;font-size:12px;line-height:1.55}.note b{display:block;font-size:11px;margin-bottom:5px}.note p{margin:0}
.note.tip{background:#eaf8ef;color:#277644}.note.warn{background:#fff6e8;color:#a5651c}
.check-box{margin-top:14px;border:1px dashed #cfc6fb;border-radius:16px;padding:16px 18px}
.check-box h4{margin:0 0 8px;font:800 10px Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;letter-spacing:1.2px;color:#725fd9;text-transform:uppercase}
.check-box>p{margin:0;font-size:13px;font-weight:600;line-height:1.55}
.check-box .answer-row{margin:12px 0 4px}
.learn-foot{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:24px;flex-wrap:wrap}
.seen-btn.on{background:#eaf8ef;border-color:#b9ddc5;color:#277644}
.hint-box div+div{margin-top:6px}.hint-box{line-height:1.6}
.fb-vars{display:flex;flex-wrap:wrap;gap:6px 14px;margin-top:9px;font-size:11px}
.fb-tip{display:block;margin-top:9px;line-height:1.55}
.formula-actions{flex-wrap:wrap}
#formulaExplain .info{margin-top:14px}
.cat-tools{display:grid;gap:10px;margin-bottom:14px}
.cat-search{width:100%;max-width:520px;border:1px solid #dfe1e8;border-radius:12px;padding:13px 15px;font:600 13px Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;outline:none;background:#fff}
.cat-search:focus{border-color:#7562dc;box-shadow:0 0 0 4px rgba(117,98,220,.08)}
.cat-item{display:grid;gap:10px;align-content:start}.cat-item.open{grid-column:1/-1}
.formula-row.btn-row{width:100%;text-align:left;font-family:inherit;color:inherit;cursor:pointer;transition:.18s}
.formula-row.btn-row:hover,.cat-item.open .btn-row{border-color:#cfc6fb;box-shadow:0 8px 20px rgba(117,98,220,.08)}
.formula-row .chev{color:#aaa;font-size:12px}
.formula-math sub,.formula-big sub,.vars sub,.rev-chip sub{font-size:.65em}
.card-vars{display:flex;flex-direction:column;gap:5px;margin:4px 0 10px;font-size:12px;color:#d6d8e0}.card-vars b{font-family:Georgia;color:#fff}
.flashcard .card-tip{max-width:520px;color:#cfc6fb;font-size:12px;line-height:1.55;margin:4px 0 14px}
@media(max-width:700px){.info-grid,.info-row{grid-template-columns:1fr}.formula-big{font-size:26px}.jump{max-width:100%;width:100%}.info-top{padding:18px}}
.answer-row input{min-width:0}.answer-row .btn{flex:none}
@media(max-width:560px){.auth-box{gap:4px}.topbar{gap:8px}}

/* v8 */
.streak{font-family:inherit;cursor:pointer;transition:.18s;filter:grayscale(1);opacity:.75}
.streak.wait{filter:grayscale(.5);opacity:.9}.streak.on{filter:none;opacity:1;border-color:#f3c999;background:#fff8ef;color:#a5651c}
.streak.on b{color:#c4701a}.streak:hover{border-color:#cfc6fb}
.streak-pop{position:fixed;top:68px;right:max(18px,calc((100vw - 1200px)/2));z-index:40;background:#fff;border:1px solid #e4e5eb;border-radius:18px;padding:18px;width:min(310px,calc(100vw - 28px));box-shadow:0 20px 50px rgba(30,32,45,.16)}
.streak-pop b{font:800 16px Manrope,Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;display:block}.streak-pop small{font-size:10px;color:#8d909a}
.streak-pop p{margin:12px 0 0;font-size:11px;line-height:1.5;color:#6c6f7a}
.streak-days{display:grid;grid-template-columns:repeat(7,1fr);gap:5px;margin-top:12px}
.streak-days span{display:flex;flex-direction:column;align-items:center;gap:4px;font-size:9px;color:#9a9da6;text-transform:capitalize}
.streak-days i{width:100%;aspect-ratio:1;border-radius:9px;background:#f2f2f6;display:grid;place-items:center;font-style:normal;font-size:14px}
.streak-days span.on i{background:#fff0de}.streak-days span.today{color:#171923;font-weight:800}.streak-days span.today i{box-shadow:0 0 0 2px #7460dc inset}
.topic{cursor:pointer;transition:.2s;display:flex;flex-direction:column}
.topic:hover,.topic:focus-visible{transform:translateY(-3px);border-color:#cfc6fb;box-shadow:0 15px 35px rgba(44,48,64,.08);outline:0}
.topic small{flex:1}.topic-actions{display:flex;gap:6px;margin-top:12px}
.mini-btn{flex:1;border:1px solid #e1e2e8;background:#fff;border-radius:9px;padding:7px 4px;font:700 10px Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;color:#6756d6;cursor:pointer;transition:.15s}
.mini-btn:hover{background:#efedff;border-color:#cfc6fb}
.match-modes{margin-bottom:14px}.hint-note{font-size:10px;color:#8d909a;font-weight:600}
.chip.go{background:#191b25;color:#fff;border-color:#191b25}
.card-actions{display:flex;gap:10px;max-width:680px;margin-top:14px}.card-actions .btn{flex:1;padding:14px}
.flashcard.done-card{cursor:default}.flashcard.done-card .btn{margin-top:8px}
.cat-tools+.flashcard{margin-top:6px}
@media(max-width:560px){.streak-pop{right:14px}}

/* ===================================================================
   v7 — настройки, мобильная адаптация, тёмная тема
   =================================================================== */

/* ---------- общее для всех экранов ---------- */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{overflow-x:clip;-webkit-tap-highlight-color:transparent}
img,svg{max-width:100%}
button{font-family:inherit}
:focus-visible{outline:2px solid #7460dc;outline-offset:2px}
.btn:focus-visible,.tab:focus-visible,.chip:focus-visible,.option:focus-visible,.pager-dot:focus-visible{outline-offset:3px}
body.modal-open{overflow:hidden}

/* кнопка настроек в шапке */
.icon-btn{flex:none;width:40px;height:40px;border:1px solid #e3e4e9;border-radius:11px;background:#fff;font-size:16px;line-height:1;cursor:pointer;display:grid;place-items:center;transition:.18s}
.icon-btn:hover{border-color:#cfc6fb;box-shadow:0 8px 20px rgba(117,98,220,.12)}

/* окно настроек */
.set-row{display:flex;align-items:center;justify-content:space-between;gap:16px;border:1px solid #e7e8ed;border-radius:14px;padding:14px 16px;margin:6px 0 18px}
.set-row b{display:block;font-size:13px}.set-row small{display:block;font-size:11px;color:#8d909a;margin-top:3px;line-height:1.4}
.switch{flex:none;position:relative;width:52px;height:30px;border-radius:30px;border:0;background:#d9dae2;cursor:pointer;padding:0;transition:background .2s}
.switch i{position:absolute;left:3px;top:3px;width:24px;height:24px;border-radius:50%;background:#fff;box-shadow:0 2px 6px rgba(25,27,37,.25);transition:transform .2s}
.switch.on{background:#7460dc}.switch.on i{transform:translateX(22px)}
.set-label{font-size:10px;font-weight:800;letter-spacing:.2px;color:#6c6f7a;margin-bottom:8px}
.theme-opts{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.theme-opt{display:flex;flex-direction:column;align-items:center;gap:6px;border:1px solid #dfe1e8;background:#fff;color:#4a4d58;border-radius:13px;padding:13px 6px;font:700 11px Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;cursor:pointer;transition:.18s}
.theme-opt span{font-size:20px;line-height:1}
.theme-opt:hover{border-color:#cfc6fb}
.theme-opt.active{border-color:#7460dc;background:#f4f1ff;color:#4a3fb0;box-shadow:0 0 0 3px rgba(117,98,220,.1)}

/* нижняя навигация: на компьютере скрыта */
.bottom-nav{display:none}

/* ---------- планшеты и телефоны ---------- */
@media(max-width:850px){
  /* шапка */
  .topbar{height:60px;gap:8px;padding-left:max(14px,env(safe-area-inset-left));padding-right:max(14px,env(safe-area-inset-right))}
  .brand{min-width:0;flex:1}
  .brand-mark{width:36px;height:36px;border-radius:12px;font-size:21px;flex:none}
  .streak{padding:8px 10px;font-size:12px;min-height:40px}
  .streak-pop{top:66px}

  /* нижняя навигация */
  .bottom-nav{display:grid;grid-template-columns:repeat(5,1fr);position:fixed;left:0;right:0;bottom:0;z-index:30;gap:2px;
    padding:6px max(8px,env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
    background:#ffffffee;backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);border-top:1px solid #e7e8ee}
  .bottom-nav .nav-btn{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:52px;padding:6px 2px;border-radius:12px;font:700 11px Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;color:#747782;background:transparent}
  .bottom-nav .nav-btn span{font-size:19px;line-height:1;font-weight:800;font-family:Manrope,Inter,sans-serif}
  .bottom-nav .nav-btn.active{background:#efedff;color:#6756d6}
  .bottom-nav .nav-btn:hover{background:transparent;color:#747782}
  .bottom-nav .nav-btn.active:hover{background:#efedff;color:#6756d6}
  body.kb-open .bottom-nav{display:none}

  main{padding:24px max(16px,env(safe-area-inset-left)) calc(96px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-right))}
  footer{padding:20px 16px calc(92px + env(safe-area-inset-bottom));flex-direction:column;gap:6px;font-size:11px}
  .toast{bottom:calc(86px + env(safe-area-inset-bottom));max-width:calc(100vw - 32px);text-align:center}

  /* крупнее мелкий текст: 9–11px на телефоне читать трудно */
  .eyebrow,.mini-label{font-size:11px}
  .mini-stats small,.progress-number span{font-size:11px}
  .feature small{font-size:12px}
  .topic b{font-size:14px}.topic small{font-size:11px}
  .source-card b{font-size:14px}.source-card p{font-size:12px}
  .page-title p{font-size:13px;line-height:1.5}
  .counter{font-size:12px}
  .tab{font-size:13px;padding:11px 14px;min-height:42px}
  .formula-card>p{font-size:12px}
  .feedback{font-size:13px;line-height:1.5}
  .match-item{font-size:13px;padding:14px}
  .flashcard p{font-size:13px}
  .formula-row b{font-size:14px}.formula-row small{font-size:11px}
  .chip{font-size:12px;padding:9px 13px}
  .fipi-link{font-size:12px}
  .tag{font-size:11px;padding:6px 9px}
  .given{font-size:14px}
  .option{font-size:14px;padding:15px;min-height:48px}
  .task-foot small,.exam-nav small{font-size:11px}
  .exam-head p{font-size:12px}
  .exam-settings label{font-size:11px}
  .exam-top{font-size:11px}
  .result-note{font-size:12px}
  .history-card small,.history-card .hist-top{font-size:11px}
  .dash-card span{font-size:12px}.dash-card small{font-size:11px}
  .weak b{font-size:13px}.weak small{font-size:11px}
  .empty{font-size:13px}
  .hint,.hint-note{font-size:12px}
  .pager-head small,.pager-legend{font-size:11px}
  .detail-head p{font-size:12px}
  .detail-stats span{font-size:11px}
  .detail-main>b{font-size:11px}.detail-main p{font-size:13px}
  .detail-answers span{font-size:12px}.detail-answers i{font-size:10px}.detail-main>small{font-size:11px}
  .field{font-size:12px}.field-hint{font-size:11px}
  .modal-sub{font-size:13px}.modal-note{font-size:11px}
  .form-err{font-size:12px}
  .prof-stats span{font-size:11px}
  .vars{font-size:13px}.vars th{font-size:11px}
  .info-box p{font-size:14px}.info-box h4,.check-box h4{font-size:11px}
  .note{font-size:14px}.note b{font-size:12px}
  .mini-btn{font-size:12px;padding:10px 4px;min-height:40px}
  .check-box>p{font-size:14px}
  .hint-box,.fb-vars{font-size:13px}
  .streak-pop small,.streak-pop p{font-size:12px}.streak-days span{font-size:10px}
  .set-row small{font-size:12px}.set-label{font-size:11px}.theme-opt{font-size:12px}

  /* поля ввода: 16px, чтобы iOS не увеличивал страницу при фокусе */
  .answer-row input,.long-answer,.field input,.cat-search,.exam-settings select,.jump{font-size:16px}
  .btn{min-height:44px}
  .tool{min-width:40px;min-height:40px;font-size:15px}
  .icon-btn{width:40px;height:40px}

  /* раскладка */
  .hero{padding:12px 0 36px;gap:28px}
  .hero h1{letter-spacing:-1.5px}
  .hero p{font-size:15px}
  .page-title{flex-direction:column;align-items:flex-start;gap:12px;margin:6px 0 20px}
  .page-title h1{font-size:34px;letter-spacing:-1px}
  .dash-card.big{grid-column:1/-1}
  .filterbar{flex-direction:column;align-items:stretch}
  .formula-row{flex-wrap:wrap}
  .formula-math{white-space:normal;overflow-wrap:anywhere}
  .info-box{overflow-x:auto}
  .detail-head{flex-direction:column}
  .detail-panel,.exam-result{padding:22px}
  .exam-intro{padding:22px}
  .exam-settings{flex-wrap:wrap}.exam-settings label{flex:1 1 180px}.exam-settings select{width:100%}
}

/* ---------- телефоны ---------- */
@media(max-width:560px){
  .topbar{height:56px}
  .streak-pop{top:62px}
  .brand small{display:none}
  .brand b{font-size:14px}
  .auth-btn:first-child{display:inline-block}   /* на телефоне оставляем «Войти», регистрация — во вкладке окна входа */
  .auth-btn:last-child{display:none}
  .auth-btn{padding:9px 13px!important;min-height:40px}

  main{padding-top:18px}
  .hero h1{font-size:clamp(34px,10.5vw,44px)}
  .actions{flex-direction:column}
  .actions .btn{width:100%}
  .hero-progress{padding:22px}
  .progress-number strong{font-size:42px}
  .feature{padding:16px}
  .section-title h2{font-size:23px}
  .topic{min-height:0}
  .source-card{padding:16px}
  .source-card>div{align-items:flex-start}
  .source-card .btn{width:100%}

  .tabs{flex-wrap:nowrap;overflow-x:auto;margin-left:-16px;margin-right:-16px;padding:2px 16px 6px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  .tabs::-webkit-scrollbar{display:none}
  .tabs .tab{flex:none;white-space:nowrap}
  .auth-tabs{margin-left:0;margin-right:0;padding:0;overflow:visible;flex-wrap:wrap}
  .chips{flex-wrap:nowrap;overflow-x:auto;margin:0 -16px;padding:2px 16px 6px;scrollbar-width:none}
  .chips::-webkit-scrollbar{display:none}
  .chip{flex:none;white-space:nowrap}

  .formula-card,.task-card,.exam-question{padding:18px;border-radius:18px}
  .formula-card h2{font-size:20px}
  .editor{padding:14px;font-size:20px;min-height:68px}
  .toolbar{padding:6px;gap:4px}
  .formula-actions .btn{flex:1 1 auto}
  .formula-big{font-size:24px;overflow-wrap:anywhere}
  .info-top{padding:18px 14px}
  .learn-top .jump{width:100%}
  .learn-foot .btn{flex:1 1 100%}
  .flashcard{min-height:250px;padding:24px 18px;border-radius:20px}
  .flashcard strong{font-size:28px;overflow-wrap:anywhere}
  .card-actions{flex-direction:column}
  .task-card h2{font-size:18px}
  .exam-question h2{font-size:17px}
  .task-foot{flex-direction:column;align-items:stretch;gap:10px}
  .task-foot .btn{width:100%}
  .exam-nav{flex-direction:column;gap:10px;align-items:stretch}
  .exam-controls .btn{flex:1 1 100%}
  .exam-controls .prev-btn,.exam-controls .next-btn{flex:1 1 40%}
  .answer-row{flex-wrap:wrap}
  .answer-row input{flex:1 1 100%}
  .answer-row .btn{flex:1 1 100%}
  .result-number{font-size:46px}
  .exam-intro{border-radius:20px}
  .exam-head{align-items:flex-start}
  .exam-settings label{flex:none;width:100%}
  .exam-settings .btn{width:100%}
  .dashboard{grid-template-columns:1fr 1fr}
  .dash-card{padding:16px}
  .dash-card strong{font-size:26px;margin:8px 0}
  .detail-stats{gap:6px}
  .detail-row{padding:12px}
  .pager-foot{flex-direction:column;align-items:stretch}
  .history-card{padding:15px}
  footer{align-items:flex-start}

  /* окна — «шторка» снизу */
  .modal-back{place-items:end center;padding:0}
  .modal{width:100%;max-height:92vh;max-height:92dvh;border-radius:22px 22px 0 0;padding:24px 18px calc(24px + env(safe-area-inset-bottom));animation:sheet-up .22s ease-out}
  .modal.wide{width:100%}
  .modal-x{width:40px;height:40px;right:12px;top:12px}
  .modal h2{padding-right:44px}
  .row-inline{flex-wrap:wrap}.row-inline .btn{width:100%}
  .prof-actions .btn,.prof-actions .file-btn{flex:1 1 100%;text-align:center}
}
@keyframes sheet-up{from{transform:translateY(24px);opacity:0}to{transform:none;opacity:1}}

/* очень узкие экраны (≈320–360px) */
@media(max-width:380px){
  .brand b{display:none}
  .streak{padding:8px}
  .topbar{gap:6px}
  .bottom-nav .nav-btn{font-size:10px}
  .theme-opts{grid-template-columns:1fr}
  .theme-opt{flex-direction:row;justify-content:center;gap:10px;padding:12px}
}

/* телефон в горизонтальной ориентации: нижняя панель ниже, не съедает экран */
@media(max-height:480px) and (max-width:900px){
  .bottom-nav .nav-btn{flex-direction:row;gap:6px;min-height:40px}
  .bottom-nav .nav-btn span{font-size:16px}
  main{padding-bottom:calc(72px + env(safe-area-inset-bottom))}
}

/* на сенсорных экранах не «подпрыгивают» карточки после касания */
@media(hover:none){
  .btn.primary:hover,.feature:hover,.topic:hover,.history-card:hover,.pager-dot:hover{transform:none}
}

@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}
}

/* ===================================================================
   Тёмная тема. Включается в «Настройках» (⚙️): html[data-theme="dark"].
   Палитра: фон #0e1016 • карточки #171a23 • вложенные блоки #1d212d
   • границы #2a2f3d • текст #e8e9ee / #9a9eac • акцент #7460dc (светлее — #a597ff)
   =================================================================== */
html[data-theme="dark"]{color-scheme:dark}
html[data-theme="dark"] body{background:#0e1016;color:#e8e9ee}
html[data-theme="dark"] ::selection{background:#4a3fb0;color:#fff}
html[data-theme="dark"] .orb{opacity:.22}
html[data-theme="dark"] .orb-a{background:#4b3bb0}
html[data-theme="dark"] .orb-b{background:#1f5f85}

/* шапка и навигация */
html[data-theme="dark"] .topbar{background:#10121add;border-bottom-color:#232738}
html[data-theme="dark"] .brand{color:#e8e9ee}
html[data-theme="dark"] .brand small{color:#7e8292}
html[data-theme="dark"] .brand-mark{background:#7460dc;color:#fff;box-shadow:0 8px 20px rgba(116,96,220,.35)}
html[data-theme="dark"] .nav-btn{color:#9a9eac}
html[data-theme="dark"] .nav-btn.active,html[data-theme="dark"] .nav-btn:hover{background:#262250;color:#b9adff}
html[data-theme="dark"] .bottom-nav{background:#10121aee;border-top-color:#232738}
html[data-theme="dark"] .bottom-nav .nav-btn{color:#8a8ea0}
html[data-theme="dark"] .bottom-nav .nav-btn.active,html[data-theme="dark"] .bottom-nav .nav-btn.active:hover{background:#262250;color:#b9adff}
html[data-theme="dark"] .bottom-nav .nav-btn:hover{background:transparent;color:#8a8ea0}
html[data-theme="dark"] .streak,html[data-theme="dark"] .icon-btn{background:#171a23;border-color:#2a2f3d;color:#9a9eac}
html[data-theme="dark"] .streak b{color:#e8e9ee}
html[data-theme="dark"] .streak.on{background:#33250f;border-color:#7a5420;color:#f0b36a}
html[data-theme="dark"] .streak.on b{color:#f5a34a}
html[data-theme="dark"] .streak:hover,html[data-theme="dark"] .icon-btn:hover{border-color:#4a418c}
html[data-theme="dark"] .user-chip{background:#171a23;border-color:#2a2f3d;color:#e8e9ee}
html[data-theme="dark"] .user-chip:hover{border-color:#4a418c}
html[data-theme="dark"] .avatar{background:#7460dc}

/* типографика */
html[data-theme="dark"] .eyebrow,html[data-theme="dark"] .hero h1 em,html[data-theme="dark"] .fipi-link,html[data-theme="dark"] .info-box h4,html[data-theme="dark"] .check-box h4{color:#a597ff}
html[data-theme="dark"] .hero p,html[data-theme="dark"] .page-title p,html[data-theme="dark"] .info-box p{color:#a3a7b5}
html[data-theme="dark"] .mini-label,html[data-theme="dark"] .progress-number span,html[data-theme="dark"] .mini-stats small,html[data-theme="dark"] .feature small,html[data-theme="dark"] .topic small,html[data-theme="dark"] .source-card p,html[data-theme="dark"] .formula-card>p,html[data-theme="dark"] .formula-row small,html[data-theme="dark"] .task-foot small,html[data-theme="dark"] .exam-nav small,html[data-theme="dark"] .history-card small,html[data-theme="dark"] .history-card .hist-top,html[data-theme="dark"] .dash-card span,html[data-theme="dark"] .dash-card small,html[data-theme="dark"] .weak small,html[data-theme="dark"] .result-note,html[data-theme="dark"] .exam-top,html[data-theme="dark"] .hint,html[data-theme="dark"] .hint-note,html[data-theme="dark"] .pager-head small,html[data-theme="dark"] .pager-legend,html[data-theme="dark"] .detail-head p,html[data-theme="dark"] .detail-stats span,html[data-theme="dark"] .detail-main>b,html[data-theme="dark"] .detail-main>small,html[data-theme="dark"] .detail-answers i,html[data-theme="dark"] .result-summary span,html[data-theme="dark"] .prof-stats span,html[data-theme="dark"] .modal-sub,html[data-theme="dark"] .modal-note,html[data-theme="dark"] .field-hint,html[data-theme="dark"] .learn-prog small,html[data-theme="dark"] .set-row small,html[data-theme="dark"] .vars th,html[data-theme="dark"] .empty,html[data-theme="dark"] footer{color:#8a8ea0}
html[data-theme="dark"] .field,html[data-theme="dark"] .set-label,html[data-theme="dark"] .check{color:#a3a7b5}
html[data-theme="dark"] .detail-main p,html[data-theme="dark"] .check-box>p,html[data-theme="dark"] .vars td,html[data-theme="dark"] .given{color:#c9ccd7}
html[data-theme="dark"] .pager-head b,html[data-theme="dark"] .set-row b{color:#e8e9ee}
html[data-theme="dark"] .vars .sym{color:#f1f1f6}
html[data-theme="dark"] .vars td,html[data-theme="dark"] .vars th{border-color:#262b3a}
html[data-theme="dark"] .vars .unit{color:#a597ff}
html[data-theme="dark"] .result-number{color:#a597ff}
html[data-theme="dark"] .detail-num{color:#a597ff}
html[data-theme="dark"] .set-row b{color:#e8e9ee}

/* кнопки, вкладки, чипы */
html[data-theme="dark"] .btn.primary{background:#ecebf5;color:#14151c;box-shadow:0 10px 25px rgba(0,0,0,.35)}
html[data-theme="dark"] .btn.ghost{background:#171a23;color:#dcdde5;border-color:#2e3344}
html[data-theme="dark"] .btn.ghost:hover{border-color:#4a418c}
html[data-theme="dark"] .danger-btn{background:#d25a5a;color:#fff}
html[data-theme="dark"] .tab{background:#171a23;border-color:#2a2f3d;color:#9a9eac}
html[data-theme="dark"] .tab.active{background:#ecebf5;border-color:#ecebf5;color:#14151c}
html[data-theme="dark"] .chip{background:#171a23;border-color:#2a2f3d;color:#9a9eac}
html[data-theme="dark"] .chip.active{background:#7460dc;border-color:#7460dc;color:#fff}
html[data-theme="dark"] .chip.go{background:#ecebf5;border-color:#ecebf5;color:#14151c}
html[data-theme="dark"] .mini-btn{background:#171a23;border-color:#2a2f3d;color:#b9adff}
html[data-theme="dark"] .mini-btn:hover{background:#262250;border-color:#4a418c}
html[data-theme="dark"] .counter{background:#171a23;border-color:#2a2f3d;color:#8a8ea0}
html[data-theme="dark"] .jump{background:#12141b;border-color:#2e3344;color:#c9ccd7}
html[data-theme="dark"] .seen-btn.on{background:#14301f;border-color:#2d6a47;color:#7fd4a0}

/* карточки и панели */
html[data-theme="dark"] .hero-progress,html[data-theme="dark"] .feature,html[data-theme="dark"] .topic,html[data-theme="dark"] .source-card,html[data-theme="dark"] .formula-card,html[data-theme="dark"] .formula-row,html[data-theme="dark"] .task-card,html[data-theme="dark"] .exam-question,html[data-theme="dark"] .exam-result,html[data-theme="dark"] .history-card,html[data-theme="dark"] .dash-card,html[data-theme="dark"] .weak,html[data-theme="dark"] .exam-pager,html[data-theme="dark"] .detail-panel,html[data-theme="dark"] .modal,html[data-theme="dark"] .streak-pop,html[data-theme="dark"] .empty,html[data-theme="dark"] .set-row{background:#171a23;border-color:#262b3a}
html[data-theme="dark"] .hero-progress,html[data-theme="dark"] .task-card,html[data-theme="dark"] .detail-panel,html[data-theme="dark"] .exam-pager{box-shadow:0 14px 40px rgba(0,0,0,.28)}
html[data-theme="dark"] .task-card:hover{box-shadow:0 16px 42px rgba(0,0,0,.4)}
html[data-theme="dark"] .feature:hover,html[data-theme="dark"] .topic:hover,html[data-theme="dark"] .topic:focus-visible,html[data-theme="dark"] .history-card:hover{box-shadow:0 15px 35px rgba(0,0,0,.4);border-color:#4a418c}
html[data-theme="dark"] .formula-row.btn-row:hover,html[data-theme="dark"] .cat-item.open .btn-row{border-color:#4a418c;box-shadow:0 8px 20px rgba(0,0,0,.3)}
html[data-theme="dark"] .history-card.good{border-color:#2d6a47}
html[data-theme="dark"] .mini-stats div{border-top-color:#262b3a}
html[data-theme="dark"] .progress{background:#262b3a}
html[data-theme="dark"] .progress i{background:linear-gradient(90deg,#9a86ff,#6a62e6)}
html[data-theme="dark"] .exam-task-foot,html[data-theme="dark"] .exam-question .task-foot,html[data-theme="dark"] .exam-controls,html[data-theme="dark"] .pager-foot{border-top-color:#262b3a}
html[data-theme="dark"] .result-summary,html[data-theme="dark"] .result-summary div{border-color:#262b3a}
html[data-theme="dark"] .feature strong{color:#6d7184}

/* цветные плашки */
html[data-theme="dark"] .violet>span,html[data-theme="dark"] .source-icon.acc{background:#262250;color:#b9adff}
html[data-theme="dark"] .blue>span{background:#12303f;color:#6cc0f5}
html[data-theme="dark"] .orange>span{background:#3a2a14;color:#f0b36a}
html[data-theme="dark"] .source-icon{background:#14301f;color:#7fd4a0}
html[data-theme="dark"] .source-icon.acc{background:#262250;color:#b9adff}
html[data-theme="dark"] .tag{background:#262250;color:#b9adff}
html[data-theme="dark"] .tag.orange{background:#3a2a14;color:#f0b36a}
html[data-theme="dark"] .timer-tag{background:#232738;color:#b6b9c6}
html[data-theme="dark"] .ok{background:#14301f;color:#7fd4a0}
html[data-theme="dark"] .bad,html[data-theme="dark"] .form-err{background:#3a1a1e;color:#f0a0a0}
html[data-theme="dark"] .form-err.good{background:#14301f;color:#7fd4a0}
html[data-theme="dark"] .feedback.neutral{background:#1d212d;color:#b6b9c6}
html[data-theme="dark"] .note.tip{background:#14301f;color:#7fd4a0}
html[data-theme="dark"] .note.warn{background:#33250f;color:#e8b46a}

/* вложенные «серые» блоки */
html[data-theme="dark"] .given,html[data-theme="dark"] .detail-stats div,html[data-theme="dark"] .prof-stats div,html[data-theme="dark"] .toolbar,html[data-theme="dark"] .match-item,html[data-theme="dark"] .info-box,html[data-theme="dark"] .detail-answers span{background:#1d212d}
html[data-theme="dark"] .toolbar{border-bottom-color:#2a2f3d}
html[data-theme="dark"] .match-item,html[data-theme="dark"] .info-box{border-color:#2a2f3d}
html[data-theme="dark"] .match-item.selected{background:#241f45;border-color:#7460dc}
html[data-theme="dark"] .match-item.done{background:#14301f;border-color:#2d6a47}
html[data-theme="dark"] .info-box.example{background:#211e3d;border-color:#3a3470}
html[data-theme="dark"] .sol{background:#171a23;color:#f1f1f6;border-left-color:#7460dc}
html[data-theme="dark"] .rev-chip{background:#1d212d;border-color:#3d3670;color:#c4baff}
html[data-theme="dark"] .check-box{border-color:#3d3670}
html[data-theme="dark"] .pw-box{border-color:#2a2f3d}
html[data-theme="dark"] .pw-box summary{color:#a3a7b5}
html[data-theme="dark"] .pw-box.danger summary{color:#f0a0a0}

/* тёмные блоки светлой темы — в тёмной делаем чуть светлее фона, чтобы не терялись */
html[data-theme="dark"] .exam-intro,html[data-theme="dark"] .flashcard,html[data-theme="dark"] .info-top{background:#1e2233;border:1px solid #2c3147;box-shadow:0 20px 45px rgba(0,0,0,.35)}
html[data-theme="dark"] .exam-icon{background:#2c3047}
html[data-theme="dark"] .exam-settings select{background:#12141b;border-color:#2e3344;color:#e8e9ee}
html[data-theme="dark"] .exam-head p,html[data-theme="dark"] .info-top p,html[data-theme="dark"] .flashcard p{color:#a3a7b5}
html[data-theme="dark"] .exam-settings label{color:#a3a7b5}
html[data-theme="dark"] .flashcard .card-tip{color:#b9adff}

/* поля ввода и редактор формул */
html[data-theme="dark"] .answer-row input,html[data-theme="dark"] .long-answer,html[data-theme="dark"] .field input,html[data-theme="dark"] .cat-search{background:#12141b;border-color:#2e3344;color:#e8e9ee}
html[data-theme="dark"] .answer-row input::placeholder,html[data-theme="dark"] .long-answer::placeholder,html[data-theme="dark"] .field input::placeholder,html[data-theme="dark"] .cat-search::placeholder{color:#6d7184}
html[data-theme="dark"] .answer-row input:disabled,html[data-theme="dark"] .long-answer:disabled{background:#171a23;color:#9a9eac}
html[data-theme="dark"] .answer-row span{color:#9a9eac}
html[data-theme="dark"] .answer-row input:focus,html[data-theme="dark"] .long-answer:focus,html[data-theme="dark"] .field input:focus,html[data-theme="dark"] .cat-search:focus{border-color:#8f7dff;box-shadow:0 0 0 4px rgba(143,125,255,.16)}
html[data-theme="dark"] .formula-editor{background:#12141b;border-color:#2e3344}
html[data-theme="dark"] .editor{color:#f1f1f6}
html[data-theme="dark"] .editor:empty:before{color:#5d6174}
html[data-theme="dark"] .tool{background:#171a23;border-color:#2e3344;color:#e8e9ee}
html[data-theme="dark"] .tool:hover{border-color:#4a418c}
html[data-theme="dark"] .frac .num{border-bottom-color:#e8e9ee}
html[data-theme="dark"] .eye{color:#e8e9ee}
html[data-theme="dark"] .check input,html[data-theme="dark"] input[type=checkbox]{accent-color:#8f7dff}
html[data-theme="dark"] .pw-meter{background:#262b3a}

/* варианты ответов */
html[data-theme="dark"] .option{background:#171a23;border-color:#2e3344;color:#e8e9ee}
html[data-theme="dark"] .option:hover{border-color:#8f7dff}
html[data-theme="dark"] .option.selected{background:#241f45;border-color:#8f7dff;box-shadow:0 0 0 2px rgba(143,125,255,.14) inset}
html[data-theme="dark"] .option.correct{background:#14301f;border-color:#2d6a47}
html[data-theme="dark"] .option.wrong{background:#3a1a1e;border-color:#7a3a40}
html[data-theme="dark"] .option.locked:hover:not(.correct):not(.wrong):not(.selected){border-color:#2e3344}

/* график */
html[data-theme="dark"] .graph-box{background:linear-gradient(180deg,#1a1d28,#171a23);border-color:#2a2f3d}
html[data-theme="dark"] .graph-box .axis{stroke:#8a8ea0}
html[data-theme="dark"] .graph-box .tick{stroke:#5d6174}
html[data-theme="dark"] .graph-box .graph-line{stroke:#a597ff}
html[data-theme="dark"] .graph-box text{fill:#9a9eac}

/* панель заданий варианта */
html[data-theme="dark"] .pager-dot{background:#171a23;border-color:#2e3344;color:#9a9eac}
html[data-theme="dark"] .pager-dot:hover{border-color:#8f7dff;color:#b9adff;box-shadow:0 8px 18px rgba(0,0,0,.35)}
html[data-theme="dark"] .pager-dot.draft,html[data-theme="dark"] .lg.draft{background:#33250f;border-color:#7a5420;color:#e8b46a}
html[data-theme="dark"] .pager-dot.saved,html[data-theme="dark"] .lg.saved{background:#241f45;border-color:#4a418c;color:#b9adff}
html[data-theme="dark"] .pager-dot.ok,html[data-theme="dark"] .lg.ok{background:#14301f;border-color:#2d6a47;color:#7fd4a0}
html[data-theme="dark"] .pager-dot.err,html[data-theme="dark"] .lg.err{background:#3a1a1e;border-color:#7a3a40;color:#f0a0a0}
html[data-theme="dark"] .pager-dot.active{background:#ecebf5;border-color:#ecebf5;color:#14151c;box-shadow:0 8px 20px rgba(0,0,0,.4)}
html[data-theme="dark"] .lg{background:#171a23;border-color:#2e3344}

/* разбор попытки */
html[data-theme="dark"] .detail-row{border-color:#262b3a}
html[data-theme="dark"] .detail-row.good{border-color:#2d6a47}
html[data-theme="dark"] .detail-row.bad{border-color:#7a3a40}
html[data-theme="dark"] .detail-row.skip{background:#1a1d27;border-color:#262b3a}
html[data-theme="dark"] .detail-status{color:#f08a8a}
html[data-theme="dark"] .detail-row.good .detail-status{color:#6fd096}
html[data-theme="dark"] .detail-row.skip .detail-status{color:#6d7184}

/* окна, всплывающие подсказки */
html[data-theme="dark"] .modal-back{background:rgba(5,6,10,.66)}
html[data-theme="dark"] .modal{box-shadow:0 30px 80px rgba(0,0,0,.6)}
html[data-theme="dark"] .modal-x{background:#171a23;border-color:#2a2f3d;color:#9a9eac}
html[data-theme="dark"] .modal-x:hover{background:#262250;color:#b9adff}
html[data-theme="dark"] .toast{background:#ecebf5;color:#14151c}
html[data-theme="dark"] .streak-pop{box-shadow:0 20px 50px rgba(0,0,0,.55)}
html[data-theme="dark"] .streak-pop b{color:#e8e9ee}
html[data-theme="dark"] .streak-pop p{color:#a3a7b5}
html[data-theme="dark"] .streak-days i{background:#232738}
html[data-theme="dark"] .streak-days span{color:#8a8ea0}
html[data-theme="dark"] .streak-days span.on i{background:#3a2a14}
html[data-theme="dark"] .streak-days span.today{color:#e8e9ee}
html[data-theme="dark"] .streak-days span.today i{box-shadow:0 0 0 2px #8f7dff inset}

/* переключатели в настройках */
html[data-theme="dark"] .switch{background:#3a3f52}
html[data-theme="dark"] .switch.on{background:#7460dc}
html[data-theme="dark"] .theme-opt{background:#171a23;border-color:#2e3344;color:#a3a7b5}
html[data-theme="dark"] .theme-opt:hover{border-color:#4a418c}
html[data-theme="dark"] .theme-opt.active{background:#241f45;border-color:#8f7dff;color:#c4baff;box-shadow:0 0 0 3px rgba(143,125,255,.16)}

/* футер */
html[data-theme="dark"] footer{border-top-color:#232738}

/* =====================================================================
   v8: юридические документы, баннер cookie, согласия в формах
   ===================================================================== */
footer{flex-direction:column;align-items:stretch;gap:12px}
.foot-main{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}
.foot-links{display:flex;flex-wrap:wrap;gap:6px 16px}
.foot-links a{color:inherit;text-decoration:none;font-size:11px;font-weight:600;border-bottom:1px dotted currentColor;opacity:.85}
.foot-links a:hover{color:#6756d6;opacity:1}

/* страница документов */
.lg-tabs{margin-bottom:18px;overflow-x:auto;flex-wrap:nowrap;-webkit-overflow-scrolling:touch}
.lg-tabs .tab{flex:none;white-space:nowrap}
.legal-doc{background:#fff;border:1px solid #e7e8ee;border-radius:22px;padding:30px 34px;max-width:880px;font-size:14px;line-height:1.7;color:#2b2e3a}
.legal-doc h3{font:800 17px Manrope,Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;letter-spacing:-.3px;margin:26px 0 8px;color:#171923}
.legal-doc h3:first-of-type{margin-top:6px}
.legal-doc p{margin:0 0 12px}
.legal-doc ul{margin:0 0 12px;padding-left:20px}.legal-doc li{margin-bottom:6px}
.legal-doc a{color:#6756d6;font-weight:600}
.legal-doc code{background:#f1effe;color:#4a3fb0;border-radius:6px;padding:1px 6px;font-size:12px}
.lg-meta{font-size:12px;color:#8d909a;margin:0 0 14px}
.lg-foot{font-size:11px;color:#9a9da6;max-width:880px;margin:14px 4px 0;line-height:1.6}
mark.ph{background:#fff1b8;color:#6b4e00;border-radius:5px;padding:1px 5px;font-weight:700}
.lg-table-wrap{overflow-x:auto;margin:6px 0 14px;border:1px solid #e7e8ee;border-radius:14px;-webkit-overflow-scrolling:touch}
.lg-table{border-collapse:collapse;width:100%;font-size:12.5px;line-height:1.55}
.lg-table th{background:#f6f5fe;color:#4a3fb0;text-align:left;font:800 11px Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;letter-spacing:.3px;padding:10px 12px;white-space:nowrap}
.lg-table td{padding:10px 12px;border-top:1px solid #eceef3;vertical-align:top;min-width:120px}
.lg-license{background:#f7f7fb;border:1px solid #e7e8ee;border-radius:14px;padding:16px;font:12px/1.55 ui-monospace,Menlo,Consolas,monospace;white-space:pre-wrap;max-height:340px;overflow:auto;color:#3a3d49}
.lg-actions{display:flex;flex-wrap:wrap;gap:10px;margin:12px 0}
.lg-form{max-width:560px;margin-top:8px}
.lg-form .field>.check{margin:6px 0 0;font-size:12px;font-weight:600}
.legal-doc .check{font-size:12.5px;color:#3a3d49}

/* согласия в форме регистрации */
.consent-block{display:grid;gap:9px;border:1px solid #e7e8ed;border-radius:13px;padding:12px 14px;background:#fbfbfe}
.check.top{align-items:flex-start;line-height:1.45}
.check.top input{margin-top:2px;flex:none}
.check.top a{color:#6756d6;font-weight:700}
.check.opt{color:#8d909a}.check.opt i{font-style:normal;font-size:10px}
.legal-links{line-height:1.8}.legal-links a{color:#6756d6;font-weight:600}
.modal-actions{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0 0}

/* баннер cookie */
.cookie-banner{position:fixed;left:50%;bottom:18px;transform:translateX(-50%);width:min(940px,calc(100vw - 28px));z-index:55;display:flex;align-items:center;gap:18px;justify-content:space-between;background:#fff;border:1px solid #e0e1ea;border-radius:20px;padding:16px 20px;box-shadow:0 20px 60px rgba(25,27,37,.22)}
.cb-text b{font:800 14px Manrope,Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;color:#171923}
.cb-text p{margin:5px 0 0;font-size:12px;line-height:1.55;color:#5c606c}
.cb-text a{color:#6756d6;font-weight:700;text-decoration:none;border-bottom:1px dotted #6756d6;cursor:pointer}
.cb-actions{display:flex;flex-wrap:wrap;gap:8px;flex:none;justify-content:flex-end}
.cb-actions .btn{white-space:nowrap}
body.cb-on main{padding-bottom:170px}

/* тёмная тема */
html[data-theme="dark"] .legal-doc{background:#171a23;border-color:#2a2f3d;color:#c4c7d2}
html[data-theme="dark"] .legal-doc h3{color:#e8e9ee}
html[data-theme="dark"] .legal-doc a,html[data-theme="dark"] .check.top a,html[data-theme="dark"] .legal-links a,html[data-theme="dark"] .cb-text a{color:#b9adff;border-bottom-color:#b9adff}
html[data-theme="dark"] .legal-doc code{background:#262250;color:#cfc6ff}
html[data-theme="dark"] .lg-meta,html[data-theme="dark"] .lg-foot{color:#7e8292}
html[data-theme="dark"] mark.ph{background:#4a3a08;color:#ffd66b}
html[data-theme="dark"] .lg-table-wrap{border-color:#2a2f3d}
html[data-theme="dark"] .lg-table th{background:#1d1a3a;color:#b9adff}
html[data-theme="dark"] .lg-table td{border-top-color:#2a2f3d}
html[data-theme="dark"] .lg-license{background:#12141b;border-color:#2a2f3d;color:#b4b8c6}
html[data-theme="dark"] .legal-doc .check{color:#c4c7d2}
html[data-theme="dark"] .consent-block{background:#12141b;border-color:#2a2f3d}
html[data-theme="dark"] .check.opt{color:#8a8ea0}
html[data-theme="dark"] .cookie-banner{background:#171a23;border-color:#2a2f3d;box-shadow:0 20px 60px rgba(0,0,0,.6)}
html[data-theme="dark"] .cb-text b{color:#e8e9ee}
html[data-theme="dark"] .cb-text p{color:#a3a7b6}
html[data-theme="dark"] .foot-links a:hover{color:#b9adff}

/* планшеты и телефоны */
@media(max-width:850px){
  .cookie-banner{flex-direction:column;align-items:stretch;gap:12px;bottom:calc(74px + env(safe-area-inset-bottom));padding:14px 16px;border-radius:18px;max-height:calc(100vh - 170px);overflow-y:auto}
  .cb-text p{font-size:13px}
  .cb-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .cb-actions .btn:first-child{grid-column:1/-1}
  body.cb-on main{padding-bottom:300px}
  .legal-doc{padding:22px 18px;font-size:15px;border-radius:18px}
  .lg-table{font-size:13px}
  .foot-links a{font-size:12px}
  .lg-actions .btn,.modal-actions .btn{flex:1 1 100%}
  body.kb-open .cookie-banner{display:none}
}
@media(prefers-reduced-motion:reduce){.cookie-banner{transition:none}}


/* v8.1: цвета не должны зависеть от системной темы, когда на сайте выбрана другая.
   Раньше при тёмной теме ОС и светлой теме сайта кнопки брали белый системный цвет текста
   (заголовки карточек «Формулы», «Задачи», «ОГЭ», варианты ответов, ⚙️ были белыми на белом). */
html[data-theme="light"]{color-scheme:light}
html[data-theme="dark"]{color-scheme:dark}
button,select,input,textarea{color:inherit}
button{color:#171923}
html[data-theme="dark"] button{color:#e8e9ee}
.foot-links a{color:#6c6f7a}.lg-foot{color:#757885}
html[data-theme="dark"] .foot-links a{color:#9a9eac}
html[data-theme="dark"] .lg-foot{color:#8a8ea0}

/* №19: разбор по критериям */
.rubric{margin-top:10px;padding-top:9px;border-top:1px solid rgba(128,128,128,.35);font-size:13px;line-height:1.55}
.rubric>div+div{margin-top:3px}
.rubric-note{opacity:.8;font-size:12px;margin-top:7px}

.age-choice{border:0;margin:0 0 6px;padding:0;min-width:0}.age-choice legend{font-size:12px;font-weight:700;opacity:.7;padding:0 0 4px}

.ad-slot{margin:22px 0;padding:10px 12px;border:1px dashed rgba(120,125,150,.35);border-radius:14px;background:rgba(120,125,150,.06);min-height:60px}
.ad-slot[hidden]{display:none}
.ad-head{display:flex;justify-content:space-between;align-items:center;font-size:12px;opacity:.8;margin-bottom:6px}
.ad-label{font-weight:800;text-transform:uppercase;letter-spacing:.06em}
.ad-head a{color:inherit}
.ad-body{overflow:hidden;max-width:100%}
html[data-theme=dark] .ad-slot{border-color:rgba(200,205,230,.25);background:rgba(200,205,230,.06)}

/* v13 — единый ритм вертикальных отступов (дизайн не меняется, выровнены только промежутки)
   --sp-block: между крупными блоками страницы; --sp-head: от заголовка секции до её содержимого;
   --sp-card: между связанными карточками и панелями управления */
:root{--sp-block:40px;--sp-head:18px;--sp-card:16px}
.hero{padding-bottom:0}
.section-title{margin:var(--sp-block) 0 var(--sp-head)}
.topics-title,.history-title{margin-top:var(--sp-block)}
.source-card{margin-top:var(--sp-block)}
.account-card{margin:var(--sp-block) 0 0}
.ad-slot{margin:var(--sp-block) 0 0}
.tabs,.filterbar,.cat-tools{margin-bottom:var(--sp-card)}
.exam-pager{margin:var(--sp-card) 0 0}
.exam-result,.detail-panel{margin-top:0}
@media(max-width:560px){:root{--sp-block:32px;--sp-head:16px}}

/* v13 — каталог формул: три ровные колонки (название | формула по центру | стрелка), формулы больше не «плавают» */
.cat-item .formula-row.btn-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 16px;align-items:center;column-gap:15px}
.cat-item .formula-row .formula-math{justify-self:center;text-align:center}
.cat-item .formula-row .chev{justify-self:end}
@media(max-width:760px){
  .cat-item .formula-row.btn-row{grid-template-columns:minmax(0,1fr) 16px;row-gap:10px}
  .cat-item .formula-row .formula-math{grid-column:1/-1;grid-row:2;justify-self:center;width:100%}
}

/* v14 — компьютерная версия: уменьшен верхний отступ под шапкой (был ~81 px на главной и ~61 px на остальных страницах, теперь везде 36 px) */
@media(min-width:851px){
  main{padding-top:36px}
  .hero{padding-top:0}
  .page-title{margin-top:0}
}
