/* =========================================================================
   WINTER ANALYTICS — frost / ice / snow design
   Scoped to .winter-frame to not leak into the rest of the app.
   ========================================================================= */
.winter-frame {
  --w-bg-deep:    #EAF2FB;
  --w-bg:         #F2F8FE;
  --w-bg-alt:     #DCE8F5;
  --w-surface:    rgba(255, 255, 255, 0.78);
  --w-surface-2:  rgba(225, 236, 248, 0.7);
  --w-line:       rgba(120, 158, 200, 0.22);
  --w-line-strong:rgba(80, 120, 170, 0.32);
  --w-text:       #0F2238;
  --w-text-2:     #4A6585;
  --w-text-3:     #7C90A8;
  --w-ice-1:      #DBEAFE;
  --w-ice-2:      #BFDBFE;
  --w-ice-3:      #93C5FD;
  --w-ice-4:      #3B82F6;
  --w-ice-5:      #1D4ED8;
  --w-cyan:       #67E8F9;
  --w-violet:     #A78BFA;
  --w-frost-glow: rgba(147, 197, 253, 0.45);
  --w-warn:       #F97316;
  --w-good:       #10B981;
  --w-radius:     14px;
  --w-radius-lg:  20px;
  --w-shadow-sm:  0 1px 2px rgba(15, 34, 56, 0.06), 0 0 0 1px rgba(120, 158, 200, 0.18);
  --w-shadow:     0 6px 18px -10px rgba(15, 34, 56, 0.18), 0 1px 3px rgba(15, 34, 56, 0.04), 0 0 0 1px rgba(120, 158, 200, 0.18);
  --w-blur:       saturate(140%) blur(14px);

  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  color: var(--w-text);
  background:
    radial-gradient(900px 480px at 110% -10%, #C6DCF5 0%, transparent 60%),
    radial-gradient(700px 380px at -10% 110%, #DCE8F5 0%, transparent 60%),
    linear-gradient(180deg, #F0F6FD 0%, #E3EEFA 100%);
  position: relative;
  -webkit-font-smoothing: antialiased;
}
.winter-frame * { box-sizing: border-box; }

/* Dark theme override — switch palette to dark frost */
[data-theme="dark"] .winter-frame {
  --w-text:       #E2EAF5;
  --w-text-2:     #9FB1CC;
  --w-text-3:     #6E8095;
  --w-line:       rgba(120, 158, 200, 0.18);
  --w-line-strong:rgba(120, 158, 200, 0.34);
  --w-surface:    rgba(20, 32, 50, 0.6);
  --w-surface-2:  rgba(40, 56, 80, 0.55);
  background:
    radial-gradient(900px 480px at 110% -10%, rgba(59, 130, 246, 0.18) 0%, transparent 60%),
    radial-gradient(700px 380px at -10% 110%, rgba(100, 116, 200, 0.15) 0%, transparent 60%),
    linear-gradient(180deg, #0c1626 0%, #0a1220 100%);
}

/* ---- snowfall ---------------------------------------------------------- */
.snowflake {
  position: absolute;
  top: -4%;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 5px rgba(220, 235, 255, 0.85);
  filter: blur(0.2px);
  pointer-events: none;
}
@keyframes winterFall {
  0%   { transform: translate3d(0, -8vh, 0); }
  100% { transform: translate3d(var(--drift, 0), 110vh, 0); }
}
.winter-snowfall { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.winter-frame > .winter-content { position: relative; z-index: 1; }

/* ---- sub-tabs ---------------------------------------------------------- */
.w-subtabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--w-line);
  padding: 0 22px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: var(--w-blur);
  -webkit-backdrop-filter: var(--w-blur);
}
[data-theme="dark"] .w-subtabs { background: rgba(15, 25, 40, 0.6); }
.w-subtab {
  background: transparent; border: none;
  padding: 12px 14px; font-size: 13px; color: var(--w-text-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-weight: 500; display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; font-family: inherit;
}
.w-subtab.on, .w-subtab.active {
  color: var(--w-ice-5);
  border-bottom-color: var(--w-ice-4);
  font-weight: 700;
}
[data-theme="dark"] .w-subtab.on, [data-theme="dark"] .w-subtab.active { color: #93C5FD; }
.w-subtab:hover { color: var(--w-text); }

/* ---- frost card -------------------------------------------------------- */
.frost-card {
  background: var(--w-surface);
  backdrop-filter: var(--w-blur);
  -webkit-backdrop-filter: var(--w-blur);
  border: 1px solid var(--w-line);
  border-radius: var(--w-radius);
  box-shadow: var(--w-shadow-sm);
  position: relative;
}

/* ---- KPI ICE CUBES ----------------------------------------------------- */
.kpi-cubes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
@media (max-width: 1100px) { .kpi-cubes { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .kpi-cubes { grid-template-columns: 1fr; } }

.ice-cube {
  position: relative;
  border-radius: 16px;
  padding: 18px 18px 16px;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(160deg, rgba(255,255,255,0.55) 0%, rgba(219,234,254,0.42) 100%);
  border: 1px solid rgba(147, 197, 253, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.85),
    inset 0 -1px 0 rgba(147, 197, 253, 0.35),
    0 8px 24px -16px rgba(15, 34, 56, 0.35),
    0 1px 2px rgba(15, 34, 56, 0.05);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  cursor: default;
}
[data-theme="dark"] .ice-cube {
  background: linear-gradient(160deg, rgba(40,56,80,0.6) 0%, rgba(30,50,90,0.4) 100%);
  border-color: rgba(147, 197, 253, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(147, 197, 253, 0.18),
    inset 0 -1px 0 rgba(60, 90, 150, 0.4),
    0 8px 24px -16px rgba(0, 0, 0, 0.6);
}

.ice-cube::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.6) 0%, transparent 35%),
    radial-gradient(120% 80% at 100% 100%, rgba(96, 165, 250, 0.18), transparent 60%);
  pointer-events: none;
}
[data-theme="dark"] .ice-cube::before {
  background:
    linear-gradient(135deg, rgba(120,160,220,0.18) 0%, transparent 35%),
    radial-gradient(120% 80% at 100% 100%, rgba(96, 165, 250, 0.22), transparent 60%);
}
.ice-cube::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(118deg, transparent 24%, rgba(255,255,255,0.55) 24.15%, transparent 24.3%),
    linear-gradient(103deg, transparent 41%, rgba(147, 197, 253, 0.4) 41.1%, transparent 41.25%),
    linear-gradient(96deg,  transparent 58%, rgba(255,255,255,0.45) 58.1%, transparent 58.25%),
    linear-gradient(112deg, transparent 72%, rgba(147, 197, 253, 0.35) 72.1%, transparent 72.2%),
    linear-gradient(85deg,  transparent 86%, rgba(255,255,255,0.5) 86.1%, transparent 86.25%);
  opacity: 0.7;
  pointer-events: none;
}
[data-theme="dark"] .ice-cube::after { opacity: 0.35; }
.ice-cube > * { position: relative; z-index: 1; }

.ice-cube .ic-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10.5px; color: var(--w-text-2); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 6px;
}
.ice-cube .ic-flake {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.85);
  color: var(--w-ice-4);
  box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.6), 0 2px 8px rgba(59, 130, 246, 0.2);
}
[data-theme="dark"] .ice-cube .ic-flake {
  background: rgba(20,32,50,0.85);
  color: #93C5FD;
  box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.4), 0 2px 8px rgba(59, 130, 246, 0.3);
}
.ice-cube .ic-value {
  font-size: 24px; font-weight: 800; letter-spacing: -0.5px;
  color: var(--w-text);
  display: flex; align-items: baseline; gap: 6px;
  font-variant-numeric: tabular-nums;
}
.ice-cube .ic-value small { font-size: 13px; font-weight: 600; color: var(--w-text-2); }
.ice-cube .ic-meta { font-size: 11.5px; color: var(--w-text-2); margin-top: 4px; line-height: 1.45; }

