@font-face {
    font-family: Academy;
    src: url('ubuntu-sans.ttf') format('truetype');
    font-weight: 100 900;
    font-display: swap;
}
@font-face {
    font-family: Cells;
    src: url('ubuntu-mono.ttf') format('truetype');
    font-weight: 100 900;
    font-display: swap;
}
/* Клетка / Excel. Phone layout first; existing content columns return at 992px. */
:root {
    font-size: 18px;
    color-scheme: light;
    --brand: #217346;
    --bg: #f5f5ef;
    --surface: #fdfdf8;
    --paper: #fdfdf8;
    --ink: #202c25;
    --muted: #59665b;
    --line: #c8cec3;
    --sidebar: #eeefe7;
    --soft: #e6eee2;
    --hero: #e0eadb;
    --field: #fffef9;
    --green: #217346;
    --green-dark: #185b36;
    --on-green: #fff;
    --focus: #a95113;
    --menu-bg: #fdfdf8;
    --menu-ink: #202c25;
    --menu-line: #c8cec3;
    --menu-hover: #e6eee2;
    --menu-accent: #217346;
    --menu-focus: #a95113;
    --trainer: #217346;
    --trainer-ink: #fff;
    --trainer-muted: #e0ebdc;
    --trainer-line: #84ad8c;
    --trainer-field: #195d38;
    --trainer-button: #fff;
    --error: #a23125;
    --error-bg: #fbe9e0;
    --good: #217346;
    --sans: Academy, 'Trebuchet MS', sans-serif;
    --mono: Cells, Consolas, monospace;
}
:root[data-theme='dark'] {
    color-scheme: dark;
    --bg: #19211d;
    --surface: #222c25;
    --paper: #222c25;
    --ink: #ebeee3;
    --muted: #b5c1b3;
    --line: #506151;
    --sidebar: #28372b;
    --soft: #304732;
    --hero: #314b34;
    --field: #1d2920;
    --green: #8bd4a2;
    --green-dark: #b0e6bc;
    --on-green: #fff;
    --focus: #e2b373;
    --menu-bg: #222c25;
    --menu-ink: #ebeee3;
    --menu-line: #637566;
    --menu-hover: #304732;
    --menu-accent: #8bd4a2;
    --menu-focus: #e2b373;
    --error: #ffb29e;
    --error-bg: #4a2d27;
    --good: #96d9a9;
}
html { scroll-padding-top: 96px; scroll-padding-bottom: 24px; }
body { padding: 0; font: 1rem/1.55 var(--sans); }
h1, h2, h3 { font-weight: 650; letter-spacing: -.035em; line-height: 1.15; overflow-wrap: break-word; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.12rem; }
p { overflow-wrap: break-word; }
button, input, select, textarea { border-radius: 2px; }
summary::-webkit-details-marker { display: none; }
.site-container { width: min(100%, 1320px); padding-inline: 18px; margin-inline: auto; min-width: 0; }
.project-layout #main { min-height: 55vh; padding-block: 28px 40px; }
.wrap { width: 100%; min-width: 0; margin-inline: auto; }
.mono, code, pre, .eyebrow, .meta, .tag { font-family: var(--mono); }
.meta { font-size: .75rem; line-height: 1.5; }
.eyebrow { font-size: .69rem; line-height: 1.5; letter-spacing: .055em; text-transform: uppercase; font-weight: 400; }
.tag { border-radius: 2px; font-size: .68rem; padding: 3px 7px; }
.button { border-radius: 2px; background: var(--brand); color: #fff; min-height: 46px; padding: 11px 17px; font-weight: 600; line-height: 1.4; transition: background .15s, border-color .15s; }
.button:hover { background: #185b36; }
.button.secondary { color: var(--green); border-color: var(--green); }
.button.secondary:hover { background: var(--soft); }
.button:disabled { opacity: .5; }
.button svg { width: 19px; height: 19px; }
.text-link, .plain-button { font-size: .83rem; }
select { min-height: 46px; font-size: .86rem; }
select:focus-visible, input:focus-visible, textarea:focus-visible { outline-offset: 2px; }
.skip { z-index: 100; font-size: .85rem; }
/* The original site's horizontal navigation, including its three groups. */
.site-header {
    --surface: #217346;
    --ink: #fffef6;
    --muted: #dfecdf;
    --line: #82a78b;
    --soft: #195d38;
    --green: #fffef6;
    --focus: #f5d590;
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid #164f31;
    background: var(--brand);
    color: var(--ink);
}
.site-header .brand-icon { background: #fffef6; color: #217346; }
.header-inner { display: flex; gap: 8px; align-items: center; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 8px; flex: none; font-size: 18px; letter-spacing: -.045em; line-height: 1.1; white-space: nowrap; }
.brand b { font-weight: 700; }
.brand-icon { display: grid; place-items: center; width: 30px; height: 34px; color: #fff; background: var(--brand); flex: none; }
.brand-icon svg { width: 23px; height: 23px; }
.header-actions { display: flex; gap: 10px; align-items: center; margin-left: auto; }
.project-layout .site-header .premium-nav-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; background: #d6f3be; color: #173e2b; border: 1px solid #c6e6aa; border-radius: 7px; font-size: .8rem; font-weight: 650; line-height: 1.4; text-decoration: none; white-space: nowrap; box-shadow: 0 2px 0 #143e2b66; transition: background .15s, border-color .15s, box-shadow .15s; }
.project-layout .site-header .premium-nav-link:hover { background: #e5ffd1; color: #173e2b; border-color: #e5ffd1; box-shadow: 0 3px 0 #143e2b66; }
.project-layout .site-header .premium-nav-link:active { background: #c6e6aa; box-shadow: none; }
.project-layout .site-header .premium-nav-link:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.nav-account .premium-nav-link { justify-self: start; margin-bottom: 10px; }
@media (max-width: 600px) { .project-layout .header-actions .premium-nav-link { display: none; } }
.icon-button, .menu-toggle { width: 42px; height: 44px; min-width: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 2px; background: transparent; color: var(--ink); }
.icon-button svg, .menu-toggle svg { width: 21px; height: 21px; }
.icon-button:hover, .menu-toggle:hover { background: var(--soft); border-color: var(--green); }
.menu-toggle { order: 3; }
.header-login { display: none; font-size: .79rem; }
.account-dropdown { display: none; position: relative; }
.account-entry { list-style: none; cursor: pointer; font-size: .79rem; }
.main-nav { --focus: var(--menu-focus); display: none; position: absolute; left: 0; right: 0; top: 100%; max-height: calc(100dvh - 73px); overflow: auto; padding: 8px 18px 18px; border-bottom: 1px solid var(--menu-line); background: var(--menu-bg); color: var(--menu-ink); }
.main-nav.open { display: block; }
.nav-dropdown { border-bottom: 1px solid var(--menu-line); }
.nav-dropdown>summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; list-style: none; cursor: pointer; font-size: .85rem; font-weight: 600; }
.nav-dropdown>summary>span { font: .9rem var(--mono); margin-left: 10px; }
.nav-dropdown.active>summary { color: var(--menu-accent); }
.nav-popup {
    --green: var(--menu-accent);
    --soft: var(--menu-hover);
    --focus: var(--menu-focus);
    display: grid;
    padding-bottom: 10px;
    background: var(--menu-bg);
    color: var(--menu-ink);
}
.nav-popup>a { display: flex; align-items: center; min-height: 44px; padding: 9px 13px; font-size: .82rem; line-height: 1.4; }
.nav-popup>a:hover, .nav-popup>a[aria-current] { color: var(--green); background: var(--soft); }
.nav-popup>a[aria-current] { font-weight: 600; border-left: 2px solid var(--green); }
.nav-account { display: grid; padding-top: 10px; }
.nav-account>a { min-height: 44px; padding-block: 9px; font-size: .83rem; color: var(--menu-accent); }
/* Sharp, quiet panels and generous type are the parts inherited from Клетка. */
.p-card, .panel, .outlined-panel, .note-panel, .progress-course, .profile-card,
.login-panel, .tool-data, .workbench, .empty-state { border-radius: 2px; }
.p-card { border-color: var(--line); }
.p-card-header { background: var(--sidebar); padding: 15px 20px; }
.p-card-header h2 { font-size: 1.07rem; line-height: 1.25; }
.p-card-body { padding: 23px 20px; }
.p-card-body>p { line-height: 1.65; }
.p-page-heading { margin-bottom: 28px; }
.p-page-heading h1 { font-size: 2rem; letter-spacing: -.045em; margin-bottom: 12px; }
.p-page-heading p { font-size: .94rem; }
.p-page-heading .eyebrow { margin-bottom: 14px; }
.p-section-intro h2, .section-title h2 { font-size: 1.6rem; letter-spacing: -.035em; }
.p-section-intro p { font-size: .9rem; }
.p-course-card, .p-exercise-card, .p-blog-card { transition: border-color .15s; }
.p-course-card:hover, .p-exercise-card:hover, .p-blog-card:hover { border-color: var(--green); }
.p-course-image { min-height: 184px; display: flex; flex-direction: column; align-items: stretch; justify-content: space-between; padding: 16px 20px; background: var(--soft); border-color: var(--line); }
.p-course-image>.p-cover-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font: .65rem/1.4 var(--mono); letter-spacing: .035em; }
.p-cover-formula { color: var(--green); font: 2.05rem/1.1 var(--mono); letter-spacing: -.04em; margin-block: 21px; overflow-wrap: anywhere; }
.p-course-image>.p-cover-caption { color: var(--muted); font: .65rem/1.4 var(--mono); }
.p-course-card:nth-child(3n + 2) .p-course-image { background: var(--sidebar); }
.p-course-card:nth-child(3n) .p-course-image { background: var(--surface); }
.p-course-card h2 { font-size: 1.33rem; line-height: 1.22; letter-spacing: -.03em; }
.p-course-card .p-card-body>p { font-size: .87rem; }
.p-course-card .p-card-footer { border-top: 1px solid var(--line); padding: 16px 20px; }
.p-course-card .p-card-footer .button { justify-content: space-between; }
.p-course-card .p-card-footer .button:after { content: '↗'; font: 1.05rem var(--mono); }
.p-course-detail h1 { font-size: 1.95rem; line-height: 1.15; }
.p-lesson-circle { border-radius: 2px; }
.p-course-lessons h3 { line-height: 1.4; }
.progress-track { border-radius: 0; height: 8px; }
/* The homepage keeps the current sequence, widths and calls to action. */
.p-home-hero { border-radius: 2px; border: 1px solid #185b36; background: var(--brand); color: #fff; padding: 24px 22px; }
.p-home-hero .hero-kicker { font: .61rem/1.55 var(--mono); letter-spacing: .055em; color: #e1ecde; margin-bottom: 16px; }
.p-home-hero h1 { font-size: 2rem; font-weight: 700; line-height: 1.05; letter-spacing: -.05em; max-width: 900px; margin-bottom: 18px; }
.p-home-hero>p:not(.hero-kicker) { color: #e1ecde; font-size: .91rem; line-height: 1.55; max-width: 820px; margin-bottom: 18px; }
.p-checklist { font-size: .81rem; line-height: 1.5; margin-bottom: 18px; }
.p-checklist li:before { color: #fff; }
.p-home-hero .button { background: #fffef6; color: #185b36; border-color: #fffef6; }
.p-home-hero .button:hover { background: #e7ecdf; }
.p-home-hero .button.secondary { background: transparent; color: #fff; border-color: #a4bfa7; }
.p-home-hero .button.secondary:hover { background: #195e38; }
.p-home-hero a:focus-visible { outline-color: #f1dca3; }
.p-home-section { margin-top: 28px; padding-block: 26px; }
.p-home-section.p-surface { border-radius: 2px; padding: 30px 22px; }
.p-audience { padding: 8px 0; }
.p-audience+.p-audience { border-top: 1px solid var(--line); padding-top: 25px; }
.p-large-symbol { font: 2.9rem/1 var(--mono); margin-bottom: 18px; }
.p-audience h3, .p-feature h3, .p-home-steps h3 { font-size: 1.16rem; line-height: 1.25; }
.p-audience p, .p-feature p, .p-home-steps p { font-size: .87rem; line-height: 1.65; }
.p-feature { border-top: 3px solid var(--green); padding: 25px 22px; }
.p-feature .text-link { font-size: .8rem; }
.p-home-steps li>span { border-radius: 2px; font: 1.4rem var(--mono); background: var(--brand); }
.p-home-steps li+li { border-top: 1px solid var(--line); padding-top: 24px; }
.p-metrics strong { font-size: 2.5rem; letter-spacing: -.045em; }
.p-formula-example { border-radius: 2px; border-left: 3px solid var(--green); }
.p-formula-example code { font-size: 1.65rem; letter-spacing: -.035em; }
.p-trainer-cta h2 { font-size: 1.7rem; }
.p-home-faq { max-width: 900px; }
.p-accordion { border-radius: 2px; }
.p-blog-card h2 { font-size: 1.25rem; line-height: 1.3; }
.p-blog-card .p-card-footer { border-top: 1px solid var(--line); padding-top: 16px; }
.p-article-heading h1 { font-size: 2.05rem; line-height: 1.1; letter-spacing: -.04em; }
.p-card-title-row h2 { font-size: 1.18rem; line-height: 1.3; }
.p-exercise-filters { background: var(--sidebar); }
.p-exercise-filters select { background: var(--field); }
.p-function-tag { font-family: var(--mono); }
.p-function-card-grid .p-card h2 { line-height: 1.35; }
.p-featured-faq>.p-card-header { background: var(--brand); color: #fff; }
.p-faq-table td:first-child>a { font-weight: 600; line-height: 1.5; }
.p-probability-track { border-radius: 0; }
.p-probability.regular { color: #795514; }
:root[data-theme='dark'] .p-probability.regular { color: #e7c07d; }
.p-pagination>button:first-child, .p-pagination>button:last-child { border-radius: 2px; }
.p-pagination>button[aria-current], .p-pagination>button:hover { background: var(--brand); }
.prose { font-size: 1rem; line-height: 1.8; }
.prose h2 { line-height: 1.25; font-size: 1.5rem; }
.prose h3 { line-height: 1.3; font-size: 1.18rem; }
.prose pre { border-radius: 2px; font-size: .94rem; line-height: 1.6; }
.project-layout .lesson-main, .project-layout .p-split-workbench .task-brief,
.project-layout .p-split-workbench .sheet-workspace { border-radius: 2px; }
.project-layout .lesson-heading h1 { line-height: 1.15; font-size: 1.8rem; }
.project-layout .p-split-workbench .task-brief h1 { line-height: 1.2; font-size: 1.85rem; }
.sheet { font-size: .77rem; }
.sheet .sheet-header td { font-size: .74rem; }
.sheet td.number { font-size: .84rem; }
.sheet .selected-cell { outline-color: var(--green); }
.formula-input { border-radius: 2px; }
.fx { font-family: var(--mono); font-style: normal; }
.formula-input input { font-size: 1rem; }
.search-control, .analysis-result, .code-block { border-radius: 2px; }
.p-profile-avatar { border-radius: 2px; }
.p-context .p-card-body { font-size: .85rem; }
.p-context .p-card-body p { font-size: .85rem; }
.p-info-list, .p-tip-list { line-height: 1.65; }
.p-feedback-wrap { max-width: 820px; }
.legal-page { max-width: 900px; margin-inline: auto; }
.legal-page .prose { max-width: none; }
.legal-page .prose p { color: var(--ink); font-size: .94rem; margin-bottom: 20px; }
.legal-page h2 { margin-top: 30px; }
.legal-page h2:first-child { margin-top: 0; }
.prototype-map { display: grid; border-top: 1px solid var(--ink); }
.prototype-map .map-link { display: flex; align-items: center; gap: 16px; padding: 16px 0; }
.map-link>span { font: .75rem var(--mono); color: var(--muted); }
.map-link>b { font-weight: 400; margin-left: auto; }
/* Footer keeps the project's four columns. */
.site-footer { margin-top: 24px; padding-top: 36px; background: var(--surface); border-top: 1px solid var(--line); }
.footer-grid { display: grid; gap: 28px; }
.footer-grid h2 { font: .72rem/1.5 var(--mono); letter-spacing: .025em; text-transform: uppercase; margin-bottom: 10px; }
.footer-grid>div>a:not(.brand) { display: block; font-size: .79rem; color: var(--muted); padding-block: 8px; min-height: 38px; }
.footer-grid>div>a:hover { color: var(--green); text-decoration: underline; text-underline-offset: 4px; }
.footer-brand p { color: var(--muted); font-size: .85rem; max-width: 340px; margin-top: 18px; line-height: 1.65; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); margin-top: 30px; padding-block: 18px 22px; font: .7rem/1.5 var(--mono); color: var(--muted); }
.footer-bottom a { display: inline-flex; align-items: center; min-height: 44px; }
.toast { position: fixed; z-index: 80; bottom: 20px; left: 16px; right: 16px; max-width: 500px; margin-inline: auto; padding: 16px 18px; background: var(--brand); color: #fff; border: 1px solid #fff5; font-size: .85rem; }
@media (min-width: 390px) {
    .site-container { padding-inline: 22px; }
    .brand { font-size: 20px; }
    .brand-icon { width: 33px; height: 36px; }
}
@media (min-width: 640px) {
    .site-container { padding-inline: 30px; }
    .project-layout #main { padding-block: 36px 48px; }
    .header-inner { min-height: 80px; gap: 12px; }
    .p-home-hero { padding: 36px 32px 38px; }
    .p-home-hero h1 { font-size: 3rem; margin-bottom: 22px; }
    .p-home-hero>p:not(.hero-kicker) { font-size: .96rem; line-height: 1.6; margin-bottom: 24px; }
    .p-home-hero .hero-kicker { font-size: .7rem; }
    .p-home-hero .button { width: auto; }
    .footer-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .footer-brand { grid-column: 1/-1; }
    .prototype-map { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 35px; }
}
@media (min-width: 768px) {
    .p-home-section { margin-top: 36px; padding-block: 32px; }
    .p-home-section.p-surface { padding: 32px 28px; }
    .p-audience+.p-audience, .p-home-steps li+li { border-top: 0; padding-top: 8px; }
    .p-audience+.p-audience { border-left: 1px solid var(--line); padding-left: 16px; }
    .p-home-steps li+li { padding-top: 0; }
    .p-audience h3, .p-feature h3, .p-home-steps h3 { font-size: 1.08rem; }
    .p-page-heading h1 { font-size: 2.55rem; }
    .p-section-intro h2, .section-title h2 { font-size: 1.9rem; }
    .p-course-detail h1 { font-size: 2.3rem; }
    .p-course-image { min-height: 194px; }
}
@media (min-width: 992px) {
    .brand { font-size: 22px; }
    .header-inner { min-height: 84px; gap: 24px; }
    .header-actions { gap: 12px; }
    .menu-toggle { display: none; }
    .main-nav { --focus: #f5d590; display: flex; align-items: center; gap: 22px; padding: 0; position: static; max-height: none; overflow: visible; border: 0; background: transparent; color: #fffef6; }
    .main-nav.open { display: flex; }
    .nav-dropdown { border: 0; position: relative; }
    .nav-dropdown>summary { justify-content: flex-start; font-size: .81rem; font-weight: 500; min-height: 56px; }
    .nav-dropdown.active>summary { color: #fffef6; box-shadow: inset 0 -2px #fffef6; }
    .nav-dropdown .nav-popup, .account-dropdown .nav-popup { position: absolute; top: calc(100% + 1px); left: -15px; width: 275px; border: 1px solid var(--menu-line); background: var(--menu-bg); padding: 8px; box-shadow: 4px 5px 0 #202c2526; }
    .header-login { display: inline-flex; }
    .account-dropdown { display: block; }
    .account-dropdown .nav-popup { left: auto; right: 0; width: 200px; top: calc(100% + 12px); }
    .nav-account { display: none; }
    .p-home-hero { padding: 48px 44px; }
    .p-home-hero h1 { font-size: 3.6rem; line-height: 1.02; max-width: 950px; }
    .p-home-hero>p:not(.hero-kicker) { font-size: 1.1rem; max-width: 850px; }
    .p-checklist { font-size: .88rem; margin-bottom: 28px; }
    .p-home-section { margin-top: 42px; padding-block: 40px; }
    .p-home-section.p-surface { padding: 40px 32px; }
    .p-three-grid { gap: 26px; }
    .p-audience h3, .p-feature h3, .p-home-steps h3 { font-size: 1.2rem; }
    .p-audience p, .p-feature p, .p-home-steps p { font-size: .88rem; }
    .p-content-layout { grid-template-columns: minmax(0,2fr) minmax(0,1fr); }
    .p-article-heading h1 { font-size: 2.55rem; }
    .p-trainer-cta h2 { font-size: 2rem; }
    .p-exercise-filters { grid-template-columns: repeat(3,minmax(0,1fr)) auto; gap: 17px; padding: 22px; }
    .p-exercise-filters>.actions { grid-column: auto; justify-self: stretch; }
    .project-layout .lesson-heading h1 { font-size: 2rem; }
    .footer-grid { grid-template-columns: 1.65fr 1fr .85fr 1.2fr; gap: 30px; }
    .footer-brand { grid-column: auto; }
    .site-footer { padding-top: 44px; }
    .prototype-map { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (min-width: 1360px) {
    .site-container { padding-inline: 36px; }
    .header-inner { gap: 40px; }
    .main-nav { gap: 28px; }
    .p-card-body { padding: 25px 22px; }
    .p-home-hero { padding: 52px 48px; }
    .p-home-hero h1 { font-size: 3.8rem; }
    .p-course-card h2 { font-size: 1.5rem; }
    .p-cover-formula { font-size: 2.4rem; }
    .p-course-image { min-height: 215px; }
    .p-section-intro h2, .section-title h2 { font-size: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
