/* Shared responsive breakpoint: 800px. Desktop scrolls inside each pane. */
:root { --portal-header-height:64px; --portal-sidebar-width:224px; --portal-motion-duration:200ms; }
body { background-color:var(--portal-bg-color); background-image:var(--portal-bg-filter,linear-gradient(transparent,transparent)),var(--portal-bg-image); background-size:cover; min-height:100vh; }
.portal-header { min-height:var(--portal-header-height); display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 20px; border-bottom:1px solid var(--ifk-color-divider); background:var(--portal-panel-bg); }
.portal-header-meta { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:6px; flex:0 0 auto; max-width:100%; margin-left:auto; text-align:right; font-size:.75rem; line-height:1.5; color:var(--ifk-color-text-muted); overflow-wrap:anywhere; }
.portal-preview-badge { display:none; padding:2px 6px; border:1px solid currentColor; border-radius:4px; background:var(--ifk-color-surface); color:var(--ifk-color-text); font-weight:700; letter-spacing:.06em; }
:root[data-site-preview=true] .portal-preview-badge { display:inline-block; }
.portal-header-start { display:flex; align-items:center; gap:12px; min-width:0; }
.portal-audience { display:flex; align-items:center; gap:6px; margin-left:auto; font-size:.8rem; flex-shrink:0; }
.portal-audience:not([hidden]) + .portal-header-meta { margin-left:0; }
.portal-audience .ifk-input { width:auto; min-height:44px; font-size:.8rem; }
:root[data-audience=kids] [data-audience=general],
:root[data-audience=kids] [data-lab-navigation] a:not([data-lab-category=learning]),
:root[data-audience=kids] [data-lab-list] > :not([data-lab-category=learning]) { display:none !important; }
.portal-brand { display:flex; align-items:center; gap:8px; min-height:40px; color:var(--ifk-color-text); text-decoration:none; font-size:1.1rem; font-weight:750; white-space:nowrap; }
.portal-logo { display:block; flex-shrink:0; width:32px; height:32px; }
.portal-wordmark { display:flex; align-items:flex-end; gap:3px; flex-shrink:0; height:24px; }
.portal-wordmark img { display:block; width:auto; flex-shrink:0; }
.portal-wordmark-ifk { height:24px; }
.portal-wordmark-lab { height:15px; }
.portal-wordmark .portal-wordmark-white { display:none; }
:root[data-panel-tone=dark] .portal-wordmark-color { display:none; }
:root[data-panel-tone=dark] .portal-wordmark-white { display:block; }
.portal-brand small { font-size:.75rem; font-weight:400; border-left:1px solid var(--ifk-color-border); padding-left:8px; }
.portal-header-tools { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-left:auto; }
.portal-theme { display:flex; align-items:center; gap:8px; font-size:.8rem; }
.portal-theme[hidden] { display:none; }
.portal-theme select { width:auto; font-size:.8rem; }
.portal-shell { display:grid; grid-template-columns:var(--portal-sidebar-width) minmax(0,1fr); min-height:calc(100vh - var(--portal-header-height)); }
.portal-sidebar { display:flex; flex-direction:column; min-width:0; background:var(--portal-panel-bg); border-right:1px solid var(--ifk-color-divider); padding:20px 12px; }
/* Navigation and footer scroll together when the menu exceeds the viewport. */
.portal-sidebar > nav { flex-shrink:0; }
.portal-sidebar-footer { margin-top:auto; padding:24px 10px 0; flex-shrink:0; color:var(--ifk-color-text-muted); }
.portal-sidebar-principle { font:600 .68rem/1.5 monospace; letter-spacing:.04em; margin:0 0 16px; }
.portal-sidebar-copyright { font-size:.6875rem; margin:0; }
.portal-nav-group { margin-bottom:16px; }
.portal-nav-heading { font:600 .68rem/1.4 monospace; letter-spacing:.1em; color:var(--ifk-color-text-muted); margin:0 10px 8px; }
.portal-nav-link { display:flex; align-items:center; gap:10px; min-height:40px; padding:7px 10px; border-radius:6px; color:var(--ifk-color-text-muted); text-decoration:none; font-size:.875rem; }
.portal-nav-link:hover { background:var(--ifk-color-surface-alt); }
.portal-nav-link[aria-current=page] { background:var(--ifk-color-surface-alt); color:var(--ifk-color-primary); font-weight:700; box-shadow:inset 3px 0 var(--ifk-color-primary); }
.portal-nav-icon { width:20px; font:1rem/1 monospace; text-align:center; flex-shrink:0; }
.portal-nav-planned { display:block; padding:5px 10px 5px 40px; font-size:.75rem; color:var(--ifk-color-text-muted); }
.portal-main { padding:calc(20px * var(--ifk-outer-scale)) clamp(calc(16px * var(--ifk-outer-scale)),calc(2.5vw * var(--ifk-outer-scale)),calc(40px * var(--ifk-outer-scale))); max-width:1440px; width:100%; margin:0 auto; align-self:start; min-width:0; }
.portal-breadcrumb { font-size:.75rem; color:var(--ifk-color-text-muted); margin-bottom:16px; display:flex; flex-wrap:wrap; gap:6px; }
.portal-skip { position:fixed; top:-100px; left:16px; z-index:50; background:var(--ifk-color-surface); padding:12px; }
.portal-skip:focus { top:12px; }
.portal-menu,.portal-menu-close { display:none; }
.portal-backdrop { visibility:hidden; opacity:0; position:fixed; inset:0; background:#07101f99; z-index:19; transition:opacity var(--portal-motion-duration),visibility 0s var(--portal-motion-duration); }
.js .portal-menu,.js .portal-menu-close { display:inline-flex; }
.portal-nav-heading-row { display:flex; align-items:center; justify-content:space-between; gap:4px; margin-bottom:8px; }
.portal-nav-heading-row .portal-nav-heading { margin-bottom:0; margin-right:0; }
.portal-menu.ifk-tooltip span,.portal-menu-close.ifk-tooltip span { display:none; top:calc(100% + 8px); bottom:auto; left:auto; right:0; width:max-content; max-width:200px; }
.portal-menu.ifk-tooltip span { left:0; right:auto; z-index:25; }
.portal-menu.ifk-tooltip.is-tooltip-visible span,.portal-menu-close.ifk-tooltip.is-tooltip-visible span { display:block; }
@media(min-width:801px) {
 body { height:100vh; height:100dvh; display:grid; grid-template-rows:auto minmax(0,1fr); overflow:hidden; }
 .portal-shell { min-height:0; overflow:hidden; transition:grid-template-columns var(--portal-motion-duration) ease; }
 .portal-sidebar { overflow:auto; overscroll-behavior:contain; }
 .portal-main { height:100%; min-height:0; overflow:auto; overscroll-behavior:contain; }
 .js .portal-sidebar { transition:opacity var(--portal-motion-duration),transform var(--portal-motion-duration),visibility 0s; }
 .js .portal-shell.is-collapsed { grid-template-columns:0 minmax(0,1fr); }
 .js .is-collapsed .portal-sidebar { visibility:hidden; opacity:0; transform:translateX(-16px); pointer-events:none; transition:opacity var(--portal-motion-duration),transform var(--portal-motion-duration),visibility 0s var(--portal-motion-duration); }
}
@media(max-width:800px) {
 .portal-header { padding:8px 12px; flex-wrap:wrap; } .portal-brand small { display:none; }
 .portal-logo { width:28px; height:28px; }
 .portal-wordmark { height:22px; }
 .portal-wordmark-ifk { height:22px; } .portal-wordmark-lab { height:14px; }
 .portal-theme>span { display:none; } .portal-theme select { max-width:112px; }
 .portal-shell { display:block; } .portal-main { padding:calc(16px * var(--ifk-outer-scale)) calc(12px * var(--ifk-outer-scale)); }
 .portal-sidebar { border-right:0; border-bottom:1px solid var(--ifk-color-divider); }
 .portal-nav-link { min-height:44px; }
 .js .portal-menu-close { display:inline-flex; }
 .js .portal-sidebar { visibility:hidden; transform:translateX(-100%); position:fixed; inset:0 auto 0 0; width:min(288px,calc(100vw - 32px)); z-index:20; overflow-y:auto; overscroll-behavior:contain; background:var(--ifk-color-surface); border-right:1px solid var(--ifk-color-divider); transition:transform var(--portal-motion-duration) ease,visibility 0s var(--portal-motion-duration); }
 .js .portal-sidebar.is-open { visibility:visible; transform:translateX(0); transition:transform var(--portal-motion-duration) ease,visibility 0s; }
 .js .portal-backdrop.is-open { visibility:visible; opacity:1; transition:opacity var(--portal-motion-duration),visibility 0s; }
 .portal-breadcrumb { margin-bottom:12px; }
}
@media(prefers-reduced-motion:reduce) { :root { --portal-motion-duration:0ms; } }
