/* Shared palette; original layout and semantic algorithm colors remain intact. */
html[data-theme="dark"] body{--ink:#e3ede7;--paper:#0f1b18;--muted:#94aaa0;--line:#2b4137;--lime:#d5f577;background:var(--paper);color:var(--ink)}
html[data-theme="light"] body{--ink:#20382d;--paper:#f6f7f1;--muted:#52695b;--line:#ced9ca;--lime:#527327;background:var(--paper);color:var(--ink)}
html[data-theme="dark"] .logo span{color:#d8e6dc}
html[data-theme="dark"] em{color:#d8e6dc}
html[data-theme="dark"] .progress>div{background:#172a21}
html[data-theme="dark"] .stage.active{background:#172a21}
html[data-theme="dark"] .card{background:#172a21}
html[data-theme="dark"] .card.completed{background:#172a21}
html[data-theme="dark"] .card.completed .card-top span:last-child{color:#d8e6dc}
html[data-theme="dark"] .graphwrap{background-image:radial-gradient(#172a21 1px,transparent 1px)}
html[data-theme="dark"] .yellow{color:#d8e6dc}
html[data-theme="dark"] .green{color:#d8e6dc}
html[data-theme="dark"] .callout{background:#172a21}
html[data-theme="dark"] .answer.correct{background:#172a21}
html[data-theme="dark"] .random-generator input:disabled{background:#172a21}
html[data-theme="dark"] nav .editor-link.current{color:#d8e6dc}
html[data-theme="dark"] .live-dot{}
html[data-theme="dark"] .compare-switch input:focus-visible+.switch-track{outline:2px solid #344d3e}
html[data-theme="dark"] .run-maze{border-color:#344d3e;color:#17291e}
html[data-theme="dark"] .run-maze:hover:enabled{background:#172a21;color:#e3ede7}
html[data-theme="dark"] .dimension-controls>span{color:#d8e6dc}
html[data-theme="dark"] .legend i{color:#d8e6dc}
html[data-theme="dark"] .canvas-scroll canvas:focus-visible{outline:2px solid #344d3e}
html[data-theme="dark"] .maze-page :focus-visible{outline:2px solid #344d3e}
html[data-theme="dark"] .tree-tabs [aria-selected=true]{color:#17291e}
html[data-theme="dark"] .tree-tools button[aria-pressed=true]{border-color:#344d3e}
html[data-theme="dark"] .tree-page button:focus-visible,html[data-theme="dark"] .tree-page select:focus-visible,html[data-theme="dark"] .tree-page input:focus-visible{outline:2px solid #344d3e}
html[data-theme="dark"] .sort-page select:focus-visible,html[data-theme="dark"] .sort-page button:focus-visible{outline:2px solid #344d3e}
html[data-theme="dark"] .draw-page .primary{color:#17291e}
html[data-theme="dark"] .draw-page .inline-weight{border-color:#344d3e}
html[data-theme="dark"] .competition-note{background:#172a21}
html[data-theme="dark"] .task-option:hover{background:#172a21}
html[data-theme="dark"] .task-option.active{background:#172a21;border-color:#344d3e}
html[data-theme="dark"] .current{color:#d8e6dc}
html[data-theme="dark"] .sample-grid pre{background:#172a21}
html[data-theme="dark"] .complexity{background:#172a21}
html[data-theme="dark"] .difficulty{color:#d8e6dc}
html[data-theme="dark"] .event-title{color:#d8e6dc}
html[data-theme="dark"] .task-category{background:#172a21}
html[data-theme="dark"] .task-category>summary::before{color:#d8e6dc}
html[data-theme="dark"] .task-availability.ready{color:#d8e6dc}
html[data-theme="dark"] .catalogue-notice{background:#172a21}
html[data-theme="dark"] .task-list{background:#172a21}
html[data-theme="dark"] .task-category>summary:hover,html[data-theme="dark"] .task-theme>summary:hover{background:#172a21}
html[data-theme="dark"] .folder-icon{color:#d8e6dc}
html[data-theme="dark"] .category-body{border-left:1px solid #344d3e}
html[data-theme="dark"] .run-button{color:#17291e}
html[data-theme="dark"] .run-button:hover:enabled{background:#172a21;color:#e3ede7}
html[data-theme="dark"] .problem-banner{background:#172a21;border:1px solid #344d3e}
html[data-theme="dark"] .editor-notice{color:#d8e6dc}
html[data-theme="dark"] .workspace :focus-visible{outline:2px solid #344d3e}
html[data-theme="dark"] .learning-page .primary{color:#17291e}
html[data-theme="dark"] .learning-page :focus-visible{outline:2px solid #344d3e}
html[data-theme="dark"] .site-footer-links a:hover{color:#d8e6dc}
html[data-theme="dark"] .about-content .about-motto{border-left:3px solid #344d3e}
html[data-theme="light"] .logo span{color:#52695b}
html[data-theme="light"] em{color:#52695b}
html[data-theme="light"] .hero-art{background:#eef4ed;color:#294235;}
html[data-theme="light"] .art-label span{color:#294235}
html[data-theme="light"] .card.completed .card-top span:last-child{color:#52695b}
html[data-theme="light"] .yellow{color:#52695b}
html[data-theme="light"] .green{color:#52695b}
html[data-theme="light"] dialog::backdrop{background:#f8faf5}
html[data-theme="light"] pre{background:#eef4ed;color:#294235}
html[data-theme="light"] .inline-weight{border:2px solid #bfcebf;}
html[data-theme="light"] .random-generator input:disabled{color:#52695b}
html[data-theme="light"] nav .editor-link.current{color:#52695b}
html[data-theme="light"] .maze-page nav .current{color:#527327}
html[data-theme="light"] .maze-page .logo span{color:#527327}
html[data-theme="light"] .maze-intro h1 em{color:#527327}
html[data-theme="light"] .maze-page .eyebrow{color:#294235}
html[data-theme="light"] .lab-sign{border-left:1px solid #bfcebf}
html[data-theme="light"] .lab-sign>span{color:#527327}
html[data-theme="light"] .lab-toolbar{background:#eef4ed}
html[data-theme="light"] .algorithm-choice label{color:#294235}
html[data-theme="light"] .maze-page select,html[data-theme="light"] .maze-page input[type=number]{background:#f8faf5;border:1px solid #bfcebf;color:#294235}
html[data-theme="light"] .switch-track{background:#eef4ed}
html[data-theme="light"] .compare-switch input:checked+.switch-track::after{background:#eef4ed}
html[data-theme="light"] .lab-button,html[data-theme="light"] .run-maze{border:1px solid #bfcebf;color:#294235}
html[data-theme="light"] .lab-button:hover:enabled{background:#eef4ed}
html[data-theme="light"] .build-toolbar,html[data-theme="light"] .generation-toolbar{background:#f8faf5}
html[data-theme="light"] .generation-toolbar{background:#f8faf5}
html[data-theme="light"] .draw-tools{background:#f8faf5;border:1px solid #bfcebf}
html[data-theme="light"] .draw-tools button{color:#294235}
html[data-theme="light"] .draw-tools button[aria-pressed=true]{background:#eef4ed;color:#294235}
html[data-theme="light"] .dimension-controls>span{color:#52695b}
html[data-theme="light"] .speed-control output{color:#294235}
html[data-theme="light"] .maze-note{color:#294235}
html[data-theme="light"] .maze-page .legend{color:#294235}
html[data-theme="light"] .grid-hint{color:#294235}
html[data-theme="light"] .board-card{border:1px solid #bfcebf;background:#f8faf5;}
html[data-theme="light"] .board-heading{border-bottom:1px solid #bfcebf}
html[data-theme="light"] .board-letter{border:1px solid #bfcebf;color:#527327}
html[data-theme="light"] .optimal-badge{border:1px solid #bfcebf;color:#294235}
html[data-theme="light"] .algorithm-state{color:#294235}
html[data-theme="light"] .canvas-scroll{background:#f8faf5}
html[data-theme="light"] .board-stats{border-top:1px solid #bfcebf}
html[data-theme="light"] .board-stats>div{border-right:1px solid #bfcebf}
html[data-theme="light"] .board-stats span{color:#294235}
html[data-theme="light"] .board-stats strong{color:#294235}
html[data-theme="light"] .board-bottom{color:#294235;background:#f8faf5;border-top:1px solid #bfcebf}
html[data-theme="light"] .maze-message{color:#294235}
html[data-theme="light"] .comparison-panel{background:#f8faf5}
html[data-theme="light"] .comparison-heading>span{color:#294235}
html[data-theme="light"] .maze-page th{color:#294235}
html[data-theme="light"] .maze-page th,html[data-theme="light"] .maze-page td{border-color:#bfcebf}
html[data-theme="light"] .comparison-panel>p{color:#294235}
html[data-theme="light"] .reading-card{background:#f8faf5}
html[data-theme="light"] .reading-card p{color:#294235}
html[data-theme="light"] .reading-card strong{color:#294235}
html[data-theme="light"] .explain-facts span{background:#eef4ed;color:#294235}
html[data-theme="light"] .correctness-note{color:#294235}
html[data-theme="light"] .correctness-note summary{color:#294235}
html[data-theme="light"] .tree-tabs{background:#f8faf5;border:1px solid #bfcebf}
html[data-theme="light"] .tree-tabs button{color:#294235}
html[data-theme="light"] .tree-tabs [aria-selected=true]{}
html[data-theme="light"] .tree-stage{border:1px solid #bfcebf;background:#f8faf5}
html[data-theme="light"] .tree-canvas-head{border-bottom:1px solid #bfcebf}
html[data-theme="light"] .tree-valid{color:#294235}
html[data-theme="light"] .tree-hint{color:#294235}
html[data-theme="light"] .view-controls button{color:#294235;background:#eef4ed;border:1px solid #bfcebf}
html[data-theme="light"] .tree-surface{background:radial-gradient(ellipse at 50% 0,#eef4ed,#f8faf5 75%)}
html[data-theme="light"] .tree-corner{color:#294235}
html[data-theme="light"] .tree-legend{color:#294235;border-top:1px solid #bfcebf}
html[data-theme="light"] .tree-stats{background:#eef4ed;border-top:1px solid #bfcebf}
html[data-theme="light"] .tree-stat{background:#f8faf5}
html[data-theme="light"] .tree-stat span{color:#294235}
html[data-theme="light"] .tree-stat strong{color:#294235}
html[data-theme="light"] .tree-stat small{color:#294235}
html[data-theme="light"] .tree-message{color:#294235}
html[data-theme="light"] .tree-panel{border:1px solid #bfcebf;background:#f8faf5}
html[data-theme="light"] .tree-page select,html[data-theme="light"] .tree-page input[type=number]{border:1px solid #bfcebf;background:#f8faf5;color:#294235}
html[data-theme="light"] .tree-page label{color:#294235}
html[data-theme="light"] .tree-tools button{background:#eef4ed;color:#294235;border:1px solid #bfcebf}
html[data-theme="light"] .tree-tools button[aria-pressed=true]{background:#eef4ed;color:#527327}
html[data-theme="light"] .tree-panel hr{border-top:1px solid #bfcebf}
html[data-theme="light"] .panel-note{color:#294235}
html[data-theme="light"] .tree-panel dt{color:#294235}
html[data-theme="light"] .tree-panel dd{color:#294235}
html[data-theme="light"] .tree-playback{border-top:1px solid #bfcebf;background:#eef4ed}
html[data-theme="light"] .tree-stephead{color:#294235}
html[data-theme="light"] .algorithm-state-panel{color:#294235}
html[data-theme="light"] .algorithm-state-panel strong{color:#294235}
html[data-theme="light"] .state-row{border-top:1px solid #bfcebf}
html[data-theme="light"] .state-chips span{background:#eef4ed;border:1px solid #bfcebf;color:#294235}
html[data-theme="light"] .tree-practice{background:linear-gradient(120deg,#eef4ed,#f8faf5);border:1px solid #bfcebf}
html[data-theme="light"] .tree-table-panel{border:1px solid #bfcebf;background:#f8faf5}
html[data-theme="light"] .tree-table-panel p{color:#294235}
html[data-theme="light"] .tree-table-panel th{background:#eef4ed}
html[data-theme="light"] .tree-table-panel tr:hover{background:#eef4ed}
html[data-theme="light"] .tree-education,html[data-theme="light"] .tree-notes{background:#f8faf5;border:1px solid #bfcebf}
html[data-theme="light"] .tree-education p,html[data-theme="light"] .tree-notes p{color:#294235}
html[data-theme="light"] .tree-education pre{background:#f8faf5;border:1px solid #bfcebf;color:#294235}
html[data-theme="light"] .tree-education a,html[data-theme="light"] .tree-notes a{color:#527327}
html[data-theme="light"] .tree-code-string{color:#294235}
html[data-theme="light"] .sort-controls{background:#f8faf5}
html[data-theme="light"] .selector-row{border-bottom:1px solid #bfcebf}
html[data-theme="light"] .sort-controls label{color:#294235}
html[data-theme="light"] .sort-controls select,html[data-theme="light"] .sort-controls input[type=number],html[data-theme="light"] .sort-controls textarea{background:#f8faf5;border:1px solid #bfcebf;color:#294235}
html[data-theme="light"] .sort-controls .compare-switch{color:#527327}
html[data-theme="light"] .playback-row{border-top:1px solid #bfcebf}
html[data-theme="light"] .sort-card{background:#f8faf5;border:1px solid #bfcebf}
html[data-theme="light"] .sort-canvas{background:linear-gradient(#f8faf5,#f8faf5)}
html[data-theme="light"] .sort-progress{background:#eef4ed}
html[data-theme="light"] .algorithm-information details{border:1px solid #bfcebf;background:#f8faf5}
html[data-theme="light"] .info-body dt{color:#294235}
html[data-theme="light"] .info-body dd{color:#527327}
html[data-theme="light"] .info-body p{color:#294235}
html[data-theme="light"] .info-body pre{background:#f8faf5;border:1px solid #bfcebf;color:#294235}
html[data-theme="light"] .cpp-string{color:#294235}
html[data-theme="light"] .info-body a{color:#527327}
html[data-theme="light"] .draw-page .labgrid{background:#f8faf5;border-color:#bfcebf}
html[data-theme="light"] .draw-page .graphwrap{background-color:#f8faf5;background-image:radial-gradient(#eef4ed 1px,transparent 1px)}
html[data-theme="light"] .draw-page .controls{background:#f8faf5;border-color:#bfcebf}
html[data-theme="light"] .draw-page input,html[data-theme="light"] .draw-page select{background:#f8faf5;border-color:#bfcebf;color:#294235}
html[data-theme="light"] .draw-page .secondary{background:#eef4ed;color:#294235;border-color:#bfcebf}
html[data-theme="light"] .draw-page .secondary:hover{background:#eef4ed}
html[data-theme="light"] .draw-page .generator-title{color:#527327}
html[data-theme="light"] .draw-page .random-generator{border-top:1px solid #bfcebf;border-bottom:1px solid #bfcebf}
html[data-theme="light"] .draw-page .parallel-option{color:#294235}
html[data-theme="light"] .draw-page #editHelp{color:#294235}
html[data-theme="light"] .draw-page .yellow{color:#527327}
html[data-theme="light"] .draw-page .green{color:#294235}
html[data-theme="light"] .draw-page #distances span{background:#eef4ed;border-color:#bfcebf;color:#294235}
html[data-theme="light"] .draw-page #trace{background:#eef4ed;color:#294235}
html[data-theme="light"] .draw-page .inline-weight{background:#f8faf5;color:#294235;}
html[data-theme="light"] .draw-page .graphsettings{border-color:#bfcebf}
html[data-theme="light"] .draw-page .draw-footnote{color:#294235}
html[data-theme="light"] .draw-page .draw-footnote a{color:#527327}
@media(max-width:850px){html[data-theme="light"] .draw-page .controls{border-top:1px solid #bfcebf}
}
html[data-theme="light"] .task-option .task-index{color:#294235}
html[data-theme="light"] .current{color:#52695b}
html[data-theme="light"] .welcome-symbol{color:#294235}
html[data-theme="light"] .difficulty{color:#52695b}
html[data-theme="light"] .event-title{color:#52695b}
html[data-theme="light"] .source-links .solve-editor{background:#eef4ed;color:#294235}
html[data-theme="light"] .task-category>summary::before{color:#52695b}
html[data-theme="light"] .task-availability.ready{color:#52695b}
html[data-theme="light"] .folder-icon{color:#52695b}
html[data-theme="light"] .task-theme .task-option::before{color:#294235}
html[data-theme="light"] .workspace{background:#f8faf5;color:#294235;border:1px solid #bfcebf;}
html[data-theme="light"] .workspace-toolbar{background:#eef4ed;border-bottom:1px solid #bfcebf}
html[data-theme="light"] .template-picker label{color:#294235}
html[data-theme="light"] .template-picker select{background:#f8faf5;color:#294235;border-color:#bfcebf}
html[data-theme="light"] .workspace-button{color:#294235;border:1px solid #bfcebf}
html[data-theme="light"] .workspace-button:hover:enabled{background:#eef4ed}
html[data-theme="light"] .code-pane{border-right:1px solid #bfcebf}
html[data-theme="light"] .pane-title{background:#eef4ed;border-bottom:1px solid #bfcebf;color:#294235}
html[data-theme="light"] .pane-title>span:last-child:not(:first-child){color:#294235}
html[data-theme="light"] .language-label{color:#294235}
html[data-theme="light"] #editorLoading{color:#294235}
html[data-theme="light"] .editor-foot{border-top:1px solid #bfcebf;color:#294235}
html[data-theme="light"] .input-pane{border-bottom:1px solid #bfcebf}
html[data-theme="light"] .input-pane textarea{background:#f8faf5;color:#294235}
html[data-theme="light"] .input-pane textarea::placeholder{color:#294235}
html[data-theme="light"] .output-tabs{border-bottom:1px solid #bfcebf}
html[data-theme="light"] .output-tabs button{color:#294235}
html[data-theme="light"] .output-content{background:#f8faf5;color:#294235}
html[data-theme="light"] .output-content:empty::before{color:#294235}
html[data-theme="light"] .execution-info{color:#294235;border-top:1px solid #bfcebf}
html[data-theme="light"] .workspace-footer{color:#294235;background:#eef4ed;border-top:1px solid #bfcebf}
html[data-theme="light"] .editor-notice{color:#52695b}
@media(max-width:760px){html[data-theme="light"] .code-pane{border-bottom:1px solid #bfcebf}
}
html[data-theme="light"] .learning-page em,html[data-theme="light"] .learning-page .logo span{color:#527327}
html[data-theme="light"] .learning-page .secondary,html[data-theme="light"] .learning-page .small{background:#f8faf5}
html[data-theme="light"] .learning-page .hero-art{}
html[data-theme="light"] .learning-page .progress>div{background:#eef4ed}
html[data-theme="light"] .curriculum-actions button:hover{background:#eef4ed}
html[data-theme="light"] .curriculum-search input{background:#f8faf5;border-color:#bfcebf}
html[data-theme="light"] .curriculum-search input::placeholder{color:#294235}
html[data-theme="light"] .curriculum-explorer{background:#f8faf5}
html[data-theme="light"] .folder-header{color:#294235}
html[data-theme="light"] .folder-header:hover{background:#eef4ed}
html[data-theme="light"] .folder-count{color:#294235}
html[data-theme="light"] .folder-contents{border-left:1px solid #bfcebf}
html[data-theme="light"] .curriculum-lesson{color:#294235}
html[data-theme="light"] .curriculum-lesson:hover{background:#eef4ed;color:#294235}
html[data-theme="light"] .curriculum-lesson.selected{background:#eef4ed;color:#294235}
html[data-theme="light"] .lesson-number{color:#294235}
html[data-theme="light"] .lesson-file{color:#294235}
html[data-theme="light"] .lesson-duration{color:#294235}
html[data-theme="light"] .lesson-completion{color:#294235}
html[data-theme="light"] .completed .lesson-completion{color:#294235}
html[data-theme="light"] .folder-empty{color:#294235}
html[data-theme="light"] .learning-page .callout{background:#eef4ed}
html[data-theme="light"] .learning-page .answer{background:#f8faf5;border-color:#bfcebf}
html[data-theme="light"] .learning-page .answer.correct{background:#eef4ed;color:#294235}
html[data-theme="light"] .folder-guide{color:#294235}
html[data-theme="light"] .folder-guide:hover,html[data-theme="light"] .folder-guide[aria-pressed=true]{color:#527327;background:#eef4ed}
html[data-theme="light"] .labs-trigger:hover,html[data-theme="light"] .labs-trigger.active{color:#52695b}
html[data-theme="light"] .labs-popover{background:#f8faf5;border:1px solid #bfcebf;}
html[data-theme="light"] nav .labs-popover a{color:#294235!important}
html[data-theme="light"] nav .labs-popover a:hover,html[data-theme="light"] nav .labs-popover a:focus-visible{background:#eef4ed}
html[data-theme="light"] nav .labs-popover a[aria-current]{background:#eef4ed;color:#527327!important}
html[data-theme="light"] .maze-page .labs-trigger.active,html[data-theme="light"] .sort-page .labs-trigger.active{color:#527327}
html[data-theme="light"] .site-footer-links a:hover{color:#52695b}
html[data-theme="light"] .maze-page .site-footer-links a:hover{color:#527327}
html[data-theme="light"] .about-content p,html[data-theme="light"] .about-content li{color:#294235}
html[data-theme="light"] .about-content strong{color:#294235}
html[data-theme="light"] .about-tagline strong{color:#527327}
html[data-theme="light"] .about-content section{border-top:1px solid #bfcebf}
html[data-theme="light"] .about-content h2{color:#294235}
html[data-theme="light"] .about-content h3{color:#527327}
html[data-theme="light"] .about-content li::marker{color:#294235}
html[data-theme="light"] .about-content .about-motto{background:#eef4ed}
html[data-theme="light"] .about-motto strong{color:#527327}

html[data-theme] .primary,html[data-theme] .run-maze,html[data-theme] .run-button,html[data-theme] .tree-tabs [aria-selected=true]{background:#d5f577;color:#17291e}
html[data-theme="light"] .tree-surface{background:radial-gradient(ellipse at 50% 0,#f2f7ed,#e6eee3 75%)}
html[data-theme="light"] .sort-canvas{background:linear-gradient(#f5f8f1,#eaf0e6)}
html[data-theme="light"] .tree-node .node-note{fill:#345442}
html[data-theme="light"] .artnodes circle{fill:#294137}
header{padding-right:90px!important}
.site-settings{position:fixed;top:16px;right:16px;z-index:1000;color:var(--ink)}
.settings-button{display:grid;place-items:center;width:40px;height:40px;border:1px solid var(--line);border-radius:10px;background:var(--paper);color:var(--ink);}
.settings-button:hover{border-color:#83a455}
.settings-button svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linejoin:round}
.settings-panel{position:absolute;top:48px;right:0;width:240px;padding:20px;border:1px solid var(--line);border-radius:12px;background:var(--paper);}
.settings-panel[hidden]{display:none!important}
.settings-panel h2{font-size:18px;letter-spacing:-.5px;margin:0 0 20px}
.site-settings .theme-setting{display:flex;align-items:center;justify-content:space-between;gap:20px;font-size:14px;cursor:pointer}
html[data-theme] .site-settings .theme-setting input{width:38px;height:22px;margin:0;accent-color:#739449;cursor:pointer}
.site-settings :focus-visible{outline:2px solid #83a455;outline-offset:3px}
@media(max-width:600px){.site-settings{top:12px;right:12px}header{padding-right:72px!important}}

html[data-theme="light"] .artnodes .lime{fill:#d5f577;stroke:#d5f577}
html[data-theme] .site-settings .theme-setting input{appearance:none;border:1px solid #82957e;border-radius:14px;background:radial-gradient(circle at 10px 50%,#fff 0 7px,transparent 8px),#a6b49e;width:40px;height:22px;padding:0}
html[data-theme] .site-settings .theme-setting input:checked{background:radial-gradient(circle at 28px 50%,#fff 0 7px,transparent 8px),#527327}
html[data-theme="light"] .tree-code-key{color:#6b40a5}
html[data-theme="light"] .tree-code-string{color:#387226}
html[data-theme="light"] .tree-code-number{color:#946b12}
html[data-theme="light"] .error-output,html[data-theme="light"] #runStatus[data-state=error]{color:#9d2920}
html[data-theme="light"] .answer.correct{background:#e0efd4;color:#294235}
html[data-theme="light"] .answer.wrong{background:#fae3df;color:#7f2d24}
html[data-theme="light"] :focus-visible{outline-color:#527327!important}

/* Keep the homepage start action legible on its lime background in either theme. */
.learning-page #start,.learning-page #start span{color:#000}

.site-settings .code-size-setting{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:20px;font-size:14px}
.site-settings .code-size-control{display:flex;align-items:center;gap:5px;color:var(--muted);font-size:12px}
html[data-theme] .site-settings #codeTextSize{width:64px;height:34px;margin:0;padding:5px 6px;border:1px solid var(--line);border-radius:6px;background:var(--paper);color:var(--ink);font-size:14px;font-family:inherit}

/* Keep disabled primary labels readable without changing control dimensions. */
html[data-theme] :is(.primary,.run-maze,.run-button):disabled{opacity:1;background:#a8bc79;color:#17291e;cursor:not-allowed}
/* Offset rings contrast against the surrounding page in either theme. */
html[data-theme="dark"] :focus-visible{outline:3px solid #d5f577!important;outline-offset:3px}
html[data-theme="light"] :focus-visible{outline:3px solid #527327!important;outline-offset:3px}
html[data-theme="dark"] .compare-switch input:focus-visible+.switch-track{outline:3px solid #d5f577;outline-offset:3px}

html[data-theme="dark"] :is(#graph [data-vertex],#treeCanvas .tree-node):focus-visible>circle:first-child{stroke:#d5f577;stroke-width:4;vector-effect:non-scaling-stroke}
html[data-theme="light"] :is(#graph [data-vertex],#treeCanvas .tree-node):focus-visible>circle:first-child{stroke:#20382d;stroke-width:4;vector-effect:non-scaling-stroke}
.tree-keyboard-help{padding:12px 16px;margin:0;border-bottom:1px solid var(--line);font-size:12px;line-height:1.6}

/* Competition content must use a dark surface with the dark text palette. */
html[data-theme="dark"] #taskDetail{background:#14261f;color:#e3ede7;border-color:#34483d}
html[data-theme="dark"] .competition-layout :is(input,select){background:#14261f;color:#e3ede7;border-color:#3d5548;color-scheme:dark}
html[data-theme="dark"] .competition-layout input::placeholder{color:#94aaa0;opacity:1}

/* Browser-storage controls use the existing Settings panel. */
.site-settings .settings-panel{width:min(360px,calc(100vw - 32px));max-height:calc(100dvh - 90px);overflow-y:auto;box-sizing:border-box}.storage-setting{border-top:1px solid var(--line);margin-top:20px;padding-top:20px}.site-settings .storage-setting .theme-setting{gap:14px;align-items:flex-start}.storage-setting .theme-setting>span{max-width:245px;line-height:1.5}.storage-setting p{font-size:12px;line-height:1.6;color:var(--muted);margin:12px 0}.site-settings .storage-setting input{flex-shrink:0;margin-top:2px!important}.delete-browser-data{display:block;max-width:100%;padding:9px 11px;border:1px solid var(--line);border-radius:6px;background:var(--paper);color:var(--ink);font:inherit;font-size:12px;cursor:pointer}.site-settings :focus-visible{outline:3px solid var(--lime);outline-offset:3px}.storage-setting #browserStorageStatus{color:var(--ink)}.storage-setting #browserStorageStatus:empty{display:none}

.site-settings .competition-sort-setting{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:20px;font-size:14px}.competition-sort-setting select{max-width:135px;padding:7px;border:1px solid var(--line);border-radius:6px;background:var(--paper);color:var(--ink);font:inherit}
