/* Shared semantic surfaces; selected preferences never change design or data values. */
:root{--paper:#f2f5f4;--surface:#fff;--surface-muted:#f0f3f1;--surface-hover:#edf4ef;--ink:#20332e;--muted:#52685f;--line:#d7e1db;--green:#176f5b;--green-hover:#115440;--green-soft:#eaf4ef;--on-accent:#fff;--red:#a53229;--error-bg:#fbeeea;--warning-bg:#fff7e8;--viewer-bg:#f1f4f0;--focus:#ac7827;--baseline:#7c8c84;color-scheme:light;background:var(--paper);color:var(--ink)}
html[data-theme=dark]{--paper:#101a1d;--surface:#18262b;--surface-muted:#203238;--surface-hover:#263d42;--ink:#e4eeea;--muted:#a9c0b6;--line:#3b5258;--green:#78d6b4;--green-hover:#a4e8cd;--green-soft:#203e35;--on-accent:#102a20;--red:#ffaaa0;--error-bg:#432a2b;--warning-bg:#413a25;--viewer-bg:#111c22;--focus:#e3b45e;--baseline:#a1b8af;color-scheme:dark;--primary:var(--green);--secondary:var(--surface-muted);--accent:var(--ink);--body-fg:var(--ink);--body-bg:var(--paper);--body-quiet-color:var(--muted);--body-loud-color:var(--ink);--header-color:var(--ink);--header-branding-color:var(--ink);--header-bg:var(--surface);--header-link-color:var(--green);--breadcrumbs-fg:var(--muted);--breadcrumbs-link-fg:var(--green);--breadcrumbs-bg:var(--paper);--link-fg:var(--green);--link-hover-color:var(--green-hover);--link-selected-fg:var(--green-hover);--hairline-color:var(--line);--border-color:var(--line);--darkened-bg:var(--surface-muted);--selected-bg:var(--green-soft);--selected-row:var(--green-soft);--button-fg:var(--on-accent);--button-bg:var(--green);--button-hover-bg:var(--green-hover);--default-button-bg:var(--green);--default-button-hover-bg:var(--green-hover);--close-button-bg:var(--muted);--message-success-bg:var(--green-soft);--message-warning-bg:var(--warning-bg);--message-error-bg:var(--error-bg);--error-fg:var(--red)}
body{background:var(--paper);color:var(--ink)}
.ui-preferences{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;min-width:0}.ui-preferences label{display:flex;align-items:center;gap:8px;margin:0;font:400 13px/1.5 var(--font-family-primary,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif);color:inherit}.ui-preferences select{width:auto;max-width:190px;min-width:0;min-height:40px;font:inherit;line-height:1.5;font-size:14px;padding:8px 28px 8px 10px;border:1px solid var(--line);border-radius:6px;background:var(--surface);color:var(--ink);cursor:pointer}.ui-preferences select:focus-visible{outline:3px solid var(--focus);outline-offset:3px}.ui-preferences .sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.site-header{height:auto;min-height:68px;gap:12px;padding-block:12px;flex-wrap:wrap}.site-header .header-actions{justify-content:flex-end;min-width:0;flex-wrap:wrap}.header-actions .button{white-space:normal;text-align:center}.account-nav,.management-tabs{min-width:0}#header .account-nav{justify-content:flex-end}#header .ui-preferences{color:var(--ink)}body.login #header{flex-wrap:wrap}.name-field{min-width:120px}.input-tabs,.result-tabs{flex-wrap:nowrap}.input-tabs button,.result-tabs button{flex-shrink:0}.tools-controls>label,.context>div,.reference-fields>label{min-width:0}.button,.text-button{overflow-wrap:anywhere}.section-heading{flex-wrap:wrap}.key-results dt{overflow-wrap:anywhere}.field-label,.help,.field-help{overflow-wrap:anywhere}
html:not([lang^=ko]) .hero-description,html:not([lang^=ko]) .landing-page h1,html:not([lang^=ko]) .landing-page h2,html:not([lang^=ko]) .capability-list p{word-break:normal;overflow-wrap:anywhere}
html[data-theme=light] .landing-page{--night:#eef4f8;--glass:rgba(255,255,255,.76);--text:#183144;--secondary:#456176;--cyan:#006c79;--blue:#245eae;--positive:#4c85cf;--negative:#208f88;--separator:#dbe9ef}html[data-theme=light] .landing-page .glass{border-color:#b7cbd8;box-shadow:0 16px 40px rgba(26,54,74,.09)}html[data-theme=light] .landing-page .primary-action{color:#fff}html[data-theme=light] .landing-page .sheet.shell-base{background:rgba(70,117,154,.32)}html[data-theme=light] .landing-page .sheet.shell-lid{background:rgba(71,124,156,.2)}.landing-page .ui-preferences select{background:var(--glass);border-color:var(--secondary);color:var(--text)}.landing-page .ui-preferences option{background:var(--night);color:var(--text)}
@media(max-width:980px){.site-header .header-actions{justify-content:flex-start}.ui-preferences{flex-wrap:wrap}.ui-preferences select{min-height:44px;font-size:16px}.ui-preferences label{flex-wrap:wrap;font-size:13px}.design-toolbar{flex-wrap:wrap}.design-actions{flex-wrap:wrap}.context{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.ui-preferences{width:100%;gap:8px 12px;justify-content:flex-start}.ui-preferences label{flex:1 1 130px;min-width:0}.ui-preferences select{max-width:100%;flex:1}.header-actions{width:100%;margin-left:0}.site-header .brand{flex-shrink:0}.landing-page>header{align-items:flex-start}.landing-page nav{width:100%}.landing-page nav .ui-preferences{margin-top:4px}.key-results dd{overflow-wrap:anywhere}.tools-controls{grid-template-columns:minmax(0,1fr)}#header .account-nav{justify-content:flex-start}.design-toolbar .name-field{flex-basis:100%;max-width:none}.design-actions{width:100%}}
@media print{.ui-preferences{display:none!important}:root,html[data-theme=dark]{--paper:#fff;--surface:#fff;--ink:#20332e;--muted:#52685f;--line:#d7e1db;--green:#176f5b;color-scheme:light}}

/* Scroll ownership: one page scroll, one input scroll; result panels flow naturally. */
html{scroll-padding-top:calc(var(--toolbar-height,76px) + 24px)}.utility-menu{position:relative;flex:0 0 auto}.utility-menu>summary{min-height:40px;padding:8px 14px;border:1px solid var(--line);border-radius:6px;color:var(--ink);background:var(--surface);font-size:14px;font-weight:600;white-space:nowrap}.utility-panel{position:absolute;inset-block-start:calc(100% + 8px);inset-inline-end:0;width:min(420px,calc(100vw - 32px));max-height:70dvh;overflow:auto;overscroll-behavior:contain;display:flex;flex-wrap:wrap;gap:10px;padding:16px;background:var(--surface);border:1px solid var(--line);border-radius:10px;z-index:80;box-shadow:0 8px 24px rgb(0 0 0 / .12)}.utility-menu:not([open])>.utility-panel{display:none}.utility-panel .local-label{flex-basis:100%}.utility-panel form{margin:0}.site-header{overflow:visible;position:relative;z-index:40}.design-toolbar{position:sticky;top:0;z-index:30;background:var(--paper);padding-block:12px;margin-bottom:16px;border-bottom:1px solid var(--line)}.editor-body{overscroll-behavior-y:contain}.editor-body:focus-visible,.result-body:focus-visible{outline-offset:-3px}.result-body{overflow:visible;max-height:none}.results{overflow:visible}.results>.section-heading{background:var(--surface);border-radius:9px 9px 0 0}.input-tabs,.result-tabs{scrollbar-width:thin;scroll-padding-inline:12px}.input-tabs button:focus-visible,.result-tabs button:focus-visible{outline-offset:-4px}.tools-panel>summary,.comparison-settings>summary,.metric-details>summary,.viewer-scope>summary{min-height:44px;display:flex;align-items:center;gap:0;padding-block:10px}.tools-panel[open]>summary,.comparison-settings[open]>summary{margin-bottom:12px}.tools-panel,.comparison-settings,details.result-section{scroll-margin-top:calc(var(--toolbar-height,76px) + 24px)}.back-to-top{position:fixed;right:20px;bottom:20px;z-index:60;min-height:44px;padding:10px 16px;border:1px solid var(--line);border-radius:6px;background:var(--surface);color:var(--ink);font:inherit;box-shadow:0 4px 12px rgb(0 0 0 / .12)}.back-to-top[hidden]{display:none}.ui-preferences,summary,button{scroll-margin-top:calc(var(--toolbar-height,76px) + 16px)}#library-dialog[open]{display:flex;flex-direction:column;max-height:calc(100dvh - 32px);overflow:hidden}#library-dialog .library{min-height:0;overflow:auto;overscroll-behavior:contain}#library-dialog .record-list{max-height:none;overflow:visible}.library-dialog-bar,.csv-dialog-header,.csv-dialog-footer{flex-shrink:0}.csv-dialog-header{position:sticky;top:0;z-index:4;background:var(--surface)}.csv-table-scroll{overscroll-behavior:contain}.csv-dialog-footer{position:sticky;bottom:0;background:var(--surface)}.field-attention{scroll-margin-top:calc(var(--toolbar-height,76px) + 32px)}
@media(min-width:981px) and (min-height:721px){.editor{height:calc(100dvh - var(--toolbar-height,76px) - 88px);max-height:none;top:calc(var(--toolbar-height,76px) + 12px);display:flex;flex-direction:column}.editor-body{flex:1;min-height:120px;max-height:none;overflow:auto}.editor>.section-heading,.editor>.context,.editor>.input-tabs,.editor>.editor-footnote{flex-shrink:0}.results>.section-heading{position:sticky;top:var(--toolbar-height,76px);z-index:10}.result-tabs{position:sticky;top:calc(var(--toolbar-height,76px) + var(--results-heading-height,56px));z-index:9}}
@media(min-width:981px) and (max-height:720px){.editor{position:static;height:auto;max-height:none}.editor-body{overflow:visible;max-height:none}.design-toolbar{position:static}}
@media(max-width:980px){.design-toolbar{position:static;padding-block:8px}.editor{position:static;max-height:none;height:auto}.editor-body,.result-body{overflow:visible;max-height:none}.back-to-top{bottom:calc(116px + env(safe-area-inset-bottom));right:16px}.utility-menu>summary{min-height:44px}.header-actions{align-items:flex-start}.header-actions>.ui-preferences{flex:1}.ui-preferences{width:auto}.utility-panel .button{min-height:44px}.csv-dialog-footer{position:static}.mobile-workspace-nav{padding-bottom:calc(12px + env(safe-area-inset-bottom))}}
@media(max-width:600px){.site-header .header-actions{flex-wrap:nowrap;gap:8px}.ui-preferences{gap:8px}.ui-preferences label{font-size:0;gap:0;flex:1 1 100px}.ui-preferences select{font-size:14px;width:100%;max-width:150px;padding-inline:8px}.ui-preferences label>select{margin:0}.utility-menu>summary{font-size:13px;padding-inline:10px}.utility-panel{right:0}.design-toolbar .design-actions .button{flex:1 1 auto}.record-list{grid-template-columns:minmax(0,1fr)}html{scroll-padding-bottom:140px}}

::selection{background:var(--green);color:var(--on-accent)}input,textarea{caret-color:var(--green)}*{scrollbar-color:var(--baseline) var(--surface-muted)}a{text-underline-offset:3px}

.mobile-workspace-nav button{background:var(--surface);color:var(--ink)}.mobile-workspace-nav button[aria-pressed=true]{background:var(--green);color:var(--on-accent)}

.geometry-svg text{fill:var(--ink)}.field{border-bottom-color:var(--line)}
