/* PhotonSharp palettes: mode and palette are independent browser preferences. */
html[data-palette=prism][data-theme=light]{color-scheme:light;--theme-bg:#f7f8f9;--theme-panel:#ffffff;--theme-text:#16181c;--theme-muted:#5b6069;--theme-line:#cdd1d7;--theme-accent:#15171b;--theme-accent-text:#ffffff;--theme-tint:#e9ebee}
html[data-palette=prism][data-theme=dark]{color-scheme:dark;--theme-bg:#0a0b0e;--theme-panel:#191b20;--theme-text:#f7f7f8;--theme-muted:#a9afb9;--theme-line:#3b3f47;--theme-accent:#f4f5f6;--theme-accent-text:#121317;--theme-tint:#292b31}
html:is([data-palette=prism],[data-palette=custom]){--bg:var(--theme-bg);--panel:var(--theme-panel);--text:var(--theme-text);--muted:var(--theme-muted);--line:var(--theme-line);--mint:var(--theme-accent)}
html:is([data-palette=prism],[data-palette=custom]) body{background:var(--theme-bg);color:var(--theme-text)}
html:is([data-palette=prism],[data-palette=custom]) :is(.shell>header,.activity-bar,.explorer,.dock-tabs,.project-heading,.source-documents,.editor-footer,.diagnostics,.component-guide,#inspector,.info-card,.result-card,.evaluation-table caption,.evaluation-table thead){background:var(--theme-panel);color:var(--theme-text);border-color:var(--theme-line)}
html:is([data-palette=prism],[data-palette=custom]) :is(.code-wrap,.editor-card,#graph-wrap,.circuit-stage,#circuit-properties,.document-tabs [role=tab],.marketplace-dialog,.project-dialog,.app-search-dialog,.search-dialog,.mcp-config){background-color:var(--theme-panel);color:var(--theme-text);border-color:var(--theme-line)}
html:is([data-palette=prism],[data-palette=custom]) :is(.shell button,.project-home button,.project-dialog button,.marketplace-dialog button){border-color:var(--theme-line);color:var(--theme-text)}
html:is([data-palette=prism],[data-palette=custom]) :is(.shell .primary,.project-home .primary,.project-dialog .primary,.marketplace-dialog .primary,#circuit-run,#run){background:var(--theme-accent)!important;border-color:var(--theme-accent)!important;color:var(--theme-accent-text)!important}
html:is([data-palette=prism],[data-palette=custom]) :is(.activity-bar button.active,.file-row.active,.dock-tabs button[aria-selected=true],.document-tabs [role=tab][aria-selected=true],.layer-row.selected){background:var(--theme-tint)!important;color:var(--theme-text)!important;border-top-color:var(--theme-accent)!important}
html:is([data-palette=prism],[data-palette=custom]) :is(.file-row.active,.layer-row.selected){box-shadow:inset 2px 0 var(--theme-accent)}
html:is([data-palette=prism],[data-palette=custom]) :is(.file-icon,.palette-element .symbol,.home-eyebrow,.marketplace-context,.marketplace-icon,.eyebrow,.simulation-reading strong,.layout-summary,.source-link-status,.project-message){color:var(--theme-text)}
html:is([data-palette=prism],[data-palette=custom]) :is(.activity-bar button,.file-row,.dock-tabs button,.pipeline-label,.pipeline-stage,.pipeline-stage.stale,.pipeline-stage.running,.hover-hint,.section-label,.flow-description,.layout-legend,.evaluation-subtitle,.evaluation-footnote){color:var(--theme-muted)}
/* Syntax editors paint their tokens underneath a transparent textarea. */
html:is([data-palette=prism],[data-palette=custom]) :is(input,select,textarea:not(.syntax-editor),.source-documents select,#app-search,.home-recent-heading input,.marketplace-toolbar input:not([hidden])){background-color:var(--theme-panel);color:var(--theme-text);border-color:var(--theme-line)}
html:is([data-palette=prism],[data-palette=custom]) :is(.home-project-card,.home-project-art,.extension-card,.package-card,.app-search-results button,.chip-layer-card){background:var(--theme-panel);color:var(--theme-text);border-color:var(--theme-line)}
html:is([data-palette=prism],[data-palette=custom]) .project-home{background:var(--theme-bg);color:var(--theme-text)}
html:is([data-palette=prism],[data-palette=custom]) :is(.home-header,.home-project-art,.home-project-card,.home-profile){border-color:var(--theme-line)}
html:is([data-palette=prism],[data-palette=custom]) :is(.home-header strong,.home-project-card>strong,.home-recent-heading h2){color:var(--theme-text)}
html:is([data-palette=prism],[data-palette=custom]) :is(.home-subtitle,.home-project-card>small,.home-local-note,.home-profile,.project-muted,.extension-publisher){color:var(--theme-muted)}
html:is([data-palette=prism],[data-palette=custom]) .home-project-art{background:radial-gradient(var(--theme-line) .8px,transparent .8px) 0 0/14px 14px,var(--theme-panel)}
html:is([data-palette=prism],[data-palette=custom]) .home-project-art span{background:var(--theme-tint);color:var(--theme-text);border-color:var(--theme-line)}
html:is([data-palette=prism],[data-palette=custom]) .home-project-art i{background:var(--theme-accent)}
html:is([data-palette=prism],[data-palette=custom]) .home-project-card:hover{border-color:var(--theme-accent);background:var(--theme-tint)}
html:is([data-palette=prism],[data-palette=custom]) .extension-badge{background:var(--theme-tint);color:var(--theme-text)}
html:is([data-palette=prism],[data-palette=custom]) .evaluation-power-track span{background:var(--theme-accent)}
html:is([data-palette=prism],[data-palette=custom]) .evaluation-logic{background:var(--theme-tint);color:var(--theme-text);border-color:var(--theme-line)}
html:is([data-palette=prism],[data-palette=custom]) .evaluation-logic-card{background:var(--theme-panel);color:var(--theme-text);border-color:var(--theme-line)}
html:is([data-palette=prism],[data-palette=custom]) :is(#graph-wrap,.circuit-stage){background-color:var(--theme-panel);background-image:radial-gradient(var(--theme-line) .7px,transparent .7px)}
html:is([data-palette=prism],[data-palette=custom]) :is(#line-numbers,#circuit-source-lines){background:var(--theme-tint);color:var(--theme-muted)}
html:is([data-palette=prism],[data-palette=custom]) footer.workspace-status{background:var(--theme-accent);color:var(--theme-accent-text)}
html:is([data-palette=prism],[data-palette=custom]) footer.workspace-status #connection{color:inherit}
html:is([data-palette=prism],[data-palette=custom]) :is(button,input,select,textarea,a):focus-visible{outline-color:var(--theme-accent)}
html[data-palette=prism] .shell>header{border-top:2px solid transparent;border-image:linear-gradient(90deg,#ec3836,#f89d25,#ffdb34,#22bb6c,#30b4ee,#7852e5) 1}
html[data-palette=prism] .home-header{border-top:3px solid transparent;border-image:linear-gradient(90deg,#ec3836,#f89d25,#ffdb34,#22bb6c,#30b4ee,#7852e5) 1}
html[data-palette=prism] .photonsharp-logo{background:transparent;object-fit:contain}
html:is([data-palette=prism],[data-palette=custom]) .preview-nav .selected{background:var(--theme-tint);color:var(--theme-text);border-top-color:var(--theme-accent)}

/* The public page follows the prism's black/white body and refracted color. */
html:is([data-palette=prism],[data-palette=custom]) .photon-landing{background:var(--theme-bg);color:var(--theme-text)}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing .landing-nav{background:var(--theme-panel)!important;color:var(--theme-text)!important;border-color:var(--theme-line)!important}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing .landing-nav nav{background:transparent!important;color:var(--theme-muted)!important;border-color:transparent!important}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing .landing-brand{color:var(--theme-text)!important}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing .landing-brand small{color:var(--theme-muted)}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing .landing-sign-in{color:var(--theme-text)!important}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing :is(.landing-nav-cta,.landing-button-primary){background:var(--theme-accent)!important;border-color:var(--theme-accent)!important;color:var(--theme-accent-text)!important;box-shadow:0 10px 30px #0002}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing :is(.landing-nav-cta,.landing-button-primary):hover{background:var(--theme-text)!important;color:var(--theme-bg)!important}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing .landing-button-secondary{color:var(--theme-text);border-color:var(--theme-line);background:var(--theme-panel)}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing .landing-hero{background:radial-gradient(ellipse 48% 30% at 28% 76%,#ed404622,transparent 75%),radial-gradient(ellipse 45% 40% at 73% 44%,#428de327,transparent 76%),radial-gradient(ellipse 52% 35% at 50% 100%,#42ba6022,transparent 76%),var(--theme-bg)}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing .landing-hero:after{background:conic-gradient(from 225deg,#ed4142,#ff9f30,#f7e348,#45c575,#409fe7,#8959ed,#ed4142);opacity:.27;filter:blur(110px)}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing .landing-hero h1{color:var(--theme-text);text-shadow:none}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing .landing-hero h1 em{background:linear-gradient(90deg,#e83f39,#f89429,#e6bd23,#28a95c,#298bc9,#8052d8);background-clip:text;-webkit-background-clip:text;color:transparent}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing :is(.landing-kicker,.landing-label){color:var(--theme-text)!important}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing .landing-kicker span{background:#3ba3d8;box-shadow:0 0 12px #3ba3d8}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing :is(.landing-hero-subtitle,.landing-section h2,.landing-steps h3,.landing-feature-grid h3,.landing-plan-strip span){color:var(--theme-text)!important}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing :is(.landing-hero-detail,.landing-free-note,.landing-section-intro>p:last-child,.landing-plans-heading p:last-child,.landing-steps p,.landing-feature-grid p,.landing-status>p,.landing-plan-strip small,.landing-footer p,.landing-device-caption){color:var(--theme-muted)!important}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing :is(.landing-workflow,.landing-features,.landing-plans,.landing-status,.landing-footer){background:var(--theme-bg);color:var(--theme-text);border-color:var(--theme-line)}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing :is(.landing-steps article,.landing-feature-grid article,.landing-plan-strip>div){background:var(--theme-panel);color:var(--theme-text);border-color:var(--theme-line)}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing .landing-feature-grid article:hover{border-color:var(--theme-accent);background:var(--theme-tint)}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing .landing-step-symbol{background:var(--theme-tint);color:var(--theme-text);border-color:var(--theme-line);box-shadow:0 0 20px #6c8be21d}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing :is(.landing-steps article>span,.landing-feature-grid b,.landing-plan-strip strong,.landing-text-button,.landing-footer a){color:var(--theme-text)!important}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing :is(.landing-ticker,.landing-footer){background:var(--theme-panel);color:var(--theme-muted);border-color:var(--theme-line)}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing .landing-ticker i{background:#32b877}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing .landing-orbit{border-color:#6fa7d15c;box-shadow:0 0 30px #ef58532b,inset 0 0 25px #549cce25}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing .landing-footer>div{color:var(--theme-text)}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing .preview-mark{display:inline-flex;align-items:center}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing .preview-mark img{width:3em;height:3em;object-fit:contain;background:transparent}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing .landing-workflow{background:radial-gradient(circle at 92% 8%,#459ae712,transparent 30%),radial-gradient(circle at 4% 78%,#df52600e,transparent 30%),var(--theme-bg)}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing .landing-showcase{background:var(--theme-panel);color:var(--theme-text);border-color:var(--theme-line);box-shadow:0 18px 55px #10141d0e}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing .landing-showcase-copy h3{color:var(--theme-text)}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing :is(.landing-showcase-copy p,.landing-showcase-visual figcaption){color:var(--theme-muted)}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing :is(.landing-showcase-number,.landing-showcase-copy a){color:var(--theme-text)}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing .landing-showcase-visual{background:var(--theme-tint);border-color:var(--theme-line);box-shadow:0 20px 44px #10141d20}

#themes-button{display:inline-flex;align-items:center;gap:5px;height:22px;padding:1px 7px;border:1px solid currentColor;border-radius:4px;background:transparent;color:inherit;font-size:10px;white-space:nowrap}
#themes-button svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
#themes-button:hover{background:#ffffff28}
footer.workspace-status #theme-toggle{background:transparent;color:inherit;border:1px solid currentColor}
.themes-dialog{width:min(680px,calc(100vw - 28px));max-height:min(850px,90vh);overflow:auto;border:1px solid var(--line);border-radius:16px;background:var(--panel);color:var(--text);padding:28px;box-shadow:0 24px 90px #0008}
.themes-dialog::backdrop{background:#0009;backdrop-filter:blur(4px)}
.themes-heading{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;border-bottom:1px solid var(--line);padding-bottom:20px}
.themes-heading h2{font-size:28px;font-weight:730;margin:0 0 6px}
.themes-heading p:not(.themes-eyebrow){font-size:13px;color:var(--muted);margin:0}
.themes-eyebrow{font:700 10px var(--mono);letter-spacing:.15em;color:var(--muted);margin:0 0 8px}
.themes-close{border:1px solid var(--line);border-radius:7px;background:transparent;color:var(--text);font-size:24px;line-height:1;width:34px;height:34px;cursor:pointer}
.themes-list,.themes-custom-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:20px 0}
.themes-card{display:flex;flex-direction:column;align-items:flex-start;width:100%;min-height:124px;padding:15px;border:1px solid var(--line);border-radius:11px;background:var(--bg);color:var(--text);text-align:left;cursor:pointer}
.themes-card[aria-pressed=true]{border:2px solid var(--mint);padding:14px;box-shadow:0 0 0 2px var(--line)}
.themes-card-top{display:flex;justify-content:space-between;align-items:center;width:100%;gap:8px;margin-bottom:18px}
.themes-card strong{font-size:15px}.themes-card small{font-size:11px;color:var(--muted);margin-top:4px;line-height:1.4}
.themes-check{font-size:11px;font-weight:650;color:var(--muted)}
.themes-swatches{display:inline-flex;align-items:center;gap:4px}.themes-swatches i{display:inline-block;width:21px;height:21px;border:1px solid #8888;border-radius:50%}.themes-swatches .themes-rainbow{background:conic-gradient(#ed4545,#f99a2c,#ead443,#30bb6b,#32a3dd,#8856de,#ed4545)!important}
.themes-custom-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:22px}.themes-custom-heading h3,.themes-form h3{font-size:16px;margin:0}.themes-custom-heading button,.themes-form button{padding:9px 12px;border:1px solid var(--line);border-radius:7px;background:var(--bg);color:var(--text);cursor:pointer}
.themes-custom-item{min-width:0}.themes-custom-actions{display:flex;gap:8px;margin-top:6px}.themes-custom-actions button{border:0;background:transparent;color:var(--muted);font-size:11px;cursor:pointer;padding:5px}
.themes-empty{grid-column:1/-1;color:var(--muted);font-size:12px}.themes-form{padding:20px;margin-top:16px;border:1px solid var(--line);border-radius:11px;background:var(--bg)}.themes-form>label{display:block;font-size:12px;font-weight:600;margin:18px 0}.themes-form>label input{display:block;width:100%;margin-top:7px;padding:9px;background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:6px}
.themes-color-grids{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.themes-color-group{min-width:0;display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0;padding:13px;border:1px solid var(--line);border-radius:8px}.themes-color-group legend{padding:0 5px;font-size:12px;font-weight:700}.themes-color-group label{display:flex;align-items:center;justify-content:space-between;gap:5px;font-size:11px}.themes-color-group input{width:38px;height:30px;padding:2px;border:1px solid var(--line);border-radius:5px;background:var(--panel);cursor:pointer}.themes-form-error{color:#c33836;font-size:12px}.themes-form-actions{display:flex;justify-content:flex-end;gap:8px}.themes-form-actions .themes-save{background:var(--mint);color:var(--theme-accent-text,#121212);border-color:var(--mint)}.themes-footnote{font-size:11px;color:var(--muted);margin:16px 0 0}
@media(max-width:590px){.themes-dialog{padding:18px}.themes-list,.themes-custom-list,.themes-color-grids{grid-template-columns:1fr}.themes-card{min-height:110px}.themes-color-group{grid-template-columns:repeat(2,minmax(0,1fr))}footer.workspace-status{gap:7px}}
html:is([data-palette=prism],[data-palette=custom]) .document-tabs .workspace-tab-group:has(>[role=tab][aria-selected=true]){background:var(--theme-tint);border-top-color:var(--theme-accent)}
html:is([data-palette=prism],[data-palette=custom]) .workspace-tab-group:has([aria-selected=true]) .workspace-tab-close{background:var(--theme-tint);color:var(--theme-text);border-top-color:var(--theme-accent)}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing .preview-sidebar .preview-file{background:#e8eaed;color:#21252a;border-left-color:#1e2329}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing .preview-stagebar b{background:#20242a;color:#fff}
html:is([data-palette=prism],[data-palette=custom]) .photon-landing .preview-nav .selected{background:#e8eaed;color:#21252a;border-top-color:#1e2329}
/* Yellow Electric retains the original dark look and gets a true light homepage. */
html[data-palette=yellow-electric][data-theme=light] .photon-landing{background:#fffdf7;color:#262217}
html[data-palette=yellow-electric][data-theme=light] .photon-landing .landing-nav{background:#fffdf7!important;color:#262217!important;border-color:#ded4b3!important}
html[data-palette=yellow-electric][data-theme=light] .photon-landing .landing-nav nav{background:transparent!important;color:#5d5544!important}
html[data-palette=yellow-electric][data-theme=light] .photon-landing .landing-brand{color:#262217!important}
html[data-palette=yellow-electric][data-theme=light] .photon-landing .landing-sign-in{color:#353026!important}
html[data-palette=yellow-electric][data-theme=light] .photon-landing .landing-hero{background:radial-gradient(ellipse at 50% 80%,#ffd78363,transparent 68%),#fffdf7}
html[data-palette=yellow-electric][data-theme=light] .photon-landing .landing-hero h1{color:#1f1d18;text-shadow:none}
html[data-palette=yellow-electric][data-theme=light] .photon-landing :is(.landing-hero-subtitle,.landing-section h2,.landing-steps h3,.landing-feature-grid h3,.landing-plan-strip span){color:#262217!important}
html[data-palette=yellow-electric][data-theme=light] .photon-landing :is(.landing-hero-detail,.landing-free-note,.landing-section-intro>p:last-child,.landing-plans-heading p:last-child,.landing-steps p,.landing-feature-grid p,.landing-status>p,.landing-plan-strip small,.landing-footer p){color:#655e50!important}
html[data-palette=yellow-electric][data-theme=light] .photon-landing :is(.landing-workflow,.landing-features,.landing-plans,.landing-status,.landing-footer){background:#fffaf0;color:#262217;border-color:#ded4b3}
html[data-palette=yellow-electric][data-theme=light] .photon-landing :is(.landing-steps article,.landing-feature-grid article,.landing-plan-strip>div,.landing-ticker){background:#fffdf7;color:#262217;border-color:#ded4b3}
html[data-palette=yellow-electric][data-theme=light] .photon-landing .landing-step-symbol{background:#fff0bf;color:#624700;border-color:#d6b65a}
html[data-palette=yellow-electric][data-theme=light] .photon-landing :is(.landing-steps article>span,.landing-feature-grid b,.landing-plan-strip strong,.landing-footer a){color:#745400!important}
html[data-palette=yellow-electric][data-theme=light] .photon-landing .landing-footer>div{color:#262217}
/* Keep the supplied transparent mark readable, with clear space before the name. */
html .shell>header>.photonsharp-logo{width:68px;height:68px;margin:-14px 6px -14px -7px;background:transparent;object-fit:contain}
html .home-brand>.photonsharp-logo{width:80px;height:80px;margin:-8px 8px -8px -8px;background:transparent;object-fit:contain}
html .photon-landing .landing-brand img{width:80px;height:80px;margin:-9px 8px -9px -8px;background:transparent;object-fit:contain}
html .photon-landing .landing-footer img{width:60px;height:60px;margin:-10px 8px -10px -6px;background:transparent;object-fit:contain}
html[data-theme=dark] :is(.photonsharp-logo,.landing-brand img,.landing-footer img,.preview-mark img){filter:drop-shadow(0 0 1px #fff) drop-shadow(0 0 3px #ffffff70)}
@media(max-width:690px){html .photon-landing .landing-brand img{width:60px;height:60px;margin:-6px 8px -6px -5px}html .home-brand>.photonsharp-logo{width:66px;height:66px;margin:-7px 7px -7px -6px}}
@media(max-width:520px){html .shell>header>.photonsharp-logo{width:48px;height:48px;margin:-6px 8px -6px -3px}html .photon-landing .landing-brand img{width:50px;height:50px;margin:-5px 8px -5px -4px}}
