/* One restrained final layer: readable lessons and a quieter, tactile launchpad. */
html{--fn-radius:18px;--fn-reading-width:76ch;--fn-shadow:0 10px 30px #142c4608}
html[data-fn-theme=dark]{--fn-shadow:0 10px 28px #00000020}
body{overflow-wrap:break-word}
:where(button,a,input,select,textarea,summary){touch-action:manipulation}
:where(a,button,input,textarea,select,summary):focus-visible{outline:3px solid var(--fn-link,var(--fn-accent));outline-offset:4px}
html[data-fn-theme] #home{max-width:1320px;padding-inline:clamp(16px,4vw,56px)}
#home .home-welcome{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr);gap:clamp(20px,4vw,54px);align-items:center;padding:22px 0 32px}
#home .intro{margin:0;display:block}
#home .intro-index{display:none}
#home h1{font-size:clamp(34px,4vw,52px);line-height:1.12;max-width:16ch}
html[data-fn-theme=dark] #home h1>span{color:#8ed8c9}
#home .intro-note{max-width:47ch;line-height:1.7}
#home .home-finder{display:block;margin:0;padding:24px;border:1px solid var(--fn-line);border-radius:var(--fn-radius);background:var(--fn-surface);box-shadow:var(--fn-shadow);background-image:radial-gradient(var(--fn-line) .6px,transparent .6px);background-size:14px 14px}
#home .home-finder h2{font-size:21px;line-height:1.45;margin:0 0 6px}
#home .home-finder p{line-height:1.7;color:var(--fn-muted);margin:0 0 18px}
#home .home-finder .fn-search-launch{width:100%;justify-content:flex-start;min-height:50px;background:var(--fn-soft);font-size:16px}
#home .home-finder kbd{margin-left:auto}
html[data-fn-theme] #home .subjects{gap:18px}
html[data-fn-theme] #home .subject{border-radius:var(--fn-radius);box-shadow:var(--fn-shadow);min-height:240px;padding:22px 22px 0;border-left-width:1px;border-top:3px solid var(--tone);position:relative}
#home .subject .subject-symbol{width:52px;height:52px;margin:18px 0 12px;display:grid;place-items:center;border-radius:16px;background:var(--tile);color:var(--tone)}
#home .subject .subject-symbol .fn-brand-icon{width:30px;height:30px}
#home .subject .card-copy h3{font-size:clamp(22px,2vw,27px);line-height:1.3}
#home .subject .card-copy p{font-size:15px;line-height:1.65;max-width:35ch}
#home .subject .tool-tags{margin-top:12px}
#home .subject .card-bottom{padding-block:16px;min-height:52px;line-height:1.6;gap:10px;flex-wrap:wrap}
#home .paper-entry{border-radius:var(--fn-radius);box-shadow:none}
#home .section-label{gap:12px;align-items:baseline;flex-wrap:wrap;margin-top:24px}
#home .section-label h2{font-size:23px;line-height:1.45}
#home .fn-today:not([open]){background:var(--fn-surface);box-shadow:none;margin-bottom:18px}
html[data-fieldnote] :is(.reading-content,.lesson-reading,.topic-reading,.section-reading,.fn-example-body){font-size:16px;line-height:1.85}
html[data-fieldnote]:not([data-fieldnote=physics]) :is(.lesson-paper,.source-paper,.topic-detail,.topic-reading,.unit-detail){border-radius:var(--fn-radius);border-color:var(--fn-line);box-shadow:none}
html[data-fieldnote] :is(.lesson-paper,.reading-panel,.source-paper,.topic-section,.fn-example-body) p{max-width:var(--fn-reading-width)}
html[data-fieldnote] :is(.topic-tile,.topic-card,.unit-card){border:1px solid var(--fn-line)!important;transition:border-color .16s ease,box-shadow .16s ease}
html[data-fieldnote] :is(.topic-tile,.topic-card,.unit-card):hover{border-color:var(--atlas-accent,var(--fn-accent))!important;box-shadow:var(--fn-shadow)!important}
html[data-fieldnote] :is(.fn-study-summary,.fn-lesson-example,.fn-visual-lesson,.fn-connection){border-radius:14px;box-shadow:none}
html[data-fieldnote] .fn-study-header-actions>[data-fn-neighbour]{width:44px;min-width:44px;padding:0;font-size:27px;line-height:1}
html[data-fieldnote] :is(.chem-topbar,.topbar,.studio-topbar,.mq-top):has([data-fn-inline-display]){height:auto;overflow:visible;flex-wrap:wrap}
.fn-appearance[data-fn-inline-display]{position:relative;inset:auto;z-index:110;width:auto;padding:0;border:0;background:none;order:10}
.fn-appearance[data-fn-inline-display]>summary{min-width:44px;min-height:44px;justify-content:center}
.fn-appearance[data-fn-inline-display] .fn-display-panel{top:calc(100% + 8px);bottom:auto;right:0;width:300px;max-width:calc(100vw - 32px);max-height:calc(100dvh - 180px);overflow-y:auto;overscroll-behavior:contain}
.fn-display-fallback{display:flex;justify-content:flex-end;align-items:center;min-height:64px;padding:12px 16px;background:var(--fn-surface);border-top:1px solid var(--fn-line)}
.fn-display-fallback:empty{display:none}
.fn-display-fallback>.fn-appearance-direct{position:relative!important;inset:auto!important;z-index:110;margin:0}
.fn-display-fallback .fn-display-panel{max-height:calc(100dvh - 150px);overflow-y:auto;overscroll-behavior:contain}
.fn-display-fallback>details>summary{min-width:44px;min-height:44px}
.mq-back,html[data-fieldnote=arc] a[href*="/tips?topic="]{display:inline-flex;align-items:center;min-height:44px;padding-block:8px}
html[data-fieldnote=biology] .lesson-aside a,html[data-fieldnote] :is(.lesson-tools,.contents,.fn-business-start) a{min-height:44px;display:inline-flex;align-items:center}
html[data-fieldnote=business] :is(.save-button,.back-button){display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px}
html[data-fieldnote] .fn-mini-quiz-link:not([aria-current=page]){background:transparent!important;border-color:var(--fn-line)!important;color:inherit!important;box-shadow:none!important}
.fn-source-card{padding:22px;margin:12px 0;border:1px dashed var(--fn-line);border-radius:14px;line-height:1.8;background:var(--fn-soft);color:var(--fn-ink)}
.fn-contact-pending{border-left:3px solid var(--fn-link,var(--fn-accent));padding-left:14px}
.fn-account-main :is(.fn-account-card,p){overflow-wrap:anywhere}
html[data-fieldnote] :where(pre,.katex-display){max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain}
html[data-fieldnote] :where(textarea,input,select){min-width:0;max-width:100%}
html[data-fieldnote] :where(.main-column,.chem-main,.cs-main,.content-section,.lesson-paper,.reading-panel,.topic-body){min-width:0}
@media(min-width:900px){#home .subjects{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:899px){#home .home-welcome{grid-template-columns:1fr;gap:20px;padding-top:4px}#home h1{max-width:none;font-size:38px}#home .home-finder{padding:20px}#home .subjects{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){#home .home-welcome{padding-bottom:22px}#home h1{font-size:33px;letter-spacing:-1px}#home .home-finder h2{font-size:19px}#home .subjects{grid-template-columns:1fr;gap:12px}html[data-fn-theme] #home .subject{display:grid;grid-template-columns:48px minmax(0,1fr);gap:0 14px;padding:16px 17px 0;min-height:0}#home .subject .card-top,#home .subject .card-bottom{grid-column:1/-1}#home .subject .subject-symbol{margin-top:16px;width:48px;height:48px;border-radius:13px}#home .subject .card-copy{margin-top:15px;padding-bottom:14px}#home .subject .card-copy h3{font-size:23px}#home .subject .card-copy p{font-size:14px;margin-bottom:0}#home .subject .tool-tags{display:none}#home .subject .card-bottom{padding-block:12px;font-size:12px}#home .section-label>span{display:none}#home .home-finder kbd{display:none}.fn-study-header-actions{flex-wrap:wrap}html[data-fieldnote] :is(.reading-content,.lesson-reading,.topic-reading){font-size:16px;line-height:1.85}html[data-fieldnote] :is(.page-heading,.page-header,.studio-header) h1{font-size:27px!important}html[data-fn-language=th] :is(h1,h2,h3){letter-spacing:normal!important;line-height:1.55!important}}
@media(hover:hover) and (prefers-reduced-motion:no-preference){#home .subject:hover{transform:translateY(-3px);border-color:var(--tone);box-shadow:0 12px 28px #142c4614}#home .subject{transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease}}
@media(max-width:600px){html[data-fieldnote=physics] .physics-native-diagram svg text{font-size:20px}}
/* The late legacy desk sheet otherwise puts this modal below its scrim.
   Restore the native full-height drawer, including its reachable Close button. */
@media(max-width:820px){html[data-fieldnote=physics] #physics-sidebar.desk-open{position:fixed;inset:0 auto 0 0;z-index:41;display:flex;flex-direction:column;height:100dvh;width:min(340px,88vw)}html[data-fieldnote] .chem-shell:has(.chem-rail.open) .chem-topbar .fn-study-header-actions{display:none}}
@media(max-width:600px){html[data-fieldnote] .fn-study-header-actions:has([data-fn-inline-display]){flex-basis:100%;width:100%;margin:0;justify-content:flex-end;gap:6px;padding-top:4px}.fn-appearance[data-fn-inline-display]>summary{width:44px;padding:10px}.fn-appearance[data-fn-inline-display] [data-fn-display]{display:none}html[data-fieldnote=biology] .topbar>.flex{flex:1;min-width:0;flex-wrap:nowrap}html[data-fieldnote=biology] .topbar .breadcrumb{display:block;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}html[data-fieldnote=biology] .topbar .mobile-menu,html[data-fieldnote=biology] .topbar .top-actions{flex-shrink:0}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto!important}#home .subject,html[data-fieldnote] :is(.topic-tile,.topic-card,.unit-card){transition:none!important;transform:none!important}}
@media print{#home .home-finder{display:none}.fn-source-card{background:none;color:#111}}
