/* Scoped code surfaces. The application shell keeps its normal typography. */
.wsc-viewer,.wsc-edit{--code-bg:#171b23;--code-line:#2b3341;--code-ink:#dce3ed;--code-muted:#9ba9bd;--code-font:13px/24px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;background:var(--code-bg);color:var(--code-ink);min-width:0;text-align:left;color-scheme:dark;font-weight:400}
.wsc-bar{display:flex;align-items:center;gap:12px;min-height:48px;padding:6px 16px;border-bottom:1px solid var(--code-line);background:#1e2430;font:12px/1.4 system-ui,sans-serif}
.wsc-language{display:inline-flex;align-items:center;gap:8px;color:#dce3ed;white-space:nowrap;font-weight:500}.wsc-language>svg{width:17px;height:17px;color:#a8c6ff}
.wsc-mode{color:var(--code-muted);font-size:12px}.wsc-actions{margin-left:auto;display:flex;align-items:center;gap:5px}
.wsc-actions>button{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:1px solid transparent;border-radius:6px;padding:6px 9px;min-height:32px;background:transparent;color:#c7d3e5;font:13px/1.4 system-ui,sans-serif;cursor:pointer;white-space:nowrap}
.wsc-actions>button:hover,.wsc-actions>button[aria-pressed=true]{background:#303b4c;color:#fff}.wsc-actions>button:disabled{opacity:.5;cursor:wait}.wsc-actions>button:focus-visible{outline:2px solid #9ec0ff;outline-offset:1px}.wsc-actions svg{height:15px;width:15px}
.wsc-source-scroll{max-height:610px;min-height:280px;overflow:auto;scrollbar-width:thin;scrollbar-color:#45536a var(--code-bg)}.wsc-source-scroll:focus-visible{outline:2px solid #8eb9ff;outline-offset:-2px}
.wsc-source-grid{display:grid;grid-template-columns:52px minmax(max-content,1fr);align-items:stretch;min-width:100%;width:max-content}
.wsc-gutter{font:var(--code-font);color:#8b9bb0;text-align:right;background:var(--code-bg);user-select:none;border-right:1px solid var(--code-line);padding:16px 12px 16px 0;box-sizing:border-box}
.wsc-gutter>span{display:block;height:24px}.wsc-source-grid>.wsc-gutter{position:sticky;left:0;z-index:1}
.wsc-source,.wsc-editor-paint{margin:0;border:0;border-radius:0;background:var(--code-bg);color:var(--code-ink);padding:16px 20px;font:var(--code-font);font-variant-ligatures:none;font-weight:400;letter-spacing:0;tab-size:2;white-space:pre;text-shadow:none;text-transform:none;text-align:left;box-shadow:none}
.wsc-source>code,.wsc-editor-paint>code{font:inherit;color:inherit;background:transparent;padding:0;white-space:inherit;display:block;border:0;letter-spacing:0}
.wsc-foot{display:flex;justify-content:space-between;gap:12px;padding:9px 16px;border-top:1px solid var(--code-line);color:var(--code-muted);font:12px/1.5 system-ui,sans-serif}.wsc-foot>span:first-child{white-space:nowrap}.wsc-foot>span:last-child{text-align:right}
.wsc-viewer .token,.wsc-edit .token{background:none;text-shadow:none;font-weight:400;font-style:normal}
.wsc-viewer .token.comment,.wsc-edit .token.comment,.wsc-viewer .token.prolog,.wsc-edit .token.prolog{color:#9baac0}
.wsc-viewer .token.punctuation,.wsc-edit .token.punctuation{color:#bbc8d9}
.wsc-viewer .token.tag,.wsc-edit .token.tag,.wsc-viewer .token.keyword,.wsc-edit .token.keyword,.wsc-viewer .token.atrule,.wsc-edit .token.atrule{color:#c6a5fa}
.wsc-viewer .token.string,.wsc-edit .token.string,.wsc-viewer .token.attr-value,.wsc-edit .token.attr-value,.wsc-viewer .token.char,.wsc-edit .token.char{color:#99d9b5}
.wsc-viewer .token.function,.wsc-edit .token.function,.wsc-viewer .token.class-name,.wsc-edit .token.class-name{color:#f2d395}
.wsc-viewer .token.number,.wsc-edit .token.number,.wsc-viewer .token.boolean,.wsc-edit .token.boolean,.wsc-viewer .token.constant,.wsc-edit .token.constant{color:#f0b99b}
.wsc-viewer .token.operator,.wsc-edit .token.operator,.wsc-viewer .token.entity,.wsc-edit .token.entity{color:#c4d7f1}
.wsc-viewer .token.property,.wsc-edit .token.property,.wsc-viewer .token.attr-name,.wsc-edit .token.attr-name{color:#90cafa}
.wsc-viewer .token.selector,.wsc-edit .token.selector,.wsc-viewer .token.builtin,.wsc-edit .token.builtin{color:#e5b6d5}
#wa-edit-form .wsc-edit{display:block;overflow:hidden;border:1px solid var(--code-line);border-radius:8px;margin-top:4px;font-weight:400}
.wsc-editor-surface{position:relative;height:52vh;min-height:280px;max-height:620px;overflow:hidden}
.wsc-editor-surface>.wsc-gutter{position:absolute;inset:0 auto 0 0;width:52px;overflow:hidden;z-index:1}
.wsc-editor-surface>.wsc-editor-paint{position:absolute;inset:0 0 0 52px;overflow:auto;pointer-events:none;scrollbar-width:none}.wsc-editor-paint::-webkit-scrollbar{display:none}
#wa-edit-form .wsc-editor-surface>textarea.wa-editor{position:absolute;inset:0 0 0 52px;box-sizing:border-box;width:calc(100% - 52px);height:100%;min-height:0!important;max-height:none;margin:0!important;padding:16px 20px!important;border:0!important;border-radius:0!important;resize:none;outline:none;box-shadow:none!important;background:transparent!important;color:transparent!important;-webkit-text-fill-color:transparent;caret-color:#f2f6ff;font:var(--code-font)!important;font-weight:400!important;letter-spacing:0!important;font-variant-ligatures:none;tab-size:2;white-space:pre!important;overflow:auto!important;overflow-wrap:normal!important;word-break:normal!important;text-align:left;text-transform:none;scrollbar-width:thin;scrollbar-color:#45536a transparent}
#wa-edit-form .wsc-editor-surface>textarea.wa-editor::selection{background:#5673a866;color:transparent}
.wsc-edit:focus-within{outline:2px solid #8eafea;outline-offset:1px}
@media(max-width:768px){.wsc-viewer,.wsc-edit{--code-font:13px/24px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.wsc-edit{--code-font:16px/26px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.wsc-edit .wsc-gutter>span{height:26px}.wsc-actions>button{min-height:44px;padding-inline:8px}.wsc-bar{gap:8px;padding:2px 12px}.wsc-mode{display:none}.wsc-source,.wsc-editor-paint{padding-inline:12px}#wa-edit-form .wsc-editor-surface>textarea.wa-editor{padding-inline:12px!important}.wsc-foot{padding:8px 12px;gap:8px}.wsc-source-scroll{max-height:65vh}.wsc-editor-surface{height:48vh;min-height:240px}}
@media(forced-colors:active){#wa-edit-form .wsc-editor-surface>textarea.wa-editor{color:CanvasText!important;-webkit-text-fill-color:CanvasText;background:Canvas!important}.wsc-editor-paint{visibility:hidden}}

.wa-code-field>label{display:block;font-size:13px;font-weight:500;margin:0 0 8px}.wsc-edit .token{display:inline;margin:0;padding:0}.wsc-gutter>span{margin:0;padding:0}
.wa-canvas:has(>.wsc-viewer){height:100%;min-height:420px;display:flex;flex-direction:column}.wa-canvas:has(>.wsc-viewer)>:not(.wsc-viewer){flex:none}.wa-canvas>.wsc-viewer{display:flex;flex-direction:column;flex:1;min-height:160px;overflow:hidden}.wa-canvas>.wsc-viewer>.wsc-source-scroll{flex:1;min-height:0;max-height:none}.wsc-viewer>.wsc-bar,.wsc-viewer>.wsc-foot{flex:none}
