/* PTP universal themes: colors apply equally to navigation, login, tables and Developer Console. */
:root,[data-theme=forest]{--bg:#edf5f0;--paper:#ffffff;--top:#fafffc;--ink:#18392f;--muted:#4d6a60;--accent:#11765a;--on-accent:#ffffff;--sidebar-bg:#103d35;--sidebar-ink:#e8faf2;--sidebar-soft:#b0d2c4;--sidebar-active:#226e59;--border:#d4e4da;--line:#d4e4da;--surface-hover:#f3faf5;--subtle:#e4f3e9;--accent-ink:#125b44;--input-bg:#ffffff;--chart-milk:#c77a22;--login-tint:rgba(11,46,35,.86);color-scheme:light;}
[data-theme=ocean]{--bg:#eaf4fc;--paper:#ffffff;--top:#f5faff;--ink:#173c5f;--muted:#4f6f8a;--accent:#176aab;--on-accent:#ffffff;--sidebar-bg:#123c69;--sidebar-ink:#e7f4ff;--sidebar-soft:#adcde5;--sidebar-active:#215e97;--border:#cbdde9;--line:#cbdde9;--surface-hover:#edf7ff;--subtle:#dfeffa;--accent-ink:#165987;--input-bg:#fbfdff;--chart-milk:#e89130;--login-tint:rgba(8,41,77,.85);color-scheme:light;}
[data-theme=sandstone]{--bg:#f5efe3;--paper:#fffaf1;--top:#fff8eb;--ink:#443b31;--muted:#746653;--accent:#956226;--on-accent:#ffffff;--sidebar-bg:#493a2f;--sidebar-ink:#fff1d8;--sidebar-soft:#e5c8a5;--sidebar-active:#795839;--border:#e4d7c4;--line:#e4d7c4;--surface-hover:#fcf2df;--subtle:#f3e7d2;--accent-ink:#815622;--input-bg:#fffcf5;--chart-milk:#c6823b;--login-tint:rgba(66,47,28,.85);color-scheme:light;}
[data-theme=midnight]{--bg:#0d1725;--paper:#1c2a3a;--top:#182639;--ink:#f1f6fc;--muted:#b6cadc;--accent:#77c2f8;--on-accent:#112638;--sidebar-bg:#081727;--sidebar-ink:#f0f7ff;--sidebar-soft:#a9c6df;--sidebar-active:#244868;--border:#405367;--line:#405367;--surface-hover:#283b4f;--subtle:#294258;--accent-ink:#a2d7fc;--input-bg:#182739;--chart-milk:#f3af5a;--login-tint:rgba(5,18,33,.89);color-scheme:dark;}
[data-theme=plum]{--bg:#17101e;--paper:#30243b;--top:#2c2037;--ink:#fcf3ff;--muted:#d2c1dd;--accent:#e1b0ef;--on-accent:#32143d;--sidebar-bg:#271930;--sidebar-ink:#fff1ff;--sidebar-soft:#d6badc;--sidebar-active:#654071;--border:#634f70;--line:#634f70;--surface-hover:#43304e;--subtle:#493456;--accent-ink:#ecc3fc;--input-bg:#2d2038;--chart-milk:#eeae67;--login-tint:rgba(31,13,39,.89);color-scheme:dark;}

html[data-theme] body{background:var(--bg)!important;color:var(--ink)}
html[data-theme] :is(.topbar,.panel-title,.data-head,.pagination,.tabs){background:var(--top)!important;color:var(--ink);border-color:var(--border)}
html[data-theme] :is(.panel,.metric,.card,.stat,.mini-card,.modal,.login-card,.skeleton-table){background:var(--paper)!important;color:var(--ink);border-color:var(--border)}
html[data-theme] :is(.sidebar,.top){background:var(--sidebar-bg)!important;color:var(--sidebar-ink)}
html[data-theme] :is(.sidebar .brand,.top .brand,.sidebar .nav,.sidebar .nav *,.top a,.top button){color:var(--sidebar-ink)}
html[data-theme] :is(.sidebar .menu-group,.sidebar .brand small,.sidebar-foot small){color:var(--sidebar-soft)}
html[data-theme] .sidebar .nav.active{background:var(--sidebar-active);color:var(--sidebar-ink)}
html[data-theme] :is(.breadcrumbs,.muted,.hint,.help,.metric .tag,.metric .sub,.task small,.securefoot,.filter-control,.label-check,.heading p,.panel-title span,.data-head small){color:var(--muted)!important}
html[data-theme] :is(.breadcrumbs b,.heading h1,.metric .num,.account b,.panel-title h2,.detailgrid strong,h1,h2,h3){color:var(--ink)}
html[data-theme] :is(.btn,.iconbutton,.select,.control,.field-search,.filter-control .select,input,select,textarea,.scope-clear){background:var(--input-bg);color:var(--ink);border-color:var(--border)}
html[data-theme] :is(.btn,.iconbutton,.select,.control,.field-search,.filter-control .select,input,select,textarea):focus-visible{outline:2px solid var(--accent);outline-offset:2px}
html[data-theme] :is(.btn,.iconbutton):not(:disabled):hover{background:var(--surface-hover);color:var(--ink)}
html[data-theme] .btn.primary,html[data-theme] .btn.dark{background:var(--accent)!important;color:var(--on-accent)!important;border-color:var(--accent)}
html[data-theme] .btn.danger{background:var(--subtle);color:var(--ink);border-color:var(--border)}
html[data-theme] :is(.status,.pill,.scope-strip,.scope-clear,.hint,.callout,.assigned-scope,.avatar,.metric .badgeicon,.task-icon){background:var(--subtle);color:var(--accent-ink);border-color:var(--border)}
html[data-theme] :is(.idtext,.eyebrow,.pill,.link){color:var(--accent-ink)}
html[data-theme] :is(.gridtable th,table th,.gridtable th:last-child){background:var(--top)!important;color:var(--muted);border-color:var(--border)}
html[data-theme] :is(.gridtable td,table td,.gridtable td:last-child){background:var(--paper)!important;color:var(--ink);border-color:var(--border)}
html[data-theme] :is(.gridtable tr:hover td,.gridtable tr:hover td:last-child){background:var(--surface-hover)!important}
html[data-theme] :is(.modal-content,.modal-footer,.modal-header){background:var(--paper);color:var(--ink);border-color:var(--border)}
html[data-theme] .login-form,html[data-theme] .preview-auth{background:var(--bg)}
html[data-theme] .login-art{background:linear-gradient(120deg,var(--login-tint),rgba(14,52,42,.34)),url('/static/buffalo-pasture.jpg') center/cover no-repeat;color:#fff}
html[data-theme] .login-art :is(h1,p){color:#fff}
html[data-theme] .login-chip{background:#0005;color:#fff;border-color:#fffa}
html[data-theme] .login-card{box-shadow:0 16px 50px #0002;border:1px solid var(--border);padding:30px;border-radius:20px}
html[data-theme] .login-card label,html[data-theme] .formgroup label{color:var(--muted)}
html[data-theme] :is(.chart-foot,.activity-month,.chart-number){color:var(--muted)}
html[data-theme] .svg-ai{fill:var(--accent)}html[data-theme] .svg-milk{fill:var(--chart-milk)}
html[data-theme] .barline .track{background:var(--subtle)}html[data-theme] .barline .fill{background:var(--accent)}
html[data-theme] .tabs button{background:transparent;color:var(--muted)}html[data-theme] .tabs button.active{background:var(--subtle);color:var(--accent-ink)}
html[data-theme] .top .muted{color:var(--sidebar-soft)!important}html[data-theme] .top a{color:var(--sidebar-ink)}
html[data-theme] .top button{background:transparent;color:var(--sidebar-ink);border-color:var(--sidebar-soft)}
html[data-theme] .login{background:radial-gradient(ellipse at 12% 9%,var(--sidebar-active),var(--sidebar-bg))}
html[data-theme] #notify span{background:var(--sidebar-bg);color:var(--sidebar-ink)}
html[data-theme] .theme-tile{background:var(--paper);color:var(--ink);border-color:var(--border)}
html[data-theme] .theme-tile.selected{border-color:var(--accent);box-shadow:0 0 0 3px var(--subtle)}
html[data-theme] .theme-swatch{background:var(--bg)}
html[data-theme] .login-form .demo-role{background:var(--subtle);color:var(--accent-ink);border:1px solid var(--border)}
html[data-theme] :is(.starting-screen,.load-error,.loader){background:var(--bg);color:var(--ink)}
html[data-theme] .skeleton-block,html[data-theme] .skeleton-line{background:var(--subtle)}
html[data-theme] .mark{background:var(--accent);color:var(--on-accent)}
html[data-theme] .login-error{color:var(--ink)}
html[data-theme] #globalLoader.active{background:var(--sidebar-bg);color:var(--sidebar-ink)}
html[data-theme=plum] :is(.btn,.select,.filter-control .select){border-radius:12px}
html[data-theme=ocean] :is(.panel,.metric,.card){border-radius:21px}
html[data-theme=sandstone] :is(.panel,.metric,.card,.btn){border-radius:7px}
html[data-density=compact] :is(.metric,.card,.panel-body,.stat){padding:12px!important}
html[data-density=compact] :is(.gridtable td,table td){padding-block:7px!important}
html[data-density=compact] .page{padding-top:15px}
html[data-corners=squared] :is(.metric,.panel,.card,.btn,.control,.select,.topbar,.modal,.login-card,.scope-strip,.stat,.dev-dialog-card){border-radius:4px!important}
.theme-preview[data-theme]{color:var(--ink);background:var(--bg);border:1px solid var(--border);border-radius:15px;overflow:hidden;margin-top:16px}
.theme-preview .preview-flag{color:var(--muted);background:var(--paper);padding:9px 13px;font-size:11px}
.theme-preview .preview-shell{display:grid;grid-template-columns:148px minmax(0,1fr);min-height:260px}
.theme-preview .preview-sidebar{padding:15px 10px;color:var(--sidebar-ink);background:var(--sidebar-bg)}
.theme-preview .preview-sidebar b{display:block;margin-bottom:18px;font-size:12px;color:var(--sidebar-ink)}
.theme-preview .preview-sidebar span{display:block;color:var(--sidebar-soft);font-size:11px;padding:8px}.theme-preview .preview-sidebar span.current{background:var(--sidebar-active);color:var(--sidebar-ink);border-radius:6px}
.theme-preview .preview-area{background:var(--bg);min-width:0}
.theme-preview .preview-topbar{background:var(--top);display:flex;gap:9px;padding:12px;font-size:10px;align-items:center;color:var(--ink)}
.theme-preview .preview-topbar strong{margin-right:auto}.theme-preview .preview-select{border:1px solid var(--border);background:var(--input-bg);color:var(--ink);padding:6px 9px;border-radius:6px}
.theme-preview .preview-body{padding:16px}.theme-preview .preview-body h3{font-size:19px;color:var(--ink)}
.theme-preview .preview-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.theme-preview .preview-stat{background:var(--paper);border:1px solid var(--border);border-radius:10px;padding:12px;color:var(--ink)}
.theme-preview .preview-stat small,.theme-preview .preview-stat em{display:block;color:var(--muted);font-size:10px}.theme-preview .preview-stat strong{font-size:23px;color:var(--ink)}
.theme-preview .preview-actions{display:flex;gap:8px;margin-top:12px}.theme-preview .preview-cta{padding:8px 11px;border-radius:7px;background:var(--accent);color:var(--on-accent);font-size:11px;font-weight:750}.theme-preview .preview-plain{padding:8px 11px;border:1px solid var(--border);border-radius:7px;color:var(--ink);background:var(--paper);font-size:11px}
.theme-preview .preview-login{display:grid;grid-template-columns:1fr 1fr;min-height:255px}
.theme-preview .preview-photo{background:linear-gradient(120deg,var(--login-tint),transparent),url('/static/buffalo-pasture.jpg') center/cover;color:#fff;display:flex;flex-direction:column;justify-content:center;padding:19px}
.theme-preview .preview-photo h3,.theme-preview .preview-photo small{color:#fff}
.theme-preview .preview-auth{padding:21px;display:flex;flex-direction:column;justify-content:center;gap:8px;background:var(--bg)}
.theme-preview .preview-auth h3{font-size:17px;color:var(--ink)}.theme-preview .preview-auth label{font-size:10px;color:var(--muted);margin:0}
.theme-preview .preview-field{background:var(--input-bg);border:1px solid var(--border);height:26px;border-radius:6px}
.theme-preview .preview-dev{min-height:235px;background:var(--bg);padding:16px}
.theme-preview .preview-devbar{background:var(--sidebar-bg);color:var(--sidebar-ink);padding:10px;border-radius:8px}
.theme-preview .preview-tabs{display:flex;gap:6px;padding:12px 0}.theme-preview .preview-tabs span{color:var(--accent-ink);background:var(--subtle);padding:6px;font-size:10px;border-radius:5px}
.theme-preview .preview-devcard{background:var(--paper);border:1px solid var(--border);padding:13px;color:var(--ink);border-radius:8px}
.theme-preview .preview-devcard h3{font-size:16px;color:var(--ink)}.theme-preview .preview-devcard p{font-size:11px;color:var(--muted)}
@media(max-width:680px){.theme-preview .preview-shell{grid-template-columns:85px 1fr}.theme-preview .preview-sidebar{font-size:10px;padding:9px 5px}.theme-preview .preview-body{padding:9px}.theme-preview .preview-stats{grid-template-columns:1fr}.theme-preview .preview-stat:nth-child(n+3){display:none}.theme-preview .preview-login{grid-template-columns:1fr}.theme-preview .preview-photo{min-height:110px}}

/* Hybrid Developer Console: no browser-native editing dialogs. */
#dev-dialog{position:relative;z-index:1500}
.ptp-dialog-layer{position:fixed;inset:0;z-index:1500;display:grid;place-items:center;padding:18px;background:rgba(7,17,23,.78);backdrop-filter:blur(7px)}
.ptp-dialog{background:var(--paper);color:var(--ink);border:1px solid var(--border);border-radius:18px;box-shadow:0 28px 95px rgba(0,0,0,.4);width:min(520px,100%);padding:25px;max-height:90vh;overflow:auto}
.ptp-dialog header{display:flex;align-items:center;gap:11px;border-bottom:1px solid var(--border);padding-bottom:15px}
.ptp-dialog header>div{flex:1}.ptp-dialog header h2{font-size:21px;color:var(--ink);margin:2px 0}.ptp-dialog header small{font-size:10px;color:var(--muted);letter-spacing:1px}
.ptp-dialog-mark{width:40px;height:40px;display:grid;place-items:center;font-size:21px;border-radius:10px;color:var(--accent-ink);background:var(--subtle)}
.ptp-dialog .ptp-x{background:var(--input-bg);border:1px solid var(--border);color:var(--ink);width:36px;height:36px;border-radius:9px;cursor:pointer;font-size:23px}
.ptp-dialog>p{color:var(--muted);font-size:13px;line-height:1.7;margin:17px 0}
.ptp-input{margin:13px 0}.ptp-input label{font-size:12px;display:block;margin:0 0 6px;color:var(--ink)}
.ptp-input input,.ptp-input select{display:block;width:100%;border:1px solid var(--border);background:var(--input-bg);color:var(--ink);padding:11px 12px;border-radius:9px}
.ptp-check{display:flex;align-items:center;gap:11px;border:1px solid var(--border);background:var(--subtle);padding:11px;border-radius:9px;color:var(--ink)}
.ptp-check input{width:19px;height:19px;accent-color:var(--accent)}
.ptp-dialog footer{border-top:1px solid var(--border);display:flex;gap:10px;justify-content:flex-end;margin-top:21px;padding-top:18px}
.ptp-dialog footer .btn{min-width:115px}
.ptp-dialog .btn.danger{border-color:var(--border);background:var(--subtle);color:var(--ink)}
.ptp-option-grid{grid-template-columns:repeat(auto-fit,minmax(320px,1fr))}
.ptp-option-card{min-width:0;margin:0}.ptp-option-row{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;border-top:1px solid var(--border);padding:11px 0}
.ptp-option-row>div:first-child{min-width:0;overflow-wrap:anywhere}.ptp-option-row b{color:var(--ink)}.ptp-option-row .hint{display:block;margin-top:4px}
.ptp-option-row button{font-size:11px;padding:7px 10px}
.ptp-designer-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:18px}
.ptp-designer-options label{color:var(--muted)}.ptp-designer-options select{margin-top:5px}
.ptp-preview-tabs{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;margin:22px 0 9px}
.ptp-preview-tabs>b{font-size:14px;color:var(--ink)}
.ptp-preview-tabs>div{display:flex;gap:6px;flex-wrap:wrap}
.ptp-preview-tabs button{border:1px solid var(--border);border-radius:8px;color:var(--ink);background:var(--paper);padding:8px 11px;font-size:11px;cursor:pointer}
.ptp-preview-tabs button.active{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.ptp-theme-note{background:var(--subtle);color:var(--accent-ink);border-radius:9px;padding:10px 13px;margin:12px 0;font-size:12px}
html[data-theme] .ptp-dialog .btn.primary{background:var(--accent);color:var(--on-accent)}
html[data-theme] .ptp-dialog input:focus-visible,html[data-theme] .ptp-dialog select:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media(max-width:650px){.ptp-designer-options,.ptp-option-grid{grid-template-columns:1fr}.ptp-dialog{padding:17px}.ptp-dialog footer .btn{flex:1}.ptp-option-row{flex-wrap:wrap}}
