/* Sully's Vault OS — the command-center layer (v3). Loaded after styles.css and overrides its theme tokens.
   Dark is the default; light mode and the accent colour are chosen in Settings → Appearance.
   Animations only use opacity/transform and are switched off with "Reduce motion" or the OS setting. */

/* ------------------------------------------------------------------ tokens */
:root, [data-theme="dark"] {
  --accent-base: #7c5cff;
  /* v3.3.3: true black (AMOLED) foundation — page #000, near-black layers, neutral grey borders, white text.
     Colour is kept for accents only (buttons, active item, status, charts). */
  /* 3.9.5: deep navy foundation (was pure black) — cards sit one step lighter than the page */
  --bg: #070912;
  --bg-2: #0a0d1a;
  --surface: rgba(16, 20, 36, .92);
  --surface-solid: #10142a;
  --surface-2: #161b33;
  --surface-3: #1e2442;
  --text: #f4f5fb;
  --text-2: #cfd3e6;
  --muted: #9298b5;
  --border: #1d2340;
  --border-strong: #2b3358;
  --chart-1: #8f7cff;
  --accent-strong: var(--accent-base);
  --accent: color-mix(in srgb, var(--accent-base) 68%, #ffffff);
  --accent-soft: color-mix(in srgb, var(--accent-base) 16%, transparent);
  --accent-line: color-mix(in srgb, var(--accent-base) 45%, transparent);
  --glow: 0 0 0 1px color-mix(in srgb, var(--accent-base) 35%, transparent), 0 8px 32px -8px color-mix(in srgb, var(--accent-base) 45%, transparent);
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 10px 30px -12px rgba(0, 0, 0, .7);
  --good: #34d399; --good-soft: rgba(52, 211, 153, .12);
  --bad: #ff6b6b; --bad-soft: rgba(255, 107, 107, .12);
  --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .12);
  --p-urgent: #ff5d5d; --p-high: #ff9f43; --p-medium: #f5c542; --p-low: #3ddc97;
  --dock-w: 232px;
  --radius: 16px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-display: "Space Grotesk", "Inter", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
/* 3.9.6 — Black appearance: the same layout as Blue with true-black surfaces (Blue = the tokens above) */
:root[data-palette="black"] {
  --bg: #000000;
  --bg-2: #050505;
  --surface: rgba(12, 12, 14, .94);
  --surface-solid: #0c0c0e;
  --surface-2: #151518;
  --surface-3: #1e1e22;
  --text: #ffffff;
  --text-2: #d6d6db;
  --muted: #a1a1aa;
  --border: #222227;
  --border-strong: #33333a;
  --chart-1: #9a8aff;
}
[data-theme="light"] {
  --bg: #eef0f6;
  --bg-2: #e6e9f2;
  --surface: rgba(255, 255, 255, .82);
  --surface-solid: #ffffff;
  --surface-2: #f3f4f9;
  --surface-3: #e7e9f2;
  --text: #121521;
  --text-2: #353a4d;
  --muted: #5f6478;
  --border: rgba(18, 21, 33, .1);
  --border-strong: rgba(18, 21, 33, .18);
  --accent: color-mix(in srgb, var(--accent-base) 82%, #000000);
  --accent-soft: color-mix(in srgb, var(--accent-base) 12%, transparent);
  --shadow: 0 1px 2px rgba(18, 21, 33, .06), 0 10px 30px -14px rgba(18, 21, 33, .25);
  --good: #0f9f6e; --good-soft: rgba(15, 159, 110, .1);
  --bad: #d93a3a; --bad-soft: rgba(217, 58, 58, .1);
  --warn: #b7791f; --warn-soft: rgba(183, 121, 31, .12);
  --gain: #0f9f6e; --loss: #d93a3a;
  --chart-1: #5b45e0;
  color-scheme: light;
}
body.dock-collapsed { --dock-w: 76px; }

/* ------------------------------------------------------------------ base */
[hidden] { display: none !important; }
html, body { background: var(--bg); color: var(--text); }
body {
  font-family: var(--font); -webkit-font-smoothing: antialiased; min-height: 100vh;
  background: var(--bg);
}
[data-theme="dark"] body::before {
  display: none;
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .5;
  background-image: linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 75%);
}
h1, h2, h3, .display { font-family: var(--font-display); letter-spacing: -.01em; }
h1 { font-size: 1.85rem; }
a { color: var(--accent); }
.card, .kpi, .src-card, .sum-card, .icard, .pcard, .stat, .pr {
  background: var(--surface); border-color: var(--border);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
}
.card { border-radius: var(--radius); }
input, select, textarea { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-line); border-color: transparent; }
.btn { background: var(--accent-strong); box-shadow: 0 6px 18px -8px var(--accent-line); }
.btn.ghost, .btn.danger { box-shadow: none; }
.btn.ghost { color: var(--text); border-color: var(--border-strong); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.icon { padding: 6px 9px; min-width: 32px; }
.toast { background: var(--surface-solid); color: var(--text); border: 1px solid var(--border-strong); box-shadow: var(--glow); }
.toast.error { background: var(--bad); color: #fff; }
.modal-backdrop { background: rgba(0, 0, 0, .7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal { background: var(--surface-solid); border-color: var(--border-strong); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7), var(--glow); }
.modal-close { color: var(--muted); }
.muted, .t, .help { color: var(--muted); }
.container { position: relative; z-index: 1; max-width: 1200px; padding: 22px 22px 80px; }
.container.wide { max-width: 1480px; }
.mobile-only { display: none !important; }
.cat-tabs .active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); }
.cat-tabs a, .cat-tabs button { background: var(--surface); color: var(--text-2); border-color: var(--border); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }

/* view transitions */
.view-in { animation: viewIn .24s ease-out both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; } }

/* ------------------------------------------------------------------ boot screen */
.boot { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  background: radial-gradient(600px 400px at 50% 40%, color-mix(in srgb, var(--accent-base) 10%, transparent), transparent 70%), #000000;
  transition: opacity .45s ease, visibility .45s; }