.ice-cube.frozen   { background: linear-gradient(160deg, rgba(241,249,255,0.6)  0%, rgba(186,219,253,0.38) 100%); }
.ice-cube.payout   { background: linear-gradient(160deg, rgba(245,250,255,0.6)  0%, rgba(199,222,247,0.38) 100%); }
.ice-cube.profit   { background: linear-gradient(160deg, rgba(239,247,255,0.62) 0%, rgba(165,210,250,0.42) 100%); border-color: rgba(125, 180, 240, 0.6); }
.ice-cube.timeout  { background: linear-gradient(160deg, rgba(243,247,255,0.6)  0%, rgba(195,212,245,0.4)  100%); }
[data-theme="dark"] .ice-cube.frozen   { background: linear-gradient(160deg, rgba(30,55,90,0.55)  0%, rgba(40,70,110,0.4) 100%); }
[data-theme="dark"] .ice-cube.payout   { background: linear-gradient(160deg, rgba(30,50,90,0.6)  0%, rgba(50,80,120,0.4) 100%); }
[data-theme="dark"] .ice-cube.profit   { background: linear-gradient(160deg, rgba(35,60,100,0.65) 0%, rgba(45,80,140,0.45) 100%); }
[data-theme="dark"] .ice-cube.timeout  { background: linear-gradient(160deg, rgba(40,55,90,0.6)  0%, rgba(60,75,110,0.4)  100%); }
.ice-cube.payout .ic-flake { color: #2563EB; }
.ice-cube.profit .ic-flake { color: #1D4ED8; background: rgba(219, 234, 254, 0.85); }
.ice-cube.timeout .ic-flake { color: #4338CA; background: rgba(224, 231, 255, 0.9); }

/* expandable profit details */
details.ice-cube > summary { list-style: none; cursor: pointer; }
details.ice-cube > summary::-webkit-details-marker { display: none; }
.ice-cube .ic-arrow { display: inline-block; transition: transform 0.2s; margin-left: 4px; opacity: 0.6; }
details.ice-cube[open] .ic-arrow { transform: rotate(180deg); }
.ice-cube .ic-body {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed var(--w-line);
  font-size: 12px;
}

/* ---- source row -------------------------------------------------------- */
.source-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--w-surface);
  border: 1px solid var(--w-line);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 12.5px;
  backdrop-filter: var(--w-blur);
  -webkit-backdrop-filter: var(--w-blur);
  flex-wrap: wrap;
}
.source-row label { color: var(--w-text-2); font-weight: 600; }
.source-row select {
  background: white;
  border: 1px solid var(--w-line);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12.5px;
  font-family: inherit;
  color: var(--w-text);
  font-weight: 500;
  cursor: pointer;
}
[data-theme="dark"] .source-row select {
  background: rgba(20, 32, 50, 0.7);
  color: var(--w-text);
  border-color: var(--w-line-strong);
}
.source-row .accuracy {
  margin-left: auto;
  background: rgba(220, 252, 231, 0.7);
  color: #047857;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(167, 220, 194, 0.6);
  font-size: 11.5px;
}
.source-row .accuracy.low { background: rgba(254, 226, 226, 0.7); color: #b91c1c; border-color: rgba(248, 180, 180, 0.6); }
[data-theme="dark"] .source-row .accuracy { background: rgba(16,185,129,0.18); color: #6ee7b7; border-color: rgba(110,231,183,0.3); }
[data-theme="dark"] .source-row .accuracy.low { background: rgba(220,38,38,0.2); color: #fca5a5; border-color: rgba(252,165,165,0.3); }

/* ---- section heading --------------------------------------------------- */
.w-section-h {
  display: flex; align-items: center; justify-content: space-between;
  margin: 18px 0 10px;
}
.w-section-h h3 {
  font-size: 14px; font-weight: 700; margin: 0;
  display: flex; align-items: center; gap: 8px;
  color: var(--w-text);
}
.w-section-h .hint { font-size: 11.5px; color: var(--w-text-2); }
.w-section-h h3 .frost-bullet {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--w-ice-4);
  box-shadow: 0 0 10px var(--w-ice-3);
}

/* ---- SKU cards (frozen products list) ---------------------------------- */
.sku-card {
  background: var(--w-surface);
  backdrop-filter: var(--w-blur);
  -webkit-backdrop-filter: var(--w-blur);
  border: 1px solid var(--w-line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
.sku-card::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 0; width: 4px;
  background: linear-gradient(180deg, var(--w-ice-3), var(--w-ice-4));
  border-radius: 14px 0 0 14px;
  opacity: 0.85;
}
.sku-thumb {
  width: 80px; height: 110px; border-radius: 12px;
  background: linear-gradient(135deg, #FCE7F3, #FECACA);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.4), 0 2px 6px rgba(15, 34, 56, 0.1);
}
.sku-thumb img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
.sku-thumb-ph { font-size: 30px; opacity: 0.55; position: relative; z-index: 1; }
.sku-thumb::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.45) 0%, rgba(219, 234, 254, 0.15) 100%);
  pointer-events: none;
}
.sku-rank {
  position: absolute;
  top: -6px; left: -6px;
  background: white;
  border: 1px solid var(--w-line);
  font-size: 10px; font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--w-text-2);
  z-index: 2;
}
[data-theme="dark"] .sku-rank { background: rgba(20,32,50,0.95); color: var(--w-text-2); }
.sku-body { flex: 1; min-width: 0; }
.sku-title-row { display: flex; gap: 12px; align-items: flex-start; }
.sku-rank-num { font-size: 12.5px; font-weight: 700; color: var(--w-text-3); flex-shrink: 0; }
.sku-title { font-size: 13.5px; font-weight: 600; color: var(--w-text); line-height: 1.35; flex: 1; min-width: 0; }
.sku-share {
  background: rgba(219, 234, 254, 0.7);
  color: var(--w-ice-5);
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(147, 197, 253, 0.5);
  flex-shrink: 0;
}
[data-theme="dark"] .sku-share { background: rgba(59,130,246,0.18); color: #93C5FD; }
.sku-meta { font-size: 11.5px; color: var(--w-text-2); margin: 6px 0; line-height: 1.5; }
.sku-meta b { color: var(--w-text); font-weight: 600; }
.sku-meta .accent { color: var(--w-ice-5); font-weight: 600; }
[data-theme="dark"] .sku-meta .accent { color: #93C5FD; }
.sku-payout { font-size: 11.5px; color: var(--w-text); margin-top: 2px; }
.sku-payout b { color: var(--w-ice-5); font-size: 13px; }
[data-theme="dark"] .sku-payout b { color: #93C5FD; }

.glacier-bar {
  height: 8px;
  background: rgba(219, 234, 254, 0.55);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
  position: relative;
  border: 1px solid rgba(147, 197, 253, 0.35);
}
[data-theme="dark"] .glacier-bar { background: rgba(40,56,80,0.6); }
.glacier-bar > i {
  display: block; height: 100%;
  background: linear-gradient(90deg, #93C5FD, #60A5FA, #3B82F6, #6366F1);
  border-radius: 999px;
  position: relative;
}
.glacier-bar > i::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.6) 50%, transparent 100%);
  background-size: 60% 100%;
  background-repeat: no-repeat;
  animation: shimmer 3.2s linear infinite;
}
@keyframes shimmer {
  0% { background-position: -60% 0; }
  100% { background-position: 160% 0; }
}
.sku-value-bottom { font-size: 11.5px; color: var(--w-text-2); margin-top: 6px; }
.sku-value-bottom b { color: var(--w-text); font-weight: 700; font-size: 13px; }

/* ---- frost banner ------------------------------------------------------ */
.frost-banner {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--w-radius);
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.7), rgba(255,255,255,0.4));
  border: 1px solid rgba(147, 197, 253, 0.5);
  margin-bottom: 14px;
  backdrop-filter: var(--w-blur);
  -webkit-backdrop-filter: var(--w-blur);
}
[data-theme="dark"] .frost-banner {
  background: linear-gradient(135deg, rgba(35,55,90,0.55), rgba(20,32,50,0.4));
  border-color: rgba(147, 197, 253, 0.25);
}
.frost-banner .fb-icon {
  flex-shrink: 0;
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,0.85);
  color: var(--w-ice-5);
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.5);
}
[data-theme="dark"] .frost-banner .fb-icon { background: rgba(20,32,50,0.9); color: #93C5FD; }
.frost-banner .fb-title { font-size: 12.5px; font-weight: 700; color: var(--w-text); margin-bottom: 2px; }
.frost-banner .fb-body  { font-size: 12px; color: var(--w-text-2); line-height: 1.5; }

/* ---- empty/loading states --------------------------------------------- */
.w-empty { padding: 40px; text-align: center; color: var(--w-text-2); font-size: 13px; }

/* ---- info chips next to source select --------------------------------- */
.cap-info-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.cap-info-chips .chip {
  padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--w-surface-2); color: var(--w-text-2);
  border: 1px solid var(--w-line);
}
.cap-info-chips .chip b { color: var(--w-text); }

/* ---- illiquid alert variant (winter style) ---------------------------- */
.illi-banner {
  display: flex; gap: 12px;
  padding: 12px 14px; margin: 14px 0;
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.6), rgba(255,255,255,0.4));
  border: 1px solid rgba(252, 165, 165, 0.5);
  border-radius: var(--w-radius);
  backdrop-filter: var(--w-blur);
}
[data-theme="dark"] .illi-banner {
  background: linear-gradient(135deg, rgba(120, 30, 30, 0.4), rgba(20, 32, 50, 0.4));
  border-color: rgba(252, 165, 165, 0.25);
}
.illi-banner .ib-icon { width: 32px; height: 32px; border-radius: 8px; background: rgba(255,255,255,0.85); color: #b91c1c; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
[data-theme="dark"] .illi-banner .ib-icon { background: rgba(20,32,50,0.9); color: #fca5a5; }
.illi-banner .ib-title { font-size: 12.5px; font-weight: 700; color: var(--w-text); margin-bottom: 2px; }
.illi-banner .ib-body { font-size: 12px; color: var(--w-text-2); line-height: 1.5; }
