:root {
    color-scheme: light;
    --accent: #ff5722;
    --accent-hover: #e64a19;
    --accent-soft: #fff3ee;
    --accent-line: #ffd3c4;
    --ink: #202124;
    --muted: #5f6975;
    --line: #e4e7ec;
    --line-strong: #cfd4dc;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --bg: #f6f7f9;
    --shadow: rgba(32, 33, 36, 0.08);
    --shadow-strong: rgba(32, 33, 36, 0.14);
    --focus: #155eef;
    --focus-ring: rgba(21, 94, 239, 0.16);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --accent: #ff7043;
    --accent-hover: #ff8a65;
    --accent-soft: #3a211a;
    --accent-line: #6f3a2a;
    --ink: #f4f6f8;
    --muted: #a8b0bb;
    --line: #2f3845;
    --line-strong: #485263;
    --surface: #161b22;
    --surface-soft: #202733;
    --bg: #0f131a;
    --shadow: rgba(0, 0, 0, 0.34);
    --shadow-strong: rgba(0, 0, 0, 0.48);
    --focus: #8ab4ff;
    --focus-ring: rgba(138, 180, 255, 0.22);
}

* {
    box-sizing: border-box;
    letter-spacing: 0;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Arial, sans-serif;
}

a {
    color: inherit;
}

.article-shell {
    width: min(100%, 920px);
    margin: 0 auto;
    padding: 28px 20px 40px;
}

.article-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.brand-link,
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    text-decoration: none;
}

.brand-link:hover,
.back-link:hover {
    color: var(--accent);
}

.brand-link:focus-visible,
.back-link:focus-visible,
.cta-link:focus-visible,
.related-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
    border-radius: 8px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.brand-copy {
    display: grid;
    gap: 2px;
}

.brand-title {
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.2;
}

.brand-subtitle,
.article-meta {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.hero {
    padding: 30px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 22px var(--shadow);
}

.breadcrumbs {
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 0.84rem;
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.breadcrumbs li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.breadcrumbs li + li::before {
    content: "/";
    color: var(--line-strong);
}

.breadcrumbs a {
    text-decoration: none;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: clamp(1.7rem, 3vw, 2.3rem);
    line-height: 1.15;
}

.hero-lead {
    max-width: 760px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.cta-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 14px;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
}

.cta-link:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.cta-link.is-secondary {
    background: transparent;
    border-color: var(--line-strong);
    color: var(--ink);
}

.cta-link.is-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.article-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 20px;
    margin-top: 20px;
}

.article-main,
.article-side {
    display: grid;
    gap: 18px;
    align-content: start;
}

.article-card {
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 22px var(--shadow);
}

.article-card h2,
.article-card h3 {
    margin: 0 0 12px;
    font-size: 1.08rem;
    line-height: 1.35;
}

.article-card p,
.article-card li {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.article-card p {
    margin: 0;
}

.article-card p + p,
.article-card ul,
.article-card ol,
.note-box,
.formula-box,
.step-list {
    margin-top: 12px;
}

.article-card ul,
.article-card ol {
    padding-left: 20px;
}

.formula-box,
.note-box {
    padding: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.formula-box {
    color: var(--ink);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.6;
}

.note-box strong {
    color: var(--ink);
}

.step-list {
    display: grid;
    gap: 10px;
    padding: 0;
    list-style: none;
}

.step-list li {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.step-badge {
    display: inline-grid;
    width: 28px;
    height: 28px;
    place-items: center;
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    border-radius: 999px;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 800;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.summary-table th,
.summary-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    font-size: 0.92rem;
    line-height: 1.55;
}

.summary-table th {
    color: var(--ink);
    font-weight: 800;
}

.summary-table td {
    color: var(--muted);
}

.side-title {
    margin: 0 0 10px;
    font-size: 0.96rem;
}

.side-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.related-link {
    display: block;
    padding: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    text-decoration: none;
}

.related-link:hover {
    border-color: var(--accent);
}

.related-link span {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.footer-note {
    margin-top: 18px;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.5;
    text-align: center;
}

@media (max-width: 760px) {
    .article-shell {
        padding: 18px 14px 28px;
    }

    .article-topbar {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 14px;
    }

    .hero {
        padding: 22px 18px;
    }

    .hero-lead {
        font-size: 0.96rem;
    }

    .article-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .article-card {
        padding: 18px;
    }
}