.boot.done { opacity: 0; visibility: hidden; }
.boot[hidden] { display: none; }
.boot-core { text-align: center; color: #eef0f7; }
.boot-logo { width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 24px; display: grid; place-items: center;
  font: 700 2rem var(--font-display); color: #fff;
  background: linear-gradient(135deg, var(--accent-base), #ff4f8b); box-shadow: 0 0 60px -6px var(--accent-base);
  animation: bootPulse 1.6s ease-in-out infinite; }
@keyframes bootPulse { 50% { transform: scale(1.05); box-shadow: 0 0 90px 0 var(--accent-base); } }
.boot-name { font: 700 1.6rem var(--font-display); letter-spacing: .04em; }
.boot-name span { font-size: .8rem; margin-left: 6px; padding: 2px 7px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .25); vertical-align: middle; }
.boot-bar { width: 220px; height: 3px; margin: 22px auto 12px; border-radius: 3px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-base), #33d6ff); animation: bootBar 1s ease-in-out forwards; }
@keyframes bootBar { to { width: 100%; } }
.boot-msg { font-size: .82rem; color: #9095ab; letter-spacing: .06em; }

/* ------------------------------------------------------------------ dock (sidebar) */
.os { display: flex; min-height: 100vh; }
.dock { position: fixed; top: 0; bottom: 0; left: 0; width: var(--dock-w); z-index: 30; display: flex; flex-direction: column;
  padding: 14px 10px; gap: 6px; background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border-right: 1px solid var(--border);
  transition: width .2s ease; overflow: hidden; }
.dock[hidden] { display: none; }
.dock a, .dock button { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; color: var(--text-2);
  font-weight: 600; font-size: .92rem; white-space: nowrap; border: 1px solid transparent; position: relative; }
.dock a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.dock a i, .dock button i { font-style: normal; width: 24px; text-align: center; font-size: 1.1rem; flex: none; }
.dock a.active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); box-shadow: var(--glow); }
.dock a.active::before { content: ""; position: absolute; left: -10px; top: 22%; bottom: 22%; width: 3px; border-radius: 3px; background: var(--accent-base); }
.dock-brand { margin-bottom: 8px; font: 700 1.1rem var(--font-display) !important; color: var(--text) !important; }
.dock-brand .brand-mark { width: 34px; height: 34px; flex: none; }
.dock-apps { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; scrollbar-width: none; flex: 1; }
.dock-foot { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--border); padding-top: 8px; }
.dock-toggle { background: transparent; cursor: pointer; font: inherit; justify-content: center; color: var(--muted) !important; }
.dock-count { margin-left: auto; background: var(--accent-2, #ff4f8b); color: #fff; font-size: .72rem; border-radius: 999px; padding: 1px 7px; }
body.dock-collapsed .dock-label { display: none; }
body.dock-collapsed .dock a, body.dock-collapsed .dock button { justify-content: center; padding: 10px 0; }
body.dock-collapsed .dock-count { position: absolute; top: 2px; right: 6px; }
.os-main { flex: 1; min-width: 0; margin-left: var(--dock-w); transition: margin-left .2s ease; }
body.no-chrome .os-main { margin-left: 0; }

/* ------------------------------------------------------------------ top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px 22px;
  background: color-mix(in srgb, var(--bg) 72%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border); }
.topbar[hidden] { display: none; }
.gsearch { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 12px; cursor: text;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font: inherit; text-align: left; }
.gsearch:hover { border-color: var(--accent-line); box-shadow: var(--glow); }
.gsearch .gs-text { flex: 1; }
kbd { font: 600 .72rem var(--font); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border-strong); color: var(--muted); background: var(--surface); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.clock { font: 600 .9rem var(--font-display); color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bell { color: var(--text); border-color: var(--border-strong); background: var(--surface); }
#username { color: var(--text-2); font-weight: 600; }
.subnav { display: flex; gap: 6px; padding: 10px 22px 0; overflow-x: auto; scrollbar-width: none; position: relative; z-index: 1; }
.subnav[hidden] { display: none; }
.subnav a { white-space: nowrap; padding: 7px 13px; border-radius: 999px; font-weight: 600; font-size: .88rem; color: var(--text-2);
  border: 1px solid var(--border); background: var(--surface); }
.subnav a:hover { text-decoration: none; border-color: var(--border-strong); }
.subnav a.active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); }

/* ------------------------------------------------------------------ mobile */
.mobile-bar { display: none; }
@media (max-width: 900px) {
  .mobile-only { display: revert !important; }
  .desktop-only { display: none !important; }
  .dock { transform: translateX(-105%); width: 270px; transition: transform .22s ease; box-shadow: 20px 0 60px rgba(0, 0, 0, .5); }
  .dock.open { transform: none; }
  body.dock-collapsed .dock-label { display: inline; }
  .dock-toggle { display: none !important; }
  .os-main { margin-left: 0; }
  .topbar { padding: 8px 12px; gap: 10px; }
  .topbar .brand-mark { width: 32px; height: 32px; }
  .gsearch kbd { display: none; }
  .container { padding: 16px 14px 110px; }
  .subnav { padding: 10px 14px 0; }
  .mobile-bar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 25; padding: 6px; border-radius: 20px; background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border: 1px solid var(--border-strong); box-shadow: 0 10px 40px rgba(0, 0, 0, .45); }
  .mobile-bar[hidden] { display: none; }
  .mobile-bar a, .mobile-bar button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border: 0; background: transparent;
    color: var(--muted); font: 600 .7rem var(--font); border-radius: 14px; cursor: pointer; }
  .mobile-bar i { font-style: normal; font-size: 1.15rem; }
  .mobile-bar a.active { color: var(--text); background: var(--accent-soft); }
  .mobile-bar a:hover { text-decoration: none; }
  .mobile-bar .m-add i { width: 44px; height: 44px; margin-top: -18px; display: grid; place-items: center; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-base), #ff4f8b); color: #fff; font-size: 1.4rem; box-shadow: 0 8px 24px -6px var(--accent-base); }
  .fab { display: none !important; }
  .dock-scrim { position: fixed; inset: 0; z-index: 29; background: rgba(0, 0, 0, .45); }
}

/* ------------------------------------------------------------------ command palette */
.palette-wrap { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; justify-content: center; align-items: flex-start; padding: 10vh 12px 12px; animation: viewIn .15s ease-out; }
.palette { width: min(680px, 100%); background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 18px;
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .8), var(--glow); overflow: hidden; display: flex; flex-direction: column; max-height: 76vh; }
.palette-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.palette-head .ttl { font: 700 .72rem var(--font-display); letter-spacing: .14em; color: var(--accent); white-space: nowrap; }
.palette-head input { border: 0; background: transparent; font-size: 1.1rem; padding: 6px 4px; outline: none !important; }
.palette-list { overflow-y: auto; padding: 6px; }
.pal-sec { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 4px; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer; color: var(--text); }
.pal-item .ic { width: 30px; height: 30px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); overflow: hidden; }
.pal-item .ic img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.pal-item .tx { min-width: 0; flex: 1; }
.pal-item .tx div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-item .sub { font-size: .8rem; color: var(--muted); }
.pal-item .hint { font-size: .75rem; color: var(--muted); }
.pal-item.sel { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.palette-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--border); font-size: .75rem; color: var(--muted); }

/* ------------------------------------------------------------------ command center */
.cc-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.cc-hello { font: 700 2.1rem var(--font-display); margin: 0; letter-spacing: -.02em; }
.cc-hello em { font-style: normal; background: linear-gradient(90deg, var(--accent), #33d6ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cc-date { color: var(--muted); font-weight: 600; margin-top: 4px; }
.cc-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.cc-search { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 18px; margin: 0 0 18px; border-radius: 16px; cursor: text;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--muted); font: inherit; font-size: 1.02rem; text-align: left;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.cc-search:hover { box-shadow: var(--glow); }
.cc-search b { font: 700 .72rem var(--font-display); letter-spacing: .14em; color: var(--accent); }

.wgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 72px; grid-auto-flow: row dense; gap: 16px; }
.widget { grid-column: span 1; grid-row: span 4; display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  transition: box-shadow .2s, border-color .2s, transform .2s; animation: viewIn .3s ease-out both; }
.widget:hover { border-color: var(--border-strong); }
.widget[data-w="2"] { grid-column: span 2; } .widget[data-w="3"] { grid-column: span 3; } .widget[data-w="4"] { grid-column: span 4; }
.widget[data-h="2"] { grid-row: span 2; } .widget[data-h="3"] { grid-row: span 3; } .widget[data-h="4"] { grid-row: span 4; }
.widget[data-h="5"] { grid-row: span 5; } .widget[data-h="6"] { grid-row: span 6; } .widget[data-h="7"] { grid-row: span 7; }
.widget[data-h="8"] { grid-row: span 8; }
.widget.minimized { grid-row: span 1 !important; }
.widget.minimized .w-body, .widget.minimized .w-foot { display: none; }
.w-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; min-height: 44px; }
.w-head .w-ic { font-size: 1rem; }
.w-title { font: 700 .82rem var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-title a { color: inherit; }
.w-actions { display: flex; gap: 2px; opacity: .55; transition: opacity .15s; }
.widget:hover .w-actions, .editing .w-actions { opacity: 1; }
.w-actions button { border: 0; background: transparent; color: var(--muted); cursor: pointer; width: 26px; height: 26px; border-radius: 7px; font-size: .85rem; }
.w-actions button:hover { background: var(--surface-2); color: var(--text); }
.w-body { flex: 1; min-height: 0; overflow: auto; padding: 0 14px 12px; scrollbar-width: thin; }
.w-foot { padding: 6px 14px 10px; font-size: .72rem; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--border); }
.w-foot a { font-weight: 600; }
.widget .pin-badge { display: none; }
.widget.pinned .pin-badge { display: inline; font-size: .8rem; }
.editing .widget { border-style: dashed; border-color: var(--accent-line); }
.editing .widget .w-head { cursor: grab; }
.editing .widget.pinned .w-head { cursor: default; }
.w-resize { display: none; position: absolute; right: 4px; bottom: 4px; width: 18px; height: 18px; cursor: nwse-resize; border-radius: 4px;
  background: linear-gradient(135deg, transparent 50%, var(--accent-line) 50%); touch-action: none; }
.editing .widget:not(.pinned) .w-resize { display: block; }
.widget.dragging { opacity: .35; }
.widget.drop-before { box-shadow: -4px 0 0 0 var(--accent-base), var(--shadow); }
.widget.drop-after { box-shadow: 4px 0 0 0 var(--accent-base), var(--shadow); }
.drag-ghost { position: fixed; z-index: 300; pointer-events: none; padding: 10px 14px; border-radius: 12px; background: var(--surface-solid);
  border: 1px solid var(--accent-line); box-shadow: var(--glow); font-weight: 700; }
.edit-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 14px; border-radius: 14px;
  background: var(--accent-soft); border: 1px solid var(--accent-line); }
