/* Premium Dark: graphite surfaces, restrained blue identity, one system across pages. */
:root[data-theme="dark"] body.portal-page {
  --bg:#101923; --bg-alt:#152231; --surface:#192737; --surface-strong:#192737;
  --text:#eaf1f8; --text-muted:#b1c0d0; --text-dim:#99adc2; --border:#2d4054;
  --accent:#1970ba; --accent-2:#155b97; --accent-text:#87c4ff; --accent-soft:#1c3852;
  --portal-blue:#163c60; --portal-blue-strong:#102d49; --header-bg:#101923f0;
}
:root[data-theme="dark"] .portal-page .hero,
:root[data-theme="dark"] .portal-page .profile-card,
:root[data-theme="dark"] .portal-page .profile-art,
:root[data-theme="dark"] .portal-page .home-store { background:var(--bg-alt); }
:root[data-theme="dark"] .portal-page .profile-card,
:root[data-theme="dark"] .portal-page .home-store-product { background:var(--surface); border-color:var(--border); }
:root[data-theme="dark"] .portal-page .hero-badge { background:var(--surface); border-color:var(--border); }
:root[data-theme="dark"] .portal-page .hero-bg { display:none; }
:root[data-theme="dark"] .portal-page .profile-card { border-radius:14px; }
:root[data-theme="dark"] .portal-page .home-store-product { border-radius:10px; }
:root[data-theme="dark"] .portal-page .section-dark { background:var(--bg-alt); }
:root { color-scheme: light; --bg:#f7f9fc; --bg-alt:#edf2f7; --surface:#fff; --surface-strong:#fff; --surface-hover:#edf4fc; --text:#182c40; --text-muted:#526478; --text-dim:#64758a; --border:#dce4ee; --border-hover:#8aafd1; --accent:#1262ac; --accent-2:#084d91; --accent-text:#0a579b; --accent-soft:#e9f2fb; --header-bg:#fffffff0; --shadow:0 12px 35px #16365412; --ui-radius:12px; --ui-good:#14704d; --ui-error:#b52e43; }
@media(prefers-color-scheme:dark) { :root:not([data-theme="light"]) { color-scheme:dark; --bg:#101923; --bg-alt:#152231; --surface:#192737; --surface-strong:#192737; --surface-hover:#20364a; --text:#eaf1f8; --text-muted:#b1c0d0; --text-dim:#99adc2; --border:#2d4054; --border-hover:#5688b2; --accent:#1970ba; --accent-2:#155b97; --accent-text:#87c4ff; --accent-soft:#1c3852; --header-bg:#101923f0; --shadow:0 12px 35px #0003; --ui-good:#78d9ae; --ui-error:#ff9aaa; } }
:root[data-theme="dark"] { color-scheme:dark; --bg:#101923; --bg-alt:#152231; --surface:#192737; --surface-strong:#192737; --surface-hover:#20364a; --text:#eaf1f8; --text-muted:#b1c0d0; --text-dim:#99adc2; --border:#2d4054; --border-hover:#5688b2; --accent:#1970ba; --accent-2:#155b97; --accent-text:#87c4ff; --accent-soft:#1c3852; --header-bg:#101923f0; --shadow:0 12px 35px #0003; --ui-good:#78d9ae; --ui-error:#ff9aaa; }
body { background:var(--bg); color:var(--text); font-family:'Inter',system-ui,-apple-system,sans-serif; }
h1,h2,h3 { text-wrap:balance; }
button,input,select,textarea { font:inherit; }
input,select,textarea { scroll-margin-block:110px; }
button,a.btn { touch-action:manipulation; }
button,a,input,select,textarea { -webkit-tap-highlight-color:transparent; }
:focus-visible { outline:3px solid var(--accent-text); outline-offset:3px; }
.btn { border-radius:9px; box-shadow:none; transition:background .15s,transform .15s; }
.btn-primary { background:var(--accent); color:#fff; }
.btn-primary:hover { background:var(--accent-2); }
.btn-ghost { background:var(--surface); border-color:var(--border); }
.ui-theme-toggle { border:1px solid var(--border); border-radius:9px; padding:10px 12px; font-size:12px; background:var(--surface); min-height:44px; }
.ui-toast { position:fixed; bottom:max(100px,env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%); width:max-content; max-width:calc(100% - 32px); padding:12px 18px; border:1px solid var(--border-hover); border-radius:10px; background:var(--surface-strong); color:var(--text); box-shadow:var(--shadow); font-size:13px; z-index:800; pointer-events:none; }
.ui-toast:empty { display:none; }
.ui-skeleton { height:260px; border-radius:12px; background:linear-gradient(100deg,var(--bg-alt) 25%,var(--surface) 45%,var(--bg-alt) 65%); background-size:200% 100%; animation:ui-shimmer 1.4s linear infinite; border:1px solid var(--border); }
.ui-error-state { padding:24px; border:1px solid var(--border); border-radius:12px; background:var(--surface); display:grid; gap:12px; grid-column:1/-1; }
.ui-error-state p { color:var(--text-muted); font-size:13px; }
.ui-dialog { width:min(600px,calc(100% - 32px)); max-height:calc(100dvh - 40px); overflow-y:auto; margin:auto; padding:26px; border:1px solid var(--border); border-radius:16px; background:var(--surface-strong); color:var(--text); box-shadow:var(--shadow); }
.ui-dialog::backdrop { background:#061b36a6; }
.ui-dialog-header { display:flex; gap:15px; align-items:start; justify-content:space-between; margin-bottom:18px; }
.ui-dialog-header h2 { font-size:21px; }
.ui-dialog-header button { padding:8px 12px; min-height:44px; border:1px solid var(--border); border-radius:8px; }
.ui-dialog p { margin-block:14px; font-size:14px; line-height:1.8; overflow-wrap:anywhere; }
.ui-dialog .dialog-price { font-size:25px; font-weight:750; color:var(--accent-text); }
.product-details-button { color:var(--accent-text); padding:8px; text-align:center; text-decoration:underline; text-underline-offset:3px; }
.product-card { background:var(--surface); transition:border-color .15s,box-shadow .15s; }
.product-card:hover { border-color:var(--border-hover); box-shadow:var(--shadow); }
.product-card[data-selected="true"] { border-color:var(--accent-text); }
.shop-filters { border:1px solid var(--border); border-radius:10px; padding:0 14px; background:var(--surface); }
.catalog-tools label { flex:1; min-width:0; }
.account-header { background:var(--bg); }
.auth-card,.account-panel { background:var(--surface); box-shadow:none; border-radius:var(--ui-radius); }
.account-main h1 { font-size:clamp(27px,4vw,40px); letter-spacing:-.035em; }
.account-panel input,.account-panel textarea { background:var(--bg); }
.auth-form.account-panel { background:transparent; }
.admin-page .account-main { max-width:1300px; }
.admin-page #admin-workspace { display:grid; grid-template-columns:180px minmax(0,1fr); align-items:start; gap:20px; }
.admin-page .admin-section-nav { grid-column:1; grid-row:1/20; position:sticky; top:16px; display:grid; gap:6px; margin-block:25px; }
.admin-page .admin-section-nav a { border:0; border-radius:8px; font-size:13px; padding:13px 15px; }
.admin-page .admin-section-nav a:hover { background:var(--accent-soft); }
.admin-page #admin-workspace > section { grid-column:2; margin-block:0 18px; }
.admin-data-tools { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin-block:15px; }
.admin-data-tools input { flex:1; width:200px; padding:10px; border:1px solid var(--border); background:var(--bg); border-radius:8px; color:var(--text); font-size:13px; }
.admin-data-tools button { min-height:40px; border:1px solid var(--border); border-radius:8px; padding:8px 12px; font-size:12px; }
.admin-data-tools span { font-size:12px; color:var(--text-muted); }
.admin-page th { background:var(--bg-alt); white-space:nowrap; }
.admin-page td { min-width:110px; }
.admin-page .admin-product { background:var(--bg); }
@media(max-width:600px) { body:has(#checkout-form :focus) .shop-selection-bar, body:has(#shop-auth-form :focus) .shop-selection-bar { display:none; } }
@keyframes ui-shimmer { to { background-position:-200% 0; } }
@media(max-width:800px) { .admin-page #admin-workspace { display:block; } .admin-page .admin-section-nav { position:static; display:flex; gap:6px; margin-block:15px; } .admin-page .admin-section-nav a { border:1px solid var(--border); padding:9px; font-size:12px; } .catalog-tools { flex-wrap:wrap; } .ui-skeleton { height:220px; } }
@media(prefers-reduced-motion:reduce) { .ui-skeleton { animation:none; } .btn,.product-card { transition:none; } }
