/* Theme overrides preserve layout and the PEP20 ink/teal/amber identity. */
:root{--surface:#fff;--surface-alt:#eef4f2;--code-bg:#f1f5f7;--code-ink:#183547;color-scheme:light}
:root[data-theme=dark]{--pep-ink:#e4edf3;--pep-muted:#b6c6d1;--pep-line:#496273;--pep-bg:#101c27;--pep-teal:#8ddbc7;--pep-focus:#ffc17e;--surface:#192b38;--surface-alt:#233b4a;--code-bg:#0b1823;--code-ink:#e5f1f7;color-scheme:dark}
html,body{background:var(--pep-bg);color:var(--pep-ink)}
.theme-control{display:inline-flex;gap:.35rem;align-items:center;font-size:.8rem;font-weight:500;white-space:nowrap;margin:0;max-width:100%}.theme-control select{font:inherit;background:var(--surface);color:var(--pep-ink);border:1px solid var(--pep-line);border-radius:6px;padding:.35rem;min-height:36px;margin:0;max-width:10rem}.top-actions .theme-control{color:var(--pep-ink)}
.card,.content,.lab-panel,.toolbar,.node-list li,.panel,.parquet-panel,.workspace>section,.dataset-info,dialog{background:var(--surface);color:var(--pep-ink);border-color:var(--pep-line)}
button,input,select,dialog input,.parquet-panel button,.parquet-panel select,#table-select{background:var(--surface);color:var(--pep-ink);border-color:var(--pep-line)}
textarea,pre,.code-area,.code-area textarea,.line-numbers{background:var(--code-bg);color:var(--code-ink);color-scheme:inherit}.code-area textarea{background:transparent}.line-numbers{color:var(--pep-muted)}
:root[data-theme=light] #python-error{color:#9b282b}
:root[data-theme=dark] a{color:#9bdacd}:root[data-theme=dark] .site-header a,:root[data-theme=dark] header a{color:#bce8dd}
:root[data-theme=dark] .topbar,:root[data-theme=dark] .inspector-foot,:root[data-theme=dark] .data-table th,:root[data-theme=dark] th,:root[data-theme=dark] .data-table td.row-number{background:var(--surface-alt);color:var(--pep-ink);border-color:var(--pep-line)}
:root[data-theme=dark] .top-crumb strong,:root[data-theme=dark] .panel-title,:root[data-theme=dark] .description,:root[data-theme=dark] .meta-chip b,:root[data-theme=dark] .column-line .col-name,:root[data-theme=dark] .relation-row strong,:root[data-theme=dark] .data-table td,:root[data-theme=dark] .empty-state strong{color:var(--pep-ink)}
:root[data-theme=dark] .objective,:root[data-theme=dark] .subheading,:root[data-theme=dark] .legend,:root[data-theme=dark] .lab-note,:root[data-theme=dark] footer,:root[data-theme=dark] .search-count,:root[data-theme=dark] .node-type,:root[data-theme=dark] .column-line .col-type,:root[data-theme=dark] .inspector-note,:root[data-theme=dark] .panel-heading small,:root[data-theme=dark] .result-footer,:root[data-theme=dark] .shortcut,:root[data-theme=dark] .empty-state p,:root[data-theme=dark] .table-tags>span{color:var(--pep-muted)}
:root[data-theme=dark] .graph-scroll{background-color:#122530;background-image:radial-gradient(#3b5663 1px,transparent 1px)}
:root[data-theme=dark] .map-node{background:#223d4d;color:var(--pep-ink);border-color:#79a9bc}:root[data-theme=dark] .map-node[data-kind=exercise]{background:#1b403c;border-left-color:#8ddbc7}:root[data-theme=dark] .map-node[data-kind=project],:root[data-theme=dark] .map-node[data-state=active]{background:#4a3921;border-color:#d8aa67}:root[data-theme=dark] .map-node[data-state=complete],:root[data-theme=dark] button[aria-pressed=true]{background:#214d40;border-color:#8ddbc7;color:#ddf6ea}
:root[data-theme=dark] .btn.primary,:root[data-theme=dark] #python-run,:root[data-theme=dark] .content button{background:#216d60;color:#fff}:root[data-theme=dark] .btn.secondary,:root[data-theme=dark] .btn.ghost,:root[data-theme=dark] .meta-chip,:root[data-theme=dark] .level,:root[data-theme=dark] .table-name,:root[data-theme=dark] .status-pill,:root[data-theme=dark] .build-label,:root[data-theme=dark] kbd{background:var(--surface-alt);color:#d3e7f5;border-color:var(--pep-line)}
:root[data-theme=dark] .feedback.ok,:root[data-theme=dark] .status-pill.ready{background:#214638;color:#bef3d3}:root[data-theme=dark] .feedback.fail,:root[data-theme=dark] .status-pill.error{background:#4b2b2d;color:#ffd4cf}:root[data-theme=dark] .feedback.info{background:#233c55;color:#c8e4ff}:root[data-theme=dark] .hint-box,:root[data-theme=dark] #storage-warning{background:#493b23;color:#ffe1ab;border-color:#b49359}
:root[data-theme=dark] .data-table tbody tr:hover{background:#294453}:root[data-theme=dark] .panel-heading,:root[data-theme=dark] .result-footer,:root[data-theme=dark] th,:root[data-theme=dark] td,:root[data-theme=dark] .column-line,:root[data-theme=dark] .tabs{border-color:var(--pep-line)}
.turnstile-status{font-size:.9rem;color:var(--pep-muted)}.turnstile-container{max-width:100%;margin:.5rem 0}.turnstile-retry{margin:.5rem 0}#massive-access-error{color:#9b282b}:root[data-theme=dark] #massive-access-error{color:#ffc8c4}
@media(max-width:710px){.theme-control{flex-wrap:wrap}.top-actions{gap:.5rem}}

:root[data-theme=dark] .eyebrow,:root[data-theme=dark] .tab.active,:root[data-theme=dark] .text-button,:root[data-theme=dark] .code-icon{color:#b5d1ff}

.map-node.search-match{outline-color:var(--pep-focus)}
/* Supporting text remains legible at small sizes in both palettes. */
.objective,.subheading,.legend,.lab-note,footer,.search-count,.node-type,.column-line .col-type,.inspector-note,.panel-heading small,.result-footer,.shortcut,.empty-state p,.table-tags>span,.top-crumb,.schema-overview,.select-caption,.inspector-head small,.relation-row small,.editor-label,.result-limit,.empty-state,.empty-state strong,.app-footer,.data-table td.row-number,.data-table td.is-null{color:var(--pep-muted)}
input::placeholder,textarea::placeholder{color:var(--pep-muted);opacity:1}
.code-surface{width:100%;min-width:0;max-width:100%;overflow:hidden;background:var(--code-bg);color:var(--code-ink)}.code-surface .cm-editor{min-height:260px;font-size:14px}.code-surface .cm-scroller{max-height:65vh}.code-surface .cm-content{white-space:pre;overflow-wrap:normal}.code-surface .cm-focused{outline:2px solid var(--pep-focus);outline-offset:-2px}.code-area .line-numbers[hidden]{display:none}
.button-row{flex-wrap:wrap}#sql-profile-output{max-height:25rem;max-width:100%;overflow:auto;white-space:pre;font:12px/1.5 ui-monospace,monospace}
.workspace>section{min-width:0}#python-example{max-width:100%;width:100%;min-width:0}

.code-surface[data-editor-language=python]{--editor-height:340px;--editor-font:16px;--editor-line:1.5}.code-surface .cm-editor{min-height:var(--editor-height,260px)}@media(max-width:850px){.code-surface[data-editor-language=python]{--editor-height:240px}}
/* Consola dual vertical, sin iframes: salida limitada dentro de su panel. */
.dual-python{padding:1.2rem;min-width:0}.dual-python label{display:block;margin:1rem 0}.dual-python pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:24rem;overflow:auto}.dual-python .actions{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:1rem}.script-messages{white-space:pre-wrap}.dual-python .result-wrap{max-width:100%;overflow:auto}
.workspace.practice-workspace{grid-template-columns:minmax(0,1fr)}#practice-fixture{margin:1rem 0}#practice-fixture pre{white-space:pre-wrap;overflow-wrap:anywhere}
.inspector[hidden]{display:none!important}