.hidden-tray { display: flex; gap: 6px; flex-wrap: wrap; }
.hidden-tray button { border: 1px dashed var(--border-strong); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: .82rem; cursor: pointer; }
@media (max-width: 1180px) {
  .wgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .widget[data-w="3"], .widget[data-w="4"] { grid-column: span 2; }
}
@media (max-width: 700px) {
  .wgrid { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .widget, .widget[data-w] { grid-column: span 1 !important; grid-row: auto !important; max-height: 560px; }
  .w-resize { display: none !important; }
  .cc-hello { font-size: 1.6rem; }
}

/* widget content */
.big-num { font: 700 1.9rem var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.1; }
.mid-num { font: 700 1.25rem var(--font-display); font-variant-numeric: tabular-nums; }
.lbl { font-size: .72rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.mini-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.mini-kpis > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.brief-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.brief-list li a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); color: var(--text); font-weight: 600; }
.brief-list li a:hover { text-decoration: none; box-shadow: inset 0 0 0 1px var(--accent-line); }
.brief-list li a::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-base); box-shadow: 0 0 10px var(--accent-base); flex: none; }
.clock-big { white-space: nowrap; font: 700 clamp(1.9rem, 2.6vw, 2.7rem) var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -.03em; line-height: 1; }
.clock-big small { font-size: 1.1rem; color: var(--muted); margin-left: 4px; }
.weather-now { display: flex; align-items: center; gap: 14px; }
.weather-now .ico { font-size: 2.6rem; }
.wx-days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; text-align: center; font-size: .8rem; }
.wx-days div { background: var(--surface-2); border-radius: 10px; padding: 6px 2px; }
.qa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.qa-grid button, .qa-grid a { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: 600 .85rem var(--font); cursor: pointer; text-align: left; }
.qa-grid button:hover, .qa-grid a:hover { border-color: var(--accent-line); box-shadow: var(--glow); text-decoration: none; }
.quick-note { display: flex; gap: 8px; margin-bottom: 10px; }
.quick-note input { padding: 8px 12px; }

/* ------------------------------------------------------------------ shared section components */
.pbar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.pbar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent-base), #33d6ff); transition: width .4s ease; }
.pbar.good i { background: linear-gradient(90deg, #10b981, #34d399); }
.prog-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); color: var(--text); }
.prog-row:last-child { border-bottom: 0; }
a.prog-row:hover { text-decoration: none; }
.prog-row .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prog-row .pct { font: 700 .9rem var(--font-display); font-variant-numeric: tabular-nums; }
.prog-row .pbar { grid-column: 1 / -1; }
.prog-row .t { grid-column: 1 / -1; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700;
  background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.chip.st-done, .chip.st-Completed { background: var(--good-soft); color: var(--good); border-color: transparent; }
.chip.st-In-Progress, .chip.st-Playing, .chip.st-Active { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip.st-On-Hold, .chip.st-Paused, .chip.st-Wishlist { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.st-Archived, .chip.st-Dropped { opacity: .7; }
.chip.over { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.prio { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.prio::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--pc, var(--p-medium)); box-shadow: 0 0 8px var(--pc, transparent); }
.prio.Urgent { --pc: var(--p-urgent); } .prio.High { --pc: var(--p-high); } .prio.Medium { --pc: var(--p-medium); } .prio.Low { --pc: var(--p-low); }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.task-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--border); }
.task-row:last-child { border-bottom: 0; }
.task-row .tt { min-width: 0; cursor: pointer; }
.task-row .tt .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row .tt .t { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.task-row.done .nm { text-decoration: line-through; color: var(--muted); }
.tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); background: transparent; cursor: pointer; display: grid; place-items: center;
  color: transparent; font-size: .8rem; padding: 0; flex: none; transition: all .15s; }
