/* TutorGum resource article. The active theme owns the header and footer. */
.tg-resource-page {
    --tg-ink: #1e1e1e;
    --tg-copy: #303438;
    --tg-muted: #74787c;
    --tg-line: #e7e7e7;
    --tg-soft: #f7f7f5;
    --tg-green: #238a58;
    --tg-green-deep: #155d3d;
    --tg-mint: #e7f3ec;
    --tg-violet: #62538f;
    --tg-violet-soft: #f1eef9;
    --tg-blue: #2878a4;
    --tg-coral: #c95f4b;
    --tg-amber: #ae6a13;
    --tg-amber-soft: #fff3df;
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: clamp(3.75rem, 8vw, 7.5rem) 1.5rem clamp(5rem, 10vw, 9rem);
    background: #fff;
    color: var(--tg-ink);
    font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.tg-resource-page * { box-sizing: border-box; }
.tg-resource-shell { width: min(100%, 71.25rem); margin: 0 auto; }
.tg-resource-card { margin: 0; }
.tg-resource-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(20rem, 1fr);
    gap: clamp(3rem, 7vw, 6.5rem);
    align-items: center;
    padding-bottom: clamp(4rem, 8vw, 7rem);
    border-bottom: 1px solid var(--tg-line);
}
.tg-resource-hero--text-only { display: block; }
.tg-resource-heading { max-width: 56rem; }
.tg-resource-title {
    max-width: 16ch;
    margin: 0;
    color: var(--tg-ink);
    font-size: clamp(2.7rem, 5.3vw, 4.2rem);
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.08;
    text-wrap: balance;
}
.tg-resource-dek {
    max-width: 47rem;
    margin: 1.75rem 0 0;
    color: #4e5357;
    font-size: clamp(1.02rem, 1.45vw, 1.2rem);
    line-height: 1.75;
}
.tg-resource-byline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.7rem;
    margin-top: 2rem;
    color: var(--tg-muted);
    font-size: 0.84rem;
    line-height: 1.5;
}
.tg-resource-featured-image { margin: 0; }
.tg-resource-featured-image img { display: block; width: 100%; height: auto; }
.tg-resource-featured-image figcaption { margin-top: 0.65rem; color: var(--tg-muted); font-size: 0.75rem; line-height: 1.5; }
.tg-resource-body { margin-top: clamp(4.5rem, 9vw, 8rem); }
.tg-resource-body--full { display: block; }
.tg-resource-reading-column { width: 100%; margin: 0 auto; }
.tg-resource-content {
    display: grid;
    grid-template-columns: minmax(12rem, 14rem) minmax(0, 50rem);
    gap: 1.5rem clamp(2.75rem, 7vw, 6.5rem);
    align-items: start;
    justify-content: center;
    color: var(--tg-copy);
    font-size: clamp(1rem, 1.15vw, 1.06rem);
    line-height: 1.78;
}
.tg-resource-content > :first-child { margin-top: 0; }
.tg-resource-article { min-width: 0; }
/* Filters can append related headings/lists after the rendered article. Keep
   every such sibling in the reading column rather than auto-placing in the rail. */
