/* PORTAL-1C1 · DUAL THEME ENGINE */
html{color-scheme:dark}
html[data-theme="light"]{
    color-scheme:light;
    --bg:#eee9e1;
    --surface:#fffdfa;
    --surface-2:#f6f1e9;
    --panel:#fffdfa;
    --panel-2:#f6f1e9;
    --line:rgba(62,42,35,.14);
    --line-hot:rgba(153,25,0,.24);
    --text:#211b19;
    --muted:#6d6870;
    --shadow:0 22px 58px rgba(62,40,29,.12);
}
.portal-theme-toggle{
    appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:8px;
    min-width:42px;height:38px;padding:0 11px;border:1px solid rgba(255,255,255,.12);
    border-radius:999px;background:rgba(255,255,255,.035);color:#f6f7f9;
    font:800 12px/1 Inter,ui-sans-serif,system-ui,sans-serif;cursor:pointer;
    transition:transform .18s ease,border-color .18s ease,background .18s ease;
}
.portal-theme-toggle:hover{transform:translateY(-1px);border-color:rgba(255,153,0,.58);background:rgba(255,153,0,.1)}
.portal-theme-toggle:focus-visible{outline:3px solid rgba(255,153,0,.3);outline-offset:3px}
.portal-theme-toggle .theme-label{font-size:10px;letter-spacing:.06em}
.portal-theme-toggle.is-floating{position:fixed;z-index:90;right:18px;bottom:18px;height:44px;box-shadow:0 12px 34px rgba(0,0,0,.28);background:#211917}
html[data-theme="light"] body{background:#eee9e1;color:#211b19}

/* Brand chrome intentionally remains dark in both themes. */
html[data-theme="light"] :is(.site-header,.utility-bar,.topbar,.admin-topbar,.admin-sidebar){
    --text:#f6f7f9;--muted:#a5adba;--surface:#111419;--surface-2:#191d22;--line:rgba(255,255,255,.1);
    color:#f6f7f9;
}
html[data-theme="light"] :is(.site-header,.utility-bar,.topbar,.admin-topbar){background:rgba(14,16,19,.97)}
html[data-theme="light"] .admin-sidebar{background:linear-gradient(180deg,#211310,#101317 45%);border-color:rgba(255,255,255,.08)}

/* Landing */
html[data-theme="light"] :is(.summary-section,.apps-section,.news-section,.information-page){background:#eee9e1}
html[data-theme="light"] .notice-section{background:linear-gradient(115deg,#f3ded3,#eee9e1 58%)}
html[data-theme="light"] :is(.metric-card,.app-card,.news-card,.information-cover){background:#fffdfa;border-color:rgba(62,42,35,.14);box-shadow:0 12px 34px rgba(62,40,29,.06)}
html[data-theme="light"] .metric-featured{background:linear-gradient(145deg,#7b2013,#431813);color:#fff}
html[data-theme="light"] .metric-featured :is(span,em){color:#f2d7ce}
html[data-theme="light"] :is(.section-head p,.app-card small,.news-body p,.method-note,.information-meta,.information-lead,.rich-article,.closing-card p){color:#68636b}
html[data-theme="light"] .app-card:hover{background:#fff7eb;border-color:#e88700;box-shadow:0 18px 42px rgba(140,74,0,.13)}
html[data-theme="light"] .news-visual{background-color:#4c170e}
html[data-theme="light"] .notice-item{border-color:rgba(62,42,35,.14)}
html[data-theme="light"] .closing-section{background:#eee9e1}
html[data-theme="light"] .closing-card{background:radial-gradient(circle at 90% 40%,rgba(255,153,0,.18),transparent 33%),linear-gradient(120deg,#fffaf2,#f2e4d7);border-color:rgba(153,25,0,.2)}
html[data-theme="light"] .site-footer{background:#171514;color:#f7f7f5}
html[data-theme="light"] .site-footer :is(span,a,small){color:#aeb3bd}
html[data-theme="light"] .rich-article :is(h2,h3){color:#211b19}
html[data-theme="light"] .rich-article blockquote{background:#fffdfa;color:#30241f;border-color:#ff9900}

/* Dashboard */
html[data-theme="light"] :is(.app-shell,.dashboard-shell,.dashboard-main,.page-main,.main-content){background:#eee9e1;color:#211b19}
html[data-theme="light"] :is(.panel,.card,.data-card,.metric-card:not(.metric-featured),.table-card,.chart-card,.chart-panel,.content-card,.detail-card,.filter-panel,.toolbar,.pagination){background:#fffdfa;border-color:rgba(62,42,35,.14);color:#211b19;box-shadow:0 12px 34px rgba(62,40,29,.055)}
html[data-theme="light"] :is(table,thead,tbody,tr,th,td){border-color:rgba(62,42,35,.12)}
html[data-theme="light"] th{color:#706870}
html[data-theme="light"] td{color:#2d2725}
html[data-theme="light"] :is(input,select,textarea){background:#fffdfa;color:#211b19;border-color:rgba(62,42,35,.2)}
html[data-theme="light"] :is(input,textarea)::placeholder{color:#91898b}
html[data-theme="light"] :is(.muted,.subtitle,.description,.meta,.hint,.note){color:#6d6870}
html[data-theme="light"] .hero{box-shadow:0 20px 55px rgba(88,28,15,.15)}

/* Admin workspace */
html[data-theme="light"] :is(.admin-main,.admin-content){background:#eee9e1;color:#211b19}
html[data-theme="light"] :is(.content-panel,.studio-panel,.media-studio,.media-library-panel,.media-library-card,.inventory-item,.rich-editor-section,.image-preview,.upload-zone,.user-mini,.settings-card,.analytics-card,.stat-card,.trend-panel,.top-pages){background:#fffdfa;border-color:rgba(62,42,35,.14);color:#211b19;box-shadow:0 12px 34px rgba(62,40,29,.055)}
html[data-theme="light"] :is(.content-panel,.studio-panel) :is(input,select,textarea,.rich-editor){background:#f9f5ef;color:#211b19;border-color:rgba(62,42,35,.18)}
html[data-theme="light"] .editor-toolbar{background:#eee8df;border-color:rgba(62,42,35,.16)}
html[data-theme="light"] .editor-toolbar button{color:#312925}
html[data-theme="light"] :is(.panel-head p,.field-hint,.editor-help,.media-empty,.safety-note,.inventory-item small,.media-library-card small){color:#706970}
html[data-theme="light"] .safety-note{background:#fffdfa}
html[data-theme="light"] .landing-admin .landing-hero{color:#fff}
html[data-theme="light"] .landing-admin .landing-hero p{color:#b9c1cd}
html[data-theme="light"] .flash.success{background:#e2f7ed;color:#176541}
html[data-theme="light"] .flash.error{background:#fde8e5;color:#8e281d}

@media(max-width:700px){
    .portal-theme-toggle .theme-label{display:none}
    .portal-theme-toggle{min-width:40px;padding:0 9px}
}
@media(prefers-reduced-motion:reduce){.portal-theme-toggle{transition:none}}
/* PORTAL-1C2 · LANDING LIGHT POLISH */
html[data-theme="light"] .hero-slide:not(.has-image){
    color:#211b19;
    background:
        radial-gradient(circle at 77% 45%,rgba(255,153,0,.115),transparent 24%),
        radial-gradient(circle at 18% 85%,rgba(153,25,0,.055),transparent 32%),
        linear-gradient(112deg,#fffdf9 0%,#f6f0e7 54%,#eee5d9 100%);
}
html[data-theme="light"] .hero-slide:not(.has-image) .hero-copy{color:#211b19}
html[data-theme="light"] .hero-slide:not(.has-image) .hero-copy p{color:#625e64}
html[data-theme="light"] .hero-slide:not(.has-image) .hero-orbit{
    border-color:rgba(79,50,39,.17);
    box-shadow:inset 0 0 90px rgba(255,153,0,.08),0 22px 55px rgba(82,52,38,.08);
}
html[data-theme="light"] .hero-slide:not(.has-image) .hero-orbit::before{border-color:rgba(79,50,39,.12)}
html[data-theme="light"] .hero-slide:not(.has-image) .hero-orbit::after{background:#fffdfa;border-color:rgba(79,50,39,.14)}
html[data-theme="light"] .hero-slide:not(.has-image) .hero-orbit span{color:#2b2421}
html[data-theme="light"] .hero-slide:not(.has-image)~.slider-controls>button{background:#fffdfa;color:#211b19;border-color:rgba(62,42,35,.2)}

/* Contact remains a dark brand island, with explicit readable text. */
html[data-theme="light"] #kontak{
    --text:#f7f7f5;
    --muted:#aeb6c3;
    color:#f7f7f5;
}
html[data-theme="light"] #kontak :is(h2,h3,strong,address,a){color:#f7f7f5}
html[data-theme="light"] #kontak :is(p,small,.contact-value){color:#aeb6c3}
html[data-theme="light"] #kontak [class*="contact-item"]{
    background:rgba(255,255,255,.035);
    border-color:rgba(255,255,255,.08);
}
html[data-theme="light"] #kontak a:hover{color:#ffb13b}