.tick:hover { border-color: var(--good); }
.tick.on { background: var(--good); border-color: var(--good); color: #062014; }
.group-h { font: 700 .74rem var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 14px 0 4px; display: flex; gap: 8px; align-items: center; }
.group-h .n { background: var(--surface-3); border-radius: 99px; padding: 0 7px; font-size: .7rem; }
.group-h.over { color: var(--bad); }
.view-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 14px; }
.view-tabs button, .view-tabs a { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font: 600 .86rem var(--font); cursor: pointer; }
.view-tabs .active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); }
.view-tabs a:hover { text-decoration: none; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.ecard { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  color: var(--text); box-shadow: var(--shadow); transition: transform .15s, border-color .15s, box-shadow .15s; min-width: 0;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
a.ecard:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent-line); box-shadow: var(--glow); }
.ecard .nm { font: 700 1.05rem var(--font-display); overflow: hidden; text-overflow: ellipsis; }
.ecard .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: .82rem; color: var(--muted); }
.ecard .desc2 { font-size: .88rem; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.activity { list-style: none; margin: 0; padding: 0; font-size: .85rem; }
.activity li { padding: 7px 0 7px 16px; border-left: 2px solid var(--border-strong); position: relative; }
.activity li::before { content: ""; position: absolute; left: -5px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-base); }
.files { display: flex; flex-direction: column; gap: 6px; }
.file-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: .88rem; }
.file-row a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv3 { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .9rem; margin: 0; }
.kv3 dt { color: var(--muted); }
.kv3 dd { margin: 0; }
.empty-state { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty-state .big { font-size: 2.4rem; margin-bottom: 6px; }

/* notes */
.notes-grid { columns: 280px; column-gap: 14px; }
.note-card { break-inside: avoid; display: block; margin-bottom: 14px; padding: 14px 16px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
a.note-card:hover { text-decoration: none; border-color: var(--accent-line); box-shadow: var(--glow); }
.note-card .nm { font: 700 1rem var(--font-display); margin-bottom: 4px; }
.note-card .pv { font-size: .88rem; color: var(--text-2); white-space: pre-line; max-height: 9em; overflow: hidden; }
.note-card.pinned { border-color: var(--accent-line); }
.editor-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border: 1px solid var(--border); border-bottom: 0; border-radius: 12px 12px 0 0; background: var(--surface-2); }
.editor-bar button { border: 0; background: transparent; color: var(--text-2); font: 700 .85rem var(--font); padding: 6px 9px; border-radius: 8px; cursor: pointer; }
.editor-bar button:hover { background: var(--surface-3); color: var(--text); }
.rich { min-height: 280px; padding: 16px; border: 1px solid var(--border); border-radius: 0 0 12px 12px; background: var(--surface-solid); outline: none; line-height: 1.6; overflow-wrap: anywhere; }
.rich:focus { box-shadow: inset 0 0 0 2px var(--accent-line); }
.rich:empty::before { content: attr(data-placeholder); color: var(--muted); }
.rich blockquote { border-left: 3px solid var(--accent-base); margin: 8px 0; padding: 2px 12px; color: var(--text-2); }
.rich pre, .rich code { background: var(--surface-3); border-radius: 6px; }
.rich pre { padding: 10px; overflow-x: auto; }
.note-title { font: 700 1.6rem var(--font-display); border: 0; background: transparent; padding: 4px 0; outline: none !important; }
.checklist { list-style: none; padding: 0; margin: 6px 0; }
.checklist li { display: flex; gap: 8px; align-items: center; padding: 4px 0; }
.checklist li input[type=text] { border: 0; background: transparent; padding: 4px 6px; }
.checklist li.done input[type=text] { text-decoration: line-through; color: var(--muted); }
.saved-ind { font-size: .8rem; color: var(--muted); }

/* games */
.game-card { display: grid; grid-template-rows: auto 1fr; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
a.game-card:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent-line); box-shadow: var(--glow); }
.game-cover { aspect-ratio: 460 / 215; background: linear-gradient(135deg, var(--surface-3), var(--surface-2)); display: grid; place-items: center; font-size: 2rem; overflow: hidden; }
.game-cover img { width: 100%; height: 100%; object-fit: cover; }
.game-card .body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.stars { color: #f5c542; letter-spacing: 1px; }

/* expenses */
.vbars { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 6px; }
.vbars div { flex: 1; min-width: 4px; background: var(--series-1); border-radius: 4px 4px 0 0; position: relative; }
.vbars div:hover { filter: brightness(1.25); }
.vbars-axis { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-top: 4px; }

/* calendar */
.cal-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-head h2 { margin: 0; min-width: 200px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 4px 6px; }
.cal-day { min-height: 108px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); padding: 6px; cursor: pointer;
  display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day:hover { border-color: var(--accent-line); }
.cal-day.other { opacity: .45; }
.cal-day.today { border-color: var(--accent-base); box-shadow: var(--glow); }
.cal-day .dn { font: 700 .85rem var(--font-display); color: var(--text-2); }
.cal-ev { font-size: .74rem; font-weight: 600; padding: 2px 6px; border-radius: 6px; background: var(--surface-3); color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 3px solid var(--ec, var(--accent-base)); }
.cal-ev.done { text-decoration: line-through; opacity: .6; }
.cal-ev.task { --ec: #33d6ff; } .cal-ev.project { --ec: #ff9f43; } .cal-ev.project_start { --ec: #ff9f43; }
.cal-ev.goal { --ec: #3ddc97; } .cal-ev.event { --ec: var(--accent-base); } .cal-ev.game { --ec: #f5c542; }
.cal-more { font-size: .72rem; color: var(--muted); }
.agenda-day { margin-bottom: 14px; }
.agenda-day h3 { font-size: .95rem; margin-bottom: 6px; }
@media (max-width: 700px) {
  .cal-day { min-height: 64px; padding: 4px; }
  .cal-ev { font-size: 0; padding: 0; height: 6px; border-left-width: 0; background: var(--ec, var(--accent-base)); }
  .cal-dow { font-size: .62rem; padding: 2px; }
}

/* notifications */
.notif { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: start; padding: 12px; border-radius: 12px; color: var(--text); border: 1px solid transparent; }
.notif:hover { background: var(--surface-2); text-decoration: none; }
.notif.unread { background: var(--accent-soft); border-color: var(--accent-line); }
.notif .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); }
.notif .nm { font-weight: 700; }

/* directory */
.dir-table td, .dir-table th { vertical-align: middle; }
.dir-table tr.prov { cursor: pointer; }
.dir-table tr.prov:hover td { background: var(--surface-2); }
.cost { display: inline-block; font-size: .7rem; font-weight: 800; letter-spacing: .05em; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.cost.FREE { background: var(--good-soft); color: var(--good); }
.cost.FREE-TIER { background: rgba(51, 214, 255, .12); color: #33d6ff; }
.cost.PAID { background: var(--warn-soft); color: var(--warn); }
.cost.REQUIRES-APPROVAL { background: var(--accent-soft); color: var(--accent); }
.cost.NOT-AVAILABLE { background: var(--surface-3); color: var(--muted); }
[data-theme="light"] .cost.FREE-TIER { color: #0b7ea3; }
.stat-dot { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .82rem; white-space: nowrap; }
.stat-dot::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.stat-dot.working::before, .stat-dot.limited::before { background: var(--good); box-shadow: 0 0 8px var(--good); }
.stat-dot.not_configured::before, .stat-dot.untested::before { background: var(--warn); }
.stat-dot.auth_failed::before, .stat-dot.rate_limited::before { background: #ff9f43; }
.stat-dot.unavailable::before { background: var(--bad); }
.dir-detail td { background: var(--surface-2); }

/* swatches */
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches button { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--border-strong); cursor: pointer; background: var(--c); }
.swatches button.on { box-shadow: 0 0 0 3px var(--surface-solid), 0 0 0 5px var(--c); }

/* ------------------------------------------------------------------ light theme: override hard-coded dark colours from styles.css */
[data-theme="light"] .topbar, [data-theme="light"] .nav a, [data-theme="light"] .count-pill strong, [data-theme="light"] .source-table .src-name,
[data-theme="light"] .steps span.on, [data-theme="light"] .cat-pick button, [data-theme="light"] .pick, [data-theme="light"] .mini,
[data-theme="light"] .range-btns button.active, [data-theme="light"] .chart-tabs button.active, [data-theme="light"] .version-list button,
[data-theme="light"] .sum-card, [data-theme="light"] .upload-zone:hover, [data-theme="light"] .cat-tabs .active, [data-theme="light"] .bell { color: var(--text); }
[data-theme="light"] input, [data-theme="light"] select, [data-theme="light"] textarea { background: #fff; color: var(--text); border-color: var(--border-strong); }
[data-theme="light"] th, [data-theme="light"] .stat .label, [data-theme="light"] .kpi .label, [data-theme="light"] .pr .label,
[data-theme="light"] .sum-card .label, [data-theme="light"] .set-head, [data-theme="light"] .legend, [data-theme="light"] .attr-chips .badge,
[data-theme="light"] .chart-tabs button, [data-theme="light"] .cat-tag, [data-theme="light"] .pr .src, [data-theme="light"] .flag { color: var(--text-2); }
[data-theme="light"] td, [data-theme="light"] .mini { border-bottom-color: var(--border); }
[data-theme="light"] a.mini:hover { background: var(--surface-2); }
[data-theme="light"] .pr, [data-theme="light"] .attr-chips .badge, [data-theme="light"] .trend, [data-theme="light"] .flag,
[data-theme="light"] .badge.no_results, [data-theme="light"] .badge.skipped, [data-theme="light"] .src-status { background: var(--surface-2); border-color: var(--border); }
[data-theme="light"] .price-range, [data-theme="light"] .kpi.hero { background: linear-gradient(135deg, var(--accent-soft), var(--surface)); border-color: var(--accent-line); }
[data-theme="light"] .stat.low, [data-theme="light"] .best-deal, [data-theme="light"] .paid-box, [data-theme="light"] .pick-exact,
[data-theme="light"] .deal-box.great, [data-theme="light"] .deal-box.good, [data-theme="light"] .deal-box.BUY, [data-theme="light"] tr.best td { background: var(--good-soft); border-color: rgba(15, 159, 110, .3); }
[data-theme="light"] .stat.high, [data-theme="light"] .deal-box.expensive, [data-theme="light"] .deal-box.very_expensive,
[data-theme="light"] .deal-box.WAIT, [data-theme="light"] .deal-box.OVERPRICED, [data-theme="light"] tr.suspicious td { background: var(--bad-soft); border-color: rgba(217, 58, 58, .3); }
[data-theme="light"] .deal-box.fair, [data-theme="light"] .deal-box.CONSIDER { background: var(--warn-soft); border-color: rgba(183, 121, 31, .3); }
[data-theme="light"] .stat.total { background: rgba(37, 99, 235, .08); border-color: rgba(37, 99, 235, .25); }
[data-theme="light"] .stat.total .usd { color: #1d4ed8; }
[data-theme="light"] .chart-svg .grid { stroke: rgba(18, 21, 33, .1); }
[data-theme="light"] .chart-svg .axis { fill: var(--muted); }
[data-theme="light"] .chart-wrap .tip { background: #fff; border-color: var(--border-strong); color: var(--text); }
[data-theme="light"] .bar-track { background: var(--surface-3); }
[data-theme="light"] .chart-empty { border-color: var(--border-strong); }
[data-theme="light"] .score-ring { background: conic-gradient(var(--gain) calc(var(--s) * 1%), var(--surface-3) 0); }
[data-theme="light"] .score-ring::after { background: var(--surface-solid); }
[data-theme="light"] .pr.high .big { color: var(--bad); }
[data-theme="light"] .tag { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
[data-theme="light"] .scan-box video { background: #111; }
[data-theme="light"] .upload-zone { border-color: var(--border-strong); }
[data-theme="light"] .card.unavail { opacity: .8; }
[data-theme="light"] .src-status.auth_failed, [data-theme="light"] .src-status.rate_limited, [data-theme="light"] .src-status.unavailable { background: var(--warn-soft); color: #9a4d00; }
[data-theme="light"] .badge.disabled, [data-theme="light"] .badge.no_api_access, [data-theme="light"] .badge.unavailable { background: var(--surface-3); color: var(--muted); }
[data-theme="light"] .tick.on { color: #fff; }
body.arranging, body.arranging * { -webkit-user-select: none; user-select: none; cursor: grabbing !important; }
.editing .w-head { touch-action: none; }
.quick-note { flex-wrap: wrap; }
.quick-note > input, .quick-note > select { width: auto; min-width: 0; flex: 0 1 auto; }
.quick-note > input:first-child { flex: 1 1 200px; }
.gsearch .gs-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 520px) {
  .quick-note > input:first-child { flex-basis: 100%; }
  .quick-note > input[type=date], .quick-note > select { flex: 1 1 120px; }
  .topbar #logout { padding: 6px 9px; }
}
.searchbar input { min-width: 0; }
@media (max-width: 520px) {
  .searchbar { flex-wrap: wrap; }
  .searchbar input { flex: 1 1 100%; order: -1; }
  .searchbar select { flex: 1 1 auto !important; }
  .searchbar .btn { padding: 12px 18px; }
}

.kpis.auto { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpis.auto .kpi.hero { grid-column: span 2; }
.two-col > *, .kpis > *, .cards > *, .detail-grid > * { min-width: 0; }
.kpi .big { overflow-wrap: anywhere; }
@media (max-width: 520px) { .kpis.auto { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpis.auto .kpi .big { font-size: 1.3rem; }
.kpis.auto .kpi.hero .big { font-size: 1.8rem; }

/* ---------- v3.2: price confidence, "price not currently found", possible matches ---------- */
.conf { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 800; letter-spacing: .05em;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); white-space: nowrap; }
.conf-high { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.conf-medium { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.conf-low { color: #fb923c; border-color: color-mix(in srgb, #fb923c 45%, transparent); }
.conf-unverified { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.price-range.possible-range { border-style: dashed; }
.nf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 10px 0; }
@media (max-width: 760px) { .nf-grid { grid-template-columns: 1fr; } }
.nf-grid .lbl { font-size: .72rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.last-known { margin: 8px 0; padding: 8px 12px; border-radius: 10px; background: var(--warn-soft); }
tr.possible td { opacity: .82; }
.health-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.health-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; grid-column: 1 / -1; display: flex; }
.health-bar i { display: block; height: 100%; }
.health-bar .ok { background: var(--good); }
.health-bar .weak { background: var(--warn); }
.health-bar .bad { background: var(--bad); }
.deal-verdict { font-size: .72rem; font-weight: 800; letter-spacing: .05em; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.deal-verdict.great { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.deal-verdict.fair { background: var(--warn-soft); color: var(--warn); }
.deal-verdict.bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.best-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-bottom: 14px; }
.best-tile { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: center; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px; color: var(--text); font: inherit; }
.best-tile:hover { border-color: var(--accent, #7c5cff); }
.best-tile .thumb { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.best-tile .thumb img { width: 100%; height: 100%; object-fit: cover; }
.best-tile .label { font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.best-tile .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#dchips { flex-wrap: wrap; }
/* long option texts (e.g. the price-alert type) must never push the page wider than a phone */
.row > select, .filters select, .filters-panel select { min-width: 0; max-width: 100%; }
#alf { flex-wrap: wrap; }

/* v3.3: lazy images fade in; a soft shimmer while a photo is on its way */
img.lz { opacity: 0; transition: opacity .25s ease; }
img.lz.loaded { opacity: 1; }
.thumb:has(img.lz:not(.loaded)), .mthumb:has(img.lz:not(.loaded)), .pthumb:has(img.lz:not(.loaded)), .game-cover:has(img.lz:not(.loaded)) {
  background: linear-gradient(100deg, var(--surface-2) 30%, color-mix(in srgb, var(--surface-2) 70%, #fff 6%) 50%, var(--surface-2) 70%);
  background-size: 200% 100%; animation: lzshimmer 1.4s linear infinite; }
@keyframes lzshimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { img.lz { transition: none; } .thumb, .mthumb, .pthumb, .game-cover { animation: none !important; } }

/* ======================= v3.3 — SULLY OS: desktop feel, Movies & TV, Travel ======================= */
:root { --rate-mine: #c084fc; --rate-mine-bg: rgba(192, 132, 252, .14); --rate-world: #2dd4bf; --rate-world-bg: rgba(45, 212, 191, .13); }
[data-theme="light"] { --rate-mine: #7e22ce; --rate-mine-bg: rgba(126, 34, 206, .09); --rate-world: #0f766e; --rate-world-bg: rgba(15, 118, 110, .09); }

/* desktop: a soft wallpaper behind the widgets, glass windows */
.view.wide, #view.wide { position: relative; }
.os-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.os-brand { font-family: "Space Grotesk", Inter, sans-serif; font-weight: 700; letter-spacing: .22em; font-size: .78rem; color: var(--muted);
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; }
.os-brand b { color: var(--accent, #7c5cff); margin-left: 2px; }
.wgrid .widget { background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .04);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.wgrid:not(.editing) .widget:hover { border-color: color-mix(in srgb, var(--accent, #7c5cff) 35%, var(--border)); transform: translateY(-1px); }
.w-actions .w-open { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: var(--muted); text-decoration: none; }
.w-actions .w-open:hover { background: var(--surface-2); color: var(--text); }
.dock-sep { height: 1px; margin: 6px 12px; background: var(--border); opacity: .7; }
.app-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.app-icon { display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px; text-decoration: none; color: var(--text);
  transition: background .15s ease, transform .15s ease; }
.app-icon span { font-size: 1.6rem; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px;
  background: linear-gradient(145deg, var(--surface-3), var(--surface-2)); border: 1px solid var(--border); }
.app-icon em { font-style: normal; font-size: .74rem; color: var(--muted); }
.app-icon:hover { background: var(--surface-2); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .wgrid .widget, .app-icon { transition: none; } .wgrid:not(.editing) .widget:hover, .app-icon:hover { transform: none; } }

/* ---- the two ratings: MY RATING (violet ★) vs WORLDWIDE (teal 🌍) — always labelled, never colour alone ---- */
.rate { display: inline-grid; grid-template-columns: auto; padding: 4px 8px; border-radius: 10px; line-height: 1.1; border: 1px solid transparent; }
.rate b { font-size: .6rem; letter-spacing: .08em; font-weight: 800; }
.rate em { font-style: normal; font-weight: 800; font-size: 1rem; font-variant-numeric: tabular-nums; }
.rate em small { font-size: .65em; opacity: .7; font-weight: 600; }
.rate.mine { background: var(--rate-mine-bg); color: var(--rate-mine); border-color: color-mix(in srgb, var(--rate-mine) 35%, transparent); }
.rate.world { background: var(--rate-world-bg); color: var(--rate-world); border-color: color-mix(in srgb, var(--rate-world) 35%, transparent); }
.rate.none { opacity: .55; }
.rate.big em { font-size: 1.6rem; }
.rate-key { font-weight: 800; font-size: .8rem; padding: 1px 6px; border-radius: 6px; }
.rate-key.mine, .rate-mine-text { color: var(--rate-mine) !important; }
.rate-key.world, .rate-world-text { color: var(--rate-world) !important; }
.rate-key.mine { background: var(--rate-mine-bg); } .rate-key.world { background: var(--rate-world-bg); }
.rates { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.rates-col { display: grid; gap: 4px; justify-items: end; }
.rate-bars { display: grid; gap: 8px; margin: 14px 0 6px; }
.rate-bar { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; }
.rate-bar .lbl { font-size: .72rem; font-weight: 800; letter-spacing: .08em; }
.rate-bar .stars { letter-spacing: 2px; font-size: 1.05rem; white-space: nowrap; overflow: hidden; }
.rate-bar .stars .off { opacity: .22; }
.rate-bar .val { font-weight: 800; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.rate-bar.mine { background: var(--rate-mine-bg); color: var(--rate-mine); }
.rate-bar.world { background: var(--rate-world-bg); color: var(--rate-world); }
@media (max-width: 560px) { .rate-bar { grid-template-columns: 1fr auto; } .rate-bar .stars { grid-column: 1 / -1; grid-row: 2; } }

/* ---- Movies & TV ---- */
.title-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.title-card { display: grid; grid-template-rows: auto 1fr; text-decoration: none; color: var(--text); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden; background: var(--surface); transition: transform .15s ease, border-color .15s ease; min-width: 0; }
.title-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent, #7c5cff) 40%, var(--border)); }
.title-card .body { padding: 10px 12px 12px; min-width: 0; }
.title-card .nm { font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.title-card .diff { margin-top: 4px; }
.poster { aspect-ratio: 2 / 3; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.poster img { width: 100%; height: 100%; object-fit: cover; }
.poster .noimg { font-size: 2.6rem; }
.poster.big { border-radius: 16px; width: 100%; max-width: 320px; box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .8); }
.title-detail { display: grid; grid-template-columns: minmax(180px, 320px) minmax(0, 1fr); gap: 26px; align-items: start; }
@media (max-width: 760px) { .title-detail { grid-template-columns: 1fr; } .poster.big { max-width: 220px; } }
.poster-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.poster-strip a { aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.poster-strip img { width: 100%; height: 100%; object-fit: cover; }
.poster-strip .noimg { font-size: 1.2rem; }
.mini .mthumb img { object-fit: cover; }

/* ---- Travel ---- */
.place-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.place-card { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--surface); cursor: pointer;
  transition: transform .15s ease, border-color .15s ease; min-width: 0; }
.place-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent, #7c5cff) 40%, var(--border)); }
.place-card .body { padding: 10px 14px 14px; display: grid; gap: 3px; }
.place-card .nm { font-weight: 800; font-size: 1.05rem; }
.place-card.want { border-style: dashed; }
.place-photo { position: relative; height: 130px; background: radial-gradient(120% 90% at 50% 0%, #141414, #070707);
  display: grid; place-items: center; overflow: hidden; }
.place-photo img { width: 100%; height: 100%; object-fit: cover; }
.place-flag { font-size: 3.2rem; }
.place-fav { position: absolute; top: 8px; right: 10px; color: #facc15; font-size: 1.2rem; text-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
.place-rating { color: #facc15; font-size: .9rem; }
.stars10 { letter-spacing: 1px; } .stars10 span { opacity: .25; }
.place-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 12px 0; }
.place-photos figure { position: relative; margin: 0; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.place-photos img { width: 100%; height: 100%; object-fit: cover; }
.place-photos .x { position: absolute; top: 4px; right: 4px; border: 0; border-radius: 999px; width: 24px; height: 24px; background: rgba(0, 0, 0, .65);
  color: #fff; cursor: pointer; }
.travel-map { height: min(62vh, 560px); border-radius: 16px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.travel-legend { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 10px; font-size: .88rem; }
.travel-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 999px; margin-right: 6px; vertical-align: -1px; border: 2px solid #0b0b10; }
.travel-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.tg-item { position: relative; aspect-ratio: 4 / 3; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; padding: 0; cursor: pointer;
  background: var(--surface-2); display: grid; place-items: center; color: var(--text); font: inherit; }
.tg-item img { width: 100%; height: 100%; object-fit: cover; }
.tg-item span { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; text-align: left; font-weight: 700; font-size: .85rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, .75)); color: #fff; }
.tg-item.noph span { background: none; color: var(--muted); position: static; padding: 0 8px 8px; }
.rate-bar .stars { color: currentColor; }

/* ---- v3.3.1: country flags everywhere in the Travel Center ---- */
/* Flags are real SVG pictures in their official proportions — see flagImg() in travel.js. The height is fixed and
   the width follows the flag's own shape, so nothing is ever stretched or cropped. */
.flag-ic { display: inline-flex; align-items: center; justify-content: center; height: 1.1em; max-width: 3em;
  vertical-align: -0.18em; margin-right: .4em; flex: none; line-height: 1; }
.flag-ic img { height: 100%; width: auto; max-width: 100%; object-fit: contain; display: block;
  filter: drop-shadow(0 0 .5px rgba(255, 255, 255, .45)); }           /* follows the flag's own outline */
.flag-ic img.ph { aspect-ratio: 4 / 3; filter: none; }
.flag-ic.big { height: 2.1em; max-width: 5em; }
.flag-ic.huge { height: 84px; max-width: calc(100% - 24px); margin: 0; }
.flag-ic.huge img { filter: drop-shadow(0 0 1px rgba(255, 255, 255, .35)) drop-shadow(0 10px 18px rgba(0, 0, 0, .85)); }
.place-photo .flag-ic.huge img, .tg-item .flag-ic.huge img { width: auto; height: 100%; object-fit: contain; }
[data-theme="light"] .flag-ic img { filter: drop-shadow(0 0 .5px rgba(0, 0, 0, .5)); }
[data-theme="light"] .flag-ic.huge img { filter: drop-shadow(0 0 1px rgba(0, 0, 0, .35)) drop-shadow(0 8px 14px rgba(0, 0, 0, .3)); }
@media (max-width: 640px) { .flag-ic.huge { height: 72px; max-width: 150px; } }
.place-card .country { font-weight: 800; font-size: 1.08rem; display: flex; align-items: center; }
.place-card .city { font-weight: 600; }
.place-card .meta-line { font-size: .86rem; color: var(--muted); }
.place-card .meta-line strong { color: var(--text); }
.country-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.country-chip { display: inline-flex; align-items: center; gap: 2px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--border); font-size: .84rem; }
.cpick { position: relative; }
.cpick-box { display: flex; align-items: center; gap: 6px; }
.cpick-box .flag-ic { margin: 0 0 0 4px; }
.cpick-box input { flex: 1; min-width: 0; }
.cpick-list { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); max-height: 280px; overflow: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .8); padding: 4px; }
.cpick-list button { display: flex; align-items: center; width: 100%; gap: 6px; text-align: left; border: 0; background: none; color: var(--text);
  padding: 7px 10px; border-radius: 8px; cursor: pointer; font: inherit; }
.cpick-list button:hover, .cpick-list button.sel { background: var(--surface-2); }
.cpick-list .sec { font-size: .7rem; font-weight: 800; letter-spacing: .08em; color: var(--muted); padding: 6px 10px 2px; text-transform: uppercase; }
.leaflet-tooltip .flag-ic { box-shadow: 0 0 0 1px rgba(0, 0, 0, .2); }
.cpick-list { background: #0d0d0d; }
[data-theme="light"] .cpick-list { background: #fff; }

/* ---- v3.3.3: profile photo instead of the "SF" letters ---- */
.brand-mark.has-avatar, .boot-logo.has-avatar { background: #0d0d0d; padding: 0; overflow: hidden; border-radius: 50%;
  box-shadow: 0 0 0 1.5px var(--accent-line), 0 6px 18px -8px rgba(0, 0, 0, .9); }
.brand-mark .avatar-img, .boot-logo .avatar-img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; display: block; }
.boot-logo.has-avatar { box-shadow: 0 0 0 2px var(--accent-line), 0 0 50px -10px var(--accent-base); }
.avatar-preview { width: 84px; height: 84px; border-radius: 50%; overflow: hidden; flex: none; background: #0d0d0d;
  box-shadow: 0 0 0 2px var(--accent-line); }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; display: block; }

/* 3.9.2 — Deals dashboard, refresh progress, game covers */
.deal-dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 10px; }
.deal-dash .dd { background: var(--surface-2, rgba(127,127,127,.08)); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.deal-dash .dd .label { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.deal-dash .dd strong { font-size: .95rem; }
.progress { height: 8px; border-radius: 6px; background: var(--surface-2, rgba(127,127,127,.15)); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); transition: width .4s ease; }
.deal-card.game .thumb { aspect-ratio: 460 / 215; background: #14161b; padding: 0; }
.deal-card.game .thumb img { width: 100%; height: 100%; max-height: none; object-fit: cover; }
.deal-card .thumb .noimg, .deal-card.game .thumb .noimg { width: 100%; height: 100%; display: grid; place-items: center; background: #1b1e25; color: #8a8f99; font-size: 2rem; }
.deal-card .thumb:has(.noimg) { background: #1b1e25; }
.view-tabs .chip-n { opacity: .6; font-size: .8em; font-variant-numeric: tabular-nums; }


/* ================================================================== 3.9.5 — dashboard redesign */
/* sidebar groups */
.nav-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.dock .nav-h { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 8px 12px 4px; border: 0;
  background: transparent; color: var(--muted); font: 700 .68rem var(--font); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.dock .nav-h:hover { color: var(--text-2); }
.dock .nav-h b { font-weight: 400; transition: transform .15s ease; }
.nav-group.closed .nav-h b { transform: rotate(-90deg); }
/* 4.4: a collapsed group hides EVERY link, the current page's too (it used to stay behind as a stray row under the
   header); the header shows a small dot instead so you still see which group holds the page you're on */
.nav-group.closed > a { display: none; }
.dock .nav-h .nav-dot { display: none; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: 8px; }
.nav-group.closed.has-active .nav-h .nav-dot { display: inline-block; }
.dock .nav-h .dock-label { display: inline-flex; align-items: center; }
.dock-apps a { position: relative; padding: 7px 12px; font-size: .9rem; }
.dock-apps a i { font-size: 1rem !important; }
body.dock-collapsed .dock .nav-h { justify-content: center; padding: 6px 0; }
body.dock-collapsed .dock .nav-h b { display: none; }
body.dock-collapsed .dock .nav-h::before { content: ""; display: block; width: 18px; height: 1px; background: var(--border-strong); }
body.dock-collapsed .nav-group.closed > a { display: flex; }

/* top bar extras */
.top-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); text-decoration: none !important; }
.refresh-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: .78rem; font-weight: 600;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); text-decoration: none !important; white-space: nowrap; }
.refresh-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.refresh-pill.busy::before { background: var(--accent-base); animation: pillPulse 1.2s ease-in-out infinite; }
.refresh-pill.warn::before { background: var(--warn); }
.refresh-pill { max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
@keyframes pillPulse { 50% { opacity: .3; } }

/* dashboard layout */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.dash-head h1 { margin: 0; font-family: var(--font-display); font-size: 1.7rem; letter-spacing: -.01em; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 16px 0; }
.kpi2 { position: relative; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow); min-width: 0; overflow: hidden; }
.kpi2 .label { color: var(--muted); font-size: .76rem; font-weight: 600; letter-spacing: .02em; }
.kpi2 .v { font: 700 clamp(1.05rem, 1.3vw, 1.45rem) var(--font-display); margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi2 .t { color: var(--muted); font-size: .76rem; margin-top: 3px; }
.kpi2.accent { border-color: var(--accent-line); background: linear-gradient(160deg, var(--accent-soft), transparent 70%), var(--surface); }
.kpi2 .skel { margin: 0; }
.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.dash-grid > .card { margin: 0; min-width: 0; }
.dash-span2 { grid-column: span 2; }
.dash-span3 { grid-column: 1 / -1; }
.dash-grid .section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.dash-grid .section-head h2 { margin: 0; font-size: 1.02rem; }
.range-btns button.active { background: var(--accent-soft); color: var(--text); }
.chart-note { color: var(--muted); font-size: .74rem; margin: 8px 0 0; }
.empty-chart { display: grid; place-items: center; text-align: center; min-height: 150px; border: 1px dashed var(--border-strong); border-radius: 12px; padding: 16px; }

/* skeletons */
.skel { border-radius: 12px; margin: 6px 0; background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%; animation: skel 1.3s linear infinite; }
.kpi-row > .skel { margin: 0; }
@keyframes skel { to { background-position: -200% 0; } }

/* value chart */
.vchart { position: relative; }
.vchart svg { display: block; width: 100%; height: 190px; overflow: visible; }
.vchart .grid { stroke: var(--border); stroke-width: 1; }
.vchart .ln { stroke: var(--chart-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.vchart .pt { fill: var(--chart-1); stroke: var(--surface-solid); stroke-width: 2; }
.vchart .xh { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.vaxis { display: flex; justify-content: space-between; color: var(--muted); font-size: .72rem; margin-top: 4px; }
.vtip { position: absolute; top: 0; width: 150px; padding: 7px 10px; border-radius: 10px; background: var(--surface-solid); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow); pointer-events: none; font-size: .82rem; }
.vtip .t { color: var(--muted); font-size: .74rem; }

/* category bars (one hue — the bar length is the number) */
.hbars { display: flex; flex-direction: column; gap: 4px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(50px, 1fr) auto; gap: 10px; align-items: center; padding: 7px 8px;
  border-radius: 10px; color: var(--text); text-decoration: none !important; }
.hbar:hover { background: var(--surface-2); }
.hbar .hl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .88rem; }
.hbar .track { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.hbar .track span { display: block; height: 100%; border-radius: 4px; background: var(--chart-1); }
.hbar .hv { text-align: right; white-space: nowrap; font-size: .85rem; font-variant-numeric: tabular-nums; }
.hbar .hv .t { color: var(--muted); margin-left: 4px; }

/* lists */
.dash-grid .mini-list, .card .mini-list { display: flex; flex-direction: column; }
.act-list { display: flex; flex-direction: column; }
.act { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--border);
  color: var(--text); text-decoration: none !important; font-size: .86rem; }
.act:last-child { border-bottom: 0; }
.act:hover { background: var(--surface-2); }
.act .ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); }
.act .tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act .t { color: var(--muted); font-size: .74rem; white-space: nowrap; }
.top-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.top-tile { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); text-decoration: none !important; min-width: 0; transition: border-color .15s ease, transform .15s ease; }
.top-tile:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.top-tile .thumb { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-3); display: grid; place-items: center; }
.top-tile .thumb img { width: 100%; height: 100%; object-fit: contain; }
.top-tile .nm { font-size: .84rem; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hub-tabs { margin-top: 12px; }

@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-span3 { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .dash-span2 { grid-column: auto; }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi2 .v { font-size: 1.2rem; }
  .dash-head h1 { font-size: 1.35rem; }
  .hub-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .hub-tabs a { white-space: nowrap; }
  .vchart svg { height: 150px; }
}
/* 4.4: on phones the slide-in menu keeps the same open / closed groups as the desktop sidebar (no special case) */

/* My Collection — list view */
#clayout { margin-left: auto; }
.section-head:has(#clayout) { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.igrid.list { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.igrid.list .icard { flex-direction: row; align-items: stretch; }
.igrid.list .icard .thumb { width: 92px; height: 92px; flex: none; aspect-ratio: auto; padding: 6px; align-self: center; margin-left: 8px; border-radius: 10px; overflow: hidden; }
.igrid.list .icard .thumb > * { max-width: 100%; max-height: 80px; }
.igrid.list .icard .body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.igrid.list .icard .body { padding: 10px 14px; }
.igrid.list .icard .name { -webkit-line-clamp: 1; }
.summary-hero, .kpi.hero { background: linear-gradient(160deg, var(--accent-soft), transparent 70%), var(--surface) !important; }

/* Settings → Appearance: the three looks, each with a small preview drawn from its own colours */
.theme-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 10px 0 4px; }
.theme-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px; border-radius: 14px; text-align: left;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font: inherit; cursor: pointer; }
.theme-opt:hover { border-color: var(--border-strong); }
.theme-opt.active { border-color: var(--accent-base); box-shadow: 0 0 0 1px var(--accent-base); }
.theme-opt .t { font-size: .74rem; }
.theme-swatch { position: relative; display: block; width: 100%; height: 64px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border-strong); }
.theme-swatch i, .theme-swatch b, .theme-swatch em { position: absolute; display: block; border-radius: 5px; }
.theme-swatch i { left: 0; top: 0; bottom: 0; width: 26%; border-radius: 0; }
.theme-swatch b { left: 32%; top: 12px; right: 10px; height: 18px; }
.theme-swatch em { left: 32%; top: 36px; width: 34%; height: 8px; background: #7c5cff; }
.theme-swatch[data-preview="black"] { background: #000; } .theme-swatch[data-preview="black"] i { background: #0c0c0e; } .theme-swatch[data-preview="black"] b { background: #1e1e22; }
.theme-swatch[data-preview="light"] { background: #eef0f6; } .theme-swatch[data-preview="light"] i { background: #ffffff; } .theme-swatch[data-preview="light"] b { background: #ffffff; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.theme-swatch[data-preview="blue"] { background: #070912; } .theme-swatch[data-preview="blue"] i { background: #10142a; } .theme-swatch[data-preview="blue"] b { background: #1e2442; }
@media (max-width: 560px) { .theme-pick { grid-template-columns: minmax(0, 1fr); } .theme-swatch { height: 48px; } }

/* 3.9.6: section states — loading / updating / error / empty, the same in every theme */
.state-msg { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 14px;
  border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: .88rem; }
.state-msg.error { border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: var(--bad-soft); }
.card.updating { position: relative; }
.card.updating::after { content: "updating…"; position: absolute; top: 10px; right: 14px; font-size: .7rem; color: var(--muted); }
.dash-grid .card.updating .section-head { padding-right: 70px; }
.stale-note { margin: 8px 0 0; }

/* source coverage + McDonald's promotions tables */
.cov-card details { margin-top: 10px; }
.cov-card summary { cursor: pointer; font-weight: 600; }
.cov-table, .promo-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.cov-table th, .cov-table td, .promo-table th, .promo-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.cov-table th, .promo-table th { color: var(--muted); font-weight: 600; font-size: .76rem; }
.cov-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }

/* 3.9.6: tab rows inside a card scroll sideways on a phone instead of widening the page */
.dash-grid .section-head .range-btns { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.dash-grid .section-head .range-btns button { white-space: nowrap; flex: none; }

/* ------------------------------------------------------------------ 4.0 📚 catalogue + ✓ owned */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.cat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px;
  display: flex; flex-direction: column; min-width: 0; }
.cat-tile .thumb { aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: #0b0b0b; display: grid; place-items: center; margin-bottom: 8px; }
.cat-tile .thumb img { width: 100%; height: 100%; object-fit: contain; }
.cat-tile .nm { font-weight: 600; font-size: .9rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-tile.is-owned { border-color: var(--good); box-shadow: 0 0 0 1px var(--good) inset; }
.badge.owned { background: var(--good-soft); color: var(--good); border-color: var(--good); }
.cat-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cat-filters input { flex: 1 1 240px; }
.cat-filters select { width: auto; flex: 0 1 180px; }
.owned-toggle { white-space: nowrap; align-self: center; }
@media (max-width: 640px) { .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cat-filters select { flex: 1 1 45%; } }

/* ------------------------------------------------------------------ 4.1 🛒 Market */
.mk-search { max-width: 860px; margin: 4px 0 12px; }
.mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.mk-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px;
  display: flex; flex-direction: column; gap: 4px; min-width: 0; cursor: pointer; transition: border-color .15s, transform .15s; }
.mk-card:hover, .mk-card:focus-visible { border-color: var(--accent); transform: translateY(-1px); outline: none; }
.mk-card.is-owned { border-color: var(--good); box-shadow: 0 0 0 1px var(--good) inset; }
.mk-card .thumb { aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: #0b0b0b; display: grid; place-items: center; margin-bottom: 4px; }
.mk-card .thumb img { width: 100%; height: 100%; object-fit: contain; }
.mk-card .nm { font-weight: 600; font-size: .9rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mk-card .cat-tag { font-size: .72rem; }
.mk-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-price { margin-top: auto; padding-top: 6px; border-top: 1px dashed var(--border); }
.mk-price strong { font-size: 1.02rem; }
.mk-price.none { color: var(--muted); font-size: .85rem; }
.mk-badges { gap: 4px; flex-wrap: wrap; }
.mk-more { text-align: center; margin: 16px 0; }
.mk-wait { padding: 30px 0; }
.mk-head { grid-template-columns: 200px 1fr; }
.mk-refs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.mk-refs .kpi2 { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; }
.mk-refs .kpi2 .v { font-weight: 700; font-size: 1.1rem; }
.mk-ids { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 14px; }
.mk-ids > div > div { overflow-wrap: anywhere; }
.mk-offers td { vertical-align: top; }
.mk-deal { margin: 10px 0; border-color: var(--accent); }
#mkcats { flex-wrap: wrap; }
@media (max-width: 640px) {
  .mk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mk-head { grid-template-columns: 1fr; }
  .mk-refs { grid-template-columns: 1fr; }
}

/* ================================================================== 4.2 ♨️ Steam */
.st-banner { padding: 10px 14px; margin-bottom: 10px; display: flex; gap: 8px; align-items: center; font-size: .92rem; }
.st-banner.warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-soft); }
.st-banner.bad { border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: var(--bad-soft); }
.st-area > h2, .st-area .section-head h2 { margin-bottom: 10px; }
.st-connect { max-width: 680px; padding: 22px 24px; }
.st-connect-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.st-logo { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-size: 1.8rem; background: linear-gradient(135deg, #1b2838, #2a475e); flex: none; }
.st-steps { margin: 6px 0 16px; padding-left: 22px; line-height: 1.55; }
.st-steps li { margin: 4px 0; }
.st-steps li.done { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--good); }
.st-signin { background: linear-gradient(135deg, #1b2838, #2a475e); border-color: #66c0f4; color: #fff; }

.st-hero { padding: 18px 20px; background: linear-gradient(160deg, color-mix(in srgb, #2a475e 30%, var(--surface)), var(--surface) 55%); }
.st-id { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; }
.st-avatar { width: 92px; height: 92px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; font-size: 2.2rem; background: var(--surface-3);
  border: 3px solid #57585a; }
.st-avatar.online { border-color: #57cbde; }
.st-avatar.ingame { border-color: #90ba3c; }
.st-avatar img { width: 100%; height: 100%; object-fit: cover; }
.st-name { font-size: 1.45rem; font-weight: 800; line-height: 1.15; word-break: break-word; }
.st-flag { width: 18px; height: auto; vertical-align: -2px; border-radius: 2px; }
.st-state { font-size: .88rem; margin-top: 4px; color: var(--muted); }
.st-state.online { color: #57cbde; }
.st-state.ingame { color: #90ba3c; }
.st-level-box { text-align: center; display: grid; justify-items: center; gap: 4px; }
.st-level { width: 54px; height: 54px; border-radius: 50%; border: 3px solid #c02942; display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; }
.st-level.na { border-color: var(--border); color: var(--muted); }
.st-yos { font-size: .8rem; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; }
.st-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin-top: 16px; }
.st-stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.st-stat .v { font-size: 1.3rem; font-weight: 800; line-height: 1.2; }
.st-stat .l { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.st-stat .t { font-size: .75rem; }
.st-foot { margin: 12px 0 0; }

.st-fav { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.st-fav-h { display: flex; justify-content: space-between; align-items: center; }
.st-fav-h .lbl { font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.st-fav-body { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 16px; align-items: center; margin-top: 10px; cursor: pointer; }
.st-fav-cover { aspect-ratio: 460 / 215; border-radius: 10px; overflow: hidden; background: var(--surface-3); display: grid; place-items: center; font-size: 2rem; }
.st-fav-cover img { width: 100%; height: 100%; object-fit: cover; }
.st-fav-name { font-size: 1.15rem; font-weight: 800; margin-bottom: 8px; }
.st-fav-stats { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 8px; }
.st-fav-stats div { display: grid; }
.st-fav-stats strong { font-size: 1.15rem; }
.st-fav-stats span { font-size: .78rem; color: var(--muted); }

.st-cover { aspect-ratio: 460 / 215; background: linear-gradient(135deg, var(--surface-3), var(--surface-2)); display: grid; place-items: center; font-size: 1.6rem; overflow: hidden; }
.st-cover img { width: 100%; height: 100%; object-fit: cover; }
.st-recent { display: grid; gap: 10px; }
.st-rg { display: grid; grid-template-columns: 220px 1fr; gap: 14px; padding: 12px; align-items: start; }
.st-rg-cover { padding: 0; border: 0; background: none; border-radius: 8px; overflow: hidden; cursor: pointer; }
.st-rg-name { all: unset; cursor: pointer; font-weight: 800; font-size: 1.05rem; }
.st-rg-name:hover { color: var(--accent); }
.st-rg-hours { font-size: .9rem; margin-top: 2px; }
.st-rg-ach { margin-top: 10px; }
.st-ach-line { display: flex; justify-content: space-between; gap: 8px; font-size: .88rem; margin-bottom: 4px; }
.st-rare { color: #e5b55a; font-weight: 700; }
.st-icons { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.st-ai { width: 34px; height: 34px; border-radius: 5px; overflow: hidden; background: var(--surface-3); display: grid; place-items: center; font-size: .78rem; font-weight: 700; flex: none; }
.st-ai img { width: 100%; height: 100%; }
.st-ai.rare { box-shadow: 0 0 0 2px #e5b55a; }
.st-ai.more { color: var(--muted); }
.st-ai.big { width: 48px; height: 48px; }

.st-gm-cover { aspect-ratio: 460 / 215; max-height: 220px; width: 100%; border-radius: 10px; overflow: hidden; background: var(--surface-3); display: grid; place-items: center; font-size: 2rem; margin-bottom: 12px; }
.st-gm-cover img { width: 100%; height: 100%; object-fit: cover; }
.st-gm-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 8px; }
.st-achs { display: grid; gap: 6px; max-height: 52vh; overflow: auto; padding-right: 4px; }
.st-a { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 8px; border-radius: 10px; background: var(--surface-2); }
.st-a.locked { opacity: .6; }
.st-a-nm { font-weight: 700; }
.st-a-side { text-align: right; white-space: nowrap; }
.st-rare-b { background: color-mix(in srgb, #e5b55a 18%, transparent); color: #e5b55a; padding: 1px 7px; font-size: .68rem; }
.st-pick-list { display: grid; gap: 6px; max-height: 55vh; overflow: auto; margin-top: 10px; }
.st-pthumb { width: 120px; aspect-ratio: 460 / 215; height: auto; background: var(--surface-3); overflow: hidden; border-radius: 6px; }
.st-pthumb img { width: 100%; height: 100%; object-fit: cover; }

.st-lib-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.st-lib-tools input[type=search] { flex: 1 1 220px; min-width: 0; }
.st-lib-tools .view-tabs { margin: 0; }
.st-count { margin: 4px 0 10px; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.st-card { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-rows: auto 1fr; border-radius: 12px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.st-card:hover, .st-card:focus-visible { border-color: var(--accent-line); }
.st-card:focus-visible { outline: 2px solid var(--accent-line); }
.st-card-b { padding: 9px 11px 11px; display: grid; gap: 4px; align-content: start; min-width: 0; }
.st-card-nm { font-weight: 700; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-card-ach { display: grid; gap: 3px; }
.st-list { display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px; }
.st-row { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: 32px minmax(0, 1fr) 80px 100px 110px 90px; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; }
.st-row:hover, .st-row:focus-visible { background: var(--surface-2); }
.st-row-ic { width: 32px; height: 32px; border-radius: 4px; overflow: hidden; background: var(--surface-3); display: grid; place-items: center; font-size: .9rem; }
.st-row-ic img { width: 100%; height: 100%; }
.st-row-nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-row-h { text-align: right; font-weight: 700; }
@media (max-width: 760px) {
  .st-id { grid-template-columns: auto 1fr; }
  .st-level-box { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 6px 10px; text-align: left; }
  .st-avatar { width: 72px; height: 72px; }
  .st-fav-body { grid-template-columns: 1fr; }
  .st-rg { grid-template-columns: 120px 1fr; gap: 10px; padding: 10px; }
  .st-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .st-row { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .st-row-r, .st-row-lp, .st-row-a { display: none; }
  .st-a { grid-template-columns: 40px 1fr; }
  .st-a-side { grid-column: 2; text-align: left; }
  .st-ai.big { width: 40px; height: 40px; }
}
.st-avatar .noimg, .st-ai .noimg, .st-row-ic .noimg { font-size: inherit; background: none; }
.st-ai img, .st-row-ic img, .st-avatar img { object-fit: cover; }

/* ================================================================== 4.2.1 dialogs: always closable, never wider than the screen */
.modal-backdrop { grid-template-columns: minmax(0, 1fr); }
.modal, .modal.wide { max-width: 100%; min-width: 0; justify-self: center; }
.modal-body { min-width: 0; }
.modal-body .table-wrap { max-width: 100%; overflow-x: auto; }
.modal-close { position: sticky; top: 10px; float: right; z-index: 3; width: 36px; height: 36px; margin: 10px 10px -46px 0;
  display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 1.4rem; }
.modal-close:hover, .modal-close:focus-visible { color: var(--text); border-color: var(--accent-line); }
.modal-body h2:first-child, .mk-head h2 { padding-right: 34px; }
.mk-head > * { min-width: 0; }
.mk-head h2 { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .modal-backdrop { padding: 10px 8px; }
  .modal-body { padding: 16px 14px; }
  .mk-head .item-photo { max-width: 220px; width: 100%; justify-self: center; }
}

/* ================================================================== 4.2.1 a photo that can't be shown: one consistent picture */
.noimg { display: grid; place-items: center; align-content: center; gap: 4px; width: 100%; height: 100%; min-height: 60px;
  background: var(--surface-2); color: var(--muted); font-size: 1.6rem; text-align: center; }
.noimg small { font-size: .68rem; letter-spacing: .02em; }
.item-photo:has(.noimg) { background: var(--surface-2); }
.mk-card .thumb .noimg, .cat-tile .thumb .noimg { border-radius: 10px; }
.mthumb .noimg small, .pthumb .noimg small, .st-ai .noimg small, .st-row-ic .noimg small, .st-avatar .noimg small { display: none; }
.mk-editions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.mk-editions .badge { font-size: .68rem; }
.badge.unverified { background: var(--warn-soft); color: var(--warn); }