.tg-resource-content > :not(.tg-resource-contents) { grid-column: 2; min-width: 0; }
.tg-resource-content > h2:not(.tg-section-title) { margin: 1.5rem 0 0; font-size: 1.65rem; }
.tg-resource-content > ul { margin-top: -1.5rem; }
.tg-resource-actions { display: flex; justify-content: flex-end; margin-top: 1.5rem; }
.tg-resource-print {
    padding: 0.7rem 1rem;
    border: 1px solid var(--tg-green);
    border-radius: 0.3rem;
    background: #fff;
    color: var(--tg-green-deep);
    font: inherit;
    font-size: 0.875rem;
    cursor: pointer;
}
.tg-resource-print[hidden] { display: none; }
.tg-resource-print:hover { background: var(--tg-mint); color: var(--tg-green-deep); }
.tg-resource-print:focus-visible { outline: 3px solid var(--tg-green); outline-offset: 3px; }
.tg-resource-print:disabled { cursor: wait; opacity: 0.65; }
.tg-resource-contents {
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    scrollbar-width: thin;
}
.tg-contents-title {
    margin: 0 0 0.85rem !important;
    color: var(--tg-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.tg-resource-contents ol { display: grid; gap: 0.1rem; margin: 0; padding: 0; list-style: none; }
.tg-resource-contents li { margin: 0; padding: 0; }
.tg-resource-contents a {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    gap: 0.35rem;
    padding: 0.58rem 0.55rem;
    border-left: 2px solid transparent;
    color: var(--tg-muted);
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.35;
    text-decoration: none;
}
.tg-resource-contents a:hover,
.tg-resource-contents a:focus-visible { border-left-color: var(--tg-green); background: var(--tg-soft); color: var(--tg-ink); }
.tg-contents-number { color: var(--tg-green); font-variant-numeric: tabular-nums; }
.tg-resource-content p { margin: 0 0 1.45rem; }
.tg-resource-content h2,
.tg-resource-content h3,
.tg-resource-content h4 {
    color: var(--tg-ink);
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.25;
    scroll-margin-top: 5rem;
    text-wrap: balance;
}
.tg-resource-content h2 { margin: 5.5rem 0 1.25rem; font-size: clamp(2rem, 4vw, 3.15rem); line-height: 1.08; }
.tg-resource-content h2:first-child { margin-top: 0; }
.tg-resource-content .tg-section-title { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0.65rem 0.8rem; }
.tg-resource-content .tg-section-title::after { content: ""; width: 4rem; height: 1px; background: var(--tg-green); opacity: 0.5; }
.tg-resource-content .tg-section-number {
    color: var(--tg-green-deep);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1;
}
.tg-resource-content .tg-section-name { grid-column: 1 / -1; }
.tg-resource-content h3 { margin: 3rem 0 1rem; font-size: clamp(1.3rem, 2vw, 1.65rem); }
.tg-resource-content h4 { margin: 2.25rem 0 0.8rem; font-size: 1.12rem; letter-spacing: -0.015em; }
.tg-resource-content a {
    color: var(--tg-green);
    font-weight: 500;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.2em;
}
.tg-resource-content a:hover,
.tg-resource-content a:focus-visible { color: var(--tg-ink); }
.tg-resource-content ul,
.tg-resource-content ol { margin: 0 0 1.6rem; padding-left: 1.55rem; }
.tg-resource-content li { margin: 0.5rem 0; padding-left: 0.2rem; }
.tg-resource-content blockquote {
    margin: 2.5rem 0;
    padding: 0.25rem 0 0.25rem 1.5rem;
    border-left: 3px solid var(--tg-ink);
    color: var(--tg-ink);
}
.tg-resource-content blockquote > :last-child { margin-bottom: 0; }
.tg-resource-content .tg-worked-example {
    margin: 2.75rem 0;
    padding: 1.5rem;
    border: 1px solid #d9d3ef;
    background: var(--tg-violet-soft);
}
.tg-resource-content .tg-worked-example > :first-child { margin-top: 0; }
.tg-resource-content .tg-worked-example > h2,
.tg-resource-content .tg-worked-example > h3 { color: var(--tg-violet); }
.tg-resource-content .tg-calculation-step {
    margin: 1rem 0;
    padding: 1rem 1.1rem;
    border-left: 3px solid var(--tg-blue);
    background: rgba(255, 255, 255, 0.78);
}
.tg-resource-content .tg-calculation-step.tg-step-tone-2 { border-left-color: var(--tg-violet); }
.tg-resource-content .tg-calculation-step.tg-step-tone-3 { border-left-color: var(--tg-coral); }
.tg-resource-content .tg-step-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem; margin: 0 0 0.65rem; }
.tg-resource-content .tg-step-pill {
    display: inline-block;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    background: var(--tg-blue);
    color: #fff;
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.025em;
    line-height: 1.4;
}
.tg-resource-content .tg-step-tone-2 .tg-step-pill { background: var(--tg-violet); }
.tg-resource-content .tg-step-tone-3 .tg-step-pill { background: var(--tg-coral); }
.tg-resource-content .tg-calculation-step > :last-child { margin-bottom: 0; }
.tg-resource-content .tg-check-question {
    margin: 2.5rem 0 0;
    padding: 1.1rem 1.3rem;
    border-left: 3px solid var(--tg-amber);
    background: var(--tg-amber-soft);
    color: var(--tg-ink);
}
.tg-resource-content .tg-check-answer {
    margin: 0 0 2.5rem;
    padding: 1rem 1.3rem;
    border-left: 3px solid var(--tg-green);
    background: var(--tg-mint);
}
.tg-resource-content .tg-check-answer > :last-child { margin-bottom: 0; }
.tg-resource-content hr { height: 1px; margin: 3.5rem 0; border: 0; background: var(--tg-line); }
.tg-resource-content img { display: block; max-width: 100%; height: auto; margin: 3rem auto; }
.tg-resource-content figure { margin: 3rem 0; }
.tg-resource-content figure img { margin: 0 auto; }
.tg-resource-content figcaption { margin-top: 0.75rem; color: var(--tg-muted); font-size: 0.8rem; line-height: 1.5; text-align: center; }
.tg-resource-content table {
    display: block;
    width: max-content;
    max-width: 100%;
    margin: 2.5rem 0;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: 0.91rem;
    line-height: 1.55;
}
.tg-resource-content th,
.tg-resource-content td { min-width: 7rem; padding: 0.8rem 0.95rem; border: 1px solid #dedede; text-align: left; vertical-align: top; }
.tg-resource-content th { background: var(--tg-soft); color: var(--tg-ink); font-weight: 600; }
.tg-resource-content pre {
    max-width: 100%;
    margin: 2rem 0;
    padding: 1.15rem 1.3rem;
    overflow-x: auto;
    background: #222628;
    color: #f6f6f3;
    font-size: 0.9rem;
    line-height: 1.65;
}
.tg-resource-content code { overflow-wrap: anywhere; padding: 0.12em 0.3em; background: var(--tg-soft); color: var(--tg-ink); font-size: 0.9em; }
.tg-resource-content pre code { padding: 0; background: transparent; color: inherit; }
.tg-resource-content mjx-container[display="true"] {
    max-width: 100%;
    margin: 2rem 0 !important;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.25rem 0;
}
@media (max-width: 900px) {
    .tg-resource-hero { grid-template-columns: minmax(0, 1fr); }
    .tg-resource-featured-image { margin-top: 0.5rem; }
    .tg-resource-content { display: block; }
    .tg-resource-contents {
        position: static;
        max-height: none;
        margin-bottom: 3.5rem;
        overflow: hidden;
        border-top: 1px solid var(--tg-line);
        border-bottom: 1px solid var(--tg-line);
    }
    .tg-contents-title { margin: 0 !important; padding: 0.85rem 0 0.25rem; color: var(--tg-green-deep); }
    .tg-resource-contents ol { display: flex; gap: 0.5rem; padding: 0.4rem 0 0.9rem; overflow-x: auto; scroll-snap-type: x proximity; }
    .tg-resource-contents li { flex: 0 0 13rem; scroll-snap-align: start; }
    .tg-resource-contents a { height: 100%; border: 1px solid var(--tg-line); border-left: 3px solid var(--tg-green); background: var(--tg-soft); }
}
@media (max-width: 600px) {
    .tg-resource-page { padding: 3rem 1.25rem 5rem; }
    .tg-resource-hero { gap: 2.5rem; padding-bottom: 3.5rem; }
    .tg-resource-title {
        max-width: none;
        overflow-wrap: anywhere;
        font-size: clamp(2.1rem, 10vw, 2.75rem);
        letter-spacing: -0.025em;
    }
    .tg-resource-dek { margin-top: 1.4rem; font-size: 1rem; line-height: 1.7; }
    .tg-resource-byline { margin-top: 1.6rem; font-size: 0.78rem; }
    .tg-resource-body { margin-top: 3.75rem; }
    .tg-resource-content { font-size: 1rem; line-height: 1.75; }
    .tg-resource-content h2 { margin-top: 3.5rem; }
    .tg-resource-content .tg-worked-example { margin-inline: -0.25rem; padding: 1.15rem; }
    .tg-resource-content .tg-calculation-step { padding: 0.9rem; }
}
/* Syllabus navigation uses the exported public course snapshot. */
.tg-resource-content > .tg-resource-rail {grid-column:1;grid-row:1;min-width:0;position:sticky;top:2rem;max-height:calc(100vh - 4rem);overflow-y:auto;scrollbar-width:thin;padding-bottom:1rem}
.tg-resource-rail .tg-resource-contents {position:static;max-height:none;overflow:visible}
.tg-resource-page .tg-syllabus-disclosure {margin-top:1.5rem;padding-top:1.25rem;border-top:1px solid var(--tg-line)}
.tg-resource-page .tg-syllabus-disclosure>summary {list-style:none;font-size:.8rem;color:var(--tg-muted);cursor:pointer;margin-bottom:1rem}
.tg-resource-page .tg-syllabus-disclosure>summary:after {content:'−';float:right;color:var(--tg-green)}
.tg-resource-page .tg-syllabus-disclosure:not([open])>summary:after {content:'+'}
.tg-resource-page .tg-syllabus-course {font-size:1rem;font-weight:600;color:var(--tg-green-deep);margin:0 0 .2rem}
.tg-resource-page .tg-syllabus-edition {font-size:.7rem;color:var(--tg-muted);margin:0 0 1.5rem}
.tg-resource-page .tg-syllabus-module {border-top:1px solid var(--tg-line);margin:0;padding:0}
.tg-resource-page .tg-syllabus-module:last-child {border-bottom:1px solid var(--tg-line)}
.tg-resource-page .tg-syllabus-module>summary {list-style:none;display:flex;align-items:baseline;gap:.6rem;padding:.7rem 0;font-size:.76rem;line-height:1.55;color:#4e5357;cursor:pointer}
.tg-resource-page .tg-syllabus-module>summary:after {content:'+';margin-left:auto;color:var(--tg-green)}
.tg-resource-page .tg-syllabus-module[open]>summary:after {content:'−'}
.tg-resource-page .tg-syllabus-module ol {list-style:none;padding:0;margin:0 0 .8rem}
.tg-resource-page .tg-syllabus-module li {margin:0;padding:0}
.tg-resource-page .tg-syllabus-module a {display:block;color:var(--tg-muted);font-size:.74rem;line-height:1.5;font-weight:400;text-decoration:none;padding:.6rem .6rem .6rem .85rem;border-left:2px solid var(--tg-line)}
.tg-resource-page .tg-syllabus-module a:hover {color:var(--tg-green-deep);background:var(--tg-soft)}
.tg-resource-page .tg-syllabus-module .is-current a {color:var(--tg-green-deep);font-weight:700}
.tg-resource-rail .tg-syllabus-module .is-current a {border-left-color:var(--tg-green);background:var(--tg-mint)}
.tg-resource-page .tg-syllabus-footer {margin:5rem 0 0;padding:3rem 0;border-top:1px solid #dce7df}
.tg-resource-page .tg-syllabus-footer h2 {font-size:2rem;font-weight:600;letter-spacing:-.03em;line-height:1.2;margin:0 0 1rem;color:var(--tg-ink)}
.tg-resource-page .tg-syllabus-footer>.tg-syllabus-edition {font-size:.8rem;margin-bottom:1.5rem}
.tg-resource-page .tg-syllabus-footer .tg-syllabus-module>summary {font-size:1rem;padding:1.3rem 0;gap:1rem}
.tg-resource-page .tg-syllabus-footer .is-current-module>summary {color:var(--tg-green-deep);font-weight:500}
.tg-resource-page .tg-syllabus-footer summary small {margin-left:auto;color:var(--tg-muted);font-size:.7rem;white-space:nowrap}
.tg-resource-page .tg-syllabus-footer .tg-syllabus-module>summary:after {margin-left:.5rem;font-size:1.3rem}
.tg-resource-page .tg-syllabus-footer ol {columns:3;column-gap:3rem;list-style:none;counter-reset:syllabus-item;margin:.5rem 0 2rem;padding:0}
.tg-resource-page .tg-syllabus-footer li {position:relative;counter-increment:syllabus-item;break-inside:avoid;margin:0 0 .85rem;padding-left:2.4rem}
.tg-resource-page .tg-syllabus-footer li:after {content:counter(syllabus-item) '.';position:absolute;left:.65rem;top:.1rem;color:#8b9c91;font-size:.7rem}
.tg-resource-page .tg-syllabus-footer a {font-size:.8rem;line-height:1.6;padding:0;border:0;color:var(--tg-green)}
.tg-resource-page .tg-syllabus-footer .progress-reached:before {content:'';position:absolute;left:0;top:0;bottom:-.85rem;width:3px;background:var(--tg-green)}
.tg-resource-page .tg-syllabus-footer .is-current:before {bottom:0}
.tg-resource-page .tg-syllabus-footer .is-current:after {color:var(--tg-green-deep);font-weight:700}
.tg-syllabus-footer :focus-visible,.tg-resource-rail summary:focus-visible,.tg-resource-rail a:focus-visible {outline:2px solid var(--tg-green);outline-offset:3px}
@media(max-width:900px){
 .tg-resource-content>.tg-resource-rail {position:static;max-height:none;overflow:visible;margin-bottom:3rem}
 .tg-resource-rail .tg-resource-contents ol {display:block;overflow:visible}
 .tg-resource-rail .tg-resource-contents li {margin:0}
 .tg-resource-rail .tg-resource-contents a {border:0;background:none}
 .tg-resource-page .tg-syllabus-footer ol {columns:2}
}
@media(max-width:600px){
 .tg-resource-page .tg-syllabus-footer {margin-top:3rem;padding-top:2rem}
 .tg-resource-page .tg-syllabus-footer h2 {font-size:1.6rem}
 .tg-resource-page .tg-syllabus-footer ol {columns:1}
 .tg-resource-page .tg-syllabus-footer .tg-syllabus-module>summary {flex-wrap:wrap;gap:.3rem;font-size:.9rem}
 .tg-resource-page .tg-syllabus-footer summary span {flex:1 1 calc(100% - 2rem)}
 .tg-resource-page .tg-syllabus-footer summary small {order:3;flex:1 1 100%;margin-left:0}
 .tg-resource-page .tg-syllabus-footer .tg-syllabus-module>summary:after {margin-left:auto}
}
@media print {
    .tg-resource-rail, .tg-syllabus-footer {display:none !important}
    @page { size: A4; margin: 16mm; }
    /* Hide theme chrome even when the theme nests main inside its own wrappers. */
    body.tg-resource-view *:not(.tg-resource-page):not(.tg-resource-page *):not(:has(.tg-resource-page)) { display: none !important; }
    body.tg-resource-view,
    body.tg-resource-view *:has(.tg-resource-page) {
        display: block !important; width: auto !important; max-width: none !important;
        margin: 0 !important; padding: 0 !important; background: #fff !important;
        overflow: visible !important; transform: none !important;
    }
    .tg-resource-page { padding: 0; color: #000; font-size: 11pt; }
    .tg-resource-shell, .tg-resource-heading { width: 100%; max-width: none; }
    .tg-resource-hero { display: block; padding-bottom: 12pt; }
    .tg-resource-title { max-width: none; font-size: 26pt; }
    .tg-resource-dek { font-size: 11pt; }
    .tg-resource-actions, .tg-resource-contents { display: none !important; }
    .tg-resource-body { display: block; margin-top: 18pt; }
    .tg-resource-content { display: block; font-size: 11pt; line-height: 1.5; }
    .tg-resource-content h2 { margin: 24pt 0 10pt; font-size: 20pt; }
    .tg-resource-content h3 { font-size: 15pt; }
    .tg-resource-content h2, .tg-resource-content h3, .tg-resource-content h4 { break-after: avoid; }
    .tg-resource-content p { orphans: 3; widows: 3; }
    .tg-resource-content a { color: #000; }
    .tg-resource-content table { display: table; width: 100%; table-layout: fixed; font-size: 9pt; overflow: visible; }
    .tg-resource-content th, .tg-resource-content td { min-width: 0; padding: 5pt; overflow-wrap: anywhere; }
    .tg-resource-content tr, .tg-resource-content figure, .tg-resource-content img { break-inside: avoid; }
    .tg-resource-content pre { white-space: pre-wrap; overflow: visible; background: #fff; color: #000; }
    .tg-resource-content mjx-container[display="true"] { overflow: visible; break-inside: avoid; }
    .tg-resource-content .tg-worked-example { padding: 10pt; }
    .tg-resource-content > ul { margin-top: 0; }
}

/* Shared geometry, fitted page text and label leaders use one canvas coordinate system. */
.tg-resource-content .tg-reviewed-visual--svg { max-width: 24rem; margin-inline: auto; }
/* New desktop-first drawings use the article width; existing v3 assets retain their cap. */
.tg-resource-content .tg-reviewed-visual--svg[data-style-profile="tutorgum-educational-v4-desktop-first"] { width: 100%; max-width: 50rem; }
.tg-resource-content .tg-diagram { position: relative; direction: ltr; isolation: isolate; }
.tg-resource-content .tg-diagram img { display: block; width: 100%; height: auto; margin: 0; }
.tg-resource-content .tg-diagram-labels { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tg-resource-content .tg-diagram-labels text { font-family: "DejaVu Sans", "Segoe UI", Arial, sans-serif; }
.tg-resource-content .tg-diagram-labels text:lang(hi),
.tg-resource-content .tg-diagram-labels text:lang(bn),
.tg-resource-content .tg-diagram-labels text:lang(ta),
.tg-resource-content .tg-diagram-labels text:lang(te) { font-family: "Nirmala UI", "DejaVu Sans", "Segoe UI", sans-serif; }
.tg-resource-content .tg-diagram-labels text:lang(zh),
.tg-resource-content .tg-diagram-labels text:lang(ja) { font-family: "Microsoft YaHei", "DejaVu Sans", "Segoe UI", sans-serif; }
.tg-resource-content .tg-diagram-labels text:lang(ko) { font-family: "Malgun Gothic", "DejaVu Sans", "Segoe UI", sans-serif; }
.tg-resource-content .tg-diagram-labels text:lang(th) { font-family: "Leelawadee UI", "DejaVu Sans", "Segoe UI", sans-serif; }
.tg-resource-content .tg-reviewed-visual--svg figcaption { font-size: 1rem; line-height: 1.5; }
.tg-resource-content .tg-graphic-key { list-style: none; padding: 0; margin: 0.6rem 0; font-size: 17px; line-height: 1.45; }
.tg-resource-content .tg-graphic-key li { display: grid; grid-template-columns: 1.7rem 1fr; gap: 0.4rem; margin: 0.35rem 0; font-size: 17px; line-height: 1.45; overflow-wrap: anywhere; }
.tg-resource-content .tg-key-swatch { display: block; width: 1.5rem; height: 0; margin-top: 0.65em; border-top: 3px solid; }
.tg-resource-content .tg-key-blue { border-color: #5c8ea8; }
.tg-resource-content .tg-key-coral { border-color: #c75445; }
.tg-resource-content .tg-key-green { border-color: #3f7d6b; }
.tg-resource-content .tg-key-violet { border-color: #6c5b8c; }
.tg-resource-content .tg-key-dashed { border-top-style: dashed; }

/* Comparisons and procedures are native document content, never pictures of text. */
.tg-resource-content .tg-reviewed-visual--semantic { margin: 2rem 0; width: 100%; max-width: 100%; }
.tg-resource-content .tg-semantic { border-block: 2px solid var(--tg-line, #dedede); padding: 1rem 0; }
.tg-resource-content .tg-semantic h3 { margin: 0 0 0.8rem; font-size: 20px; line-height: 1.3; font-weight: 600; overflow-wrap: anywhere; }
.tg-resource-content .tg-semantic p,
.tg-resource-content .tg-semantic strong,
.tg-resource-content .tg-semantic th,
.tg-resource-content .tg-semantic td { font-family: inherit; font-size: 17px; line-height: 1.45; }
.tg-resource-content .tg-semantic p { margin: 0 0 0.45rem; }
.tg-resource-content .tg-semantic p:last-child { margin-bottom: 0; }
.tg-resource-content table.tg-semantic-comparison { display: table; width: 100%; margin: 0; border: 0; table-layout: fixed; }
.tg-resource-content .tg-semantic-comparison th,
.tg-resource-content .tg-semantic-comparison td { min-width: 0; padding: 0.75rem 0.6rem; border: 0; border-top: 1px solid var(--tg-line, #dedede); background: transparent; overflow-wrap: anywhere; }
.tg-resource-content .tg-semantic-comparison th { width: 25%; font-weight: 600; }
.tg-resource-content .tg-semantic-formula { font-weight: 600; }
.tg-resource-content .tg-semantic-steps { margin: 0; padding-inline-start: 1.5rem; }
.tg-resource-content .tg-semantic-steps > li { margin: 0; padding: 0.5rem 0 0.5rem 0.3rem; font-size: 17px; }
.tg-resource-content .tg-semantic-steps > li + li { border-top: 1px solid var(--tg-line, #dedede); }
.tg-resource-content .tg-semantic-steps strong { display: block; margin-bottom: 0.2rem; font-weight: 600; }
.tg-resource-content .tg-reviewed-visual--semantic figcaption { margin-top: 0.6rem; font-size: 16px; line-height: 1.45; }
@media (max-width: 480px) {
    .tg-resource-content .tg-semantic-comparison,
    .tg-resource-content .tg-semantic-comparison tbody,
    .tg-resource-content .tg-semantic-comparison tr,
    .tg-resource-content .tg-semantic-comparison th,
    .tg-resource-content .tg-semantic-comparison td { display: block; width: auto; }
    .tg-resource-content .tg-semantic-comparison th { padding: 0.65rem 0 0.25rem; }
    .tg-resource-content .tg-semantic-comparison td { border: 0; padding: 0 0 0.65rem; }
}

/* Graph text reflows as HTML; only plotted geometry and tick labels live in SVG. */
.tg-resource-content .tg-reviewed-visual--responsive { width: 100%; max-width: none; }
.tg-resource-content .tg-reviewed-visual figcaption { text-align: start; font-style: normal; }
.tg-resource-content .tg-responsive-graph { font-family: inherit; width: 100%; }
.tg-resource-content .tg-graph-title { margin: 0 0 1rem; font-size: 1.15rem; line-height: 1.4; }
.tg-resource-content .tg-graph-axis-label { font-size: 1rem; line-height: 1.5; overflow-wrap: anywhere; }
.tg-resource-content .tg-graph-x-label { text-align: center; margin-block: 0.2rem 0.8rem; }
.tg-resource-content .tg-graph-plot { display: block; width: 100%; overflow: visible; direction: ltr; }
.tg-resource-content .tg-graph-plot text { font: 16px system-ui, sans-serif; fill: #40535d; }
.tg-resource-content .tg-graph-plot:focus-visible { outline: 2px solid #2878a4; outline-offset: 4px; }
.tg-resource-content .tg-graph-legend { list-style: none; padding: 0; margin: 0.5rem 0; }
.tg-resource-content .tg-graph-legend li { display: flex; align-items: baseline; gap: 0.6rem; font-size: 1rem; }
.tg-resource-content .tg-graph-swatch { display: inline-block; width: 1.5rem; border-top: 3px solid; flex-shrink: 0; }
.tg-resource-content .tg-graph-readout { display: block; min-height: 1.5em; font-family: inherit; font-size: 1rem; line-height: 1.5; font-variant-numeric: tabular-nums; }
.tg-resource-content [data-graph-ready="true"] > .tg-diagram,
.tg-resource-content [data-graph-ready="true"] > .tg-graphic-key { display: none; }

/* Quiet PDF utility action. */
.tg-resource-page .tg-resource-print {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    min-width: 44px; min-height: 40px; padding: 8px;
    border: 0; border-radius: 4px; background: transparent;
    color: #c5413b; font: inherit; font-size: 10px; line-height: 1;
    font-weight: 500; letter-spacing: 0.02em; box-shadow: none;
}
.tg-resource-page .tg-resource-print[hidden] { display: none; }
.tg-resource-page .tg-resource-print svg { display: block; width: 18px; height: 18px; flex: none; }
.tg-resource-page .tg-resource-print:hover { color: #a82e2e; background: #fff2f2; }
.tg-resource-page .tg-resource-print:focus-visible { outline: 2px solid #c5413b; outline-offset: 3px; }
.tg-resource-page .tg-resource-print[aria-busy="true"] { opacity: 0.55; cursor: progress; }

/* Place the PDF utility inside the existing header padding, above its divider. */
.tg-resource-page .tg-resource-hero { position: relative; }
.tg-resource-page .tg-resource-hero > .tg-resource-actions {
    position: absolute; inset-inline-end: 0; bottom: 10px; margin: 0;
}

/* Figure guidance stays separate from the explanatory caption. */
.tg-resource-page .tg-figure-disclaimer {
    margin: 0.5rem 0 0; color: #686d70;
    font-family: inherit; font-size: 13px; font-weight: 400;
    line-height: 1.55; font-style: normal; text-align: start;
}
