/* Paired surfaces and text, after legacy component overrides in both themes. */
html[data-fn-theme]{--fn-link:#245f91;--fn-good:#206957;--fn-good-bg:#e8f5ee;--fn-caution:#785516;--fn-caution-bg:#fff3d8}
html[data-fn-theme=dark]{--fn-link:#a9d1fa;--fn-good:#b5ead0;--fn-good-bg:#203f36;--fn-caution:#f4d595;--fn-caution-bg:#433822}
/* The portal surrounding a subject must share its palette too. */
html[data-fn-theme] body{background:var(--fn-backdrop);color:var(--fn-ink)}
html[data-fn-theme] body.subject-mode{height:100dvh;display:flex;flex-direction:column;overflow:hidden}
body.subject-mode>.masthead{flex:0 0 auto}
body.subject-mode>#main{flex:1 1 0;min-height:0;overflow:hidden}
body.subject-mode #workspace{height:100%;min-height:0;background:var(--fn-backdrop)}
body.subject-mode #subject-frame{background:var(--fn-backdrop)}
html[data-fn-theme] :is(.loading,.load-error){background:var(--fn-backdrop);color:var(--fn-ink)}
html[data-fn-theme] .loading p{color:var(--fn-muted)}
html[data-fn-theme] .fn-result-meta{color:var(--fn-muted)!important}
html[data-fn-theme] .load-error button{background:var(--fn-soft);color:var(--fn-ink);border:1px solid var(--fn-line)}
html[data-fn-theme][data-fieldnote=computer-science] .hw-key-point{background:var(--fn-good-bg)!important;color:var(--fn-good)!important}
html[data-fn-theme][data-fieldnote=computer-science] .hw-key-point :is(strong,p){color:var(--fn-good)!important}
html[data-fn-theme][data-fieldnote=computer-science] .hw-key-point p{font-size:16px;line-height:1.65}
html[data-fn-theme][data-fieldnote=computer-science] .hw-flow figcaption{color:var(--fn-ink)!important}
html[data-fieldnote] .topic-nav a>span{color:var(--fn-ink)!important}
html[data-fieldnote] .chem-topbar b{color:var(--fn-muted)!important}
html[data-fieldnote=physics] .search-box>span{color:var(--fn-muted)!important}
html[data-fieldnote] .course-stat strong>span{color:var(--fn-muted)!important}
html[data-fieldnote] .sim-explain>a{color:var(--fn-link)!important}
html[data-fieldnote] .sim-source a{color:var(--fn-link)!important}
html[data-fieldnote] .sim-truth tr.active td{background:var(--fn-good-bg)!important;color:var(--fn-good)!important}

/* Physics had two independent themes. The shared palette owns all reading UI. */
html[data-fn-theme][data-fieldnote=physics] .site-shell .check-button{width:44px;height:44px;min-width:44px;min-height:44px;background:var(--fn-soft)!important;border-color:var(--fn-muted)!important;color:var(--fn-ink)!important}
html[data-fn-theme][data-fieldnote=physics] .site-shell .check-button.checked{background:var(--fn-good-bg)!important;border-color:var(--fn-good)!important;color:var(--fn-good)!important}
html[data-fn-theme][data-fieldnote=physics] .site-shell .check-button span{color:inherit!important;font-size:20px}
html[data-fn-theme][data-fieldnote=physics] .site-shell .topic-hero :is(h1,p,.topic-code-pill,.topic-code-pill span,.topic-status){color:var(--fn-ink)!important}
html[data-fn-theme][data-fieldnote=physics] .site-shell .topic-nav-item.selected :is(em,small,strong){color:var(--fn-ink)!important}
html[data-fn-theme=light][data-fieldnote=physics] .site-shell .topic-nav-item.selected :is(em,small,strong){color:#42251e!important}
html[data-fn-theme][data-fieldnote=physics] .site-shell :is(.section-count,.subtopic-tag,.subtopic-index,.subtopic-remember,.subtopic-remember>span,.remember-label,.reading-label,.reading-toggle,.site-footer,.site-footer span,.sidebar-progress p,.ghost-tool-button,.ghost-tool-button>span){color:var(--fn-muted)!important}
html[data-fn-theme][data-fieldnote=physics] .site-shell .sidebar-progress p{color:var(--fn-ink)!important}
html[data-fn-theme][data-fieldnote=physics] .site-shell .tool-header{background:var(--atlas-tint)!important;color:var(--fn-ink)!important}
html[data-fn-theme][data-fieldnote=physics] .site-shell .tool-header h1{color:var(--fn-ink)!important}
html[data-fn-theme][data-fieldnote=physics] .site-shell .tool-header p{color:var(--fn-muted)!important}
html[data-fn-theme][data-fieldnote=physics] .site-shell .timer-box{background:var(--fn-soft)!important;border-color:var(--fn-line)!important;color:var(--fn-ink)!important}
html[data-fn-theme][data-fieldnote=physics] .site-shell .timer-box strong{color:var(--fn-ink)!important;font-size:26px}
html[data-fn-theme][data-fieldnote=physics] .site-shell .timer-box button{color:var(--fn-link)!important;font-size:14px;min-height:44px}
html[data-fn-theme][data-fieldnote=physics] .site-shell .timer-box>span{color:var(--fn-muted)!important;font-size:12px}
html[data-fn-theme][data-fieldnote=physics] .site-shell .exam-option>span{color:var(--fn-ink)!important;background:var(--fn-soft)!important;font-size:14px}
html[data-fn-theme][data-fieldnote=physics] .site-shell .exam-topic-strip button{background:var(--fn-soft)!important;color:var(--fn-ink)!important;font-size:14px;min-width:44px;min-height:44px}
html[data-fn-theme][data-fieldnote=physics] .site-shell .exam-topic-strip button.current{background:var(--atlas-tint)!important;color:var(--atlas-accent)!important;border-color:var(--atlas-accent)!important}
html[data-fn-theme][data-fieldnote=physics] .site-shell :is(.exam-progress-label,.exam-question-meta>span){font-size:12px;color:var(--fn-muted)!important}
html[data-fn-theme][data-fieldnote=physics] .site-shell :is(.exam-hint,.exam-feedback){background:var(--fn-soft)!important;color:var(--fn-ink)!important;font-size:16px;line-height:1.65}
html[data-fn-theme][data-fieldnote=physics] .site-shell .exam-hint>span{color:var(--fn-muted)!important;font-size:12px}
html[data-fn-theme][data-fieldnote=physics] .site-shell .exam-topic-strip>span{color:var(--fn-muted)!important;font-size:14px}
html[data-fn-theme][data-fieldnote=physics] .site-shell .reading-details{background:var(--fn-surface)!important;border-color:var(--fn-line)!important}
html[data-fn-theme][data-fieldnote=physics] .site-shell .reading-details summary strong{color:var(--fn-ink)!important;font-size:14px}
html[data-fn-theme][data-fieldnote=physics] .site-shell :is(.reading-example,.reading-pitfall){background:var(--fn-soft)!important;color:var(--fn-ink)!important}
html[data-fn-theme][data-fieldnote=physics] .site-shell .reading-example>span{color:var(--fn-muted)!important}
html[data-fn-theme][data-fieldnote=physics] .site-shell .reading-pitfall{background:var(--fn-caution-bg)!important;color:var(--fn-caution)!important}
html[data-fn-theme][data-fieldnote=physics] .site-shell .reading-pitfall>span{color:var(--fn-caution)!important}
html[data-fn-theme][data-fieldnote=physics] .site-shell .subtopic-formula :is(span,code){color:var(--fn-link)!important}
html[data-fn-theme][data-fieldnote=physics] .site-shell .rail-card{background:var(--fn-surface)!important;border-color:var(--fn-line)!important;color:var(--fn-ink)!important}
html[data-fn-theme][data-fieldnote=physics] .site-shell .rail-card :is(h3,li,button,small,.formula-symbol,.exam-mark,.source-icon,.overline){color:var(--fn-ink)!important}
html[data-fn-theme][data-fieldnote=physics] .site-shell .rail-card :is(p,.rail-note){color:var(--fn-muted)!important}
html[data-fn-theme][data-fieldnote=physics] .site-shell .rail-card li>span{color:var(--fn-good)!important}
html[data-fn-theme][data-fieldnote=physics] .site-shell .topic-mark{background:var(--fn-soft)!important;color:var(--fn-ink)!important}
html[data-fn-theme][data-fieldnote=physics] .site-shell .next-topic button{background:var(--fn-soft)!important;color:var(--fn-link)!important}
html[data-fn-theme][data-fieldnote=physics] .site-shell .flashcard-known{background:var(--fn-good-bg)!important;color:var(--fn-good)!important;border:1px solid var(--fn-good)!important}
html[data-fn-theme][data-fieldnote=physics] .site-shell .flashcard-known>span{color:inherit!important}
html[data-fn-theme][data-fieldnote=physics] .site-shell :is(.reading-label,.remember-label,.subtopic-tag,.section-count,.site-footer span){font-size:12px;line-height:1.5}
html[data-fn-theme][data-fieldnote=physics] .site-shell .subtopic-remember>span:not(.remember-label){font-size:14px;line-height:1.6}
html[data-fn-theme][data-fieldnote=physics] .site-shell :is(.remember-row span,.mini-formula span,.mini-formula code,.section-heading>.overline){color:var(--fn-muted)!important;font-size:14px;line-height:1.6}
html[data-fn-theme][data-fieldnote=physics] .site-shell .topbar b{color:var(--fn-muted)!important}
html[data-fn-theme][data-fieldnote=physics] .site-shell .overline{color:var(--fn-muted)!important}

/* Business teaching cards retain their semantic colours with legible labels. */
html[data-fn-theme][data-fieldnote=business] .site-shell .insight-card{background:var(--fn-soft)!important;color:var(--fn-ink)!important;border:1px solid var(--fn-line)}
html[data-fn-theme][data-fieldnote=business] .site-shell .insight-card :is(h3,strong){color:var(--fn-ink)!important;line-height:1.4}
html[data-fn-theme][data-fieldnote=business] .site-shell .insight-card :is(p,.card-kicker){color:var(--fn-ink)!important}
html[data-fn-theme][data-fieldnote=business] .site-shell :is(.explain-simply-label strong,.detail-card pre){color:var(--fn-ink)!important}
html[data-fn-theme][data-fieldnote=business] .site-shell :is(.explain-simply-card small,.chevron,.deep-dive-card span,.chapter-guide-content li,.chapter-example span,.chapter-exam-link span,.chapter-extension span,.case-study-prompts li,.terms-card span,.command-row span,.mistakes-card li,.tradeoff-heading span){color:var(--fn-muted)!important}
html[data-fn-theme][data-fieldnote=business] .site-shell :is(.cash-flow-row>div,.ratio-card,.motivation-card,.production-method-card){background:var(--fn-soft)!important;color:var(--fn-ink)!important}
html[data-fn-theme][data-fieldnote=business] .site-shell :is(.cash-flow-row>div,.ratio-card,.motivation-card,.production-method-card) :is(b,strong){color:var(--fn-ink)!important}
html[data-fn-theme][data-fieldnote=business] .site-shell :is(.cash-flow-row>div,.ratio-card,.motivation-card,.production-method-card) :is(span,small){color:var(--fn-ink)!important}
html[data-fn-theme][data-fieldnote=business] .site-shell :is(.cash-flow-row>i,.detail-jumpbar>span,.detail-chapter-number,.chapter-code,.deep-dive-card strong,.command-tag){color:var(--fn-link)!important}
html[data-fn-theme][data-fieldnote=business] .site-shell .exam-technique-card{background:var(--fn-soft)!important;color:var(--fn-ink)!important}
html[data-fn-theme][data-fieldnote=business] .site-shell .exam-technique-card :is(p,.card-kicker){color:var(--fn-ink)!important}
html[data-fn-theme][data-fieldnote=business] .site-shell .exam-technique-card h3{color:var(--fn-ink)!important}
html[data-fn-theme][data-fieldnote=business] .site-shell .tradeoff-column{background:var(--fn-soft)!important;color:var(--fn-ink)!important}
html[data-fn-theme][data-fieldnote=business] .site-shell .tradeoff-column :is(strong,li){color:var(--fn-ink)!important}
html[data-fn-theme][data-fieldnote=business] .site-shell .tradeoff-benefits{background:var(--fn-good-bg)!important}
html[data-fn-theme][data-fieldnote=business] .site-shell .tradeoff-benefits :is(strong,li){color:var(--fn-good)!important}
html[data-fn-theme][data-fieldnote=business] .site-shell .tradeoff-limitations{background:var(--fn-caution-bg)!important}
html[data-fn-theme][data-fieldnote=business] .site-shell .tradeoff-limitations :is(strong,li){color:var(--fn-caution)!important}
html[data-fn-theme][data-fieldnote=business] .site-shell .footer{background:var(--fn-surface)!important;color:var(--fn-muted)!important}
html[data-fn-theme][data-fieldnote=business] .site-shell .footer-back{color:var(--fn-link)!important}
html[data-fn-theme][data-fieldnote=business] .site-shell :is(.explain-simply-label span,.chapter-example strong,.tradeoff-heading strong){color:var(--fn-link)!important}
html[data-fn-theme][data-fieldnote=business] .site-shell .quick-check-panel{background:var(--fn-surface)!important;color:var(--fn-ink)!important}
html[data-fn-theme][data-fieldnote=business] .site-shell .quick-check-panel :is(h3,p,.card-kicker){color:var(--fn-ink)!important}
html[data-fn-theme][data-fieldnote=business] .site-shell :is(.chapter-exam-link strong,.tradeoff-best-fit strong,.detail-jumpbar a span){color:var(--fn-link)!important}
html[data-fn-theme][data-fieldnote=business] .site-shell :is(.practice-copy em,.flashcard-meta span,.question-mark,.answer-label,.flashcard-bottom span,.quiz-unit,.quiz-card-top b){color:var(--fn-ink)!important}
html[data-fn-theme][data-fieldnote=business] .site-shell :is(.practice-copy>p,.quiz-sidebar .card-kicker,.eyebrow.dark){color:var(--fn-muted)!important}
html[data-fn-theme][data-fieldnote=business] .site-shell :is(.quick-check-panel summary,.idea-row>span,.command-row strong){color:var(--fn-link)!important}
html[data-fn-theme][data-fieldnote=business] .site-shell .diagram-heading>span{color:var(--fn-link)!important}
html[data-fn-theme][data-fieldnote=business] .site-shell :is(.cash-flow-row,.ratio-card,.motivation-card,.production-method-card,.chapter-code,.chapter-guide-content,.chapter-extension,.tradeoff-column,.command-row,.explain-simply-card,.case-study-prompts,.mistakes-card) :is(b,small,span,li){font-size:14px;line-height:1.6}
html[data-fn-theme=dark][data-fieldnote=business] .business-desk-rail a.active>span{color:var(--fn-ink)!important}

/* Axis links were retaining the light-mode accent inside dark cards. */
html[data-fn-theme=dark][data-fieldnote=arc] :is(a.text-accent-foreground,a.text-muted-foreground){color:var(--fn-link)!important}
/* The Maths application card used translucent pale blue behind dark-mode text. */
html[data-fn-theme=dark][data-fieldnote=arc] [class~="bg-blue-50/60"]{background:var(--fn-soft)!important;border-color:var(--fn-line)!important;color:var(--fn-ink)!important}
html[data-fn-theme=dark][data-fieldnote=arc] [class~="bg-blue-50/60"] :is(p,h3){color:var(--fn-ink)!important}
html[data-fn-theme=dark][data-fieldnote=arc] :is(.bg-amber-100,.bg-amber-50){background:var(--fn-caution-bg)!important;color:var(--fn-caution)!important}
html[data-fn-theme=dark][data-fieldnote=arc] :is(.text-amber-900,.text-amber-800){color:var(--fn-caution)!important}

/* Short compositor-only arrivals, without moving the whole reading surface. */
@keyframes desk-arrive{from{opacity:.78}to{opacity:1}}
.desk-enter{animation:desk-arrive 160ms ease-out both}
.workspace iframe{transition:opacity 160ms ease-out}
@media(hover:none){html[data-fieldnote] :is(.topic-card,.topic-tile):hover,#home .subject:hover{transform:none!important;box-shadow:none!important}}
@media(max-width:750px){.masthead,.chem-topbar,.studio-topbar,.detail-topbar{backdrop-filter:none!important}html[data-fieldnote] :is(main,.content-inner,.detail-main){overflow-wrap:break-word}html[data-fieldnote] :is(.lesson-tools,.lesson-bottom,.recall-nav){flex-wrap:wrap;gap:10px}html[data-fieldnote] :is(.lesson-tools a,.recall-nav button){min-height:44px}}
@media(prefers-reduced-motion:reduce){.desk-enter{animation:none!important}.workspace iframe{transition:none!important}}

/* V26: one study vocabulary, compact task-first phone layouts. */
.fn-tool-guide{margin:4px 0 14px;padding:10px 12px;border:1px solid var(--fn-line);border-radius:12px;background:var(--fn-soft);color:var(--fn-ink);font-size:14px;line-height:1.6}
.fn-tool-guide summary{min-height:34px;display:list-item;cursor:pointer;font-weight:650;padding:4px 0}
.fn-tool-guide dl{margin:12px 0 0}.fn-tool-guide dt{font-weight:700;margin-top:10px}.fn-tool-guide dd{margin:0;color:var(--fn-muted)}
.fn-answer-guide{margin:16px 0;padding:12px 16px;border:1px solid var(--fn-line);border-radius:12px;background:var(--fn-soft);color:var(--fn-ink);font-size:14px;line-height:1.65}
.fn-answer-guide summary{cursor:pointer;min-height:34px;padding:4px 0;font-weight:650}.fn-answer-guide summary span{margin-left:8px;color:var(--fn-link)}
.fn-answer-guide p{margin:10px 0}.fn-answer-guide a{color:var(--fn-link);display:inline-flex;align-items:center;min-height:44px}
.fn-exam-workshop{border-top:1px solid var(--fn-line);padding-top:22px;margin-top:24px}.fn-exam-workshop>h3{font-size:21px;line-height:1.45}.fn-exam-workshop aside{padding:14px;background:var(--fn-soft);border-radius:12px;color:var(--fn-ink)}
.fn-save-review{min-height:44px;margin:14px 12px 0 0;border:1px solid var(--fn-line);border-radius:10px;padding:10px 14px;background:var(--fn-soft);color:var(--fn-ink);font:inherit;font-size:14px;font-weight:650;cursor:pointer}
.fn-save-review:disabled{cursor:default}.fn-save-review[data-saved=true]{color:var(--fn-good)}
:is(.fn-tool-guide,.fn-answer-guide) summary:focus-visible,.fn-save-review:focus-visible{outline:3px solid var(--fn-link);outline-offset:3px}
html[data-fn-language=th] :is(.fn-account-main,.fn-review-main,.fn-account-top,.fn-answer-guide,.fn-tool-guide){letter-spacing:normal;font-family:inherit}
html[data-fn-theme] .fn-review-main :is(button,input,select),html[data-fn-theme] .fn-account-card :is(button,input){font-family:inherit}
html[data-fn-theme] :is(.fn-account-main,.fn-review-main) button{font-size:16px;line-height:1.5}
html[data-fn-theme] .fn-account-card input:not([type=checkbox]){font-family:inherit;font-size:16px;line-height:1.6}
#home .home-welcome{margin-bottom:22px}#home .intro h1{font-size:clamp(32px,4vw,48px);line-height:1.15}
@media(max-width:750px){
 #home{padding:22px 16px 60px!important}#home .intro h1{font-size:32px!important;margin:8px 0 12px}#home .intro-note{font-size:16px;margin:0}#home .home-welcome{gap:14px;margin-bottom:18px}#home .home-finder{padding:12px!important}#home .resume-panel{padding:16px!important;margin-bottom:18px}#home .subjects{gap:14px}
 html[data-fieldnote] :is(.page-heading,.page-header,.studio-header,.tool-header,.tips-hero,.ref-heading){padding:16px 18px!important;margin-bottom:18px!important;border-radius:16px!important}
 html[data-fieldnote] :is(.page-heading,.page-header,.studio-header,.tool-header,.tips-hero,.ref-heading) h1{font-size:28px!important;line-height:1.25!important;margin:3px 0 8px!important}
 html[data-fieldnote] :is(.page-heading,.page-header,.studio-header,.tool-header,.tips-hero,.ref-heading) p{margin:0;font-size:16px;line-height:1.55}
 html[data-fieldnote] .course-mode-top{gap:10px;align-items:center}html[data-fieldnote] .course-mode-top>div{flex:1 1 160px!important}html[data-fieldnote] .course-mode-top .course-change{min-height:44px;font-size:14px}
 html[data-fieldnote] .course-overview{gap:0;margin-bottom:18px}html[data-fieldnote] .course-overview .continue{padding:18px!important}html[data-fieldnote] .course-overview .continue h2{font-size:24px!important;margin:6px 0 10px}html[data-fieldnote] .course-overview .continue p{margin:0 0 12px;max-width:36ch;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
 html[data-fieldnote] .course-overview .course-stat{padding:14px 18px!important;display:flex;align-items:center;flex-wrap:wrap;gap:8px 14px}html[data-fieldnote] .course-overview .course-stat>strong{font-size:24px!important}html[data-fieldnote] .course-overview .course-stat>p{margin:0;font-size:14px}html[data-fieldnote] .course-overview .course-stat>progress{width:100%;margin:0}html[data-fieldnote] .course-overview .course-stat>small{font-size:12px}
 html[data-fieldnote] .course-overview .quick-tools{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:12px!important}html[data-fieldnote] .course-overview .quick-tools a{padding:12px!important;min-height:44px}html[data-fieldnote] .course-overview .quick-tools span{font-size:12px}
 html[data-fieldnote=physics] .site-shell .topic-hero{padding:18px!important}html[data-fieldnote=physics] .site-shell .topic-hero h1{font-size:28px!important;margin:6px 0 10px}
 html[data-fieldnote=biology] .study-card{padding:18px!important}html[data-fieldnote=biology] .study-card h2{font-size:26px!important;margin:8px 0}
 html[data-fieldnote=business] :is(.hero,.detail-hero,.topic-detail-hero){padding:18px!important;margin-bottom:18px}html[data-fieldnote=business] :is(.hero,.detail-hero,.topic-detail-hero) h1{font-size:28px!important}
 .mq-app{padding-top:14px!important}.mq-top{margin-bottom:16px!important}.mq-header h1{font-size:30px!important;margin-bottom:8px!important}.mq-header p{font-size:14px;line-height:1.6}.mq-scope{padding:6px 12px!important;margin-top:10px!important}.mq-controls{gap:12px!important;margin-bottom:16px!important}.mq-controls .mq-button{min-height:44px;padding:8px 14px}
}
@media(prefers-reduced-motion:reduce){html,body{scroll-behavior:auto!important}*,*::before,*::after{scroll-behavior:auto!important}}
.fn-search-constraint{margin:10px 0 0;padding:9px 12px;border-radius:12px;background:var(--fn-soft);color:var(--fn-ink);font-size:14px;line-height:1.5}
.fn-search-constraint[hidden]{display:none}
html[data-fieldnote=physics] .site-shell .topic-hero .overline{display:block!important;color:var(--fn-muted)!important;font-size:14px;line-height:1.5;margin:0 0 8px}
