.theory-library,.theory-lesson{max-width:960px;margin:0 auto}.theory-intro,.theory-hero{position:relative;padding:28px 0}.theory-intro h2,.theory-hero h2{font-size:clamp(26px,4vw,36px);line-height:1.2;max-width:750px;margin:14px 0}.theory-intro p,.theory-hero p{max-width:690px;color:var(--muted)}.theory-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.theory-card{display:flex;flex-direction:column;align-items:flex-start;border:1px solid var(--line);background:var(--card,#fff);border-radius:16px;padding:24px;gap:14px}.theory-card h3{font-size:21px;line-height:1.35;margin:0}.theory-card p{margin:0;color:var(--muted)}.theory-card small{margin-top:auto}.theory-card .button{white-space:normal}.theory-number{font-size:34px;color:var(--accent);font-weight:700;opacity:.65}.theory-toc{display:flex;flex-wrap:wrap;gap:10px;margin:8px 0 28px}.theory-toc a{padding:9px 12px;background:var(--section);border-radius:8px;text-decoration:none;font-size:14px}.theory-section{position:relative;isolation:isolate;margin:20px 0;padding:30px;border:1px solid var(--line);border-radius:16px;background:var(--card,#fff);scroll-margin-top:20px}.theory-section:before{content:'';position:absolute;right:24px;top:20px;width:105px;height:105px;background:url('assets/brand/3a-grid/logo-3a-mark.svg') center/contain no-repeat;opacity:.045;pointer-events:none;z-index:-1}.theory-section h3{font-size:23px;line-height:1.4;margin-bottom:20px}.theory-prose{font-size:17px;line-height:1.8;max-width:790px}.theory-prose p{line-height:1.8}.theory-prose li,.theory-recap li{margin:10px 0;line-height:1.7}.theory-rule{padding:16px 20px;background:var(--section);border-left:3px solid var(--accent);border-radius:4px;font-size:22px;color:var(--text);overflow-wrap:anywhere}.theory-figures{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:18px}.theory-figure{margin:12px 0 0;min-width:0}.theory-figure img{width:100%;height:auto;display:block;border:1px solid var(--line);border-radius:12px;background:white}.theory-figure figcaption{font-size:14px;line-height:1.6;color:var(--muted);margin-top:10px}.theory-frac{display:inline-flex;flex-direction:column;vertical-align:middle;text-align:center;font-size:.9em;line-height:1.3}.theory-frac>span:first-child{border-bottom:1px solid;padding:0 5px 2px}.theory-frac>span:last-child{padding-top:2px}.theory-check{margin:24px 0;padding:20px;min-width:0;border-radius:12px}.theory-check legend{font-weight:600;line-height:1.6;padding:0 8px;max-width:100%}.theory-check label{display:flex;align-items:baseline;gap:10px;padding:12px;border:1px solid var(--line);border-radius:8px;margin-top:10px;cursor:pointer}.theory-check input{width:auto;flex-shrink:0;accent-color:var(--accent)}.theory-feedback{line-height:1.6}.theory-feedback:empty{display:none}.theory-feedback[data-correct=true]{color:var(--accent)}.theory-source{font-size:14px;line-height:1.7;color:var(--muted);padding:12px 0 30px}.theory-source a{text-decoration:underline}.theory-small{font-size:13px}.theory-hero a.button{display:inline-block;text-decoration:none;white-space:normal}.theory-source .button{white-space:normal}html[data-theme=dark] .theory-card,html[data-theme=dark] .theory-section{background:#111827}html[data-theme=dark] .theory-section:before{opacity:.07;filter:invert(1)}.theory-standalone-header{padding:22px 28px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;gap:16px;align-items:center}.theory-standalone-header img{width:190px;max-width:50vw}.theory-standalone-header a{text-decoration:none}.theory-standalone-main{max-width:1040px;padding:24px;margin:auto}.theory-standalone-header button{border:1px solid var(--line);padding:10px 14px;border-radius:9px;background:var(--section);color:var(--text)}@media(max-width:850px){.theory-grid{grid-template-columns:1fr}.theory-section{padding:20px}.theory-hero h2{font-size:28px}.theory-prose{font-size:16px}.theory-section h3{font-size:21px}.theory-rule{font-size:20px;padding:14px}.theory-check{padding:12px}.theory-toc{display:grid}.theory-standalone-main{padding:16px}.theory-section ul,.theory-section ol{padding-left:22px}}

.theory-figure{max-width:650px}.theory-standalone-header>a{background:#fff;border-radius:10px;padding:8px 12px;display:flex}
.theory-unit{margin:34px 0 48px}.theory-unit-heading{display:flex;align-items:end;justify-content:space-between;gap:16px;margin-bottom:16px}.theory-unit-heading h3{font-size:25px}.theory-unit-heading span{color:var(--muted);font-size:14px}.theory-meta{display:flex;flex-wrap:wrap;gap:7px}.theory-card .theory-meta{min-height:28px}.theory-hero .theory-meta{margin:12px 0}.theory-meta .tag{font-size:12px}
/* A short first reading; proofs remain available to keyboard and touch users. */
.theory-proof{margin:20px 0;padding:14px 18px;border:1px solid var(--line);border-radius:12px;background:var(--section)}
.theory-proof summary{cursor:pointer;font-weight:600;line-height:1.5;color:var(--text)}
.theory-proof summary:focus-visible{outline:2px solid var(--accent);outline-offset:5px;border-radius:3px}
.theory-proof[open] summary{margin-bottom:12px}
.theory-proof p:last-child{margin-bottom:0}
.theory-recap .theory-small{color:var(--muted);line-height:1.6}
.theory-filters{display:grid;grid-template-columns:2fr 1fr 1.5fr auto;gap:14px;align-items:end;margin:12px 0 24px}.theory-filters label{display:grid;gap:7px;font-size:14px}.theory-filters input,.theory-filters select{width:100%;min-width:0;padding:12px;border:1px solid var(--line);border-radius:9px;color:var(--text);background:var(--card,#fff);font:inherit}
.theory-reading-links{display:flex;flex-wrap:wrap;gap:12px;margin-top:22px;align-items:center}.theory-reading-links a{padding:10px 12px;background:var(--section);border-radius:8px;text-decoration:none}.theory-copy-feedback{font-size:14px;color:var(--muted)}
.theory-rule{overflow-x:auto;overflow-wrap:normal}.theory-equation{display:block;width:max-content;max-width:none;white-space:nowrap;margin:7px 0}.theory-rule .math-text{font-size:1em}.theory-inline-math{display:inline-block;white-space:nowrap}
.theory-prose .theory-figure{margin:18px 0 24px}.theory-image-button{display:block;width:100%;padding:0;border:0;border-radius:12px;background:transparent;color:var(--muted);cursor:zoom-in;text-align:left;font:inherit}.theory-image-button>span{display:block;margin:6px 0 0;font-size:12px}.theory-image-button:focus-visible{outline:3px solid var(--accent);outline-offset:4px}
.theory-image-dialog{width:min(95vw,1100px);max-width:95vw;max-height:94vh;background:var(--card,#fff);color:var(--text);border:1px solid var(--line);border-radius:14px;padding:20px}.theory-image-dialog::backdrop{background:rgba(0,0,0,.7)}.theory-image-dialog img{display:block;width:100%;height:auto;background:white;border-radius:12px;margin:16px 0}.theory-image-dialog p{line-height:1.6;margin-bottom:0}
.theory-hint,.theory-answer{margin-top:16px;padding:12px;border-radius:8px;background:var(--section);line-height:1.7}.theory-hint summary,.theory-answer summary{cursor:pointer;font-weight:600}.theory-answer[hidden]{display:none}
.theory-homework-links{padding:14px 18px;margin:18px 0;border:1px solid var(--line);border-radius:10px;background:var(--section)}.theory-homework-links>div{display:flex;flex-wrap:wrap;gap:10px 16px;margin-top:10px}.theory-homework-links a{font-size:14px;text-decoration:underline}
@media(max-width:850px){.theory-filters{grid-template-columns:1fr 1fr}.theory-filters label:first-child{grid-column:1/-1}.theory-filters label:nth-child(3){grid-column:1/-1}.theory-image-dialog{padding:12px}.theory-rule{font-size:18px}.theory-reading-links{gap:8px;font-size:14px}}
@media(max-width:480px){.theory-standalone-header{padding:16px;gap:12px}.theory-standalone-header img{width:150px;max-width:36vw}.theory-standalone-header button{font-size:13px;padding:9px}}
/* Пояснение под формулой: что означают буквы и как формула выглядит на нашем чертеже. */
.theory-rule-note{margin:-6px 0 16px;padding:0 2px;font-size:14px;line-height:1.5;color:var(--muted,#667085)}
.theory-rule-note sub{font-size:.75em}
.theory-exam-tag{background:var(--accent-tint,#ECF1FE)!important;color:var(--accent,#2F5BEA)!important}
/* Вкладки «Для N класса» / «Вся теория» над фильтрами. */
.theory-scope{display:grid;grid-template-columns:1fr 1fr;max-width:520px;margin:4px 0 18px}
.theory-scope button{white-space:nowrap}
/* Темы-разделы: номер над названием. «Одним словом» — простая формулировка после определения. */
.theory-unit-heading h3 .theory-unit-num{display:block;margin-bottom:4px;color:var(--accent);font-size:13px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}
.theory-plain{margin:2px 0 18px;padding:10px 14px;border-radius:10px;background:var(--accent-tint,#ECF1FE);color:var(--ink,#101828);font-size:15px;line-height:1.55}
.theory-plain strong{color:var(--accent)}
@media print{.theory-plain{background:#F2F5FF!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}}
