/* Baloot Commerce 7.8.3 — shared light/dark theme layer */
:root{
  --theme-bg:#fafafa;
  --theme-surface:#ffffff;
  --theme-surface-2:#f7f8fa;
  --theme-surface-3:#f1f5f9;
  --theme-text:#27272a;
  --theme-muted:#64748b;
  --theme-faint:#94a3b8;
  --theme-line:#e4e4e7;
  --theme-input:#ffffff;
  --theme-shadow:0 14px 36px rgba(15,23,42,.08);
}
html{color-scheme:light}
html[data-theme="dark"]{
  color-scheme:dark;
  --theme-bg:#0b1120;
  --theme-surface:#111827;
  --theme-surface-2:#172033;
  --theme-surface-3:#1d293d;
  --theme-text:#f8fafc;
  --theme-muted:#cbd5e1;
  --theme-faint:#94a3b8;
  --theme-line:#2b3a50;
  --theme-input:#0f172a;
  --theme-shadow:0 16px 40px rgba(0,0,0,.28);
}
body,.topbar,.sidebar,.site-header,.site-footer,.panel,.dashsection,.tablewrap,.page-title,
.s-product-card,.filter-card,.purchase-box,.form-card,.profile-content,.profile-menu,
.product-main-image,.pane,.cart-item-new,.auth-card,.success-card,.empty-state,.home-category,
.receipt-box,.contact-menu,.ai-dialog,.search-results,.toolbar,.mini-card{
  transition:background-color .2s ease,color .2s ease,border-color .2s ease,box-shadow .2s ease;
}
.theme-toggle{
  width:42px!important;height:42px!important;min-width:42px!important;min-height:42px!important;
  padding:0!important;border:1px solid var(--theme-line)!important;border-radius:12px!important;
  background:var(--theme-surface)!important;color:var(--theme-text)!important;
  display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:7px!important;box-shadow:none!important;cursor:pointer;
}
.theme-toggle:hover{background:var(--theme-surface-2)!important;color:var(--primary,var(--store-primary,#2563eb))!important}
.theme-toggle [data-theme-icon]{font-size:19px;line-height:1}
.theme-toggle-label{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.theme-toggle-admin{width:42px!important;min-width:42px!important;height:42px!important;padding:0!important;white-space:nowrap!important;border-radius:13px!important}.theme-toggle-admin .theme-toggle-label{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}.theme-toggle-glyph{width:22px;height:22px;display:grid;place-items:center}.theme-toggle-glyph svg{width:21px;height:21px;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.sidebar-theme-toggle{width:calc(100% - 18px)!important;min-height:39px!important;margin:3px 9px 8px!important;padding:7px 12px!important;border:1px solid var(--theme-line)!important;border-radius:11px!important;background:var(--theme-surface)!important;color:var(--theme-text)!important;display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:9px!important;font-size:12px!important;font-weight:800!important;box-shadow:none!important}
.sidebar-theme-toggle:hover{background:var(--theme-surface-2)!important;color:var(--primary,var(--store-primary,#2563eb))!important}
.sidebar-theme-toggle [data-theme-icon]{width:20px;text-align:center;font-size:17px}
html[data-theme="dark"] .theme-toggle{background:#172033!important;border-color:#34445c!important;color:#f8fafc!important}
html[data-theme="dark"] .theme-toggle:hover{background:#202c42!important}
html[data-theme="dark"] .sidebar-theme-toggle{background:#172033!important;border-color:#34445c!important;color:#f8fafc!important}
html[data-theme="dark"] .sidebar-theme-toggle:hover{background:#202c42!important;color:#fff!important}

/* Admin */
html[data-theme="dark"] body{background:#0b1120!important;color:var(--theme-text)!important}
html[data-theme="dark"] .content{color:var(--theme-text)}
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .sidebar{background:#0f172a!important;border-color:var(--theme-line)!important;box-shadow:none!important}
html[data-theme="dark"] .adminbrand b,
html[data-theme="dark"] .profile b,
html[data-theme="dark"] .page-title h1,
html[data-theme="dark"] .panel h1,
html[data-theme="dark"] .panel h2,
html[data-theme="dark"] .panel h3,
html[data-theme="dark"] .dashsection h2,
html[data-theme="dark"] .stat b,
html[data-theme="dark"] .modulegrid b,
html[data-theme="dark"] .quickgrid b,
html[data-theme="dark"] .quicklist b,
html[data-theme="dark"] label{color:#f8fafc!important}
html[data-theme="dark"] .adminbrand small,
html[data-theme="dark"] .userchip,
html[data-theme="dark"] .page-title p,
html[data-theme="dark"] .sectionhead p,
html[data-theme="dark"] .stat small,
html[data-theme="dark"] .stat em,
html[data-theme="dark"] .modulegrid span,
html[data-theme="dark"] .form-help,
html[data-theme="dark"] .helptext,
html[data-theme="dark"] small,
html[data-theme="dark"] .muted{color:#b8c4d6!important}
html[data-theme="dark"] .side-title{color:#8fa0b8!important}
html[data-theme="dark"] .sidebar details{border-color:#1f2c40!important}
html[data-theme="dark"] .sidebar summary{color:#dbe5f2!important}
html[data-theme="dark"] .sidebar summary:hover{background:#172033!important}
html[data-theme="dark"] .sidebar a{color:#cbd5e1!important}
html[data-theme="dark"] .sidebar a:hover{background:#172033!important;color:#ffffff!important}
html[data-theme="dark"] .sidebar a.active{background:#172554!important;color:#93c5fd!important;box-shadow:inset -3px 0 var(--primary)!important}
html[data-theme="dark"] .globalsearch{background:#172033!important;border-color:#27364d!important}
html[data-theme="dark"] .globalsearch:focus-within{background:#111827!important;border-color:#4c78ff!important}
html[data-theme="dark"] .globalsearch input{color:#f8fafc!important}
html[data-theme="dark"] .globalsearch kbd{background:#0b1120!important;border-color:#34445c!important;color:#cbd5e1!important}
html[data-theme="dark"] .storelink{color:#dbe5f2!important}
html[data-theme="dark"] .storelink:hover{background:#172033!important}
html[data-theme="dark"] .avatar{background:#172554!important;color:#93c5fd!important}
html[data-theme="dark"] .navbtn{background:#172033!important;color:#f8fafc!important;border:1px solid #34445c!important}
html[data-theme="dark"] .page-title,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .dashsection,
html[data-theme="dark"] .tablewrap,
html[data-theme="dark"] article,
html[data-theme="dark"] .cards>div,
html[data-theme="dark"] .card,
html[data-theme="dark"] .stat,
html[data-theme="dark"] .modulegrid a,
html[data-theme="dark"] .quickgrid a,
html[data-theme="dark"] .quicklist a,
html[data-theme="dark"] .mini-card,
html[data-theme="dark"] .toolbar,
html[data-theme="dark"] .sticky-actions{
  background:#111827!important;border-color:var(--theme-line)!important;color:#f8fafc!important;box-shadow:var(--theme-shadow)!important;
}
html[data-theme="dark"] .hero-title,
html[data-theme="dark"] .hero-settings{background:linear-gradient(135deg,#111827 35%,#16213a)!important}
html[data-theme="dark"] .modulegrid a:hover,
html[data-theme="dark"] .quickgrid a:hover,
html[data-theme="dark"] .quicklist a:hover{background:#172033!important;border-color:#3b4c67!important}
html[data-theme="dark"] .modulegrid i,
html[data-theme="dark"] .quicklist i,
html[data-theme="dark"] .stat-icon{background:#172554!important;color:#93c5fd!important}
html[data-theme="dark"] .stat.featured{background:linear-gradient(135deg,var(--primary),var(--primary2))!important;color:#fff!important}
html[data-theme="dark"] .stat.featured small,
html[data-theme="dark"] .stat.featured em{color:#fff1f2!important}
html[data-theme="dark"] .group-title{background:#172033!important;color:#f8fafc!important}
html[data-theme="dark"] .formrow{background:#0f172a!important;border-color:var(--theme-line)!important}
html[data-theme="dark"] .check-field{background:#0f172a!important;border-color:var(--theme-line)!important}
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea{
  background:#0f172a!important;color:#f8fafc!important;border-color:#3a4a62!important;caret-color:#fff;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder{color:#8fa0b8!important;opacity:1}
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus{border-color:#60a5fa!important;box-shadow:0 0 0 3px rgba(96,165,250,.18)!important}
html[data-theme="dark"] select option{background:#0f172a;color:#f8fafc}
html[data-theme="dark"] input[type="checkbox"],html[data-theme="dark"] input[type="radio"]{accent-color:var(--primary,var(--store-primary,#2563eb));box-shadow:none!important}
html[data-theme="dark"] input[type="file"]::file-selector-button{background:#1e293b;color:#f8fafc;border:1px solid #475569;border-radius:8px;padding:6px 10px}
html[data-theme="dark"] .button.light,
html[data-theme="dark"] .secondary{background:#172033!important;color:#f8fafc!important;border-color:#3a4a62!important}
html[data-theme="dark"] .button.light:hover,
html[data-theme="dark"] .secondary:hover{background:#202c42!important;color:#fff!important}
html[data-theme="dark"] table{background:#111827!important;color:#f8fafc!important}
html[data-theme="dark"] th{background:#172033!important;color:#cbd5e1!important;border-color:#2b3a50!important}
html[data-theme="dark"] td{border-color:#26354a!important;color:#e5edf7!important}
html[data-theme="dark"] tbody tr:hover{background:#172033!important}
html[data-theme="dark"] .trade-price-table .trade-product td{background:#111827!important}
html[data-theme="dark"] .trade-price-table .trade-variant td{background:#0f172a!important;color:#cbd5e1!important}
html[data-theme="dark"] .line,
html[data-theme="dark"] .compact-orders>a,
html[data-theme="dark"] .healthrow{border-color:#26354a!important}
html[data-theme="dark"] .panel ul{border-color:#34445c!important;background:#0f172a!important}
html[data-theme="dark"] .badge{background:#253047!important;color:#e2e8f0!important}
html[data-theme="dark"] .badge.ok,
html[data-theme="dark"] .status-paid,
html[data-theme="dark"] .status-processing,
html[data-theme="dark"] .status-sent{background:#123426!important;color:#86efac!important}
html[data-theme="dark"] .status-pending,
html[data-theme="dark"] .status-payment_review{background:#3a2d11!important;color:#fde68a!important}
html[data-theme="dark"] .status-cancelled{background:#431c20!important;color:#fda4af!important}
html[data-theme="dark"] .alert,
html[data-theme="dark"] .update-warning{background:#3a2d11!important;border-color:#80621f!important;color:#fde68a!important}
html[data-theme="dark"] .update-warning h2{color:#fde68a!important}
html[data-theme="dark"] .msg{background:#123426!important;border-color:#256b43!important;color:#bbf7d0!important}
html[data-theme="dark"] .msg.error,
html[data-theme="dark"] .errorlist{background:#431c20!important;border-color:#7f1d1d!important;color:#fecaca!important}
html[data-theme="dark"] .msg.warning{background:#3a2d11!important;border-color:#80621f!important;color:#fde68a!important}
html[data-theme="dark"] .danger-zone{background:#2b171b!important;border-color:#7f1d1d!important}
html[data-theme="dark"] .code-help{background:#020617!important;color:#e2e8f0!important;border:1px solid #334155}
html[data-theme="dark"] .table-thumb,
html[data-theme="dark"] .field-preview{background:#172033!important;border-color:#34445c!important}
html[data-theme="dark"] .settings-index a{color:#cbd5e1!important}
html[data-theme="dark"] .settings-index a:hover{background:#172554!important;color:#bfdbfe!important}

/* CKEditor 5 in admin */
html[data-theme="dark"] .ck.ck-editor__main>.ck-editor__editable,
html[data-theme="dark"] .ck.ck-toolbar,
html[data-theme="dark"] .ck.ck-dropdown__panel,
html[data-theme="dark"] .ck.ck-list,
html[data-theme="dark"] .ck.ck-balloon-panel{
  background:#0f172a!important;color:#f8fafc!important;border-color:#3a4a62!important;
}
html[data-theme="dark"] .ck.ck-editor__editable_inline{color:#f8fafc!important}
html[data-theme="dark"] .ck.ck-editor__editable_inline p,
html[data-theme="dark"] .ck.ck-editor__editable_inline h1,
html[data-theme="dark"] .ck.ck-editor__editable_inline h2,
html[data-theme="dark"] .ck.ck-editor__editable_inline h3,
html[data-theme="dark"] .ck.ck-editor__editable_inline li{color:#f8fafc!important}
html[data-theme="dark"] .ck.ck-button,
html[data-theme="dark"] .ck.ck-button .ck-button__label,
html[data-theme="dark"] .ck.ck-icon{color:#dbe5f2!important}
html[data-theme="dark"] .ck.ck-button:hover:not(.ck-disabled),
html[data-theme="dark"] .ck.ck-button.ck-on{background:#27364d!important;color:#fff!important}

/* Storefront */
html[data-theme="dark"] .site-header,
html[data-theme="dark"] .site-footer{background:#0f172a!important;border-color:#26354a!important;color:#f8fafc!important}
html[data-theme="dark"] .desktop-nav a{color:#dbe5f2!important}
html[data-theme="dark"] .desktop-nav a:hover{color:#93c5fd!important}
html[data-theme="dark"] .mobile-menu-button{color:#f8fafc!important}
html[data-theme="dark"] .mobile-menu,
html[data-theme="dark"] .search-panel{background:#0f172a!important;border-color:#26354a!important;color:#f8fafc!important}
html[data-theme="dark"] .mobile-menu a{color:#e2e8f0!important;border-color:#26354a!important}
html[data-theme="dark"] .headbtn{background:#172033!important;border-color:#34445c!important;color:#f8fafc!important;box-shadow:none!important}
html[data-theme="dark"] .headbtn:hover{background:var(--store-primary)!important;color:#fff!important;border-color:var(--store-primary)!important}
html[data-theme="dark"] .search-inner input{background:#0b1120!important;color:#f8fafc!important;border-color:#3a4a62!important}
html[data-theme="dark"] .search-results{background:#111827!important;border:1px solid #34445c!important;color:#f8fafc!important;box-shadow:var(--theme-shadow)!important}
html[data-theme="dark"] .search-results a{border-color:#26354a!important;color:#e5edf7!important}
html[data-theme="dark"] .search-results a:hover{background:#172033!important}
html[data-theme="dark"] main{color:#f8fafc!important}
html[data-theme="dark"] .section-head h1,
html[data-theme="dark"] .section-head h2,
html[data-theme="dark"] .product-info h1,
html[data-theme="dark"] .s-product-card h3,
html[data-theme="dark"] .purchase-box h3,
html[data-theme="dark"] .auth-card h1,
html[data-theme="dark"] .success-card h1{color:#f8fafc!important}
html[data-theme="dark"] .section-head span,
html[data-theme="dark"] .section-head a{color:#93c5fd!important}
html[data-theme="dark"] .s-hero{position:relative;color:#f8fafc!important;border:1px solid #2b3a50!important}
html[data-theme="dark"] .s-hero:not([style*="background-image"]){background:linear-gradient(120deg,#111827,#172033 60%,#1e293b)!important}
html[data-theme="dark"] .s-hero[style*="background-image"]{background-color:#111827!important;background-blend-mode:normal!important}
html[data-theme="dark"] .s-hero[style*="background-image"]::before{content:"";position:absolute;inset:0;background:linear-gradient(90deg,rgba(3,7,18,.08),rgba(3,7,18,.18) 52%,rgba(3,7,18,.22));z-index:0;pointer-events:none}
html[data-theme="dark"] .s-hero h1{color:#fff!important}
html[data-theme="dark"] .s-hero p{color:#dbe5f2!important}
html[data-theme="dark"] .hero-chip{background:#172554!important;color:#bfdbfe!important}
html[data-theme="dark"] .s-product-card,
html[data-theme="dark"] .filter-card,
html[data-theme="dark"] .purchase-box,
html[data-theme="dark"] .form-card,
html[data-theme="dark"] .profile-content,
html[data-theme="dark"] .profile-menu,
html[data-theme="dark"] .product-main-image,
html[data-theme="dark"] .pane,
html[data-theme="dark"] .cart-item-new,
html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .success-card,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .home-category,
html[data-theme="dark"] .receipt-box,
html[data-theme="dark"] .contact-menu,
html[data-theme="dark"] .ai-dialog,
html[data-theme="dark"] .bg-white{
  background:#111827!important;border-color:#2b3a50!important;color:#f8fafc!important;
}
html[data-theme="dark"] .s-product-card:hover{box-shadow:var(--theme-shadow)!important;border-color:#3b4c67!important}
html[data-theme="dark"] .s-product-image{background:#0f172a!important}
html[data-theme="dark"] .s-product-card a,
html[data-theme="dark"] .home-category,
html[data-theme="dark"] .order-row a{color:#f8fafc!important}
html[data-theme="dark"] .secondary-btn{background:#172033!important;border-color:#3a4a62!important;color:#f8fafc!important}
html[data-theme="dark"] .secondary-btn:hover{background:#202c42!important;color:#fff!important}
html[data-theme="dark"] .product-thumbs button,
html[data-theme="dark"] .qty-row button,
html[data-theme="dark"] .qty-row input,
html[data-theme="dark"] .cart-qty{background:#0f172a!important;border-color:#3a4a62!important;color:#f8fafc!important}
html[data-theme="dark"] .spec-mini div{background:#172033!important;color:#f8fafc!important}
html[data-theme="dark"] .spec-mini span,
html[data-theme="dark"] .trust-list,
html[data-theme="dark"] .auth-card>p{color:#b8c4d6!important}
html[data-theme="dark"] .tab-head{border-color:#34445c!important}
html[data-theme="dark"] .tab-head button{background:transparent!important;color:#cbd5e1!important}
html[data-theme="dark"] .tab-head button.active{color:#93c5fd!important;border-color:#60a5fa!important}
html[data-theme="dark"] .spec-table div,
html[data-theme="dark"] .comment,
html[data-theme="dark"] .order-row,
html[data-theme="dark"] .summary-line,
html[data-theme="dark"] .shipping-option,
html[data-theme="dark"] .rich-content td,
html[data-theme="dark"] .rich-content th{border-color:#2b3a50!important}
html[data-theme="dark"] .comment,
html[data-theme="dark"] .order-row,
html[data-theme="dark"] .shipping-option{background:#0f172a!important;color:#e5edf7!important}
html[data-theme="dark"] .profile-menu .active{background:#172554!important;color:#bfdbfe!important}
html[data-theme="dark"] .profile-menu a,
html[data-theme="dark"] .profile-menu button{color:#e2e8f0!important;background:transparent!important}
html[data-theme="dark"] .profile-menu a:hover,
html[data-theme="dark"] .profile-menu button:hover{background:#172033!important;color:#fff!important}
html[data-theme="dark"] .site-footer .footer-grid a{color:#cbd5e1!important}
html[data-theme="dark"] .site-footer .footer-grid a:hover{color:#93c5fd!important}
html[data-theme="dark"] .footer-bottom{border-color:#26354a!important;color:#b8c4d6!important}
html[data-theme="dark"] .home-banner-info{background:rgba(15,23,42,.92)!important;color:#f8fafc!important;box-shadow:0 8px 24px rgba(0,0,0,.25)}
html[data-theme="dark"] .contact-menu a,
html[data-theme="dark"] .contact-menu button{color:#e5edf7!important;background:transparent!important}
html[data-theme="dark"] .contact-menu a:hover,
html[data-theme="dark"] .contact-menu button:hover{background:#172033!important;color:#93c5fd!important}
html[data-theme="dark"] .dialog-head{background:#111827!important;border-color:#2b3a50!important;color:#f8fafc!important}
html[data-theme="dark"] .dialog-head button{color:#f8fafc!important;background:transparent!important}
html[data-theme="dark"] .ai-messages{background:#0b1120!important}
html[data-theme="dark"] .ai-answer{background:#172033!important;border-color:#34445c!important;color:#e5edf7!important}
html[data-theme="dark"] .ai-form{background:#111827!important}
html[data-theme="dark"] .ai-form input{background:#0f172a!important;color:#f8fafc!important;border-color:#3a4a62!important}
html[data-theme="dark"] .trade-strip,
html[data-theme="dark"] .trade-label,
html[data-theme="dark"] .trade-account-chip{background:#123426!important;color:#86efac!important;border-color:#256b43!important}
html[data-theme="dark"] .notification-unread{background:#12213a!important;border-right-color:#60a5fa!important}
html[data-theme="dark"] .alert{background:#3a2d11!important;border-color:#80621f!important;color:#fde68a!important}
html[data-theme="dark"] .text-zinc-400{color:#aab7c9!important}
html[data-theme="dark"] .text-zinc-500,
html[data-theme="dark"] .text-zinc-700{color:#cbd5e1!important}
html[data-theme="dark"] .text-blue-600{color:#93c5fd!important}
html[data-theme="dark"] .text-green-600{color:#86efac!important}
html[data-theme="dark"] .text-red-600{color:#fda4af!important}
html[data-theme="dark"] .border-b{border-color:#2b3a50!important}
html[data-theme="dark"] blockquote{background:#172033!important;border-color:#475569!important;color:#e2e8f0!important}
html[data-theme="dark"] hr{border-color:#2b3a50!important}
html[data-theme="dark"] #toast{background:#e2e8f0!important;color:#0f172a!important}

@media (prefers-reduced-motion:reduce){
  body,.topbar,.sidebar,.site-header,.site-footer,.panel,.dashsection,.tablewrap,.page-title,
  .s-product-card,.filter-card,.purchase-box,.form-card,.profile-content,.profile-menu,
  .product-main-image,.pane,.cart-item-new,.auth-card,.success-card,.empty-state,.home-category,
  .receipt-box,.contact-menu,.ai-dialog,.search-results,.toolbar,.mini-card{transition:none!important}
}
@media(max-width:600px){.theme-toggle{width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important}.theme-toggle-admin{width:38px!important;min-width:38px!important;padding:0!important}.theme-toggle-admin .theme-toggle-label{position:absolute!important;width:1px!important;height:1px!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important}}


/* Baloot 7.8.3 — compatibility with product gallery + stronger dark readability */
html[data-theme="dark"] .media-panel,
html[data-theme="dark"] .main-image-preview,
html[data-theme="dark"] .gallery-selection>div,
html[data-theme="dark"] .gallery-thumb,
html[data-theme="dark"] .empty-gallery{
  background:#111827!important;
  border-color:#3a4a62!important;
  color:#f8fafc!important;
}
html[data-theme="dark"] .main-image-preview{background:#0f172a!important;border-color:#475569!important}
html[data-theme="dark"] .main-image-preview.is-empty span,
html[data-theme="dark"] .empty-gallery,
html[data-theme="dark"] .multi-upload span,
html[data-theme="dark"] .gallery-selection small{color:#cbd5e1!important}
html[data-theme="dark"] .multi-upload{
  background:#172554!important;
  border-color:#60a5fa!important;
  color:#bfdbfe!important;
}
html[data-theme="dark"] .multi-upload b{color:#dbeafe!important}
html[data-theme="dark"] .multi-upload:hover{background:#1e3a8a!important;border-color:#93c5fd!important}
html[data-theme="dark"] .gallery-selection img,
html[data-theme="dark"] .gallery-thumb img{background:#0b1120!important}
html[data-theme="dark"] .gallery-thumb span{color:#fca5a5!important}
html[data-theme="dark"] .image-file-field,
html[data-theme="dark"] .native-gallery-input{color:#dbe5f2!important}
html[data-theme="dark"] input[type="file"]{color:#dbe5f2!important}
html[data-theme="dark"] input[type="file"]::file-selector-button{
  background:#24324a!important;color:#f8fafc!important;border-color:#52627a!important;
}
html[data-theme="dark"] input[type="file"]::file-selector-button:hover{background:#334155!important}

/* Editor readability, including links, placeholders and selected text. */
html[data-theme="dark"] .ck.ck-editor__editable_inline a{color:#93c5fd!important}
html[data-theme="dark"] .ck.ck-editor__editable_inline blockquote{color:#dbe5f2!important;border-color:#64748b!important}
html[data-theme="dark"] .ck.ck-editor__editable_inline code,
html[data-theme="dark"] .ck.ck-editor__editable_inline pre{background:#0b1120!important;color:#e2e8f0!important}
html[data-theme="dark"] .ck .ck-placeholder::before{color:#94a3b8!important}
html[data-theme="dark"] .ck.ck-editor__editable_inline ::selection{background:#1d4ed8!important;color:#fff!important}

/* Generic low-contrast states that otherwise become hard to read in dark mode. */
html[data-theme="dark"] button:disabled,
html[data-theme="dark"] input:disabled,
html[data-theme="dark"] select:disabled,
html[data-theme="dark"] textarea:disabled{opacity:.72!important;color:#cbd5e1!important}
html[data-theme="dark"] hr{border-color:#334155!important}
html[data-theme="dark"] code,
html[data-theme="dark"] pre{color:#e2e8f0}

/* Baloot admin dark-mode compatibility bridge — universal patch v1
   Keep legacy admin color variables synchronized with the shared theme tokens.
   Many older/newer admin modules still use --bg/--panel/--text/--muted/--line/--nav/--soft. */
html[data-theme="dark"]{
  --bg:var(--theme-bg,#0b1120);
  --panel:var(--theme-surface,#111827);
  --text:var(--theme-text,#f8fafc);
  --muted:var(--theme-muted,#cbd5e1);
  --line:var(--theme-line,#2b3a50);
  --nav:#0f172a;
  --soft:var(--theme-surface-2,#172033);
  --shadow:var(--theme-shadow,0 16px 40px rgba(0,0,0,.28));
}

/* Generic admin surfaces that rely only on legacy variables. */
html[data-theme="dark"] body.ui-v8-admin .ai-laptop-intro,
html[data-theme="dark"] body.ui-v8-admin .ai-laptop-progress,
html[data-theme="dark"] body.ui-v8-admin .ai-preview-short,
html[data-theme="dark"] body.ui-v8-admin .ai-warning-box,
html[data-theme="dark"] body.ui-v8-admin .ai-source-box,
html[data-theme="dark"] body.ui-v8-admin .ai-spec-group>h4{
  background:var(--theme-surface-2,#172033)!important;
  border-color:var(--theme-line,#2b3a50)!important;
  color:var(--theme-text,#f8fafc)!important;
}
html[data-theme="dark"] body.ui-v8-admin .ai-highlight-grid div,
html[data-theme="dark"] body.ui-v8-admin .ai-source-box a,
html[data-theme="dark"] body.ui-v8-admin .ai-spec-group{
  background:var(--theme-surface,#111827)!important;
  border-color:var(--theme-line,#2b3a50)!important;
  color:var(--theme-text,#f8fafc)!important;
}
html[data-theme="dark"] body.ui-v8-admin .ai-laptop-intro span,
html[data-theme="dark"] body.ui-v8-admin .ai-laptop-actions small,
html[data-theme="dark"] body.ui-v8-admin .ai-final-actions small,
html[data-theme="dark"] body.ui-v8-admin .ai-laptop-progress small,
html[data-theme="dark"] body.ui-v8-admin .ai-preview-head span:first-child,
html[data-theme="dark"] body.ui-v8-admin .ai-highlight-grid span,
html[data-theme="dark"] body.ui-v8-admin .ai-spec-row span{
  color:var(--theme-muted,#cbd5e1)!important;
}
html[data-theme="dark"] body.ui-v8-admin .ai-laptop-preview,
html[data-theme="dark"] body.ui-v8-admin .ai-spec-row{
  border-color:var(--theme-line,#2b3a50)!important;
}
html[data-theme="dark"] body.ui-v8-admin .ai-source-box a:hover{
  background:var(--theme-surface-3,#1d293d)!important;
  color:#fff!important;
}

/* Browser-native and legacy controls which otherwise retain light surfaces. */
html[data-theme="dark"] body.ui-v8-admin fieldset,
html[data-theme="dark"] body.ui-v8-admin details:not(.sidebar details),
html[data-theme="dark"] body.ui-v8-admin .formrow,
html[data-theme="dark"] body.ui-v8-admin .check-field{
  border-color:var(--theme-line,#2b3a50)!important;
}
html[data-theme="dark"] body.ui-v8-admin hr{border-color:var(--theme-line,#2b3a50)!important}
html[data-theme="dark"] body.ui-v8-admin input:disabled,
html[data-theme="dark"] body.ui-v8-admin select:disabled,
html[data-theme="dark"] body.ui-v8-admin textarea:disabled{
  background:#111827!important;
  color:#94a3b8!important;
  opacity:1!important;
}
