@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg-base: #000000;
    --bg-body: #000000;
    --bg-body-grad: radial-gradient(circle at 50% 0%, #0c0d19 0%, #000000 70%);
    --bg-glass: rgba(10,10,11,0.6);
    --bg-glass-hover: rgba(18,18,20,0.8);
    --bg-glass-opaque: #0a0a0b;
    --border-glass: rgba(255,255,255,0.08);
    --border-light: rgba(255,255,255,0.16);
    --text-main: #FFFFFF;
    --text-muted: rgba(255,255,255,0.55);
    
    --accent: #5e6ad2;
    --accent-glow: rgba(94,106,210,0.15);
    --sys-green: #07CA6B;
    --sys-red: #FA6476;
    --sys-orange: #E89558;
    
    --font-primary: 'Inter', -apple-system, sans-serif;
    
    --card-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 20px 80px rgba(0,0,0,0.6);
    --widget-shadow: 0 10px 40px rgba(0,0,0,0.6);
    
    --radius-lg: 20px;
    --radius-md: 16px;

    /* Z-index layering system */
    --z-base: 1;
    --z-content: 2;
    --z-sticky: 10;
    --z-pinned: 20;
    --z-corner: 30;
    --z-nav: 50;
    --z-dropdown: 90;
    --z-geo-popup: 200;
    --z-header: 500;
    --z-toast: 1000;
    --z-loader: 9999;
    --z-modal: 10000;
    --z-tooltip: 99999;
}

[data-theme="light"] {
    --bg-base: #F4F5F8;
    --bg-body: #F4F5F8;
    --bg-body-grad: #F4F5F8;
    --bg-glass: #FFFFFF;
    --bg-glass-hover: #F8FAFC;
    --bg-glass-opaque: #FFFFFF;
    --border-glass: #CBD5E1;
    --border-light: #94A3B8;
    --text-main: #0F172A;
    --text-muted: #64748B;
    
    --accent: #5e6ad2;
    --accent-glow: rgba(94,106,210,0.2);
    --sys-green: #059669;
    --sys-red: #DC2626;
    --sys-orange: #EA580C;
    
    --card-shadow: 0px 4px 20px rgba(0, 0, 0, 0.03);
    --widget-shadow: 0px 8px 30px rgba(0,0,0,0.06);
}

* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html, body { font-family:var(--font-primary); background:var(--bg-body-grad); color:var(--text-main); overflow:hidden !important; position:fixed !important; width:100% !important; height:100% !important; margin:0; padding:0; }
html::-webkit-scrollbar, body::-webkit-scrollbar, .app::-webkit-scrollbar, .views-container::-webkit-scrollbar { display:none !important; width:0 !important; height:0 !important; }
html, body, .app, .views-container { scrollbar-width:none !important; -ms-overflow-style:none !important; }


/* Loader */
/* Loader */
.loader { position:fixed;inset:0;z-index:var(--z-loader);background:var(--bg-base);display:flex;align-items:center;justify-content:center;transition:opacity .4s ease, visibility .4s; }
.loader-ripples { position:relative;display:flex;align-items:center;justify-content:center;width:120px;height:120px; }
.ripple { position:absolute;inset:0;border-radius:50%;border:2px solid var(--accent);opacity:0;animation:ripple-anim 2s cubic-bezier(0.19, 1, 0.22, 1) infinite; }
.ripple.r2 { animation-delay: 1s; }
@keyframes ripple-anim {
    0% { transform: scale(0.3); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* Layout */
.app { display:flex; flex-direction:column; height:100vh; height:100dvh; overflow:hidden; position:relative; }
.header { padding:12px 20px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--border-glass);background:rgba(5,5,10,0.6);backdrop-filter:blur(24px);flex-shrink:0;z-index:10; transition: margin-top 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.header .title { font-size:18px;font-weight:800;letter-spacing:-0.02em; }
.header .sub { font-size:12px;font-weight:500;color:var(--text-muted);margin-top:1px; }
.header-right { display:flex;gap:12px;align-items:center; }
.header-btn { background:var(--bg-glass);border:1px solid var(--border-glass);color:var(--text-main);padding:8px 12px;border-radius:12px;font-size:14px;cursor:pointer;transition:all .2s; }
.logo-glow { width:36px;height:36px;border-radius:10px;background:linear-gradient(135deg,var(--accent),#5e6ad2);display:flex;align-items:center;justify-content:center;font-weight:800;font-size:13px;color:#fff;box-shadow:0 0 16px var(--accent-glow);letter-spacing:-0.5px; }

.views-container { flex:1 1 0px!important;position:relative!important;overflow:hidden!important;min-height:0!important; transition: all 0.4s; }
.view { position:absolute;inset:0;display:flex;flex-direction:column;overflow:hidden;transition:transform .5s cubic-bezier(.32, .72, 0, 1),opacity .4s ease;padding-bottom:0px!important; }
.view.active { transform:translateX(0) scale(1);opacity:1;z-index:2; }
.view.right { transform:translateX(50px) scale(0.97);opacity:0;z-index:1;pointer-events:none; }
.view.left { transform:translateX(-50px) scale(0.97);opacity:0;z-index:1;pointer-events:none; }


/* PREMIUM 2026 BOTTOM NAV */
.bottom-nav { 
  display:flex; position:fixed!important; bottom:12px!important; left:50%!important; transform:translateX(-50%); 
  width:calc(100% - 32px); max-width:500px; height: 72px;
  border:1px solid rgba(255,255,255,0.06); 
  background:rgba(12,12,16,0.6); 
  backdrop-filter:blur(40px); -webkit-backdrop-filter:blur(40px); 
  border-radius:36px; 
  box-shadow:0 16px 40px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.08); 
  padding:6px 8px; z-index:90!important; 
  align-items: center; justify-content: space-between;
}
.nav-item { 
  flex:1; height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center;
  cursor:pointer; color:rgba(255,255,255,0.3); 
  transition:all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); 
  position:relative; 
  border-radius: 30px;
}
.nav-item:hover { color: rgba(255,255,255,0.7); }

/* Active background pill */
.nav-item::before {
  content:''; position:absolute; inset:0; 
  background:rgba(43,94,255,0.1); 
  border-radius:30px; 
  opacity:0; transform:scale(0.85); 
  transition:all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.nav-item.active::before { opacity:1; transform:scale(1); background:rgba(255,255,255,0.08); }

/* Active indicator dot */
.nav-item::after { 
  content:''; position:absolute; top:-24px; left:50%; margin-left:-3px;
  width:6px; height:6px; border-radius:50%; 
  background:var(--accent); 
  box-shadow:0 0 12px var(--accent), 0 0 20px var(--accent); 
  opacity:0; transform:translateY(-10px) scale(0); 
  transition:all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); 
}
.nav-item.active::after { opacity:1; transform:translateY(0) scale(1); }

.nav-item.active { color:#fff; }

.nav-item .nav-icon { 
  width:26px; height:26px; position:absolute; top:50%; margin-top:-13px;
  transition:all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); 
  z-index: 2;
  pointer-events: none; /* Let clicks pass through to nav-item */
}
.nav-item.active .nav-icon { 
  color:var(--accent); 
  transform:translateY(-10px) scale(1.05); 
  filter:drop-shadow(0 4px 12px rgba(43,94,255,0.5)); 
}

.nav-item .nav-lbl { 
  font-size:11px; font-weight:700; position:absolute; bottom:8px; 
  opacity:0; transform:translateY(8px); 
  transition:all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 2; pointer-events: none; letter-spacing:0.3px;
}
.nav-item.active .nav-lbl { opacity:1; transform:translateY(0); }


/* Glass panels */
.glass-panel { background:var(--bg-glass);backdrop-filter:blur(16px);border:1px solid var(--border-glass);border-radius:var(--radius-lg);margin:0 16px 16px;padding:20px;transition:all .3s; }
.glass-panel:hover { border-color:var(--border-light);background:rgba(255,255,255,0.06); }

/* Bento */
.bento-grid { display:grid;grid-template-columns:1fr 1fr;gap:16px;padding:20px 16px; }
.bento-wide { grid-column:span 2; }
.bento-box { background:var(--bg-glass);backdrop-filter:blur(12px);border:1px solid var(--border-glass);border-radius:var(--radius-md);padding:16px;transition:all .3s; }
.bento-box:hover { border-color:var(--border-light);background:rgba(255,255,255,0.06); }
.m-lbl { display:block;font-size:12px;font-weight:600;color:var(--text-muted);margin-bottom:8px;text-transform:uppercase;letter-spacing:0.05em; letter-spacing:0.5px;}

/* Buttons */
.btn { padding:12px 20px;border-radius:14px;border:none;font-size:15px;font-weight:700;cursor:pointer;transition:all .2s;font-family:var(--font-primary); }
.btn-outline { background:var(--bg-glass);border:1px solid var(--border-light);color:var(--text-main); }
.btn-accent { background:var(--accent);color:#fff;box-shadow:0 4px 20px rgba(24,86,255,0.4); }
.btn-green { background:var(--sys-green);color:#000;box-shadow:0 4px 20px rgba(7,202,107,0.3); }
.btn-micro { background:rgba(255,255,255,0.05);border:1px solid rgba(255,255,255,0.1);color:var(--text-muted);padding:4px 10px;border-radius:6px;font-size:11px;font-weight:600;cursor:pointer;transition:all .2s; }
.btn-micro:hover { background:rgba(255,255,255,0.15);color:#fff; }

/* Inputs */
input[type=number],input[type=text],select { background:rgba(255,255,255,0.05);border:1px solid var(--border-glass);border-radius:12px;color:var(--text-main);font-family:var(--font-primary);transition:all .2s; }
input:focus,select:focus { border-color:var(--accent);outline:none;box-shadow:0 0 0 3px var(--accent-glow);background:rgba(255,255,255,0.08); }

/* RNP / Unit Economics */
.rnp-shell {
  padding:20px 20px 104px;
  min-height:100%;
}
.rnp-toolbar,
.rnp-panel,
.rnp-kpi,
.rnp-status {
  background:rgba(15,23,42,0.72);
  border:1px solid rgba(148,163,184,0.16);
  box-shadow:0 18px 60px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.05);
}
.rnp-toolbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  border-radius:18px;
  padding:18px;
  margin-bottom:14px;
}
.rnp-title {
  display:flex;
  align-items:center;
  gap:10px;
  font-size:22px;
  line-height:1.15;
  font-weight:850;
  letter-spacing:0;
}
.rnp-title svg {
  width:24px;
  height:24px;
  color:#22D3EE;
}
.rnp-subtitle {
  margin-top:7px;
  color:var(--text-muted);
  font-size:13px;
  font-weight:650;
}
.rnp-actions {
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.rnp-upload-btn,
.rnp-btn {
  min-height:42px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:0 15px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,0.1);
  background:linear-gradient(135deg,#2563EB,#06B6D4);
  color:#fff;
  font-family:var(--font-primary);
  font-size:13px;
  font-weight:800;
  cursor:pointer;
  white-space:nowrap;
  transition:transform .18s ease, border-color .18s ease, filter .18s ease;
}
.rnp-upload-btn:hover,
.rnp-btn:hover {
  transform:translateY(-1px);
  filter:brightness(1.06);
}
.rnp-btn.secondary {
  background:rgba(255,255,255,0.06);
  color:var(--text-main);
}
.rnp-upload-btn svg,
.rnp-btn svg {
  width:17px;
  height:17px;
}
.has-tip {
  position:relative;
}
.has-tip::after {
  content:attr(data-tip);
  position:absolute;
  right:0;
  top:calc(100% + 9px);
  z-index:var(--z-nav);
  width:280px;
  padding:10px 12px;
  border-radius:10px;
  background:#111827;
  border:1px solid rgba(148,163,184,0.24);
  box-shadow:0 18px 44px rgba(0,0,0,0.45);
  color:#E5E7EB;
  font-size:12px;
  line-height:1.35;
  font-weight:700;
  white-space:normal;
  opacity:0;
  pointer-events:none;
  transform:translateY(-4px);
  transition:opacity .14s ease, transform .14s ease;
}
.has-tip:hover::after {
  opacity:1;
  transform:translateY(0);
}
.rnp-more {
  position:relative;
}
.rnp-more summary {
  min-height:42px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 16px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,0.1);
  background:rgba(255,255,255,0.06);
  color:var(--text-main);
  font-size:13px;
  font-weight:850;
  cursor:pointer;
  list-style:none;
}
.rnp-more summary::-webkit-details-marker {
  display:none;
}
.rnp-more-menu {
  position:absolute;
  right:0;
  top:calc(100% + 8px);
  z-index:20;
  display:grid;
  gap:8px;
  min-width:220px;
  padding:10px;
  border-radius:12px;
  border:1px solid rgba(148,163,184,0.2);
  background:#0f172a;
  box-shadow:0 22px 55px rgba(0,0,0,0.42);
}
.rnp-more-menu .rnp-btn,
.rnp-more-menu .rnp-upload-btn {
  width:100%;
  justify-content:flex-start;
}
.unit-tool-tabs {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-bottom:12px;
}
.unit-tool-tabs button {
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  column-gap:10px;
  row-gap:2px;
  align-items:center;
  min-height:62px;
  padding:11px 12px;
  border-radius:10px;
  border:1px solid rgba(148,163,184,0.14);
  background:rgba(15,23,42,0.58);
  color:rgba(226,232,240,0.72);
  text-align:left;
}
.unit-tool-tabs button.active {
  border-color:rgba(56,189,248,0.34);
  background:linear-gradient(135deg,rgba(56,189,248,0.13),rgba(24,86,255,0.06));
  color:#fff;
}
.unit-tool-tabs button:disabled {
  opacity:.52;
  cursor:not-allowed;
}
.unit-tool-tabs svg {
  grid-row:1 / span 2;
  width:20px;
  height:20px;
  color:#38bdf8;
}
.unit-tool-tabs span {
  font-size:13px;
  font-weight:850;
}
.unit-tool-tabs small {
  color:rgba(226,232,240,0.54);
  font-size:11px;
  font-weight:650;
}
.rnp-guidance {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-bottom:12px;
}
.rnp-guidance div {
  min-height:70px;
  padding:13px 14px;
  border-radius:12px;
  border:1px solid rgba(34,211,238,0.15);
  background:linear-gradient(135deg,rgba(34,211,238,0.08),rgba(15,23,42,0.55));
}
.rnp-guidance span {
  display:block;
  color:#38bdf8;
  font-size:10px;
  font-weight:900;
  text-transform:uppercase;
  margin-bottom:5px;
}
.rnp-guidance strong {
  display:block;
  color:#fff;
  font-size:13px;
  font-weight:900;
  margin-bottom:4px;
}
.rnp-guidance small {
  color:rgba(226,232,240,0.6);
  font-size:11px;
  line-height:1.35;
  font-weight:700;
}
.rnp-control-panel {
  display:grid;
  grid-template-columns:minmax(0,1.15fr) minmax(320px,0.85fr);
  gap:10px;
  margin-bottom:12px;
}
.rnp-control-group {
  display:flex;
  align-items:end;
  gap:10px;
  min-height:64px;
  padding:12px;
  border:1px solid rgba(148,163,184,0.14);
  border-radius:12px;
  background:rgba(15,23,42,0.58);
}
.rnp-control-group label {
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:136px;
  flex:1;
}
.rnp-control-group .has-tip::after {
  left:0;
  right:auto;
}
.rnp-control-group label span {
  color:var(--text-muted);
  font-size:11px;
  font-weight:850;
}
.rnp-control-group input[type=date],
.rnp-control-group input[type=number] {
  height:38px;
  padding:0 10px;
  font-size:12px;
  font-weight:800;
}
.rnp-kpis {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  margin-bottom:12px;
}
.rnp-kpi {
  min-height:96px;
  border-radius:14px;
  padding:15px;
}
.rnp-kpi span,
.rnp-panel-head span,
.rnp-detail-grid span,
.rnp-metric-list span {
  display:block;
  color:var(--text-muted);
  font-size:11px;
  font-weight:800;
}
.rnp-kpi strong {
  display:block;
  margin-top:8px;
  font-size:24px;
  line-height:1.05;
  font-weight:850;
}
.rnp-kpi small {
  display:block;
  margin-top:8px;
  color:rgba(255,255,255,0.5);
  font-size:11px;
  font-weight:700;
}
.rnp-status {
  min-height:44px;
  display:flex;
  align-items:center;
  gap:10px;
  border-radius:12px;
  padding:12px 14px;
  color:rgba(255,255,255,0.76);
  font-size:13px;
  font-weight:700;
  margin-bottom:12px;
  border-color:rgba(34,211,238,0.15);
  background:linear-gradient(135deg,rgba(34,211,238,0.07),rgba(15,23,42,0.72));
}
.rnp-first-steps {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-bottom:12px;
}
.rnp-loader {
  width:16px;
  height:16px;
  border:2px solid rgba(255,255,255,0.2);
  border-top-color:#38BDF8;
  border-radius:50%;
  animation:rnp-spin .8s linear infinite;
}
@keyframes rnp-spin { to { transform:rotate(360deg); } }
.rnp-layout {
  display:grid;
  grid-template-columns:minmax(0,1.7fr) minmax(340px,0.8fr);
  gap:12px;
  align-items:start;
}
.rnp-panel {
  border-radius:16px;
  overflow:hidden;
}
.rnp-panel-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  border-bottom:1px solid rgba(148,163,184,0.14);
}
.rnp-panel-head strong {
  display:block;
  margin-top:4px;
  font-size:16px;
  line-height:1.2;
  font-weight:850;
}
.rnp-filters {
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}
.rnp-filters input,
.rnp-filters select {
  height:38px;
  padding:0 12px;
  font-size:12px;
  font-weight:750;
  min-width:180px;
}
.rnp-filters select {
  min-width:150px;
}
.rnp-filters .table-save {
  min-height:38px;
  padding:0 12px;
  font-size:12px;
}
.rnp-metric-tabs {
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px 14px;
  border-bottom:1px solid rgba(148,163,184,0.1);
  overflow:auto;
}
.rnp-metric-tabs button {
  min-height:32px;
  padding:0 12px;
  border-radius:8px;
  border:1px solid rgba(148,163,184,0.14);
  background:rgba(255,255,255,0.04);
  color:rgba(226,232,240,0.66);
  font-size:12px;
  font-weight:850;
  cursor:pointer;
  white-space:nowrap;
}
.rnp-metric-tabs .has-tip::after {
  left:0;
  right:auto;
}
.rnp-metric-tabs button.active {
  border-color:rgba(34,211,238,0.34);
  background:rgba(34,211,238,0.12);
  color:#fff;
}
.rnp-table-wrap {
  overflow:auto;
  max-height:calc(100vh - 390px);
}
.rnp-table {
  width:100%;
  border-collapse:collapse;
  min-width:1080px;
}
.rnp-table th {
  position:sticky;
  top:0;
  z-index:1;
  background:rgba(15,23,42,0.96);
  color:rgba(255,255,255,0.46);
  text-align:left;
  font-size:11px;
  font-weight:850;
  padding:12px 14px;
  border-bottom:1px solid rgba(148,163,184,0.16);
  white-space:nowrap;
}
.rnp-table td {
  padding:12px 14px;
  border-bottom:1px solid rgba(148,163,184,0.08);
  color:rgba(255,255,255,0.82);
  font-size:13px;
  font-weight:750;
  white-space:nowrap;
}
.rnp-table tr {
  cursor:pointer;
  transition:background .15s ease;
}
.rnp-table tr:hover,
.rnp-table tr.active {
  background:rgba(34,211,238,0.07);
}
.rnp-table tr.dirty {
  background:rgba(245,158,11,0.055);
}
.rnp-th-tip {
  cursor:help;
  position:sticky;
}
.rnp-th-tip span {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:14px;
  height:14px;
  margin-left:5px;
  border-radius:50%;
  background:rgba(148,163,184,0.14);
  color:rgba(255,255,255,0.7);
  font-size:10px;
  font-weight:900;
}
.rnp-th-tip::after {
  content:attr(data-tip);
  position:absolute;
  left:10px;
  top:calc(100% + 8px);
  z-index:30;
  width:260px;
  padding:10px 12px;
  border-radius:10px;
  background:#111827;
  border:1px solid rgba(148,163,184,0.24);
  box-shadow:0 18px 44px rgba(0,0,0,0.45);
  color:#E5E7EB;
  font-size:12px;
  line-height:1.35;
  font-weight:700;
  white-space:normal;
  opacity:0;
  pointer-events:none;
  transform:translateY(-4px);
  transition:opacity .14s ease, transform .14s ease;
}
.rnp-th-tip:hover::after {
  opacity:1;
  transform:translateY(0);
}
.rnp-table td strong {
  display:block;
  max-width:210px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#fff;
  font-size:13px;
}
.rnp-table td small {
  display:block;
  margin-top:4px;
  color:rgba(255,255,255,0.42);
  font-size:11px;
}
.rnp-table .good {
  color:#34D399;
}
.rnp-table .bad {
  color:#FB7185;
}
.unit-inline-input {
  width:96px;
  height:34px;
  padding:0 9px;
  border-radius:8px;
  font-size:12px;
  font-weight:850;
  position:relative;
  z-index:2;
  pointer-events:auto;
}
.unit-inline-input.compact {
  width:72px;
}
.rnp-risk {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:76px;
  min-height:26px;
  border-radius:8px;
  padding:0 8px;
  font-size:11px;
  font-weight:850;
}
.rnp-risk.good {
  color:#34D399;
  background:rgba(16,185,129,0.14);
  border:1px solid rgba(16,185,129,0.22);
}
.rnp-risk.bad {
  color:#FB7185;
  background:rgba(244,63,94,0.14);
  border:1px solid rgba(244,63,94,0.22);
}
.rnp-risk.watch {
  color:#FBBF24;
  background:rgba(245,158,11,0.13);
  border:1px solid rgba(245,158,11,0.22);
}
.rnp-risk.neutral {
  color:#CBD5E1;
  background:rgba(148,163,184,0.12);
  border:1px solid rgba(148,163,184,0.16);
}
.rnp-empty-row {
  padding:28px !important;
  text-align:center;
  color:var(--text-muted) !important;
}
.rnp-detail-panel {
  position:sticky;
  top:14px;
}
.rnp-detail-empty {
  padding:18px;
  color:var(--text-muted);
  font-size:13px;
  line-height:1.5;
  font-weight:700;
}
.rnp-detail-body {
  padding:16px;
}
.rnp-detail-meta {
  color:var(--text-muted);
  font-size:12px;
  font-weight:800;
  margin-bottom:12px;
}
.rnp-detail-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  margin-bottom:12px;
}
.rnp-detail-grid div,
.rnp-metric-list div {
  border:1px solid rgba(148,163,184,0.12);
  background:rgba(255,255,255,0.035);
  border-radius:10px;
  padding:11px;
}
.rnp-detail-grid strong,
.rnp-metric-list strong {
  display:block;
  margin-top:6px;
  color:#fff;
  font-size:15px;
  font-weight:850;
}
.rnp-insight {
  border-radius:12px;
  padding:13px;
  font-size:13px;
  line-height:1.45;
  font-weight:800;
  margin-bottom:14px;
}
.rnp-insight.good {
  color:#A7F3D0;
  background:rgba(16,185,129,0.12);
  border:1px solid rgba(16,185,129,0.18);
}
.rnp-insight.bad {
  color:#FDA4AF;
  background:rgba(244,63,94,0.12);
  border:1px solid rgba(244,63,94,0.18);
}
.rnp-insight.watch {
  color:#FDE68A;
  background:rgba(245,158,11,0.12);
  border:1px solid rgba(245,158,11,0.18);
}
.rnp-mini-chart {
  height:82px;
  display:flex;
  align-items:flex-end;
  gap:4px;
  padding:12px;
  border-radius:12px;
  border:1px solid rgba(148,163,184,0.12);
  background:linear-gradient(180deg,rgba(255,255,255,0.04),rgba(255,255,255,0.015));
  margin-bottom:12px;
}
.rnp-mini-chart span {
  flex:1;
  min-width:4px;
  border-radius:5px 5px 2px 2px;
  background:linear-gradient(180deg,#22D3EE,#2563EB);
}
.rnp-mini-chart span.bad {
  background:linear-gradient(180deg,#FB7185,#BE123C);
}
.rnp-metric-list {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  max-height:280px;
  overflow:auto;
  padding-right:2px;
}
.rnp-metric-list strong {
  font-size:13px;
}

@media (max-width:1100px) {
  .rnp-layout { grid-template-columns:1fr; }
  .rnp-detail-panel { position:relative; top:0; }
  .rnp-table-wrap { max-height:none; }
  .rnp-first-steps { grid-template-columns:1fr; }
}
@media (max-width:820px) {
  .rnp-shell { padding:14px 12px 96px; }
  .rnp-toolbar,
  .rnp-panel-head {
    align-items:flex-start;
    flex-direction:column;
  }
  .rnp-actions,
  .rnp-filters {
    width:100%;
  }
  .rnp-upload-btn,
  .rnp-btn,
  .rnp-filters input,
  .rnp-filters select {
    flex:1;
    min-width:0;
  }
  .rnp-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .unit-tool-tabs { grid-template-columns:1fr; }
  .rnp-guidance { grid-template-columns:1fr; }
  .rnp-control-panel { grid-template-columns:1fr; }
  .rnp-control-group { flex-wrap:wrap; }
  .rnp-more-menu { left:0; right:auto; }
}
@media (max-width:520px) {
  .rnp-kpis,
  .rnp-detail-grid,
  .rnp-metric-list {
    grid-template-columns:1fr;
  }
  .rnp-title { font-size:19px; }
}
select option { background:#141416;color:#fff; }

/* Toggle */
.toggle-switch-premium { position:relative;display:inline-block;width:46px;height:26px; }
.toggle-switch-premium input { opacity:0;width:0;height:0; }
.toggle-slider { position:absolute;cursor:pointer;inset:0;background:rgba(255,255,255,0.1);transition:.4s;border-radius:26px;border:1px solid rgba(255,255,255,0.1); }
.toggle-slider:before { position:absolute;content:"";height:18px;width:18px;left:3px;bottom:3px;background:white;transition:.4s;border-radius:50%;box-shadow:0 2px 5px rgba(0,0,0,0.2); }
input:checked+.toggle-slider { background:var(--sys-green);border-color:var(--sys-green); }
input:checked+.toggle-slider:before { transform:translateX(20px); }

/* Premium components */
.premium-glass { background:var(--bg-glass-opaque);backdrop-filter:blur(30px);border:1px solid rgba(255,255,255,0.08);box-shadow:var(--card-shadow); }
.modal-overlay { position:fixed;inset:0;z-index:var(--z-modal);background:rgba(0,0,0,0.8);backdrop-filter:blur(12px);display:flex;align-items:center;justify-content:center;opacity:0;pointer-events:none;transition:all .3s; }
.modal-overlay.open { opacity:1;pointer-events:auto; }
.modal-content { background:#1e1e2d;border:1px solid var(--border-light);border-radius:var(--radius-md);width:96%;max-width:1480px;max-height:90vh;display:flex;flex-direction:column;box-shadow:var(--widget-shadow);transform:translateY(20px);transition:all .3s cubic-bezier(.2,.8,.2,1); }
.modal-overlay.open .modal-content { transform:translateY(0); }
.modal-header-premium { padding:20px 24px;border-bottom:1px solid rgba(255,255,255,0.05);display:flex;justify-content:space-between;align-items:center;background:linear-gradient(135deg,rgba(24,86,255,0.05),transparent);border-radius:var(--radius-md) 16px 0 0; }
.modal-title-area { display:flex;gap:12px;align-items:center; }
.modal-icon { width:44px;height:44px;border-radius:12px;background:rgba(24,86,255,0.15);border:1px solid rgba(24,86,255,0.3);display:flex;align-items:center;justify-content:center;color:var(--accent);box-shadow:0 4px 20px rgba(24,86,255,0.2); }
.modal-title-gradient { font-size:17px;font-weight:800;margin:0;background:linear-gradient(90deg,#fff,#a2b1f8);-webkit-background-clip:text;-webkit-text-fill-color:transparent; }
.btn-icon-close { background:rgba(255,255,255,0.05);border:none;width:36px;height:36px;border-radius:50%;color:var(--text-muted);cursor:pointer;transition:all .2s;display:flex;align-items:center;justify-content:center; }
.btn-icon-close:hover { background:rgba(234,33,67,0.15);color:var(--sys-red);transform:rotate(90deg); }
.modal-body { padding:20px;overflow-y:auto;flex:1; }
.modal-footer-premium { padding:16px 24px;border-top:1px solid rgba(255,255,255,0.05);display:flex;justify-content:space-between;align-items:center;background:rgba(10,10,15,0.5); }
.btn-premium-nav { padding:12px 24px;border-radius:12px;font-weight:600;font-size:14px;border:none;cursor:pointer;transition:all .2s;display:flex;align-items:center;gap:8px; }
.btn-back { background:transparent;color:var(--text-muted); }
.btn-back:hover { background:rgba(255,255,255,0.05);color:#fff; }
.btn-next { background:#fff;color:#000;box-shadow:0 4px 15px rgba(255,255,255,0.2); }
.btn-finish { background:var(--sys-green);color:#000;box-shadow:0 4px 15px rgba(7,202,107,0.3); }

.progress-bar-container { height:3px;background:rgba(255,255,255,0.05);width:100%;overflow:hidden; }
.progress-bar-fill { height:100%;background:linear-gradient(90deg,var(--accent),#0fc7ec);width:25%;transition:width .5s; }

.step-hero { text-align:center;margin-bottom:24px;padding:16px 0; }
.step-hero h3 { font-size:18px;font-weight:800;color:#fff;margin:8px 0 6px; }
.step-hero p { font-size:12px;color:var(--text-muted);max-width:80%;margin:0 auto;line-height:1.5; }
.step-icon { width:36px;height:36px;color:var(--accent);opacity:0.8;filter:drop-shadow(0 4px 12px var(--accent-glow)); }
.config-step { display:none;animation:fadeIn .3s; }
.config-step.active { display:block; }
@keyframes fadeIn { from{opacity:0;transform:translateX(10px)}to{opacity:1;transform:translateX(0)} }
@keyframes waterfallUp {
    from { opacity:0; transform:translateY(30px) scale(0.97); }
    to { opacity:1; transform:translateY(0) scale(1); }
}
.cascade-reveal { opacity:0; animation: waterfallUp 0.6s cubic-bezier(.2,.8,.2,1) forwards; }
.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.15s; }
.delay-3 { animation-delay: 0.25s; }
.delay-4 { animation-delay: 0.35s; }

.premium-card { background:rgba(255,255,255,0.03);border:1px solid rgba(255,255,255,0.06);border-radius:var(--radius-md);padding:20px;transition:all .3s;margin-bottom:16px; }
.premium-card:hover { border-color:rgba(255,255,255,0.15);background:rgba(255,255,255,0.05); }
.input-group-premium select,.input-premium { background:rgba(0,0,0,0.3);border:1px solid rgba(255,255,255,0.1);color:#fff;border-radius:12px;padding:14px 16px;font-size:14px;outline:none;transition:all .2s;font-family:var(--font-primary); }
.btn-premium { width:100%;border:none;padding:14px;border-radius:14px;font-weight:700;font-size:14px;color:#fff;display:flex;justify-content:center;align-items:center;gap:8px;cursor:pointer;transition:all .3s; }
.btn-sync-pulse { background:linear-gradient(135deg,var(--accent),#5e6ad2);box-shadow:0 4px 20px var(--accent-glow); }
.btn-sync-pulse:hover { box-shadow:0 8px 30px rgba(24,86,255,0.4);transform:translateY(-2px); }

.chip { padding:6px 12px;border-radius:var(--radius-lg);background:rgba(255,255,255,0.05);border:1px solid rgba(255,255,255,0.1);font-size:12px;cursor:pointer;transition:all .2s;color:var(--text-muted);font-weight:600; }
.chip.active { background:rgba(24,86,255,0.15);border-color:var(--accent);color:var(--accent); }
.dropzone-animated { border:2px dashed rgba(24,86,255,0.4);border-radius:var(--radius-md);padding:32px;text-align:center;background:rgba(24,86,255,0.02);transition:all .3s;cursor:pointer; }
.dropzone-animated:hover { background:rgba(24,86,255,0.08);border-color:var(--accent); }
.wh-list-premium { min-height:200px;overflow-y:auto;padding-right:8px; }
.wh-item { display:flex;align-items:center;gap:12px;padding:10px 14px;border-bottom:1px solid rgba(255,255,255,0.04);cursor:pointer;transition:background .2s; }
.wh-item:hover { background:rgba(255,255,255,0.06); }
.wh-item input[type=checkbox] { width:18px;height:18px;accent-color:var(--accent);flex-shrink:0;cursor:pointer; }
.wh-info { flex:1;min-width:0; }
.wh-name { font-size:13px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.wh-meta { font-size:10px;font-weight:500;color:var(--text-muted);margin-top:2px; }
.rec-warehouse { background:rgba(255,255,255,0.03);border:1px solid rgba(255,255,255,0.08);border-radius:12px;padding:10px 14px;display:flex;align-items:center;gap:12px; }
.rec-warehouse.rec-high { border-left:3px solid #07ca6b; }
.rec-warehouse.rec-medium { border-left:3px solid #e89558; }
.rec-score { width:32px;height:32px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:14px;flex-shrink:0; }
.rec-mode-option:hover { background:rgba(255,255,255,0.06) !important; }

/* ===================== PRO TABLE — BULLETPROOF 2D STICKY DATAGRID ===================== */
.plan-toolbar { padding:10px 16px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--border-glass);flex-shrink:0;gap:8px;flex-wrap:wrap; }
.filter-select { padding:5px 10px;border-radius:8px;border:1px solid var(--border-glass);background:var(--bg-glass);color:var(--text-main);font-size:11px;font-family:var(--font-primary); }
.filter-input { padding:5px 10px;border-radius:8px;border:1px solid var(--border-glass);background:var(--bg-glass);color:var(--text-main);font-size:11px;width:120px;font-family:var(--font-primary); }
.plan-table-wrap { flex:1;overflow:auto;position:relative; }
.plan-footer { padding:10px 16px;border-top:1px solid var(--border-glass);flex-shrink:0;display:flex;gap:8px;justify-content:space-between;align-items:center; }

/* ── Rule 1: Anti-Shrink Foundation ── */
.pro-table {
    table-layout: fixed;
    width: max-content;
    min-width: 100%;
    border-collapse: separate;  /* Rule 2: NEVER use collapse with sticky — Chrome bug */
    border-spacing: 0;
    font-size: 12px;
    white-space: nowrap;
}
.pro-table * { box-sizing: border-box; }

/* ── Grid lines via cell borders (since we use border-collapse: separate) ── */
.pro-table th,
.pro-table td {
    border-bottom: 1px solid var(--border-glass);
    border-right: 1px solid rgba(255,255,255,0.03);
}
/* Bold right border for group separators */
.border-right-bold { border-right: 2px solid var(--border-glass) !important; }

/* ── Base thead: sticky top ── */
.pro-table thead {
    z-index: 10;  /* Rule 4: z-10 for header row */
}
/* Two-row sticky header: row 1 (group names) at top:0, row 2 (column names) below it */
.pro-table thead tr:first-child th {
    position: sticky;
    top: 0;
    z-index: 10;
}
.pro-table thead tr:nth-child(2) th {
    position: sticky;
    top: 34px;  /* Height of the group header row */
    z-index: 10;
}
/* Corner intersection for pinned + both header rows */
.plan-table-wrap.is-pinned thead tr:first-child th.sticky-col {
    z-index: 30;
}
.plan-table-wrap.is-pinned thead tr:nth-child(2) th.sticky-col {
    z-index: 30;
}

/* ── All th: OPAQUE bg (Rule 3) ── */
.pro-table th {
    padding: 8px 8px;
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 700;
    border-bottom: 2px solid var(--border-glass);
    background-color: #05050A;  /* Rule 3: OPAQUE, no transparency */
    user-select: none;
    resize: horizontal;
    overflow: hidden;
    white-space: nowrap;
}
.pro-table th:hover {
    color: var(--text-main);
    background-color: #0c0c18;  /* Opaque hover — no rgba */
}

/* ── Group headers (row 1 of thead) ── */
.pro-table th.th-group {
    text-align: center;
    border-bottom: 1px solid var(--border-light);
    font-size: 11px;
    color: var(--text-main);
    font-weight: 800;
    letter-spacing: 0;
    resize: none;
}
.pro-table th.th-group-common {
    background-color: #0a0f1f;  /* Opaque: dark + blue tint */
    border-left: 2px solid var(--accent);
    border-right: 2px solid var(--accent);
}
.pro-table th.th-group-wh {
    border-left: 2px solid rgba(7,202,107,0.4);
    border-right: 2px solid rgba(7,202,107,0.4);
    background-color: #05050A;
}
.pro-table th.th-group-wh:nth-child(even) { background-color: #060810; }
.pro-table th.th-group-wh:nth-child(odd)  { background-color: #07071a; }

/* ── Base cells ── */
.pro-table td {
    padding: 7px 8px;
    vertical-align: middle;
    color: var(--text-main);
    font-size: 12px;
    position: relative;  /* Rule 4: z-index: 1 baseline */
    z-index: 1;
    background-color: #05050A;  /* Rule 3: OPAQUE */
}
.pro-table td.narrow-num { font-size: 11px; text-align: center; padding: 7px 4px; }

/* Row hover/striping — OPAQUE colors */
.pro-table tbody tr:hover > td { background-color: #0d0d1a; }
.pro-table tbody tr:nth-child(even) > td { background-color: #08080f; }

/* ── STICKY COLUMNS — Controlled by .is-pinned class (Rule 5) ── */
/* Default: sticky-col cells act as normal cells */
.pro-table .sticky-col {
    /* left offset is set via CSS var --offset on each cell */
}

/* When pinned: activate sticky positioning */
.plan-table-wrap.is-pinned .sticky-col {
    position: sticky;
    left: var(--offset, 0px);
    z-index: 20;  /* Rule 4: z-20 for pinned columns */
    background-color: #05050A !important;  /* Rule 3: OPAQUE — !important to beat all other selectors */
    box-shadow: 2px 0 6px -2px rgba(0,0,0,0.5);  /* Visual lift */
}
/* Last pinned column gets stronger shadow */
.plan-table-wrap.is-pinned .sticky-col.sticky-col-last {
    box-shadow: 3px 0 10px -2px rgba(0,0,0,0.6);
}

/* Corner intersection: sticky both top AND left — KING of z-index (Rule 4) */
.plan-table-wrap.is-pinned thead th.sticky-col {
    z-index: 30;  /* Rule 4: z-30 for corner */
    background-color: #05050A !important;
}

/* Hover/stripe for pinned body cells */
.plan-table-wrap.is-pinned tbody tr:hover > td.sticky-col { background-color: #0d0d1a !important; }
.plan-table-wrap.is-pinned tbody tr:nth-child(even) > td.sticky-col { background-color: #08080f !important; }

/* Totals row pinned cells */
.plan-table-wrap.is-pinned .totals-row td.sticky-col {
    z-index: 21;
    background-color: #141424 !important;
}

/* ── Light mode: override all opaque backgrounds ── */
[data-theme="light"] .pro-table th { background-color: #F4F5F8; }
[data-theme="light"] .pro-table th:hover { background-color: #E8EAF0; }
[data-theme="light"] .pro-table th.th-group-common { background-color: #E8EEFF; }
[data-theme="light"] .pro-table th.th-group-wh { background-color: #F4F5F8; }
[data-theme="light"] .pro-table th.th-group-wh:nth-child(even) { background-color: #EFF8F0; }
[data-theme="light"] .pro-table th.th-group-wh:nth-child(odd)  { background-color: #F0EFF8; }
[data-theme="light"] .pro-table td { background-color: #FFFFFF; }
[data-theme="light"] .pro-table tbody tr:hover > td { background-color: #F0F4FF; }
[data-theme="light"] .pro-table tbody tr:nth-child(even) > td { background-color: #FAFBFD; }
[data-theme="light"] .plan-table-wrap.is-pinned .sticky-col { background-color: #FFFFFF; }
[data-theme="light"] .plan-table-wrap.is-pinned thead th.sticky-col { background-color: #F4F5F8; }
[data-theme="light"] .plan-table-wrap.is-pinned tbody tr:hover > td.sticky-col { background-color: #F0F4FF; }
[data-theme="light"] .plan-table-wrap.is-pinned tbody tr:nth-child(even) > td.sticky-col { background-color: #FAFBFD; }
[data-theme="light"] .plan-table-wrap.is-pinned .totals-row td.sticky-col { background-color: #EAECF0; }

/* ── Input cells ── */
.tbl-input { width:56px;padding:5px;text-align:center;font-weight:600;font-size:12px;border-radius:8px;color:var(--text-main);background:transparent;border:1px solid transparent; }
.tbl-input:focus { border-color:var(--sys-green);box-shadow:0 0 0 2px rgba(7,202,107,0.3);background:var(--bg-glass); }

/* Product photo thumbnail */
.prod-photo { width:28px;height:28px;border-radius:6px;object-fit:cover;border:1px solid rgba(255,255,255,0.1);background:rgba(255,255,255,0.05); }
.prod-photo-placeholder { width:28px;height:28px;border-radius:6px;background:rgba(255,255,255,0.05);border:1px solid rgba(255,255,255,0.08); }

/* ABC badges */
.abc-a { color:#07ca6b;font-weight:800;background:rgba(7,202,107,0.15);padding:2px 6px;border-radius:4px;font-size:10px; }
.abc-b { color:#e89558;font-weight:800;background:rgba(232,149,88,0.15);padding:2px 6px;border-radius:4px;font-size:10px; }
.abc-c { color:var(--text-muted);font-weight:700;background:rgba(255,255,255,0.05);padding:2px 6px;border-radius:4px;font-size:10px; }
.region-badge { display:inline-block;padding:3px 8px;border-radius:6px;font-size:9px;font-weight:700;background:var(--accent-glow);color:var(--accent); }
.deficit-cell { color:var(--sys-red);font-weight:700; }
.surplus-cell { color:var(--sys-green);font-weight:700; }

/* GEO popup */
.geo-popup { position:fixed;z-index:var(--z-geo-popup);background:rgba(20,20,30,0.95);backdrop-filter:blur(20px);border:1px solid var(--border-light);border-radius:14px;padding:16px;box-shadow:0 20px 60px rgba(0,0,0,0.8);min-width:260px;max-width:360px; }
.geo-popup-header { display:flex;justify-content:space-between;align-items:center;margin-bottom:12px; }
.geo-popup-close { cursor:pointer;color:var(--text-muted);font-size:16px;transition:color .2s; }
.geo-popup-close:hover { color:var(--sys-red); }
.geo-bar { display:flex;align-items:center;gap:8px;margin-bottom:6px;font-size:11px; }
.geo-bar-label { width:80px;text-align:right;color:var(--text-muted);font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.geo-bar-track { flex:1;height:14px;background:rgba(255,255,255,0.05);border-radius:4px;overflow:hidden; }
.geo-bar-fill { height:100%;border-radius:4px;transition:width .4s;min-width:2px; }
.geo-bar-value { width:40px;font-weight:700;color:#fff;text-align:right; }
.geo-btn { cursor:pointer;color:var(--text-muted);transition:color .2s;font-size:14px; }
.geo-btn:hover { color:var(--accent); }

/* Scrollbar */
.glass-scrollbar::-webkit-scrollbar { width:10px;height:10px; }
.glass-scrollbar::-webkit-scrollbar-thumb { background:rgba(255,255,255,0.25);border-radius:10px; border: 2px solid transparent; background-clip: padding-box; }
.plan-table-wrap::-webkit-scrollbar { width:10px;height:14px; }
.plan-table-wrap::-webkit-scrollbar-thumb { background:rgba(255,255,255,0.25);border-radius:10px; border: 2px solid transparent; background-clip: padding-box; }
.plan-table-wrap::-webkit-scrollbar-thumb:hover { background:rgba(255,255,255,0.4); border: 2px solid transparent; background-clip: padding-box; }

/* Toast */
.toast { position:fixed;bottom:90px;left:50%;transform:translateX(-50%) translateY(40px);background:rgba(20,20,22,0.9);backdrop-filter:blur(16px);border:1px solid var(--border-light);color:var(--text-main);padding:12px 24px;border-radius:100px;font-size:13px;font-weight:600;z-index:var(--z-toast);opacity:0;transition:all .3s;box-shadow:0 10px 30px rgba(0,0,0,0.5); }
.toast.show { opacity:1;transform:translateX(-50%) translateY(0); }

/* AI */
/* AI Messages — Premium 2026 */
.ai-messages { flex:1;overflow-y:auto;padding:20px; }

.ai-input-bar { display:flex;gap:12px;padding:12px 16px;border-top:1px solid var(--border-glass);background:rgba(5,5,10,0.6);backdrop-filter:blur(24px); }
.ai-input-bar input { flex:1;padding:12px 16px;font-size:14px;border-radius:12px; }
.ai-input-bar button { padding:12px 20px;border-radius:12px;font-weight:700;background:var(--accent);color:#fff;border:none;cursor:pointer; }

/* AI Chat Panel — Glass Scrollbar + Visual Separation */
.ai-chat-pane { border-left:1px solid rgba(255,255,255,0.06) !important; box-shadow: inset 8px 0 24px rgba(0,0,0,0.25); }
.ai-chat-pane ::-webkit-scrollbar { width:6px; }
.ai-chat-pane ::-webkit-scrollbar-thumb { background:rgba(255,255,255,0.12);border-radius:10px; }
.ai-chat-pane ::-webkit-scrollbar-thumb:hover { background:rgba(255,255,255,0.25); }
.ai-chat-pane ::-webkit-scrollbar-track { background:transparent; }
#ai-chat-history { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.12) transparent; }

/* AI Fade-in-up animation */
@keyframes aiFadeInUp {
  from { opacity:0; transform:translateY(12px); }
  to   { opacity:1; transform:translateY(0); }
}

@keyframes loadingBar { 0% { transform:translateX(-100%); } 100% { transform:translateX(100%); } }
@keyframes pulseGlow { 0% { transform:scale(0.9); opacity:0.8; } 50% { transform:scale(1.2); opacity:0.4; } 100% { transform:scale(0.9); opacity:0.8; } }

p { line-height:1.5; }

/* Responsive */
@media (min-width:768px) {
    .views-container { max-height:calc(100vh - 60px - 64px)!important; }
    .bento-grid { grid-template-columns:1fr 1fr 1fr; }
}
@media(max-width:1200px){
    .modal-content { max-width:96vw; }
}
@media (min-width:1200px) {
    .plan-toolbar { flex-wrap:nowrap; }
}
/* Trend Sparkline Styles */
.trend-tooltip {
  display: none;
  position: fixed;
  background: rgba(15, 15, 20, 0.98);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: 8px;
  z-index: var(--z-tooltip);
  box-shadow: 0 8px 32px rgba(0,0,0,0.8);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateY(5px);
  opacity: 0;
}
.trend-tooltip.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}
.trend-title {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.trend-svg {
  width: 250px;
  height: 60px;
  overflow: visible;
}
.trend-svg path {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.trend-svg circle {
  fill: var(--surface);
  stroke-width: 2;
}
.trend-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  margin-left: 6px;
  cursor: pointer;
  background: rgba(255,255,255,0.05);
  transition: all 0.2s ease;
}
.trend-icon:hover {
  background: rgba(255,255,255,0.1);
}

/* NEW UX IMPROVEMENTS */
.muted-zero {
  color: var(--text-muted) !important;
  font-weight: 400 !important;
  opacity: 0.4;
}

.highlight-supply {
  background-color: #0b0e1f !important;  /* Pre-mixed opaque: #05050A + blue tint (NO transparency) */
  color: var(--accent) !important;
  font-weight: 800 !important;
  box-shadow: inset 0 0 12px rgba(11, 102, 255, 0.25);
}
/* Sticky intersection: highlight-supply + pinned column must be fully opaque */
.plan-table-wrap.is-pinned td.highlight-supply.sticky-col {
  background-color: #0b0e1f !important;
  z-index: 20;
}
.plan-table-wrap.is-pinned tbody tr:hover > td.highlight-supply.sticky-col {
  background-color: #12153a !important;
}
.plan-table-wrap.is-pinned tbody tr:nth-child(even) > td.highlight-supply.sticky-col {
  background-color: #0d1028 !important;
}
/* Totals row highlight-supply pinned */
.plan-table-wrap.is-pinned .totals-row td.highlight-supply.sticky-col {
  background-color: #141438 !important;
  z-index: 21;
}
.pro-table tbody tr {
  transition: background 0.15s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.pro-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.ai-dashboard-panel {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.ai-stat-card {
  background: var(--surface-card);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 12px 16px;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.2s ease;
}
.ai-stat-card:hover { border-color: var(--accent); }
.ai-stat-val { font-size: 24px; font-weight: 800; color: var(--text-primary); margin-bottom: 4px; }
.ai-stat-lbl { font-size: 11px; color: var(--text-muted); text-transform: uppercase; }

.quick-start-btn {
  background: linear-gradient(135deg, var(--accent) 0%, #3080ff 100%);
  color: white;
  padding: 16px;
  width: 100%;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  margin-bottom: 16px;
  box-shadow: 0 4px 15px rgba(11, 102, 255, 0.3);
  transition: transform 0.2s;
}
.quick-start-btn:hover { transform: translateY(-2px); }

/* Apply AI Fix btn in Tooltip */
.apply-ai-btn {
  width: 100%; margin-top: 8px; font-size: 11px; padding: 6px;
  background: rgba(255, 60, 60, 0.2); color: #ff6b6b; border: 1px solid rgba(255, 60, 60, 0.4);
  border-radius: 4px; cursor: pointer; transition: all 0.2s;
}
.apply-ai-btn:hover { background: rgba(255, 60, 60, 0.4); color: #fff; }

@media (max-width: 768px) {
  .pro-table th.col-wh, .pro-table td.col-wh {
    display: none !important;
  }
}

/* ======================== FAQ / HELP UI ======================== */
.faq-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 800px;
  margin: 0 auto;
}
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}
.faq-item:hover {
  border-color: var(--accent);
}
.faq-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  background: rgba(255,255,255,0.02);
}
.faq-header i {
  color: var(--text-muted);
  transition: transform 0.3s ease;
}
.faq-item.open .faq-header {
  border-bottom: 1px solid var(--border-color);
  background: rgba(45, 114, 217, 0.1); /* Subtle accent bg */
}
.faq-item.open .faq-header i {
  transform: rotate(180deg);
  color: var(--accent);
}
.faq-content {
  max-height: 0;
  padding: 0 20px;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.6;
}
.faq-item.open .faq-content,
.wiki-item.open .faq-content {
  max-height: 800px; /* arbitrary large max height for animation */
  padding: 20px;
  opacity: 1;
}
.faq-content ul {
  padding-left: 20px;
  margin: 10px 0;
}
.faq-content li {
  margin-bottom: 6px;
}
.faq-content b, .faq-content strong {
  color: var(--text-primary);
}

/* ======================== AI MASTER REPORT HUB ======================== */
#view-ai {
    display: flex;
    flex-direction: row;
    height: 100%;
    background: transparent;
    position: relative;
    align-items: stretch;
}
.ai-dashboard-pane {
    flex: 1 1 65%;
    display: flex;
    flex-direction: column;
}
.ai-chat-pane {
    flex: 0 0 35%;
    min-width: 320px;
    display: flex;
    flex-direction: column;
}

#ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    width: 100%;
}

/* Dashboard Metric Blocks */

.ai-kpi-block {
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    text-align: left;
    transition: all 0.3s cubic-bezier(0.2,0.8,0.2,1);
    position: relative;
    overflow: visible;
}
.ai-kpi-block:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.ai-kpi-lbl {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}
.ai-kpi-val {
    font-size: 24px;
    font-weight: 800;
    font-family: var(--font-display);
    color: #fff;
    line-height: 1.2;
    margin-bottom: 4px;
    letter-spacing: -1px;
}

/* Glass Report Container */
.ai-msg {
    width: 100%;
    animation: slideInUp 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    font-size: 14px;
    line-height: 1.6;
}
.ai-msg.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--accent), #5e6ad2);
    color: #fff;
    padding: 12px 20px;
    border-radius: 18px 18px 4px 18px;
    font-weight: 500;
    max-width: 80%;
    box-shadow: 0 4px 15px rgba(24,86,255,0.25);
}
.ai-msg.bot {
    align-self: flex-start;
    width: 100%;
    margin-left: 0;
}
.ai-glass-card {
    background: rgba(20,20,30,0.4);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    position: relative;
    overflow: visible;
}
.ai-glass-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}
.ai-report-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 16px;
}
.ai-report-icon {
    width: 36px; height: 36px;
    background: rgba(24,86,255,0.15);
    border: 1px solid rgba(24,86,255,0.3);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: var(--accent);
    box-shadow: 0 0 15px rgba(24,86,255,0.4);
}
.ai-report-title { font-size: 16px; font-weight: 800; color: #fff; letter-spacing: 0.5px; }
.ai-report-subtitle { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

/* Bento Blocks inside Reports */
.ai-bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}


.ai-wh-list { display: flex; flex-direction: column; gap: 8px; }
.ai-wh-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Premium SOS Alerts inside Report */
.ai-sos-alert {
    background: rgba(234,33,67,0.05);
    border-left: 3px solid var(--sys-red);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 16px;
}

/* Redesigned Floating Input Bar */
.ai-bottom-anchor {
    width: 100%;
    position: sticky;
    bottom: 0;
    padding: 0 16px 112px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(0deg, var(--bg-base) 60%, transparent);
}
.ai-quick-prompts {
    display: flex;
    gap: 8px;
    padding: 0 0 12px 0;
    overflow-x: auto;
    width: 100%;
    max-width: 900px;
    scrollbar-width: none;
}
.ai-quick-prompts::-webkit-scrollbar { display: none; }
.chip-prompt {
    flex-shrink: 0;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 6px 12px;
    border-radius: 14px;
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    letter-spacing: 0.01em;
}
.chip-prompt:hover {
    background: linear-gradient(135deg, rgba(24,86,255,0.18), rgba(99,102,241,0.12));
    border-color: rgba(24,86,255,0.5);
    color: #fff;
    box-shadow: 0 0 16px rgba(24,86,255,0.15), inset 0 1px 0 rgba(255,255,255,0.06);
    transform: translateY(-1px);
}
.ai-input-bar {
    display: flex;
    gap: 8px;
    padding: 8px;
    background: rgba(20,20,30,0.8);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 24px;
    width: 100%;
    max-width: 900px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.ai-input-bar input {
    flex: 1;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 8px 16px;
    font-size: 15px;
    color: #fff;
    outline: none;
}
.ai-input-bar button {
    width: 40px; height: 40px;
    padding: 0;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.ai-input-bar button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Modern AI Tables */
.ai-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 12px 0;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
}
.ai-table th, .ai-table td {
    padding: 10px 14px;
    text-align: left;
    font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.ai-table th {
    background: rgba(255,255,255,0.02);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
}
.ai-table tr:last-child td { border-bottom: none; }

.ai-btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 20px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}
.ai-btn-action:hover {
    background: rgba(24,86,255,0.15);
    border-color: var(--accent);
    color: var(--accent);
}
.ai-btn-danger {
    background: rgba(234,33,67,0.1);
    border-color: rgba(234,33,67,0.3);
    color: #ff5252;
}
.ai-btn-danger:hover {
    background: rgba(234,33,67,0.2);
    border-color: var(--sys-red);
    color: var(--sys-red);
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ======================== AI HUB 2.0 COMMAND CENTER ======================== */

/* Sub-tab navigation */
.ai-hub-tab {
    display:inline-flex; align-items:center; gap:6px;
    padding:10px 18px; border:none; background:transparent;
    color:var(--text-muted); font-size:12px; font-weight:600;
    font-family:var(--font-primary); cursor:pointer;
    border-bottom:2px solid transparent; transition:all 0.25s;
    position:relative; white-space:nowrap;
}
.ai-hub-tab:hover { color:rgba(255,255,255,0.8); background:rgba(255,255,255,0.03); }
.ai-hub-tab.active {
    color:#fff; border-bottom-color:var(--accent);
    background:rgba(24,86,255,0.06);
}
.ai-hub-tab.active i { color:var(--accent); }

/* Hero KPI Grid */
.ai-hero-grid {
    display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:20px;
}
.ai-hero-card {
    border:1px solid rgba(255,255,255,0.06); border-radius:16px;
    padding:18px 16px; position:relative; overflow:hidden;
    transition:all 0.3s cubic-bezier(0.2,0.8,0.2,1);
}
.ai-hero-card:hover {
    transform:translateY(-2px); border-color:rgba(255,255,255,0.15);
    box-shadow:0 12px 32px rgba(0,0,0,0.4);
}
.ai-hero-icon { margin-bottom:10px; opacity:0.9; }
.ai-hero-label { font-size:11px; color:var(--text-muted); font-weight:600; text-transform:uppercase; letter-spacing:0.5px; }
.ai-hero-value { font-size:26px; font-weight:800; margin:4px 0 2px; letter-spacing:-0.5px; line-height:1.1; }
.ai-hero-sub { font-size:10px; color:rgba(255,255,255,0.3); font-weight:500; }

/* Section Cards */
.ai-section-card {
    background:rgba(255,255,255,0.02); border:1px solid rgba(255,255,255,0.06);
    border-radius:16px; padding:20px; margin-bottom:16px;
    transition:border-color 0.2s;
}
.ai-section-card:hover { border-color:rgba(255,255,255,0.12); }
.ai-section-header {
    display:flex; justify-content:space-between; align-items:center;
}
.ai-section-header > div:first-child {
    display:flex; align-items:center; gap:8px;
    font-size:14px; font-weight:700; color:#fff;
}

/* Mini Filter Buttons */
.ai-mini-btn {
    padding:4px 12px; border-radius:8px; border:1px solid rgba(255,255,255,0.08);
    background:rgba(255,255,255,0.03); color:var(--text-muted);
    font-size:10px; font-weight:600; cursor:pointer; transition:all 0.2s;
    font-family:var(--font-primary);
}
.ai-mini-btn:hover { background:rgba(255,255,255,0.08); color:#fff; }
.ai-mini-btn.active { background:rgba(24,86,255,0.15); border-color:var(--accent); color:var(--accent); }

/* Warehouse Heatmap Bubbles */
.wh-bubble {
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    border-radius:50%; border:2px solid rgba(255,255,255,0.1);
    transition:all 0.3s; cursor:pointer; position:relative;
    backdrop-filter:blur(8px);
}
.wh-bubble:hover {
    transform:scale(1.12); z-index:5;
    box-shadow:0 8px 24px rgba(0,0,0,0.5);
    border-color:rgba(255,255,255,0.3);
}
.wh-bubble-name { font-size:10px; font-weight:700; color:#fff; text-align:center; line-height:1.2; max-width:90%; overflow:hidden; text-overflow:ellipsis; }
.wh-bubble-qty { font-size:9px; font-weight:600; color:rgba(255,255,255,0.5); margin-top:2px; }

/* Scenario Controls */
.ai-scenario-block {
    padding:16px 18px; background:rgba(255,255,255,0.02);
    border:1px solid rgba(255,255,255,0.06); border-radius:14px;
}
.ai-scenario-label {
    display:flex; align-items:center; gap:8px;
    font-size:13px; font-weight:700; color:#fff; margin-bottom:10px;
}
.ai-scenario-hint { font-size:10px; color:var(--text-muted); margin-top:6px; }
.ai-range {
    flex:1; -webkit-appearance:none; height:6px;
    background:rgba(255,255,255,0.08); border-radius:3px; outline:none;
}
.ai-range::-webkit-slider-thumb {
    -webkit-appearance:none; width:18px; height:18px; border-radius:50%;
    background:var(--accent); cursor:pointer; border:2px solid #fff;
    box-shadow:0 2px 8px rgba(24,86,255,0.4);
}
.ai-range-val {
    min-width:50px; text-align:center; font-size:14px;
    font-weight:800; color:var(--accent); font-family:monospace;
}
.ai-select {
    width:100%; padding:10px 14px; border-radius:10px;
    background:rgba(0,0,0,0.3); border:1px solid rgba(255,255,255,0.1);
    color:#fff; font-size:13px; font-family:var(--font-primary);
}

/* Action Buttons */
.ai-action-btn {
    display:inline-flex; align-items:center; justify-content:center; gap:6px;
    padding:10px 18px; border-radius:12px; border:none;
    background:var(--accent); color:#fff; font-size:13px;
    font-weight:700; cursor:pointer; transition:all 0.2s;
    font-family:var(--font-primary);
}
.ai-action-btn:hover {
    transform:translateY(-1px);
    box-shadow:0 6px 20px rgba(24,86,255,0.3);
}
.ai-action-btn.secondary {
    background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.1);
    color:var(--text-muted);
}
.ai-action-btn.secondary:hover { background:rgba(255,255,255,0.1); color:#fff; }

/* Quick Insight Cards */
.ai-quick-card {
    display:flex; align-items:center; gap:10px;
    padding:10px 12px; border-radius:10px;
    background:rgba(255,255,255,0.02); border:1px solid rgba(255,255,255,0.06);
    cursor:pointer; transition:all 0.2s;
}
.ai-quick-card:hover {
    background:rgba(24,86,255,0.06); border-color:rgba(24,86,255,0.2);
    transform:translateX(2px);
}
.ai-quick-card-icon {
    width:32px; height:32px; border-radius:8px;
    display:flex; align-items:center; justify-content:center;
    flex-shrink:0; font-size:16px;
}
.ai-quick-card-text { flex:1; min-width:0; }
.ai-quick-card-title { font-size:11px; font-weight:700; color:#fff; margin-bottom:2px; }
.ai-quick-card-desc { font-size:9px; color:var(--text-muted); line-height:1.3; }
.ai-quick-card-action {
    font-size:9px; color:var(--accent); font-weight:700;
    white-space:nowrap; padding:3px 8px; border-radius:4px;
    background:rgba(24,86,255,0.1); flex-shrink:0;
}

/* ABC Matrix Cells */
.abc-cell {
    padding:14px; border-radius:12px; text-align:center;
    border:1px solid rgba(255,255,255,0.05); transition:all 0.2s;
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    min-height:80px; cursor:default;
}
.abc-cell:hover { border-color:rgba(255,255,255,0.15); }
.abc-cell-label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:0.5px; margin-bottom:6px; }
.abc-cell-count { font-size:22px; font-weight:800; line-height:1; }
.abc-cell-hint { font-size:9px; color:var(--text-muted); margin-top:4px; }

/* Trend item rows */
.hub-trend-item {
    display:flex; align-items:center; gap:10px;
    padding:8px 10px; border-radius:8px;
    border-bottom:1px solid rgba(255,255,255,0.03);
    transition:background 0.15s;
}
.hub-trend-item:hover { background:rgba(255,255,255,0.03); }
.hub-trend-item:last-child { border-bottom:none; }

/* Warehouse analytics table */
.hub-wh-row {
    display:grid; grid-template-columns:1.5fr 1fr 1fr 1fr 1fr;
    padding:10px 12px; border-bottom:1px solid rgba(255,255,255,0.04);
    align-items:center; font-size:12px; transition:background 0.15s;
}
.hub-wh-row:hover { background:rgba(255,255,255,0.03); }
.hub-wh-row.header {
    font-size:10px; color:var(--text-muted); font-weight:700;
    text-transform:uppercase; letter-spacing:0.5px;
    border-bottom:2px solid rgba(255,255,255,0.08);
}

/* Responsive for AI Hub */
@media (max-width:1100px) {
    .ai-hero-grid { grid-template-columns:repeat(2,1fr); }
    #ai-tab-products > div:nth-child(2) { grid-template-columns:1fr; }
}
@media (max-width:800px) {
    .ai-hero-grid { grid-template-columns:1fr; }
    .hub-wh-row { grid-template-columns:1fr 1fr; gap:4px; }
}


/* GLOBAL TYPOGRAPHY */

/* Tabular Nums */
.num, .metric-vals, .stat-val, td, th {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/* Hover fx */
.glass-panel:hover, .premium-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
}
.nav-item:hover {
    color: var(--accent);
}

/* Force inner-scrolling views to flex column with no overflow (children handle their own scroll) */
#view-dashboard, #view-plan, #view-ai, #view-rnp, #view-help, #view-reviews, #view-admin {
    overflow: hidden !important;
}
#view-dashboard > div:first-child {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ======================== TABLE SCROLL PERFORMANCE ======================== */
#plan-table-wrap {
    overflow-x: auto;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    will-change: scroll-position;
}
#plan-table {
    /* table-layout and border-collapse are on .pro-table class */
}
#plan-table th,
#plan-table td {
    white-space: nowrap;
}
/* Disable heavy transitions/animations inside table during scroll */
#plan-table-wrap * {
    transition: none !important;
    animation: none !important;
}
/* Re-enable hover transitions only */
#plan-table tbody tr {
    transition: background 0.15s ease !important;
}
/* Fixed totals bar (separate from table) */
#plan-totals-bar {
    flex-shrink: 0;
}
#plan-totals-bar::-webkit-scrollbar {
    height: 0px;
    display: none;
}
#plan-totals-bar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
#plan-totals-table {
    table-layout: fixed;
}
[data-theme="light"] #plan-totals-bar {
    background: linear-gradient(90deg, #e8f5e9 0%, #e3f2fd 50%, #e8f5e9 100%) !important;
    border-top-color: #5e6ad2 !important;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.08) !important;
}
[data-theme="light"] #plan-totals-tbody td {
    background: #edf2f7 !important;
    color: #1a202c !important;
}
/* ======================== TOOLTIPS ======================== */
.tooltip-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
    color: var(--text-muted);
    margin-left: 6px;
}
.tooltip-wrap:hover {
    color: var(--accent);
}
.tooltip-content { 
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: max-content;
    max-width: 600px;
    background: #1e222d !important;
    border: 1px solid #3b4252 !important; 
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 12px;
    color: #e0e0e0;
    z-index: var(--z-tooltip) !important;
    line-height: 1.6;
    box-shadow: 0 16px 48px rgba(0,0,0,0.9), 0 0 0 1px rgba(0,0,0,0.8), 0 0 80px rgba(0,0,0,0.5) !important;
    font-weight: 500;
    text-transform: none;
    white-space: normal;
    pointer-events: none;
    opacity: 1 !important;
}
.tooltip-content::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent #1e222d transparent;
}
.tooltip-wrap:hover .tooltip-content {
    display: none; /* JS portal system handles tooltip display */
}

/* Fix light mode Tooltips */
[data-theme="light"] .tooltip-content {
    background: #FFFFFF;
    color: #0F172A;
    border: 1px solid var(--border-light);
    box-shadow: 0px 10px 30px rgba(0,0,0,0.1);
}
[data-theme="light"] .tooltip-content::after {
    border-color: #FFFFFF transparent transparent transparent;
}

/* ======================== DASHBOARD V11 WIDGETS ======================== */
.health-ring-container { display:flex;align-items:center;justify-content:center;margin-top:12px; }
.health-ring { position:relative;width:180px;height:180px;flex-shrink:0;display:flex;align-items:center;justify-content:center; }
.health-ring svg { transform:rotate(-90deg);overflow:visible; }
.health-ring-bg { fill:none;stroke:rgba(255,255,255,0.05);stroke-width:14px; }
.health-ring-fill { fill:none;stroke:var(--sys-green);stroke-width:14px;stroke-linecap:round;transition:stroke-dashoffset 1s ease-out, stroke 0.3s;filter:drop-shadow(0 0 16px currentColor); }
.health-ring-value { position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:36px;font-weight:900;letter-spacing:-1px;color:#fff; }
.health-label { font-size:12px;color:var(--text-muted);font-weight:600;margin-bottom:4px;text-transform:uppercase;letter-spacing:0.05em; }
.health-detail { font-size:14px;font-weight:600;line-height:1.4; color:var(--text-main); }

.kpi-extended-grid { display:grid;grid-template-columns:repeat(2, 1fr);gap:12px;margin-top:12px; }
.kpi-mini-card { background:var(--bg-glass);border:1px solid var(--border-glass);border-radius:12px;padding:12px;display:flex;flex-direction:column;justify-content:center; }
.kpi-mini-label { font-size:11px;color:var(--text-muted);font-weight:600;margin-bottom:6px; }
.kpi-mini-value { font-size:16px;font-weight:800;font-variant-numeric:tabular-nums; }

.sos-container { display:flex;flex-direction:column;gap:8px;margin-top:12px; }
.sos-empty { text-align:center;color:var(--text-muted);font-size:12px;padding:20px 0;background:var(--bg-glass);border-radius:12px;font-weight:500; }
.sos-card { display:flex;justify-content:space-between;align-items:center;background:linear-gradient(90deg, rgba(234,33,67,0.1), transparent);border-left:3px solid var(--sys-red);padding:10px 14px;border-radius:8px; border:1px solid var(--border-glass); gap: 12px; cursor:pointer; transition: transform 0.2s; }
.sos-card:hover { transform: translateY(-2px); border-color:rgba(234,33,67,0.4); }
.sos-card img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: var(--border-glass); }
.sos-card-info { flex: 1; min-width: 0; }
.sos-name, .sos-card-title { font-size:13px;font-weight:700;margin-bottom:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.sos-metric, .sos-card-subtitle { font-size:11px;color:var(--text-muted); }
.sos-action, .sos-card-badge { flex-shrink: 0; font-size:12px;font-weight:700;color:var(--sys-red);background:rgba(234,33,67,0.1);padding:4px 8px;border-radius:6px; }
@keyframes shimmerPremium { 0% { left: -100%; } 100% { left: 200%; } }

/* Premium Image Zoom on Hover */
.table-img-wrap { position: relative; }
.prod-photo {
  transition: all 0.25s;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  cursor: zoom-in;
  position: relative;
  z-index: 10;
}
.prod-photo:hover {
  filter: brightness(1.2);
}

/* CSS Tooltip for Headers */
.help-tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%;
  background: rgba(255,255,255,0.15); color: #fff; font-size: 10px; font-family: monospace;
  margin-left: 6px; cursor: help; position: relative; font-weight: bold;
}
.help-tip::after {
  content: attr(data-tip);
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(-6px);
  background: rgba(10,10,14,0.95); color: #fff; padding: 10px 14px;
  border-radius: 6px; box-shadow: 0 4px 15px rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.1);
  font-size: 12px; font-family: 'Inter', sans-serif; font-weight: 500; text-transform: none; text-align: center;
  width: max-content; max-width: 280px; white-space: normal;
  line-height: 1.4;
  opacity: 0; pointer-events: none; transition: 0.2s; z-index: var(--z-tooltip);
}
.help-tip:hover::after { opacity: 1; transform: translateX(-50%) translateY(-2px); }

/* === LIGHT THEME OVERRIDES FOR HARDCODED VALUES === */
[data-theme="light"] .glass-panel,
[data-theme="light"] .premium-card,
[data-theme="light"] .bento-box { background: var(--bg-glass) !important; border: 1px solid var(--border-glass) !important; }
[data-theme="light"] .btn-micro { background: #E2E8F0 !important; color: #0F172A !important; border: 1px solid var(--border-glass) !important; }
[data-theme="light"] .btn-micro:hover { background: #CBD5E1 !important; }
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="number"],
[data-theme="light"] select { background: #FFFFFF !important; border: 1px solid #CBD5E1 !important; color: #0F172A !important; }
[data-theme="light"] .info-box,
[data-theme="light"] .rec-warehouse,
[data-theme="light"] .alert-box { background: #F1F5F9 !important; border: 1px solid #CBD5E1 !important; color: #0F172A !important; }
[data-theme="light"] .pro-table th { background: #E2E8F0 !important; color: #0F172A !important; }
[data-theme="light"] .pro-table tr td { border-bottom: 1px solid #E2E8F0 !important; }
[data-theme="light"] .filter-select,
[data-theme="light"] .filter-input { background: #FFFFFF !important; border: 1px solid #CBD5E1 !important; color: #000 !important; }
[data-theme="light"] .wh-item:hover { background: #F8FAFC !important; }

[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] .step-hero h3 {
    color: var(--text-main) !important;
    background: none !important;
    -webkit-text-fill-color: var(--text-main) !important;
}

[data-theme="light"] p,
[data-theme="light"] .step-hero p {
    color: var(--text-muted) !important;
}

[data-theme="light"] i.lucide {
    stroke: currentColor;
    color: inherit;
}

[data-theme="light"] button[onclick="openConfigModal()"] {
    background: var(--accent) !important;
    color: #FFF !important;
    -webkit-text-fill-color: #FFF !important;
}

/* === NEW GLASS & AI COMPONENT LIGHT MODE OVERRIDES === */
[data-theme="light"] .bottom-nav {
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 1) !important;
}
[data-theme="light"] .nav-item { color: rgba(15, 23, 42, 0.5) !important; }
[data-theme="light"] .nav-item:hover { color: rgba(15, 23, 42, 0.9) !important; }
[data-theme="light"] .nav-item::before { background: rgba(24, 86, 255, 0.05) !important; box-shadow: none !important; }
[data-theme="light"] .nav-item.active::before { background: rgba(24, 86, 255, 0.1) !important; }
[data-theme="light"] .nav-item.active { color: #0F172A !important; }

[data-theme="light"] .header { background: rgba(244, 245, 248, 0.85) !important; border-bottom: 1px solid rgba(0,0,0,0.05) !important; }
[data-theme="light"] .ai-dashboard-pane { background: rgba(255,255,255,0.7) !important; border-right: 1px solid rgba(0,0,0,0.05) !important; }
[data-theme="light"] .ai-chat-pane { background: rgba(248,250,252,0.9) !important; border-left: 1px solid rgba(0,0,0,0.05) !important; }
[data-theme="light"] .ai-dashboard-pane > div:first-child,
[data-theme="light"] .ai-chat-pane > div:first-child { background: rgba(244,245,248,0.9) !important; border-bottom: 1px solid rgba(0,0,0,0.05) !important; }
[data-theme="light"] .ai-dashboard-pane .lucide,
[data-theme="light"] .ai-chat-pane .lucide,
[data-theme="light"] .ai-report-title,
[data-theme="light"] #ai-messages div { color: #0F172A !important; }

[data-theme="light"] .ai-kpi-block { background: rgba(255,255,255,0.8) !important; border: 1px solid rgba(0,0,0,0.05) !important; box-shadow: 0 4px 15px rgba(0,0,0,0.02) !important; }
[data-theme="light"] .ai-kpi-block:hover { background: #FFFFFF !important; box-shadow: 0 8px 25px rgba(0,0,0,0.05) !important; border-color: rgba(24,86,255,0.2) !important; }
[data-theme="light"] .ai-kpi-val { color: #0F172A !important; }
[data-theme="light"] .ai-kpi-lbl { color: #64748B !important; }

[data-theme="light"] .ai-glass-card { background: rgba(255,255,255,0.8) !important; border: 1px solid rgba(0,0,0,0.05) !important; box-shadow: 0 10px 30px rgba(0,0,0,0.03) !important; }
[data-theme="light"] .ai-glass-card::before { background: none !important; }
[data-theme="light"] .ai-table { background: #FFFFFF !important; border: 1px solid rgba(0,0,0,0.05) !important; }
[data-theme="light"] .ai-table th { background: #F1F5F9 !important; color: #475569 !important; border-bottom: 2px solid rgba(0,0,0,0.05) !important; }
[data-theme="light"] .ai-table td { color: #0F172A !important; border-bottom: 1px solid rgba(0,0,0,0.03) !important; }
[data-theme="light"] .ai-table img { border-color: rgba(0,0,0,0.05) !important; background: #F8FAFC !important; }

[data-theme="light"] .ai-input-bar { background: rgba(255,255,255,0.95) !important; border: 1px solid rgba(0,0,0,0.1) !important; box-shadow: 0 10px 40px rgba(0,0,0,0.05) !important; }
[data-theme="light"] .ai-input-bar input { color: #0F172A !important; }
[data-theme="light"] .chip-prompt { background: rgba(255,255,255,0.9) !important; border: 1px solid rgba(0,0,0,0.08) !important; color: #475569 !important; }
[data-theme="light"] .chip-prompt:hover { background: rgba(24,86,255,0.1) !important; border-color: var(--accent) !important; color: var(--accent) !important; }

[data-theme="light"] .ai-msg.bot > div { background: #FFFFFF !important; border: 1px solid rgba(0,0,0,0.05) !important; color: #0F172A !important; box-shadow: 0 4px 15px rgba(0,0,0,0.02) !important; }
[data-theme="light"] .ai-msg.bot > div > div { color: inherit !important; }
[data-theme="light"] .ai-msg.bot b { color: #000 !important; }
[data-theme="light"] .ai-msg.user { color: #FFF !important; }

[data-theme="light"] .faq-item { background: #FFFFFF !important; border: 1px solid rgba(0,0,0,0.08) !important; }
[data-theme="light"] .faq-header { background: #F8FAFC !important; color: #0F172A !important; }
[data-theme="light"] .faq-item.open .faq-header { background: rgba(24,86,255,0.05) !important; border-bottom: 1px solid rgba(0,0,0,0.05) !important; }
[data-theme="light"] .faq-content { color: #334155 !important; }
[data-theme="light"] .faq-content b { color: #0F172A !important; }
[data-theme="light"] .faq-container > div:first-child { background: #F1F5F9 !important; border: 1px solid #CBD5E1 !important; border-left: 3px solid var(--accent) !important; }
[data-theme="light"] .faq-container > div:first-child h3 { color: #0F172A !important; }
[data-theme="light"] .faq-container > div:first-child p { color: #475569 !important; }

/* =====================================================
   AUTH OVERLAY & FORMS (Phase 6)
   ===================================================== */
#auth-overlay, #expired-overlay {
    position: fixed; inset: 0; z-index: var(--z-modal);
    background: rgba(5,5,10,0.95);
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(16px);
    background-image: radial-gradient(ellipse at 30% 50%, rgba(24,86,255,0.08) 0%, transparent 60%),
                      radial-gradient(ellipse at 70% 30%, rgba(124,58,237,0.06) 0%, transparent 60%);
}
.auth-container {
    width: 400px; max-width: 92vw;
}
.auth-form {
    background: rgba(15,15,30,0.85);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 40px 32px;
    backdrop-filter: blur(12px);
    animation: authFadeIn 0.4s ease;
}
@keyframes authFadeIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.auth-logo {
    font-size: 22px; font-weight: 800; text-align: center; margin-bottom: 8px;
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.auth-subtitle {
    text-align: center; font-size: 13px; color: var(--text-muted); margin-bottom: 24px; line-height: 1.4;
}
.auth-form input {
    width: 100%; padding: 13px 16px; border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: #fff; font-size: 14px; font-family: 'Inter', sans-serif;
    margin-bottom: 12px; outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.auth-form input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(24,86,255,0.12);
}
.auth-form input::placeholder { color: rgba(255,255,255,0.3); }
.auth-btn {
    width: 100%; padding: 14px; border-radius: 12px; border: none;
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    color: #fff; font-weight: 600; font-size: 15px; font-family: 'Inter', sans-serif;
    cursor: pointer; transition: opacity 0.3s, transform 0.2s;
    margin-top: 4px;
}
.auth-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.auth-btn:active { transform: translateY(0); }
.auth-error {
    text-align: center; color: var(--sys-red); font-size: 13px;
    min-height: 20px; margin-top: 10px;
}
.auth-switch {
    text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 16px;
}
.auth-switch a { color: var(--accent); text-decoration: none; font-weight: 500; }
.auth-switch a:hover { text-decoration: underline; }

.token-help {
    margin: -4px 0 12px; font-size: 12px; color: var(--text-muted);
}
.token-help summary { cursor: pointer; color: var(--accent); font-weight: 500; padding: 4px 0; }
.token-help ol { padding-left: 20px; margin-top: 8px; line-height: 1.8; }
.token-help b { color: #fff; }

/* Subscription badge pulse */
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,100,118,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(239,100,118,0); }
}

/* ======================== AI REVIEWS TOGGLE ======================== */
.reviews-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    cursor: pointer;
    flex-shrink: 0;
}
.reviews-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.reviews-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #374151;
    border-radius: 28px;
    transition: 0.3s;
}
.reviews-slider::before {
    content: '';
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.reviews-switch input:checked + .reviews-slider {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 0 12px rgba(16,185,129,0.4);
}
.reviews-switch input:checked + .reviews-slider::before {
    transform: translateX(24px);
}

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ═══ TECH CALCULATE BUTTON ═══ */
.btn-calculate-tech {
  position: relative;
  padding: 16px 48px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 10px;
  color: #000;
}
.btn-calc-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #07ca6b 0%, #0fc7ec 50%, #07ca6b 100%);
  background-size: 200% 100%;
  animation: calcGlow 3s ease infinite;
  border-radius: 14px;
}
.btn-calc-border {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.3), transparent 60%, rgba(255,255,255,0.15));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.btn-calc-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.btn-calculate-tech:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 40px rgba(7,202,107,0.4), 0 0 60px rgba(15,199,236,0.15);
}
.btn-calculate-tech:active {
  transform: translateY(0) scale(0.98);
}
@keyframes calcGlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.btn-calculate-tech::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.12) 0%, transparent 70%);
  animation: calcPulse 2.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes calcPulse {
  0%, 100% { opacity: 0; transform: scale(0.8); }
  50%      { opacity: 1; transform: scale(1); }
}

/* ═══ TOTALS ROW ═══ */
.plan-totals-row {
  position: sticky;
  bottom: 0;
  background: var(--bg-main, #0a0a0f) !important;
  border-top: 2px solid var(--accent, #5e6ad2) !important;
  font-weight: 800 !important;
  z-index: 5;
}
.plan-totals-row td {
  background: var(--bg-main, #0a0a0f) !important;
  font-weight: 800 !important;
  padding: 8px 6px !important;
  font-size: 12px !important;
  color: var(--text-main, #fff) !important;
  border-bottom: none !important;
}

/* ═══ LIGHT THEME FIXES ═══ */

/* Scrollbar in light theme */
[data-theme="light"] #plan-table-wrap::-webkit-scrollbar {
  height: 14px !important;
  width: 10px !important;
}
[data-theme="light"] #plan-table-wrap::-webkit-scrollbar-track {
  background: #E2E8F0 !important;
  border-radius: 10px !important;
}
[data-theme="light"] #plan-table-wrap::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #94A3B8, #64748B) !important;
  border-radius: 10px !important;
  border: 2px solid #E2E8F0 !important;
}
[data-theme="light"] #plan-table-wrap::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #64748B, #475569) !important;
}

/* Opaque table in light theme */
[data-theme="light"] #view-plan {
  background: #F8FAFC !important;
}
[data-theme="light"] 
/* duplicate sticky-cell rules removed — see lines 262-272 for opaque fix */

[data-theme="light"] .pro-table td {
  background: #FFFFFF !important;
  color: #0F172A !important;
}
[data-theme="light"] .pro-table tr:nth-child(even) td {
  background: #F8FAFC !important;
}
[data-theme="light"] .pro-table tr:hover td {
  background: #EFF6FF !important;
}

/* Season column visibility in light theme */
[data-theme="light"] .pro-table td[style*="color: rgba(255"],
[data-theme="light"] .pro-table td span {
  color: #0F172A !important;
}

/* Light totals row */
[data-theme="light"] .plan-totals-row td {
  background: #EFF6FF !important;
  color: #0F172A !important;
  border-top: 2px solid #3B82F6 !important;
}

/* Light theme table wrapper */
[data-theme="light"] #plan-table-wrap {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 8px;
}

/* ═══ WIKI LIBRARY ═══ */
.wiki-cat {
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.wiki-cat:hover {
  background: rgba(24,86,255,0.1);
  border-color: rgba(24,86,255,0.3);
  color: #fff;
}
.wiki-cat.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(24,86,255,0.3);
}
.wiki-item {
  margin-bottom: 6px;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s;
}
.wiki-item:hover {
  border-color: rgba(24,86,255,0.2);
}
.wiki-item.hidden {
  display: none !important;
}
.wiki-item .faq-header {
  padding: 14px 18px;
}
.wiki-item .faq-content {
  padding: 0 18px;
}
.wiki-item .faq-content p,
.wiki-item .faq-content li {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-muted);
}
.wiki-item .faq-content b {
  color: #fff;
}
[data-theme="light"] .wiki-cat {
  background: #F1F5F9 !important;
  color: #475569 !important;
  border-color: #E2E8F0 !important;
}
[data-theme="light"] .wiki-cat.active {
  background: var(--accent) !important;
  color: #fff !important;
}
[data-theme="light"] .wiki-item .faq-content b {
  color: #0F172A !important;
}

/* ======================== COMPREHENSIVE LIGHT MODE FIX ======================== */

/* Header */
[data-theme="light"] .header {
  background: rgba(255,255,255,0.85) !important;
  backdrop-filter: blur(24px) !important;
  border-bottom-color: #E2E8F0 !important;
}
[data-theme="light"] .header .title { color: #0F172A !important; }
[data-theme="light"] .header .sub { color: #64748B !important; }
[data-theme="light"] .header-btn {
  background: #F1F5F9 !important; border-color: #E2E8F0 !important; color: #334155 !important;
}
[data-theme="light"] .header-btn:hover { background: #E2E8F0 !important; }

/* Bottom Nav */
[data-theme="light"] .bottom-nav {
  background: rgba(255,255,255,0.85) !important;
  border-color: #E2E8F0 !important;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08) !important;
}
[data-theme="light"] .nav-item { color: #94A3B8 !important; }
[data-theme="light"] .nav-item.active { color: var(--accent) !important; }
[data-theme="light"] .nav-item.active::before { background: rgba(24,86,255,0.08) !important; }

/* Glass panels and cards */
[data-theme="light"] .glass-panel,
[data-theme="light"] .premium-card {
  background: #FFFFFF !important; border-color: #E2E8F0 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
}
[data-theme="light"] .glass-panel:hover,
[data-theme="light"] .premium-card:hover {
  background: #F8FAFC !important; border-color: #CBD5E1 !important;
}
[data-theme="light"] .bento-box {
  background: #FFFFFF !important; border-color: #E2E8F0 !important;
  backdrop-filter: none !important;
}

/* Welcome / Dashboard hero area */
[data-theme="light"] #view-home {
  background: var(--bg-body-grad) !important;
}
[data-theme="light"] #view-home h1,
[data-theme="light"] #view-home h2,
[data-theme="light"] #view-home h3,
[data-theme="light"] .m-val { color: #0F172A !important; }
[data-theme="light"] .m-val.green { color: var(--sys-green) !important; }

/* News feed */
[data-theme="light"] #news-feed > div {
  background: #FFFFFF !important; border-color: #E2E8F0 !important;
  backdrop-filter: none !important;
}
[data-theme="light"] #news-items > div {
  border-color: #E2E8F0 !important;
}

/* Dropdowns */
[data-theme="light"] #client-dropdown {
  background: rgba(255,255,255,0.97) !important;
  border-color: #E2E8F0 !important;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12) !important;
}
[data-theme="light"] #client-dropdown div[style*="color:rgba(255,255,255"] {
  color: #64748B !important;
}

/* Inputs & selects */
[data-theme="light"] input[type=number],
[data-theme="light"] input[type=text],
[data-theme="light"] select,
[data-theme="light"] .input-premium,
[data-theme="light"] .filter-input,
[data-theme="light"] .filter-select {
  background: #F8FAFC !important; border-color: #CBD5E1 !important; color: #0F172A !important;
}
[data-theme="light"] select option { background: #fff !important; color: #0F172A !important; }

/* Table */
[data-theme="light"] .pro-table th {
  background: #F1F5F9 !important; color: #475569 !important;
  border-bottom-color: #CBD5E1 !important;
}
[data-theme="light"] 
/* duplicate sticky-cell rules removed — see lines 262-272 for opaque fix */

[data-theme="light"] .pro-table td { border-bottom-color: #E2E8F0 !important; }
[data-theme="light"] .pro-table tr:nth-child(even) td { background: #FAFBFC !important; }
[data-theme="light"] .pro-table tr:hover td { background: #F1F5F9 !important; }
[data-theme="light"] .sticky-col { background: #FFFFFF !important; }
[data-theme="light"] .pro-table th.sticky-col { background: #F1F5F9 !important; }
[data-theme="light"] .tbl-input { color: #0F172A !important; }
[data-theme="light"] .tbl-input:focus { background: #F8FAFC !important; }

/* Modals */
[data-theme="light"] .modal-content {
  background: #FFFFFF !important; border-color: #E2E8F0 !important;
}
[data-theme="light"] .modal-header-premium {
  background: linear-gradient(135deg, rgba(24,86,255,0.04), transparent) !important;
  border-bottom-color: #E2E8F0 !important;
}
[data-theme="light"] .modal-title-gradient {
  background: linear-gradient(90deg, #0F172A, #475569) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}
[data-theme="light"] .modal-footer-premium {
  background: #F8FAFC !important; border-top-color: #E2E8F0 !important;
}

/* Chips */
[data-theme="light"] .chip {
  background: #F1F5F9 !important; border-color: #CBD5E1 !important; color: #475569 !important;
}
[data-theme="light"] .chip.active {
  background: rgba(24,86,255,0.1) !important; border-color: var(--accent) !important; color: var(--accent) !important;
}

/* Toast */
[data-theme="light"] .toast {
  background: rgba(255,255,255,0.95) !important; border-color: #CBD5E1 !important;
  color: #0F172A !important; box-shadow: 0 8px 24px rgba(0,0,0,0.1) !important;
}

/* AI Chat */
[data-theme="light"] .ai-input-bar {
  background: rgba(255,255,255,0.9) !important; border-color: #CBD5E1 !important;
}
[data-theme="light"] .ai-input-bar input { color: #0F172A !important; }
[data-theme="light"] .ai-msg.bot {
  background: #F8FAFC !important; border-color: #E2E8F0 !important; color: #334155 !important;
}
[data-theme="light"] .ai-glass-card {
  background: #FFFFFF !important; border-color: #E2E8F0 !important;
  backdrop-filter: none !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
}

[data-theme="light"] .ai-report-title { color: #0F172A !important; }
[data-theme="light"] .chip-prompt {
  background: #F1F5F9 !important; border-color: #E2E8F0 !important; color: #475569 !important;
}
[data-theme="light"] .chip-prompt:hover {
  background: rgba(24,86,255,0.08) !important; color: var(--accent) !important;
}

/* GEO popup */
[data-theme="light"] .geo-popup {
  background: rgba(255,255,255,0.97) !important; border-color: #CBD5E1 !important;
  box-shadow: 0 12px 40px rgba(0,0,0,0.1) !important;
}

/* Scrollbars */
[data-theme="light"] .glass-scrollbar::-webkit-scrollbar-thumb,
[data-theme="light"] .plan-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15) !important;
}

/* Video widget */
[data-theme="light"] #video-panel {
  background: rgba(255,255,255,0.97) !important; border-color: #E2E8F0 !important;
  box-shadow: 0 20px 50px rgba(0,0,0,0.12) !important;
}
[data-theme="light"] .vp-header { border-bottom-color: #E2E8F0 !important; }
[data-theme="light"] .vp-header-title { color: #0F172A !important; }
[data-theme="light"] .vp-header-actions button {
  background: #F1F5F9 !important; color: #64748B !important;
}
[data-theme="light"] .vp-item:hover { background: #F1F5F9 !important; }
[data-theme="light"] .vp-item.active { background: rgba(255,71,87,0.06) !important; border-color: rgba(255,71,87,0.15) !important; }
[data-theme="light"] .vp-item-title { color: #0F172A !important; }
[data-theme="light"] .vp-item-meta { color: #94A3B8 !important; }

/* FAQ items */
[data-theme="light"] .faq-item {
  background: #FFFFFF !important; border-color: #E2E8F0 !important;
}
[data-theme="light"] .faq-header { color: #0F172A !important; background: #F8FAFC !important; }
[data-theme="light"] .faq-item.open .faq-header { background: rgba(24,86,255,0.04) !important; }

/* Tooltip portal */
[data-theme="light"] .tooltip-portal {
  background-color: #FFFFFF !important; border-color: #CBD5E1 !important;
  color: #334155 !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1) !important;
}

/* Settings modal cards */
[data-theme="light"] .input-group-premium select,
[data-theme="light"] .input-group-premium .input-premium {
  background: #F1F5F9 !important; border-color: #CBD5E1 !important; color: #0F172A !important;
}

/* Plan toolbar */
[data-theme="light"] .plan-toolbar { border-bottom-color: #E2E8F0 !important; }
[data-theme="light"] .plan-footer { border-top-color: #E2E8F0 !important; }

/* AI Chat pane */
[data-theme="light"] .ai-chat-pane {
  border-left-color: #E2E8F0 !important;
  box-shadow: inset 4px 0 12px rgba(0,0,0,0.03) !important;
}

/* Inline elements with hardcoded dark colors */
[data-theme="light"] [style*="color:#fff"],
[data-theme="light"] [style*="color: #fff"] { }

/* Views container bg */
[data-theme="light"] .views-container { background: var(--bg-body-grad) !important; }

/* Dropdown animation */
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* WB Niche AI */
.niche-ai-shell {
  min-height: 100%;
  padding: 18px 20px 112px;
  background:
    linear-gradient(180deg, rgba(8,10,18,0.94), rgba(8,10,18,0.98)),
    radial-gradient(circle at 20% 0%, rgba(24,86,255,0.14), transparent 40%),
    radial-gradient(circle at 80% 100%, rgba(168,85,247,0.08), transparent 36%);
}
.niche-presets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 18px 0 16px;
}
@media (max-width: 900px) { .niche-presets-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .niche-presets-grid { grid-template-columns: 1fr; } }
.niche-preset-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  color: #fff;
  transition: all 0.22s ease;
  position: relative;
  overflow: hidden;
}
.niche-preset-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(24,86,255,0.08), rgba(168,85,247,0.06));
  opacity: 0;
  transition: opacity 0.22s ease;
  border-radius: inherit;
}
.niche-preset-card:hover {
  border-color: rgba(24,86,255,0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(24,86,255,0.12);
}
.niche-preset-card:hover::before { opacity: 1; }
.niche-preset-card.active {
  border-color: rgba(24,86,255,0.6);
  background: rgba(24,86,255,0.1);
  box-shadow: 0 0 20px rgba(24,86,255,0.2), inset 0 0 20px rgba(24,86,255,0.06);
}
.niche-preset-card.active::after {
  content: '✓';
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 14px;
  color: #07ca6b;
  font-weight: 700;
}
.niche-preset-icon {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.niche-preset-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  z-index: 1;
}
.niche-preset-info strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.niche-preset-info span {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
}
.niche-preset-info small {
  font-size: 11.5px;
  color: rgba(255,255,255,0.35);
  line-height: 1.4;
}

/* ===== NICHE TABS ===== */
.niche-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  margin: 14px 0 0;
}
.niche-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(255,255,255,0.45);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s ease;
}
.niche-tab:hover { color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.04); }
.niche-tab.active {
  color: #fff;
  background: rgba(24,86,255,0.15);
  box-shadow: 0 2px 12px rgba(24,86,255,0.15);
}
.niche-tab svg { width: 16px; height: 16px; }
.niche-tab-content { display: none; margin-top: 14px; }
.niche-tab-content.active { display: block; }

/* ===== CATEGORY TREE ===== */
.niche-tree-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}
.niche-tree-path {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.niche-crumb {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: color 0.2s;
  padding: 4px 8px;
  border-radius: 6px;
}
.niche-crumb:hover { color: #fff; background: rgba(255,255,255,0.06); }
.niche-crumb.active { color: #6ea8fe; font-weight: 600; }
.niche-crumb + .niche-crumb::before {
  content: '›';
  margin-right: 6px;
  color: rgba(255,255,255,0.2);
}
.niche-tree-stats {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
}
.niche-tree-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}
.niche-tree-grid::-webkit-scrollbar { width: 4px; }
.niche-tree-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }
.niche-tree-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  transition: all 0.2s ease;
  color: #fff;
  font-size: 13px;
  min-height: 44px;
}
.niche-tree-item:hover {
  border-color: rgba(24,86,255,0.3);
  background: rgba(24,86,255,0.06);
  transform: translateY(-1px);
}
.niche-tree-item .tree-icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}
.niche-tree-item .tree-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.niche-tree-item .tree-count {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  flex-shrink: 0;
}
.niche-tree-item.leaf {
  border-color: rgba(7,202,107,0.15);
}
.niche-tree-item.leaf:hover {
  border-color: rgba(7,202,107,0.4);
  background: rgba(7,202,107,0.06);
}
.niche-tree-loading {
  grid-column: 1 / -1;
  padding: 40px;
  text-align: center;
  color: rgba(255,255,255,0.4);
  font-size: 14px;
}

/* ===== SEARCH ===== */
.niche-search-box {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 4px;
  position: relative;
}
.niche-search-icon {
  position: absolute;
  left: 16px;
  width: 18px;
  height: 18px;
  color: rgba(255,255,255,0.3);
  pointer-events: none;
}
.niche-search-input {
  flex: 1;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 15px;
  padding: 12px 16px 12px 44px;
  outline: none;
  min-width: 0;
}
.niche-search-input::placeholder { color: rgba(255,255,255,0.25); }
.niche-search-go {
  padding: 10px 28px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #1856ff, #7c3aed);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.niche-search-go:hover { filter: brightness(1.15); transform: scale(1.02); }
.niche-search-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.niche-search-hint {
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.18s;
}
.niche-search-hint:hover {
  border-color: rgba(24,86,255,0.3);
  color: #fff;
  background: rgba(24,86,255,0.08);
}
.niche-search-results {
  margin-top: 14px;
}

/* ===== PROGRESS BAR ===== */
.niche-progress-wrap {
  margin: 14px 0;
}
.niche-progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}
.niche-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #1856ff, #7c3aed, #07ca6b);
  border-radius: 4px;
  transition: width 0.4s ease;
  background-size: 200% 100%;
  animation: nicheProgressShimmer 2s linear infinite;
}
@keyframes nicheProgressShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: 0 0; }
}
.niche-progress-text {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  margin-top: 6px;
  text-align: center;
}

.niche-ai-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  background: rgba(15,23,42,0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.niche-ai-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 22px;
  font-weight: 850;
}
.niche-ai-title svg { width: 22px; height: 22px; color: #38bdf8; }
.niche-ai-subtitle { margin-top: 4px; color: var(--text-muted); font-size: 12px; }
.niche-ai-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.niche-ai-input {
  width: 190px;
  padding: 11px 12px;
  border-radius: 8px;
  border: 1px solid rgba(148,163,184,0.2);
  background: rgba(255,255,255,0.04);
  color: #fff;
  font-weight: 700;
}
.niche-ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #5e6ad2, #0f9fce);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.niche-ai-btn.secondary {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(148,163,184,0.18);
}
.niche-ai-btn svg { width: 16px; height: 16px; }
.niche-howto-strip {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-top:12px;
}
.niche-howto-strip div,
.rnp-first-steps div {
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  column-gap:10px;
  row-gap:2px;
  align-items:center;
  padding:12px;
  border-radius:8px;
  border:1px solid rgba(56,189,248,0.14);
  background:rgba(56,189,248,0.045);
}
.niche-howto-strip span,
.rnp-first-steps span {
  grid-row:1 / span 2;
  width:26px;
  height:26px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  background:rgba(56,189,248,0.16);
  color:#7dd3fc;
  font-size:12px;
  font-weight:900;
}
.niche-howto-strip strong,
.rnp-first-steps strong {
  color:#fff;
  font-size:12px;
  font-weight:850;
}
.niche-howto-strip small,
.rnp-first-steps small {
  color:rgba(226,232,240,0.62);
  font-size:11px;
  font-weight:650;
  line-height:1.35;
}
.niche-control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  gap: 12px;
  margin-top: 12px;
}
.niche-settings-panel, .niche-chat-panel {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color 0.3s ease;
}
.niche-settings-panel:hover, .niche-chat-panel:hover {
  border-color: rgba(255,255,255,0.18);
}
.niche-panel-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.niche-panel-head span {
  display:block;
  color:#38bdf8;
  font-size:10px;
  font-weight:850;
  text-transform:uppercase;
  margin-bottom:3px;
}
.niche-panel-head strong { color:#fff; font-size:14px; }
.niche-settings-grid {
  display:grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap:8px;
}
.niche-settings-grid label, .niche-toggle-row label {
  color:var(--text-muted);
  font-size:10px;
  font-weight:800;
}
.niche-field { display:block; position:relative; }
.niche-field > span {
  display:flex;
  align-items:center;
  gap:6px;
}
.niche-field em {
  display:block;
  min-height:28px;
  margin-top:6px;
  color:rgba(148,163,184,0.74);
  font-size:10px;
  line-height:1.35;
  font-style:normal;
  font-weight:650;
}
.niche-help-dot {
  width:17px;
  height:17px;
  border-radius:50%;
  border:1px solid rgba(56,189,248,0.26);
  background:rgba(56,189,248,0.08);
  color:#7dd3fc;
  font-size:11px;
  font-weight:900;
  cursor:help;
  position:relative;
}
.niche-help-dot::after {
  content:attr(data-tip);
  position:absolute;
  left:50%;
  bottom:calc(100% + 10px);
  width:260px;
  padding:10px 11px;
  border-radius:8px;
  background:#0b1120;
  border:1px solid rgba(56,189,248,0.24);
  color:rgba(226,232,240,0.9);
  box-shadow:0 16px 36px rgba(0,0,0,0.42);
  transform:translateX(-50%) translateY(4px);
  opacity:0;
  pointer-events:none;
  transition:opacity .16s ease, transform .16s ease;
  text-transform:none;
  line-height:1.45;
  font-size:11px;
  font-weight:650;
  z-index:40;
}
.niche-help-dot:hover::after,
.niche-help-dot:focus-visible::after {
  opacity:1;
  transform:translateX(-50%) translateY(0);
}
.niche-settings-grid input, .niche-settings-grid select {
  width:100%;
  margin-top:5px;
  padding:9px 10px;
  border-radius:8px;
  border:1px solid rgba(148,163,184,0.18);
  background:rgba(255,255,255,0.04);
  color:#fff;
  font-weight:800;
}
.niche-settings-grid select option { background:#101624; color:#fff; }
.niche-toggle-row { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.niche-toggle-row label {
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:8px 10px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.07);
  background:rgba(255,255,255,0.035);
}
.niche-small-btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  padding:9px 11px;
  border-radius:8px;
  border:1px solid rgba(148,163,184,0.16);
  background:rgba(255,255,255,0.045);
  color:#cbd5e1;
  font-weight:800;
  cursor:pointer;
}
.niche-small-btn svg { width:15px; height:15px; }
.niche-chat-log {
  height:78px;
  overflow:auto;
  padding:10px;
  border-radius:8px;
  background:rgba(0,0,0,0.18);
  border:1px solid rgba(255,255,255,0.055);
}
.niche-chat-msg {
  padding:8px 10px;
  border-radius:8px;
  font-size:12px;
  line-height:1.45;
  color:rgba(226,232,240,0.78);
  background:rgba(255,255,255,0.035);
}
.niche-chat-msg.user { margin-top:6px; color:#fff; background:rgba(24,86,255,0.16); }
.niche-chat-input-row { display:flex; gap:8px; margin-top:8px; }
.niche-chat-input-row .niche-ai-input { flex:1; width:auto; }
.niche-prompt-row { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.niche-prompt-row button, .niche-sort-tabs button {
  border:1px solid rgba(148,163,184,0.14);
  background:rgba(255,255,255,0.035);
  color:#94a3b8;
  border-radius:8px;
  padding:8px 10px;
  font-size:11px;
  font-weight:800;
  cursor:pointer;
}
.niche-command-bar {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-top:12px;
  padding:10px;
  border-radius:8px;
  border:1px solid rgba(148,163,184,0.12);
  background:rgba(255,255,255,0.025);
}
.niche-sort-tabs, .niche-export-actions { display:flex; flex-wrap:wrap; gap:7px; }
.niche-sort-tabs button.active {
  color:#fff;
  background:rgba(24,86,255,0.18);
  border-color:rgba(56,189,248,0.28);
}
.niche-ai-recommendations {
  display:none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:10px;
  margin-top:12px;
}
.niche-ai-recommendations.visible { display:grid; }
.niche-decision-board {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-top:12px;
}
.niche-decision-empty {
  grid-column:1 / -1;
  padding:14px;
  border-radius:8px;
  border:1px dashed rgba(148,163,184,0.2);
  background:rgba(255,255,255,0.025);
}
.niche-decision-empty strong {
  display:block;
  color:#fff;
  margin-bottom:4px;
}
.niche-decision-empty span {
  color:rgba(226,232,240,0.68);
  font-size:12px;
}
.niche-decision-col {
  padding:14px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.08);
  background:rgba(15,23,42,0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.25s ease;
}
.niche-decision-col.good { border-color:rgba(7,202,107,0.28); background:rgba(7,202,107,0.055); }
.niche-decision-col.watch { border-color:rgba(232,149,88,0.26); background:rgba(232,149,88,0.055); }
.niche-decision-col.bad { border-color:rgba(234,33,67,0.24); background:rgba(234,33,67,0.055); }
.niche-decision-head {
  display:flex;
  gap:9px;
  align-items:flex-start;
  margin-bottom:10px;
}
.niche-decision-head svg {
  width:19px;
  height:19px;
  color:#38bdf8;
  flex-shrink:0;
}
.niche-decision-head strong {
  display:block;
  color:#fff;
  font-size:14px;
}
.niche-decision-head span,
.niche-decision-col p {
  display:block;
  color:rgba(226,232,240,0.62);
  font-size:11px;
  line-height:1.35;
}
.niche-decision-col button {
  width:100%;
  text-align:left;
  border:1px solid rgba(255,255,255,0.07);
  background:rgba(255,255,255,0.04);
  border-radius:8px;
  padding:9px;
  color:#fff;
  cursor:pointer;
  margin-top:7px;
}
.niche-decision-col button b {
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:12px;
}
.niche-decision-col button span {
  display:block;
  color:rgba(226,232,240,0.62);
  margin-top:3px;
  font-size:11px;
}
.niche-rec-card {
  padding:14px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.1);
  background:rgba(15,23,42,0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.3s ease;
  cursor: pointer;
}
.niche-rec-card:hover {
  border-color: rgba(56,189,248,0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.niche-rec-card span { color:#38bdf8; font-size:10px; font-weight:850; text-transform:uppercase; }
.niche-rec-card strong { display:block; color:#fff; margin:5px 0; font-size:14px; }
.niche-rec-card p { margin:0; color:rgba(226,232,240,0.7); font-size:12px; line-height:1.45; }
.niche-strategy-summary {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-top:10px;
  padding:10px 12px;
  border-radius:8px;
  border:1px solid rgba(56,189,248,0.14);
  background:linear-gradient(135deg, rgba(56,189,248,0.07), rgba(24,86,255,0.035));
}
.niche-strategy-summary span {
  display:block;
  color:#38bdf8;
  font-size:9px;
  font-weight:850;
  text-transform:uppercase;
  margin-bottom:3px;
}
.niche-strategy-summary strong {
  color:rgba(226,232,240,0.86);
  font-size:12px;
  line-height:1.45;
}
.niche-ai-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.niche-kpi {
  padding: 16px 18px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: rgba(15,23,42,0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.25s ease;
}
.niche-kpi:hover {
  border-color: rgba(255,255,255,0.16);
  transform: translateY(-1px);
}
.niche-kpi span { display:block; color: var(--text-muted); font-size: 11px; font-weight: 700; margin-bottom: 6px; }
.niche-kpi strong { color:#fff; font-size: 20px; }
.niche-ai-status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 12px 14px;
  color: rgba(226,232,240,0.78);
  border: 1px dashed rgba(148,163,184,0.18);
  border-radius: 8px;
  background: rgba(255,255,255,0.025);
}
.niche-comparison-table {
  margin-top:12px;
  border:1px solid rgba(148,163,184,0.14);
  border-radius:8px;
  background:rgba(15,23,42,0.66);
  overflow:hidden;
}
.niche-comparison-table:empty { display:none; }
.niche-comparison-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  border-bottom:1px solid rgba(148,163,184,0.12);
}
.niche-comparison-head span {
  display:block;
  color:#38bdf8;
  font-size:10px;
  font-weight:850;
  text-transform:uppercase;
  margin-bottom:3px;
}
.niche-comparison-head strong { color:#fff; font-size:14px; }
.niche-comparison-head small { color:rgba(226,232,240,0.58); font-size:11px; font-weight:700; }
.niche-comparison-scroll { overflow:auto; }
.niche-comparison-table table {
  width:100%;
  min-width:980px;
  border-collapse:collapse;
}
.niche-comparison-table th,
.niche-comparison-table td {
  padding:10px 12px;
  border-bottom:1px solid rgba(148,163,184,0.08);
  text-align:left;
  font-size:12px;
}
.niche-comparison-table th {
  color:rgba(226,232,240,0.48);
  font-size:10px;
  font-weight:850;
  text-transform:uppercase;
  background:rgba(0,0,0,0.14);
}
.niche-comparison-table tr { cursor:pointer; }
.niche-comparison-table tr:hover { background:rgba(56,189,248,0.055); }
.niche-comparison-table td strong {
  display:block;
  color:#fff;
  max-width:260px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.niche-comparison-table td small {
  display:block;
  color:rgba(226,232,240,0.5);
  max-width:360px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  margin-top:3px;
}
.niche-table-verdict {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:76px;
  padding:5px 8px;
  border-radius:7px;
  font-size:10px;
  font-weight:900;
}
.niche-table-verdict.good,
.niche-score-chip.good { color:#86efac; border-color:rgba(7,202,107,0.24); background:rgba(7,202,107,0.08); }
.niche-table-verdict.watch { color:#fdba74; border:1px solid rgba(232,149,88,0.22); background:rgba(232,149,88,0.08); }
.niche-table-verdict.bad { color:#fda4af; border:1px solid rgba(234,33,67,0.24); background:rgba(234,33,67,0.08); }
.niche-table-verdict.neutral { color:#cbd5e1; border:1px solid rgba(148,163,184,0.18); background:rgba(148,163,184,0.08); }
.niche-ai-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.niche-empty-state {
  grid-column:1 / -1;
  display:flex;
  align-items:flex-start;
  gap:16px;
  padding:22px;
  border-radius:10px;
  border:1px dashed rgba(148,163,184,0.22);
  background:rgba(15,23,42,0.5);
}
.niche-empty-icon {
  width:44px;
  height:44px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  color:#38bdf8;
  background:rgba(56,189,248,0.08);
  border:1px solid rgba(56,189,248,0.18);
}
.niche-empty-icon svg { width:22px; height:22px; }
.niche-empty-state h3 { margin:0 0 6px; color:#fff; font-size:18px; }
.niche-empty-state p { margin:0; max-width:760px; color:rgba(226,232,240,0.68); font-size:13px; line-height:1.55; }
.niche-empty-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.niche-empty-actions button {
  border:1px solid rgba(56,189,248,0.22);
  background:rgba(24,86,255,0.12);
  color:#fff;
  border-radius:8px;
  padding:9px 12px;
  font-weight:850;
  cursor:pointer;
}
.niche-card {
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(15,23,42,0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  transition: all 0.3s ease;
}
.niche-card:hover {
  border-color: rgba(255,255,255,0.2);
  background: rgba(15,23,42,0.65);
  transform: translateY(-3px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.35);
}
.niche-card.niche-good { border-color: rgba(7,202,107,0.4); }
.niche-card.niche-bad { border-color: rgba(234,33,67,0.36); }
.niche-card-focus {
  animation:niche-focus 1.35s ease;
}
@keyframes niche-focus {
  0%,100% { box-shadow:0 16px 40px rgba(0,0,0,0.2); }
  35% { box-shadow:0 0 0 2px rgba(56,189,248,0.5), 0 22px 64px rgba(56,189,248,0.18); }
}
.niche-card-top { display:flex; align-items:flex-start; justify-content:space-between; gap: 12px; margin-bottom: 14px; }
.niche-label { color:#38bdf8; font-size:10px; font-weight:850; text-transform:uppercase; }
.niche-card h3 { margin: 4px 0 0; color:#fff; font-size: 18px; line-height: 1.2; letter-spacing:0; }
.niche-score-row {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin:10px 0 12px;
}
.niche-score-chip {
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:5px 8px;
  border-radius:7px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.06);
  color:#cbd5e1;
  font-size:10px;
  font-weight:850;
}
.niche-score-chip.good { color:#86efac; border-color:rgba(7,202,107,0.24); background:rgba(7,202,107,0.08); }
.niche-score-chip.watch { color:#fdba74; border-color:rgba(232,149,88,0.22); background:rgba(232,149,88,0.08); }
.niche-score-chip.bad { color:#fda4af; border-color:rgba(234,33,67,0.24); background:rgba(234,33,67,0.08); }
.niche-score-chip.neutral { color:#cbd5e1; }
.niche-decision-card {
  margin:10px 0 12px;
  padding:12px;
  border-radius:8px;
  border:1px solid rgba(148,163,184,0.14);
  background:rgba(255,255,255,0.035);
}
.niche-decision-card.good { border-color:rgba(7,202,107,0.28); background:linear-gradient(135deg, rgba(7,202,107,0.11), rgba(56,189,248,0.035)); }
.niche-decision-card.watch { border-color:rgba(232,149,88,0.26); background:rgba(232,149,88,0.075); }
.niche-decision-card.bad { border-color:rgba(234,33,67,0.25); background:rgba(234,33,67,0.075); }
.niche-decision-card.neutral { border-color:rgba(148,163,184,0.18); }
.niche-decision-title {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:7px;
}
.niche-decision-title span {
  color:#fff;
  font-size:16px;
  font-weight:900;
}
.niche-decision-title strong {
  color:#7dd3fc;
  font-size:13px;
  font-weight:900;
}
.niche-decision-card p {
  margin:0;
  color:rgba(226,232,240,0.76);
  font-size:12px;
  line-height:1.45;
}
.niche-reason-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-top:10px;
}
.niche-reason-grid div {
  padding:9px;
  border-radius:8px;
  background:rgba(0,0,0,0.16);
  border:1px solid rgba(255,255,255,0.05);
}
.niche-reason-grid b {
  display:block;
  color:#fff;
  font-size:11px;
  margin-bottom:6px;
}
.niche-reason-grid span {
  display:block;
  color:rgba(226,232,240,0.66);
  font-size:11px;
  line-height:1.35;
}
.niche-reason-grid span + span { margin-top:4px; }
.niche-mini-bars {
  display:grid;
  grid-template-columns: repeat(18, minmax(3px, 1fr));
  align-items:end;
  gap:3px;
  height:34px;
  margin:10px 0;
  padding:7px;
  border-radius:8px;
  background:rgba(0,0,0,0.18);
  border:1px solid rgba(255,255,255,0.05);
}
.niche-mini-bars span {
  min-height:4px;
  border-radius:3px;
  background:linear-gradient(180deg, #38bdf8, #5e6ad2);
}
.niche-opportunity-box {
  margin-top:12px;
  padding:11px 12px;
  border-radius:8px;
  border:1px solid rgba(7,202,107,0.18);
  background:linear-gradient(135deg, rgba(7,202,107,0.08), rgba(56,189,248,0.035));
}
.niche-opportunity-box span,
.niche-section-caption {
  display:block;
  color:#38bdf8;
  font-size:10px;
  font-weight:850;
  text-transform:uppercase;
  margin-bottom:5px;
}
.niche-opportunity-box strong {
  display:block;
  color:rgba(226,232,240,0.9);
  font-size:12px;
  line-height:1.45;
}
.niche-demand-box {
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:8px;
  margin-top:10px;
  padding:10px;
  border-radius:8px;
  border:1px solid rgba(56,189,248,0.16);
  background:rgba(56,189,248,0.055);
}
.niche-demand-box div {
  padding:7px;
  border-radius:7px;
  background:rgba(0,0,0,0.16);
}
.niche-demand-box span {
  display:block;
  color:rgba(148,163,184,0.78);
  font-size:9px;
  font-weight:850;
  margin-bottom:3px;
  text-transform:uppercase;
}
.niche-demand-box strong { color:#fff; font-size:13px; }
.niche-demand-box small {
  grid-column:1 / -1;
  color:rgba(226,232,240,0.72);
  font-size:11px;
  line-height:1.35;
}
.niche-demand-box small.live { color:rgba(110,231,183,0.86); }
.niche-demand-box small.fallback { color:rgba(251,191,36,0.82); }
.niche-section-caption {
  color:rgba(148,163,184,0.72);
  text-transform:none;
  font-weight:750;
}
.niche-related-queries {
  margin:6px 0 2px;
  padding:8px 10px;
  background:rgba(99,102,241,0.06);
  border-radius:8px;
  border:1px solid rgba(99,102,241,0.12);
}
.niche-related-queries .niche-section-caption {
  margin-bottom:6px;
  font-size:11px;
  color:rgba(129,140,248,0.85);
}
.niche-queries-list {
  display:flex;
  flex-wrap:wrap;
  gap:5px;
}
.query-chip {
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:3px 10px;
  background:rgba(99,102,241,0.10);
  border:1px solid rgba(99,102,241,0.18);
  border-radius:12px;
  font-size:11px;
  color:rgba(199,210,254,0.92);
  transition:background .15s, transform .15s;
  cursor:default;
}
.query-chip:hover {
  background:rgba(99,102,241,0.22);
  transform:translateY(-1px);
}
.query-chip small {
  font-size:9px;
  color:rgba(148,163,184,0.6);
  font-weight:600;
}
.niche-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(56,189,248,0.28);
  background: rgba(56,189,248,0.08);
  color: #38bdf8;
  cursor: pointer;
}
.niche-icon-btn svg { width: 18px; height: 18px; }
.niche-metrics, .niche-wb-row, .niche-roi-strip {
  display:grid;
  gap: 8px;
}
.niche-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.niche-wb-row, .niche-roi-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 10px; }
.niche-metrics div, .niche-wb-row div, .niche-roi-strip div {
  padding: 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.055);
}
.niche-metrics span, .niche-wb-row span, .niche-roi-strip span {
  display:block;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  margin-bottom: 5px;
}
.niche-metrics strong, .niche-wb-row strong, .niche-roi-strip strong { color:#fff; font-size: 14px; }
.niche-products { margin-top: 12px; display:flex; flex-direction:column; gap:6px; }
.niche-product-line { display:flex; justify-content:space-between; gap:12px; color:rgba(226,232,240,0.72); font-size:12px; }
.niche-product-line span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.niche-product-line strong { color:#94a3b8; flex-shrink:0; }
.niche-economics { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:14px; }
.niche-economics label { color:var(--text-muted); font-size:11px; font-weight:700; }
.niche-economics input {
  display:block;
  width:100%;
  margin-top:6px;
  padding:10px 11px;
  border-radius:8px;
  border:1px solid rgba(148,163,184,0.2);
  background:rgba(255,255,255,0.04);
  color:#fff;
  font-size:14px;
  font-weight:800;
}
.niche-ai-analyze {
  display:flex;
  width:100%;
  justify-content:center;
  align-items:center;
  gap:8px;
  margin-top:12px;
  padding:11px 14px;
  border-radius:8px;
  border:0;
  background:rgba(168,85,247,0.14);
  color:#d8b4fe;
  font-weight:850;
  cursor:pointer;
}
.niche-ai-analyze svg { width:16px; height:16px; }
.niche-sourcing-row {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:7px;
  margin-top:12px;
}
.niche-sourcing-row a {
  padding:7px 10px;
  border-radius:8px;
  color:#7dd3fc;
  background:rgba(56,189,248,0.08);
  border:1px solid rgba(56,189,248,0.18);
  text-decoration:none;
  font-size:11px;
  font-weight:850;
}
.niche-sourcing-row span {
  color:rgba(148,163,184,0.76);
  font-size:11px;
  font-weight:700;
}
.niche-ai-verdict {
  margin-top:10px;
  padding:12px;
  border-radius:8px;
  background:rgba(255,255,255,0.035);
  border:1px solid rgba(255,255,255,0.06);
  color:rgba(226,232,240,0.72);
  font-size:12px;
  line-height:1.45;
}
.niche-ai-verdict.good { border-color:rgba(7,202,107,0.28); background:rgba(7,202,107,0.08); }
.niche-ai-verdict.watch { border-color:rgba(232,149,88,0.28); background:rgba(232,149,88,0.08); }
.niche-ai-verdict.bad { border-color:rgba(234,33,67,0.28); background:rgba(234,33,67,0.08); }
.niche-verdict-head { color:#fff; font-weight:850; margin-bottom:6px; }
.niche-verdict-actions { display:grid; gap:6px; margin-top:10px; }
.niche-verdict-actions span {
  display:block;
  padding:7px 9px;
  border-radius:7px;
  background:rgba(255,255,255,0.045);
  border:1px solid rgba(255,255,255,0.06);
  color:rgba(226,232,240,0.78);
}
.niche-verdict-points { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.niche-verdict-points span { padding:5px 8px; border-radius:6px; background:rgba(0,0,0,0.2); color:#cbd5e1; font-size:11px; font-weight:750; }
.niche-loader {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.18);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display:inline-block;
  flex-shrink:0;
}
@media (max-width: 900px) {
  .niche-ai-toolbar { align-items:flex-start; flex-direction:column; }
  .niche-ai-actions { justify-content:flex-start; }
  .niche-control-grid, .niche-ai-recommendations, .niche-decision-board, .niche-howto-strip { grid-template-columns: 1fr; }
  .niche-strategy-summary { align-items:flex-start; flex-direction:column; }
  .niche-settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .niche-command-bar { align-items:flex-start; flex-direction:column; }
  .niche-ai-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .niche-ai-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .niche-ai-shell { padding: 12px 12px 104px; }
  .niche-settings-grid { grid-template-columns: 1fr; }
  .niche-ai-kpis, .niche-metrics, .niche-wb-row, .niche-roi-strip, .niche-economics, .niche-reason-grid { grid-template-columns: 1fr; }
  .niche-ai-input { width:100%; }
  .niche-ai-btn { width:100%; justify-content:center; }
}

/* 2026-05-19 Design refresh: Premium Linera & TMA Start Screen */
#zero-state-hero {
  justify-content: flex-start !important;
  min-height: auto !important;
  padding: 60px 24px 120px !important;
  overflow: visible !important;
  background: radial-gradient(circle at 50% 0%, #0c0d19 0%, #000000 70%) !important;
}

#zero-state-main {
  width: min(100%, 1120px) !important;
  margin: 0 auto !important;
  padding: 40px 24px 0 !important;
  border-radius: 32px !important;
}

#zero-state-core {
  width: 100px !important;
  height: 100px !important;
  margin-bottom: 32px !important;
  animation: floatCore 4s ease-in-out infinite !important;
}

#zero-state-core > div:nth-child(3) {
  inset: 16px !important;
  background: linear-gradient(135deg, var(--accent), #7c3aed) !important;
  box-shadow: 0 0 30px rgba(94, 106, 210, 0.4) !important;
}

#zero-state-core > div:nth-child(4),
#zero-state-core > div:nth-child(5) {
  display: block !important;
}

#zero-state-main h1 {
  max-width: 760px !important;
  margin-bottom: 20px !important;
  font-size: clamp(36px, 5vw, 52px) !important;
  line-height: 1.1 !important;
  letter-spacing: -0.03em !important;
  animation: shimmerText 5s linear infinite !important;
}

#zero-state-main > p {
  max-width: 600px !important;
  margin-bottom: 32px !important;
  color: rgba(255, 255, 255, 0.6) !important;
  font-size: 16px !important;
  line-height: 1.6 !important;
}

#ops-snapshot {
  width: min(100%, 760px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 32px;
}

.ops-snapshot-item {
  min-height: 78px;
  padding: 16px 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ops-snapshot-item:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.16);
}

.ops-snapshot-label {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ops-snapshot-item strong {
  display: block;
  color: #ffffff;
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.ops-snapshot-item small {
  display: block;
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

#command-card-wrap {
  max-width: 680px !important;
  margin-bottom: 48px !important;
}

#command-card-wrap > div:first-child {
  opacity: 0.8 !important;
  filter: blur(40px) !important;
}

#command-card-wrap > div:nth-child(2) {
  padding: 40px !important;
  border-radius: 32px !important;
  background: rgba(10, 10, 11, 0.6) !important;
  backdrop-filter: blur(30px) !important;
  -webkit-backdrop-filter: blur(30px) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

#command-card-wrap .btn {
  width: auto !important;
  justify-content: center !important;
  padding: 22px 56px !important;
  border-radius: 100px !important;
  background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 100%) !important;
  box-shadow: 0 16px 40px rgba(94, 106, 210, 0.35), inset 0 2px 2px rgba(255, 255, 255, 0.2) !important;
  animation: pulseAura 2.5s infinite !important;
  letter-spacing: 0.3px !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#command-card-wrap .btn:hover {
  transform: translateY(-2px) scale(1.02) !important;
  box-shadow: 0 20px 48px rgba(94, 106, 210, 0.45), inset 0 2px 2px rgba(255, 255, 255, 0.3) !important;
}

#command-card-wrap div[style*="margin-top:24px"] {
  margin-top: 24px !important;
}

#teaser-cards-wrap {
  max-width: 1050px !important;
  margin-top: 20px !important;
  padding-bottom: 24px !important;
}

#teaser-cards-wrap > div[style*="filter:blur"] {
  display: block !important;
}

#teaser-cards-wrap .spotlight-card {
  min-height: 172px;
  padding: 32px !important;
  border-radius: 24px !important;
  background: rgba(255, 255, 255, 0.02) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2) !important;
}

#teaser-cards-wrap .spotlight-card:hover {
  transform: translateY(-6px) scale(1.02) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

#teaser-cards-wrap .spotlight-card h3 {
  margin-bottom: 8px !important;
  font-size: 18px !important;
  letter-spacing: -0.01em !important;
}

#teaser-cards-wrap .spotlight-card p {
  font-size: 13px !important;
  line-height: 1.5 !important;
}

#teaser-cards-wrap .spotlight-card .spotlight-content > div:first-child {
  width: 44px !important;
  height: 44px !important;
  margin-bottom: 18px !important;
  border-radius: 12px !important;
}

#left-side-panel,
#right-side-panel {
  display: none !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 280px !important;
  border-radius: 24px !important;
  padding: 24px !important;
  background: rgba(10, 10, 11, 0.6) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5) !important;
  z-index: 10 !important;
}

@media (min-width: 1300px) {
  #left-side-panel,
  #right-side-panel {
    display: flex !important;
  }
}

@media (max-width: 760px) {
  #zero-state-hero {
    padding: 18px 14px 112px !important;
  }

  #zero-state-main {
    padding: 26px 0 0 !important;
    border-radius: 0 !important;
  }

  #ops-snapshot {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  #command-card-wrap > div:nth-child(2) {
    padding: 24px 16px !important;
    border-radius: 20px !important;
  }

  #command-card-wrap .btn {
    font-size: 15px !important;
    padding: 18px 24px !important;
  }
}

.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}
.status-indicator.completed {
  background: var(--sys-green);
  box-shadow: 0 0 10px var(--sys-green);
}
.status-indicator.pending {
  background: #64748b;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.status-indicator.error {
  background: var(--sys-red);
  box-shadow: 0 0 10px var(--sys-red);
}

/* Responsive RNP Table Cards (Mobile) */
@media (max-width: 768px) {
  .rnp-table-wrap { max-height: none; overflow: visible; }
  .rnp-table, .rnp-table tbody { display: block; width: 100%; min-width: 0; }
  .rnp-table thead { display: none; }
  .rnp-table tr {
    display: flex; flex-wrap: wrap; gap: 8px;
    background: rgba(15,23,42,0.72);
    border: 1px solid rgba(148,163,184,0.16);
    border-radius: 16px; margin-bottom: 12px; padding: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  }
  .rnp-table td {
    display: flex; flex-direction: column; padding: 4px; border: none;
    font-size: 13px; flex: 1 1 45%; min-width: 0; align-items: flex-start;
  }
  .rnp-table td::before {
    content: attr(data-label); color: var(--text-muted);
    font-size: 11px; font-weight: 800; margin-bottom: 4px;
  }
  .rnp-table td:nth-child(1), .rnp-table td:nth-child(2) {
    flex: 1 1 100%; border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 8px; margin-bottom: 4px;
  }
  .rnp-table td strong { font-size: 15px; }
  .rnp-empty-row { display: block; text-align: center; padding: 28px !important; }
}
.unit-saas-shell {
  --unit-bg: #070a13;
  --unit-panel: #0f1726;
  --unit-panel-2: #151e2e;
  --unit-border: rgba(148, 163, 184, 0.14);
  --unit-border-strong: rgba(56, 189, 248, 0.28);
  --unit-text: #f8fafc;
  --unit-muted: #94a3b8;
  --unit-soft: #cbd5e1;
  --unit-blue: #2384ff;
  --unit-cyan: #10c8f5;
  --unit-good: #22c55e;
  --unit-warn: #f59e0b;
  --unit-bad: #f43f5e;
  --unit-purple: #8b5cf6;
  min-height: calc(100vh - 82px);
  padding: 18px 22px 110px;
  background:
    linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.025) 1px, transparent 1px),
    linear-gradient(180deg, #0b1020 0%, #070a13 48%, #050813 100%);
  background-size: 42px 42px, 42px 42px, auto;
  color: var(--unit-text);
  overflow-y: auto;
}

.unit-saas-header,
.unit-stepper,
.unit-kpi-card,
.unit-main-panel,
.unit-detail-preview {
  border: 1px solid var(--unit-border);
  background: linear-gradient(180deg, rgba(16, 24, 39, 0.96), rgba(11, 17, 29, 0.96));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.unit-saas-header {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) auto;
  gap: 22px;
  align-items: stretch;
  padding: 22px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.unit-title-block {
  min-width: 320px;
}

.unit-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--unit-cyan);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.unit-eyebrow svg {
  width: 16px;
  height: 16px;
}

.unit-title-block h1 {
  margin: 8px 0 6px;
  font-size: 31px;
  line-height: 1.05;
  letter-spacing: 0;
}

.unit-title-block p {
  margin: 0;
  color: var(--unit-muted);
  font-size: 13px;
  line-height: 1.45;
}

.unit-access-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 16px;
  max-width: 760px;
}

.unit-access-strip div {
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  padding: 9px 11px;
}

.unit-access-strip span,
.unit-access-strip strong {
  display: block;
}

.unit-access-strip span {
  color: var(--unit-muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.unit-access-strip strong {
  margin-top: 4px;
  color: var(--unit-soft);
  font-size: 12px;
  line-height: 1.25;
}

.unit-access-strip.connected div {
  border-color: rgba(34, 197, 94, 0.22);
  background: rgba(34, 197, 94, 0.055);
}

.unit-access-strip.connected strong {
  color: #bbf7d0;
}

.unit-access-strip.demo div {
  border-color: rgba(245, 158, 11, 0.22);
  background: rgba(245, 158, 11, 0.055);
}

.unit-action-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 9px;
  align-items: center;
  justify-content: stretch;
  min-width: 430px;
  align-self: center;
}

.unit-btn {
  height: 48px;
  border-radius: 10px;
  border: 1px solid var(--unit-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--unit-text);
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.unit-btn svg {
  width: 16px;
  height: 16px;
}

.unit-btn:hover {
  transform: translateY(-1px);
  border-color: var(--unit-border-strong);
  background: rgba(255, 255, 255, 0.09);
}

.unit-btn.primary {
  border-color: rgba(16, 200, 245, 0.42);
  background: linear-gradient(135deg, var(--unit-blue), var(--unit-cyan));
  color: #fff;
  box-shadow: 0 14px 30px rgba(16, 200, 245, 0.18);
}

.unit-btn.ghost {
  background: transparent;
}

.unit-new-product-calculator {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(520px, 1.45fr) minmax(280px, 0.8fr);
  gap: 14px;
  align-items: stretch;
  border: 1px solid rgba(16, 200, 245, 0.18);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(8, 13, 25, 0.96));
  padding: 14px;
  margin-bottom: 12px;
}

.unit-new-product-copy,
.unit-new-product-results {
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  padding: 14px;
}

.unit-new-product-copy span {
  display: block;
  color: var(--unit-cyan);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.unit-new-product-copy strong {
  display: block;
  margin-top: 5px;
  color: var(--unit-text);
  font-size: 19px;
}

.unit-new-product-copy p {
  margin: 8px 0 0;
  color: var(--unit-muted);
  font-size: 12px;
  line-height: 1.45;
}

.unit-new-product-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.unit-new-product-field {
  display: grid;
  gap: 6px;
  color: var(--unit-muted);
  font-size: 11px;
  font-weight: 900;
}

.unit-new-product-field em {
  color: var(--unit-cyan);
  font-style: normal;
}

.unit-new-product-field input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--unit-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--unit-text);
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  outline: none;
}

.unit-new-product-field input:focus {
  border-color: var(--unit-cyan);
  box-shadow: 0 0 0 3px rgba(16, 200, 245, 0.12);
}

.unit-new-product-results {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.unit-new-product-results div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.82);
  padding: 8px 10px;
}

.unit-new-product-results span {
  color: var(--unit-muted);
  font-size: 11px;
  font-weight: 900;
}

.unit-new-product-results strong {
  color: var(--unit-text);
  font-size: 16px;
}

.unit-new-product-results .danger strong {
  color: var(--unit-red);
}

.unit-new-product-results .success strong {
  color: var(--unit-green);
}

.unit-rnp-start {
  display: grid;
  grid-template-columns: minmax(360px, 1.2fr) minmax(300px, 0.8fr);
  gap: 14px;
  align-items: stretch;
}

.unit-rnp-start-hero,
.unit-rnp-start-kpis,
.unit-rnp-start-flow {
  border: 1px solid var(--unit-border);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.82);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.18);
}

.unit-rnp-start-hero {
  padding: 22px;
}

.unit-rnp-start-hero span {
  color: var(--unit-cyan);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.unit-rnp-start-hero h2 {
  margin: 8px 0 8px;
  color: var(--unit-text);
  font-size: 25px;
  line-height: 1.16;
}

.unit-rnp-start-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--unit-muted);
  font-size: 13px;
  line-height: 1.55;
}

.unit-rnp-start-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.unit-rnp-start-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 10px;
  padding: 14px;
}

.unit-rnp-start-kpis article {
  min-height: 92px;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  padding: 12px;
}

.unit-rnp-start-kpis span,
.unit-rnp-start-kpis strong,
.unit-rnp-start-kpis small {
  display: block;
}

.unit-rnp-start-kpis span {
  color: var(--unit-muted);
  font-size: 11px;
  font-weight: 900;
}

.unit-rnp-start-kpis strong {
  margin-top: 6px;
  color: var(--unit-text);
  font-size: 22px;
}

.unit-rnp-start-kpis small {
  margin-top: 4px;
  color: var(--unit-muted);
  font-size: 11px;
}

.unit-rnp-start-kpis article.bad {
  border-color: rgba(255, 79, 114, 0.32);
}

.unit-rnp-start-kpis article.bad strong {
  color: var(--unit-red);
}

.unit-rnp-start-kpis article.warn {
  border-color: rgba(245, 158, 11, 0.32);
}

.unit-rnp-start-kpis article.warn strong {
  color: #fbbf24;
}

.unit-rnp-start-flow {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.unit-rnp-start-flow div {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  row-gap: 3px;
  align-items: start;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  padding: 12px;
}

.unit-rnp-start-flow b {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(16, 200, 245, 0.14);
  color: var(--unit-cyan);
}

.unit-rnp-start-flow strong {
  color: var(--unit-text);
  font-size: 13px;
}

.unit-rnp-start-flow span {
  color: var(--unit-muted);
  font-size: 12px;
  line-height: 1.35;
}

.unit-period-panel {
  display: grid;
  grid-template-columns: minmax(520px, 1.08fr) minmax(520px, 0.92fr);
  gap: 12px;
  align-items: stretch;
  margin-top: 12px;
}

.unit-period-controls,
.unit-diagnostics {
  border: 1px solid var(--unit-border);
  border-radius: 12px;
  background: rgba(10, 15, 27, 0.86);
  padding: 12px;
}

.unit-period-controls {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.unit-period-title {
  min-width: 210px;
  margin-right: auto;
}

.unit-period-title span,
.unit-period-controls label span,
.unit-diagnostic-card span {
  display: block;
  color: var(--unit-muted);
  font-size: 11px;
  font-weight: 900;
}

.unit-period-title strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.unit-period-controls label {
  display: block;
  min-width: 150px;
}

.unit-period-controls input {
  width: 100%;
  height: 40px;
  margin-top: 5px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--unit-text);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
  outline: none;
}

.unit-period-controls input:focus {
  border-color: var(--unit-border-strong);
  box-shadow: 0 0 0 3px rgba(16, 200, 245, 0.08);
}

.unit-chip-btn {
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: var(--unit-soft);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.unit-chip-btn:hover {
  border-color: var(--unit-border-strong);
  color: #fff;
}

.unit-diagnostics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.unit-diagnostic-card {
  min-height: 66px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.72);
  padding: 10px;
}

.unit-diagnostic-card strong {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.25;
}

.unit-diagnostic-card small {
  display: block;
  margin-top: 5px;
  color: var(--unit-muted);
  font-size: 10px;
  line-height: 1.25;
  font-weight: 800;
}

.unit-diagnostic-card.ok {
  border-color: rgba(34, 197, 94, 0.22);
}

.unit-diagnostic-card.ok strong {
  color: #86efac;
}

.unit-diagnostic-card.warn {
  border-color: rgba(245, 158, 11, 0.26);
}

.unit-diagnostic-card.warn strong,
.unit-diagnostic-warning {
  color: #fbbf24;
}

.unit-diagnostic-card.muted strong {
  color: var(--unit-soft);
}

.unit-diagnostic-warning {
  grid-column: 1 / -1;
  border-radius: 10px;
  border: 1px solid rgba(245, 158, 11, 0.22);
  background: rgba(245, 158, 11, 0.08);
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 850;
}

.unit-stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
}

.unit-step {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 66px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.64);
}

.unit-step span {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: rgba(148, 163, 184, 0.12);
  color: var(--unit-soft);
  font-weight: 900;
}

.unit-step strong,
.unit-step small {
  display: block;
}

.unit-step strong {
  font-size: 13px;
}

.unit-step small {
  color: var(--unit-muted);
  font-size: 11px;
  margin-top: 3px;
}

.unit-step.done span {
  background: rgba(34, 197, 94, 0.16);
  color: var(--unit-good);
}

.unit-step.active {
  border-color: var(--unit-border-strong);
  background: rgba(14, 165, 233, 0.08);
}

.unit-step.active span {
  background: rgba(16, 200, 245, 0.16);
  color: var(--unit-cyan);
}

.unit-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.unit-kpi-card {
  min-height: 108px;
  border-radius: 12px;
  padding: 16px;
  overflow: hidden;
  position: relative;
}

.unit-kpi-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-left: 3px solid rgba(148, 163, 184, 0.18);
  pointer-events: none;
}

.unit-kpi-card.profit::before {
  border-left-color: var(--unit-good);
}

.unit-kpi-card.ads::before {
  border-left-color: var(--unit-purple);
}

.unit-kpi-card.danger::before {
  border-left-color: var(--unit-bad);
}

.unit-kpi-card span,
.unit-kpi-card small {
  display: block;
  color: var(--unit-muted);
  font-size: 12px;
  font-weight: 800;
}

.unit-kpi-card strong {
  display: block;
  margin-top: 10px;
  font-size: 25px;
  line-height: 1.05;
}

.unit-kpi-card small {
  margin-top: 8px;
}

.unit-tabs {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  padding: 8px;
  border: 1px solid var(--unit-border);
  border-radius: 12px;
  background: rgba(7, 10, 19, 0.78);
  overflow-x: auto;
}

.unit-tabs button {
  height: 38px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--unit-soft);
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 900;
}

.unit-tabs button svg {
  width: 15px;
  height: 15px;
}

.unit-tabs button.active {
  color: #fff;
  border-color: rgba(16, 200, 245, 0.34);
  background: rgba(16, 200, 245, 0.13);
}

.unit-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 12px;
  align-items: start;
  margin-top: 12px;
}

.unit-main-panel,
.unit-detail-preview {
  border-radius: 12px;
  overflow: hidden;
}

.unit-panel-head {
  min-height: 68px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.unit-panel-head span,
.unit-panel-head strong,
.unit-panel-head small {
  display: block;
}

.unit-panel-head span {
  color: var(--unit-muted);
  font-size: 11px;
  font-weight: 900;
}

.unit-panel-head strong {
  margin-top: 4px;
  font-size: 17px;
}

.unit-save-inline-status {
  margin-top: 7px;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 11px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
  color: var(--unit-muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
}

.unit-action-bar .unit-save-inline-status {
  width: 100%;
  justify-content: center;
  margin-top: 2px;
  grid-column: 1 / -1;
}

.unit-save-inline-status.dirty,
.unit-save-inline-status.saving {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.34);
  background: rgba(120, 53, 15, 0.22);
}

.unit-save-inline-status.saved {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.34);
  background: rgba(6, 78, 59, 0.24);
}

.unit-save-inline-status.warn {
  color: #fb7185;
  border-color: rgba(251, 113, 133, 0.36);
  background: rgba(127, 29, 29, 0.22);
}

.pulse-button {
  animation: unitPulseButton 1.4s ease-in-out infinite;
  border-color: rgba(34, 211, 238, 0.7) !important;
  box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.35);
}

@keyframes unitPulseButton {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.35);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(34, 211, 238, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 211, 238, 0);
  }
}

.unit-rnp-matrix-cell {
  padding: 0 !important;
}

.unit-rnp-matrix {
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(8, 13, 24, 0.82);
}

.unit-rnp-matrix-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.unit-rnp-matrix-toolbar strong {
  display: block;
  color: #fff;
  font-size: 14px;
}

.unit-rnp-matrix-toolbar small {
  display: block;
  margin-top: 4px;
  color: var(--unit-muted);
  font-size: 12px;
}

.unit-rnp-metric-switch {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.unit-rnp-metric-switch button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(226, 232, 240, 0.72);
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.unit-rnp-metric-switch button.active {
  color: #fff;
  border-color: rgba(16, 200, 245, 0.36);
  background: rgba(16, 200, 245, 0.14);
}

.unit-rnp-scroll {
  overflow: auto;
  max-height: 460px;
}

.unit-rnp-daily-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: separate;
  border-spacing: 0;
}

.unit-rnp-daily-table th,
.unit-rnp-daily-table td {
  min-width: 118px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  border-right: 1px solid rgba(148, 163, 184, 0.06);
  text-align: right;
  white-space: nowrap;
}

.unit-rnp-daily-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #111827;
  color: var(--unit-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.unit-rnp-daily-table .sticky-col {
  position: sticky;
  left: 0;
  z-index: 4;
  min-width: 280px;
  text-align: left;
  background: #101827;
}

.unit-rnp-daily-table tbody tr.selected .sticky-col,
.unit-rnp-daily-table tbody tr.selected td {
  background: rgba(16, 200, 245, 0.08);
}

.unit-rnp-daily-table td.good {
  color: var(--unit-good);
}

.unit-rnp-daily-table td.bad {
  color: var(--unit-bad);
}

.unit-rnp-daily-table td.watch {
  color: #fbbf24;
}

.unit-rnp-daily-table td.muted {
  color: rgba(148, 163, 184, 0.45);
}

.unit-rnp-sheet {
  color: #172033;
  background: #f8fafc;
  border: 1px solid #d7dee8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.unit-rnp-sheet-toolbar {
  position: sticky;
  top: 0;
  z-index: 16;
  min-height: 54px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #dbe2ec;
  background: #ffffff;
  color: #172033;
}

.unit-rnp-sheet-toolbar strong,
.unit-rnp-sheet-toolbar span {
  display: block;
}

.unit-rnp-sheet-toolbar strong {
  font-size: 14px;
  font-weight: 950;
}

.unit-rnp-sheet-toolbar span {
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.unit-rnp-expand-btn {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 8px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #075985;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
  cursor: pointer;
}

.unit-rnp-expand-btn:hover {
  background: #dbeafe;
}

.unit-rnp-fullscreen {
  position: fixed;
  inset: 10px;
  z-index: var(--z-tooltip);
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.unit-rnp-fullscreen .unit-rnp-sheet-scroll {
  flex: 1 1 auto;
  max-height: none;
}

.unit-rnp-fullscreen .unit-rnp-bi-table {
  min-width: 2200px;
}

.unit-rnp-sheet-note,
.unit-rnp-sheet-period {
  padding: 10px 14px;
  border-bottom: 1px solid #e5eaf1;
  background: #fbfdff;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.unit-rnp-sheet-period strong {
  color: #334155;
}

.unit-rnp-sheet-scroll {
  overflow: auto;
  max-height: 680px;
  background: #fff;
}

.rnp-matrix-container {
  max-height: 85vh;
  overflow: auto;
  background: #fff;
  position: relative;
  contain: layout paint;
}

.unit-rnp-bi-table {
  min-width: 1720px;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.rnp-table {
  border-collapse: separate;
  border-spacing: 0;
}

.unit-rnp-bi-table th,
.unit-rnp-bi-table td {
  border-right: 1px solid #dbe2ec;
  border-bottom: 1px solid #e6ebf2;
  padding: 7px 10px;
  height: 34px;
  background: #fff;
  color: #172033;
  text-align: right;
  white-space: nowrap;
}

.unit-rnp-bi-table th {
  position: sticky;
  top: 0;
  z-index: 8;
  background: #f3f6fa;
  color: #334155;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.rnp-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f8f9fa;
  box-shadow: 0 1px 0 #e2e8f0;
}

.rnp-table tbody td:nth-child(1),
.rnp-table thead th:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 5;
  background: #fff;
  box-shadow: 1px 0 0 #e2e8f0;
}

.rnp-table tbody td:nth-child(2),
.rnp-table thead th:nth-child(2) {
  position: sticky;
  left: 120px;
  z-index: 5;
  background: #fff;
  box-shadow: 1px 0 0 #e2e8f0;
}

.rnp-table thead th:nth-child(1),
.rnp-table thead th:nth-child(2) {
  z-index: 15;
  background: #f8f9fa;
}

.unit-rnp-bi-table .art-col {
  position: sticky;
  left: 0;
  z-index: 7;
  width: 120px;
  min-width: 120px;
  text-align: center;
  background: #fff;
}

.unit-rnp-bi-table th.art-col {
  z-index: 10;
  background: #f3f6fa;
}

.unit-rnp-bi-table .metric-col {
  position: sticky;
  left: 120px;
  z-index: 7;
  width: 240px;
  min-width: 240px;
  text-align: left;
  background: #fff;
}

.unit-rnp-bi-table th.metric-col {
  z-index: 10;
  background: #f3f6fa;
}

.unit-rnp-bi-table .trend-col {
  position: sticky;
  left: 360px;
  z-index: 7;
  width: 105px;
  min-width: 105px;
  text-align: center;
  background: #fff;
}

.unit-rnp-bi-table th.trend-col {
  z-index: 10;
  background: #f3f6fa;
}

.unit-rnp-bi-table .total-col {
  position: sticky;
  left: 465px;
  z-index: 7;
  width: 90px;
  min-width: 90px;
  text-align: right;
  background: #fff;
  font-weight: 900;
}

.unit-rnp-bi-table th.total-col {
  z-index: 10;
  color: #0645ad;
  background: #f3f6fa;
}

.unit-rnp-bi-table .date-col {
  min-width: 78px;
  color: #64748b;
}

.unit-rnp-total-row td {
  background: #eaf2ff;
  border-bottom: 2px solid #2563eb;
  color: #0f172a;
  font-weight: 950;
}

.unit-rnp-group-row td {
  position: sticky;
  left: 0;
  z-index: 6;
  text-align: left;
  background: #f0f5ff;
  color: #0f172a;
  font-weight: 950;
  border-top: 1px solid #cbd5e1;
}

.unit-rnp-hypothesis-row td {
  background: #fffde8;
  color: #94a3b8;
  height: 72px;
}

.unit-rnp-hypothesis-row .hypothesis-cell {
  color: #0645ad;
  font-weight: 950;
  text-align: left;
}

.unit-rnp-hypothesis-row .hypothesis-day {
  text-align: center;
  color: #c7d2fe;
}

.unit-rnp-product-card {
  display: grid;
  justify-items: center;
  gap: 4px;
  color: #334155;
  font-size: 11px;
  white-space: normal;
}

.unit-rnp-thumb {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: linear-gradient(135deg, #dbeafe, #ecfeff);
  color: #0369a1;
  font-size: 24px;
  font-weight: 950;
  border: 1px solid #bfdbfe;
  overflow: hidden;
  position: relative;
}

.unit-rnp-thumb img,
.unit-product-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.unit-rnp-thumb.has-image span,
.unit-product-avatar.has-image span {
  display: none;
}

.unit-rnp-thumb.image-missing span,
.unit-product-avatar.image-missing span {
  display: grid;
}

.unit-rnp-product-card strong {
  max-width: 104px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #0645ad;
  font-size: 11px;
}

.unit-rnp-product-card small {
  color: #64748b;
  font-size: 10px;
}

.unit-rnp-product-card span {
  padding: 2px 7px;
  border-radius: 999px;
  background: #dcfce7;
  color: #047857;
  font-size: 10px;
  font-weight: 900;
}

.unit-rnp-metric-row.strong td {
  font-weight: 950;
}

.unit-rnp-bi-table .profit-total {
  background: #bbf7d0;
  color: #065f46;
}

.unit-rnp-spark {
  height: 30px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  justify-content: center;
}

.unit-rnp-spark i {
  width: 3px;
  min-height: 3px;
  border-radius: 2px 2px 0 0;
  background: #60a5fa;
}

.unit-rnp-heat.good.l1 { background: #ecfdf5; }
.unit-rnp-heat.good.l2 { background: #bbf7d0; }
.unit-rnp-heat.good.l3 { background: #86efac; color: #064e3b; font-weight: 900; }
.unit-rnp-heat.bad.l1 { background: #fff1f2; }
.unit-rnp-heat.bad.l2 { background: #ffe4e6; }
.unit-rnp-heat.bad.l3 { background: #fecdd3; color: #881337; font-weight: 900; }
.unit-rnp-heat.neutral.l1 { background: #fff; }
.unit-rnp-heat.neutral.l2 { background: #f8fafc; }
.unit-rnp-heat.neutral.l3 { background: #eff6ff; }

@media (max-width: 920px) {
  .unit-rnp-bi-table {
    min-width: 1380px;
  }
}

.unit-panel-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.unit-panel-tools input,
.unit-panel-tools select {
  height: 40px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 0 12px;
  outline: none;
  font-size: 12px;
  font-weight: 800;
}

.unit-panel-tools input {
  width: 250px;
}

.unit-analytics-view {
  background: #f8fafc;
  color: #172033;
  min-height: 620px;
}

.unit-analytics-head {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.unit-analytics-head strong,
.unit-analytics-head span {
  display: block;
}

.unit-analytics-head strong {
  font-size: 24px;
  font-weight: 950;
  color: #0f172a;
}

.unit-analytics-head span {
  margin-top: 4px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.unit-analytics-actions button,
.unit-analytics-presets button {
  min-height: 36px;
  border-radius: 7px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f3ea8;
  padding: 0 13px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.unit-analytics-kpis {
  padding: 14px 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
  background: #f8fafc;
}

.unit-analytics-kpis article {
  min-height: 82px;
  padding: 13px 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
}

.unit-analytics-kpis span,
.unit-analytics-kpis strong,
.unit-analytics-kpis small {
  display: block;
}

.unit-analytics-kpis span {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
}

.unit-analytics-kpis strong {
  margin-top: 4px;
  color: #0f172a;
  font-size: 20px;
  font-weight: 950;
}

.unit-analytics-kpis small {
  margin-top: 5px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
}

.unit-analytics-kpis article.bad {
  border-color: #fecdd3;
}

.unit-analytics-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  min-height: 520px;
  border-top: 1px solid #e2e8f0;
}

.unit-analytics-table-wrap {
  overflow: auto;
  max-height: 690px;
  background: #ffffff;
}

.unit-analytics-table {
  min-width: 2500px;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.unit-analytics-table th,
.unit-analytics-table td {
  padding: 10px 12px;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #eef2f7;
  background: #fff;
  color: #334155;
  text-align: right;
  white-space: nowrap;
}

.unit-analytics-table th {
  position: sticky;
  top: 0;
  z-index: 8;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.unit-analytics-table .sticky-col {
  position: sticky;
  left: 0;
  z-index: 7;
  text-align: left;
  background: #fff;
}

.unit-analytics-table th.sticky-col {
  z-index: 10;
  background: #f8fafc;
}

.unit-analytics-table td.sticky-col + td.sticky-col,
.unit-analytics-table th.sticky-col + th.sticky-col {
  left: 58px;
}

.unit-analytics-table td strong,
.unit-analytics-table td small {
  display: block;
}

.unit-analytics-table td small {
  margin-top: 2px;
  color: #94a3b8;
  font-size: 10px;
}

.unit-analytics-total td {
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 950;
}

.unit-analytics-photo {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  overflow: hidden;
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 950;
}

.unit-analytics-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.unit-analytics-photo.has-image span {
  display: none;
}

.unit-analytics-columns {
  border-left: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 14px;
  max-height: 690px;
  overflow: auto;
}

.unit-analytics-columns > strong {
  display: block;
  color: #334155;
  font-size: 13px;
  margin-bottom: 10px;
}

.unit-analytics-col-list {
  display: grid;
  gap: 2px;
}

.unit-analytics-col-list label {
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 6px;
  color: #334155;
  font-size: 13px;
  cursor: pointer;
}

.unit-analytics-col-list label:hover {
  background: #f1f5f9;
}

.unit-analytics-presets {
  position: sticky;
  bottom: -14px;
  margin: 12px -14px -14px;
  padding: 10px 14px;
  display: flex;
  gap: 10px;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}

.unit-analytics-fullscreen {
  position: fixed;
  inset: 10px;
  z-index: var(--z-tooltip);
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.unit-analytics-fullscreen .unit-analytics-body {
  flex: 1 1 auto;
  min-height: 0;
}

.unit-analytics-fullscreen .unit-analytics-table-wrap,
.unit-analytics-fullscreen .unit-analytics-columns {
  max-height: none;
}

.unit-table-wrap {
  max-height: 560px;
  overflow: auto;
}

.unit-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 980px;
}

.unit-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #0f1828;
  color: var(--unit-muted);
  font-size: 11px;
  font-weight: 900;
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.unit-table th i {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.14);
  color: var(--unit-soft);
  font-style: normal;
  font-size: 10px;
  cursor: help;
}

.unit-help {
  vertical-align: middle;
}

.unit-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.09);
}

.unit-data-row {
  transition: background 0.16s ease;
}

.unit-data-row:hover {
  background: rgba(16, 200, 245, 0.05);
}

.unit-data-row.selected {
  background: rgba(16, 200, 245, 0.08);
  box-shadow: inset 3px 0 0 var(--unit-cyan);
}

.unit-data-row td {
  color: var(--unit-soft);
  font-size: 13px;
  font-weight: 800;
  vertical-align: middle;
}

.unit-data-row td > strong,
.unit-data-row td strong {
  color: var(--unit-text);
  display: block;
}

.unit-data-row td small {
  display: block;
  margin-top: 4px;
  color: var(--unit-muted);
  font-size: 11px;
}

.unit-data-row td.good strong,
.unit-data-row td.good {
  color: var(--unit-good);
}

.unit-data-row td.bad strong,
.unit-data-row td.bad {
  color: var(--unit-bad);
}

.unit-product-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 230px;
}

.unit-product-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: linear-gradient(135deg, rgba(16, 200, 245, 0.16), rgba(139, 92, 246, 0.14));
  color: #fff;
  font-weight: 900;
  border: 1px solid rgba(148, 163, 184, 0.14);
  overflow: hidden;
  position: relative;
}

.unit-cost-input {
  width: 112px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 0 12px;
  outline: none;
  font-size: 13px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  position: relative;
  z-index: 2;
}

.unit-cost-input.compact {
  width: 82px;
}

.unit-cost-input:focus {
  border-color: rgba(16, 200, 245, 0.62);
  box-shadow: 0 0 0 3px rgba(16, 200, 245, 0.12);
}

.unit-cost-import-panel {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 180px auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.10), rgba(15, 23, 42, 0.88));
}

.unit-cost-import-panel strong,
.unit-cost-import-panel span,
.unit-tax-preset span {
  display: block;
}

.unit-cost-import-panel strong {
  color: var(--unit-text);
  font-size: 14px;
}

.unit-cost-import-panel span,
.unit-tax-preset span {
  color: var(--unit-muted);
  font-size: 12px;
  line-height: 1.35;
}

.unit-tax-preset input {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.86);
  color: var(--unit-text);
  font-weight: 900;
}

.unit-tax-preset input:focus {
  outline: none;
  border-color: rgba(16, 200, 245, 0.62);
  box-shadow: 0 0 0 3px rgba(16, 200, 245, 0.12);
}

@media (max-width: 900px) {
  .unit-cost-import-panel {
    grid-template-columns: 1fr;
  }
}

.unit-mode-badge,
.unit-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.unit-mode-badge.exact {
  color: var(--unit-good);
  background: rgba(34, 197, 94, 0.11);
  border: 1px solid rgba(34, 197, 94, 0.22);
}

.unit-mode-badge.prelim {
  color: var(--unit-warn);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.24);
}

.unit-status-badge {
  margin-bottom: 0;
}

.unit-status-badge.good {
  color: var(--unit-good);
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.24);
}

.unit-status-badge.warning {
  color: var(--unit-warn);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.24);
}

.unit-status-badge.orange {
  color: #fb923c;
  background: rgba(251, 146, 60, 0.12);
  border: 1px solid rgba(251, 146, 60, 0.24);
}

.unit-status-badge.bad {
  color: var(--unit-bad);
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.24);
}

.unit-status-badge.muted,
.unit-muted-text {
  color: var(--unit-muted);
}

.unit-status-badge.muted {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.unit-decision-cell {
  max-width: 220px;
  display: grid;
  gap: 7px;
  align-content: start;
}

.unit-decision-cell strong {
  color: var(--unit-text);
  font-size: 12px;
  line-height: 1.25;
}

.unit-reason {
  display: block;
  max-width: 280px;
  color: var(--unit-soft);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.unit-empty-row {
  text-align: center;
  color: var(--unit-muted);
  height: 120px;
}

.unit-toast {
  position: fixed;
  right: 28px;
  bottom: 104px;
  z-index: 1200;
  min-width: 260px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(34, 197, 94, 0.24);
  background: rgba(15, 23, 42, 0.96);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.unit-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.unit-detail-preview {
  min-height: 380px;
  position: sticky;
  top: 12px;
}

.unit-detail-card {
  padding: 16px;
}

.unit-detail-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--unit-muted);
  font-size: 12px;
  font-weight: 800;
}

.unit-detail-kpis,
.unit-whatif-result {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.unit-detail-kpis div,
.unit-whatif-result div {
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px;
}

.unit-detail-kpis span,
.unit-whatif-result span {
  display: block;
  color: var(--unit-muted);
  font-size: 10px;
  font-weight: 900;
}

.unit-detail-kpis strong,
.unit-whatif-result strong {
  display: block;
  margin-top: 5px;
  color: var(--unit-text);
  font-size: 14px;
}

.unit-detail-kpis strong.good,
.unit-whatif-result strong.good {
  color: var(--unit-good);
}

.unit-detail-kpis strong.bad,
.unit-whatif-result strong.bad {
  color: var(--unit-bad);
}

.unit-section-head {
  margin: 18px 0 10px;
}

.unit-section-head span,
.unit-section-head strong {
  display: block;
}

.unit-section-head span {
  color: var(--unit-cyan);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.unit-section-head strong {
  margin-top: 4px;
  font-size: 14px;
}

.unit-waterfall,
.unit-whatif {
  margin-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.unit-waterfall-bars {
  display: grid;
  gap: 8px;
}

.unit-waterfall-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 82px;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  color: var(--unit-muted);
  font-weight: 900;
}

.unit-waterfall-row > div {
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.1);
  overflow: hidden;
}

.unit-waterfall-row b {
  display: block;
  height: 100%;
  border-radius: inherit;
  min-width: 8px;
}

.unit-waterfall-row.plus b {
  background: linear-gradient(90deg, var(--unit-blue), var(--unit-cyan));
}

.unit-waterfall-row.minus b {
  background: linear-gradient(90deg, #f97316, var(--unit-bad));
}

.unit-waterfall-row.profit b {
  background: linear-gradient(90deg, #16a34a, var(--unit-good));
}

.unit-waterfall-row strong {
  color: var(--unit-text);
  text-align: right;
  font-size: 11px;
}

.unit-waterfall-row.minus strong {
  color: var(--unit-bad);
}

.unit-waterfall-row.profit strong {
  color: var(--unit-good);
}

.unit-whatif label {
  display: block;
  margin-top: 12px;
  color: var(--unit-soft);
  font-size: 12px;
  font-weight: 900;
}

.unit-whatif label span {
  display: block;
  margin-bottom: 8px;
}

.unit-whatif input[type="range"] {
  width: 100%;
  accent-color: var(--unit-cyan);
}

.unit-whatif-result {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.unit-whatif-result div:last-child {
  grid-column: 1 / -1;
}

.unit-empty-detail {
  min-height: 300px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  padding: 28px;
  color: var(--unit-muted);
}

.unit-empty-detail svg {
  width: 34px;
  height: 34px;
  color: var(--unit-cyan);
  margin-bottom: 12px;
}

.unit-empty-detail strong {
  color: var(--unit-text);
  font-size: 16px;
}

.unit-empty-detail p {
  margin: 8px 0 0;
  max-width: 260px;
  font-size: 12px;
  line-height: 1.55;
}

.unit-skeleton,
.unit-skeleton-line {
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.08), rgba(148, 163, 184, 0.2), rgba(148, 163, 184, 0.08));
  background-size: 220% 100%;
  animation: unitSkeleton 1.4s ease-in-out infinite;
}

.unit-skeleton {
  height: 18px;
  width: 88px;
}

.unit-skeleton.product {
  width: 180px;
  height: 34px;
}

.unit-skeleton.input {
  width: 92px;
  height: 38px;
  border-radius: 10px;
}

.unit-skeleton.badge {
  width: 112px;
  height: 30px;
  border-radius: 999px;
}

.unit-skeleton-line {
  height: 7px;
  margin-top: 14px;
  width: 86%;
}

.unit-skeleton-line.short {
  width: 58%;
}

@keyframes unitSkeleton {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

@media (max-width: 1180px) {
  .unit-saas-header {
    grid-template-columns: 1fr;
  }

  .unit-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .unit-action-bar {
    min-width: 0;
    width: 100%;
  }

  .unit-period-panel {
    grid-template-columns: 1fr;
  }

  .unit-action-bar,
  .unit-panel-tools {
    justify-content: flex-start;
  }

  .unit-workspace {
    grid-template-columns: 1fr;
  }

  .unit-detail-preview {
    min-height: 260px;
  }
}

@media (max-width: 760px) {
  .unit-saas-shell {
    padding: 14px 12px 110px;
  }

  .unit-stepper,
  .unit-kpi-grid,
  .unit-diagnostics,
  .unit-access-strip {
    grid-template-columns: 1fr;
  }

  .unit-action-bar,
  .unit-btn {
    width: 100%;
  }

  .unit-action-bar {
    grid-template-columns: 1fr;
  }

  .unit-period-controls,
  .unit-period-controls label,
  .unit-chip-btn {
    width: 100%;
  }

  .unit-panel-tools,
  .unit-panel-tools input,
  .unit-panel-tools select {
    width: 100%;
  }
}

/* ============================================================== */
/* BENTO UI GRID FOR UNIT ECONOMICS OVERVIEW                      */
/* ============================================================== */

.unit-bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  padding: 16px;
}

.unit-bento-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.unit-bento-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.unit-bento-card.selected {
  background: rgba(0, 240, 255, 0.05);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.unit-bento-card.selected::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(0, 240, 255, 0.1), transparent 60%);
  pointer-events: none;
}

.unit-bento-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.unit-bento-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding-bottom: 4px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

.unit-bento-metrics .metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.unit-bento-metrics .metric .label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.unit-bento-metrics .metric strong {
  font-size: 16px;
  font-family: var(--font-display);
  color: #fff;
}

.unit-bento-metrics .metric strong.good {
  color: var(--success);
}

.unit-bento-metrics .metric strong.bad {
  color: var(--danger);
}

.unit-bento-whatif {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  cursor: default;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.unit-bento-whatif-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.whatif-slider-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.whatif-slider-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #fff;
}

.whatif-slider-group input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
  -webkit-appearance: none;
}

.whatif-slider-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.whatif-advice {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.whatif-advice i {
  width: 14px;
  height: 14px;
  color: var(--accent);
  flex-shrink: 0;
}

.unit-table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Premium Value Slider & Trust Block (Onboarding additions) */
.value-slider-card {
  width: 100%;
  background: rgba(8, 8, 12, 0.45);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 260px;
}
.value-slider-card:hover {
  border-color: rgba(94, 106, 210, 0.25);
  background: rgba(10, 10, 15, 0.55);
}
.value-tab {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.6);
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.value-tab:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}
.value-tab.active {
  background: rgba(94, 106, 210, 0.12);
  border-color: rgba(94, 106, 210, 0.4);
  color: #fff;
  box-shadow: 0 0 20px rgba(94, 106, 210, 0.1);
}
.value-slide-content {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s ease;
}
.value-slide-content.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}
.badge-premium {
  font-size: 11px;
  font-weight: 700;
  color: #07ca6b;
  background: rgba(7, 202, 107, 0.1);
  border: 1px solid rgba(7, 202, 107, 0.2);
  padding: 4px 10px;
  border-radius: 8px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.premium-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
  margin: 10px 0;
  transition: background 0.3s;
}
.premium-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding-bottom: 4px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

.unit-bento-metrics .metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.unit-bento-metrics .metric .label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.unit-bento-metrics .metric strong {
  font-size: 16px;
  font-family: var(--font-display);
  color: #fff;
}

.unit-bento-metrics .metric strong.good {
  color: var(--success);
}

.unit-bento-metrics .metric strong.bad {
  color: var(--danger);
}

.unit-bento-whatif {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  cursor: default;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.unit-bento-whatif-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.whatif-slider-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.whatif-slider-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #fff;
}

.whatif-slider-group input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
  -webkit-appearance: none;
}

.whatif-slider-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.whatif-advice {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.whatif-advice i {
  width: 14px;
  height: 14px;
  color: var(--accent);
  flex-shrink: 0;
}

.unit-table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Premium Value Slider & Trust Block (Onboarding additions) */
.value-slider-card {
  width: 100%;
  background: rgba(8, 8, 12, 0.45);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 260px;
}
.value-slider-card:hover {
  border-color: rgba(94, 106, 210, 0.25);
  background: rgba(10, 10, 15, 0.55);
}
.value-tab {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.6);
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.value-tab:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}
.value-tab.active {
  background: rgba(94, 106, 210, 0.12);
  border-color: rgba(94, 106, 210, 0.4);
  color: #fff;
  box-shadow: 0 0 20px rgba(94, 106, 210, 0.1);
}
.value-slide-content {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s ease;
}
.value-slide-content.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}
.badge-premium {
  font-size: 11px;
  font-weight: 700;
  color: #07ca6b;
  background: rgba(7, 202, 107, 0.1);
  border: 1px solid rgba(7, 202, 107, 0.2);
  padding: 4px 10px;
  border-radius: 8px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.premium-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
  margin: 10px 0;
  transition: background 0.3s;
}
.premium-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5e6ad2, #0fc7ec);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(94, 106, 210, 0.5);
  transition: transform 0.2s;
}
.premium-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* ===== Migrated from inline <style> blocks in index.html ===== */

/* --- Block 1: Comparison table mobile (was inline L53) --- */
@media(max-width:640px) {
    .comp-grid { grid-template-columns:1fr !important; }
}

/* --- Block 2: Global loader (was inline L131) --- */
@keyframes pulseOrb { 0% { transform: scale(0.8); opacity: 0.5; } 100% { transform: scale(1.2); opacity: 0.8; } }
@keyframes pulseText { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
@keyframes gridMove { 0% { background-position: 0 0; } 100% { background-position: 0 40px; } }
@keyframes spinR1 { 0% { transform: rotate(0deg) scale(1); } 50% { transform: rotate(180deg) scale(1.1); } 100% { transform: rotate(360deg) scale(1); } }
@keyframes spinR2 { 0% { transform: rotate(0deg) scale(1); } 50% { transform: rotate(-180deg) scale(1.15); } 100% { transform: rotate(-360deg) scale(1); } }
@keyframes spinR3 { 0% { transform: rotateX(75deg) rotateZ(0deg); } 100% { transform: rotateX(75deg) rotateZ(360deg); } }
@keyframes corePulse { 0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(15, 199, 236, 0.2), inset 0 0 20px rgba(15, 199, 236, 0.1); } 50% { transform: scale(1.05); box-shadow: 0 0 40px rgba(15, 199, 236, 0.6), inset 0 0 30px rgba(7, 202, 107, 0.3); border-color:rgba(7,202,107,0.5); } }
@keyframes scannerScan { 0% { top: -10%; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { top: 110%; opacity: 0; } }
@keyframes progressBar { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.cyber-loader-container { position: relative; perspective: 1000px; }
.cyber-ring { position: absolute; border-radius: 50%; border: 3px solid transparent; }
.cyber-ring.r1 { inset: 0; border-top-color: #0fc7ec; border-bottom-color: #07ca6b; animation: spinR1 2.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite; filter: drop-shadow(0 0 8px #0fc7ec); }
.cyber-ring.r2 { inset: 18px; border-left-color: #ae21ff; border-right-color: #0fc7ec; animation: spinR2 2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite; opacity: 0.9; }
.cyber-ring.r3 { inset: -30px; border: 1px dashed rgba(7, 202, 107, 0.6); animation: spinR3 8s linear infinite; transform-style: preserve-3d; filter: drop-shadow(0 0 4px #07ca6b); }
.cyber-core { position: absolute; inset: 32px; border-radius: 50%; background: linear-gradient(135deg, rgba(15, 199, 236, 0.1), rgba(7, 202, 107, 0.1)); display: flex; align-items: center; justify-content: center; animation: corePulse 1.5s ease-in-out infinite alternate; border: 1px solid rgba(15, 199, 236, 0.3); backdrop-filter: blur(8px); overflow: hidden; }
.cyber-scanner { position: absolute; left: -10%; right: -10%; height: 2px; background: #fff; box-shadow: 0 0 20px 4px #0fc7ec, 0 20px 20px -5px rgba(15, 199, 236, 0.4); animation: scannerScan 2s cubic-bezier(0.4, 0, 0.2, 1) infinite; z-index: var(--z-sticky); border-radius:50%; }
#global-loader-text::after { content: ''; display: inline-block; width: 4px; height: 18px; background: #0fc7ec; margin-left: 6px; vertical-align: middle; animation: pulseText 1s infinite; }

/* --- Block 3: Landing page (was inline L196) --- */
.bg-orb { position:absolute; filter:blur(140px); opacity:0.5; border-radius:50%; pointer-events:none; z-index:var(--z-base); mix-blend-mode: screen; animation: floatOrb 25s infinite alternate ease-in-out; will-change: transform; }
.orb-1 { width:700px; height:700px; background:#5e6ad2; top:-30%; left:-10%; max-width: 100vw; }
.orb-2 { width:600px; height:600px; background:#AE21FF; bottom:10%; right:-20%; animation-delay: -12s; max-width: 100vw; }
@keyframes floatOrb { 0% { transform: translate3d(0,0,0) scale(1); } 100% { transform: translate3d(150px, 200px, 0) scale(1.3); } }

.grid-layer { position:absolute; top:0; left:0; width:100%; height:120vh; background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px); background-size: 60px 60px; z-index:var(--z-base); mask-image: linear-gradient(to bottom, black 0%, transparent 100%); -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 80%); pointer-events:none; transform: perspective(500px) rotateX(45deg) translateZ(0); transform-origin: top; will-change: transform; }
.glow-line { position:absolute; height:1px; background:linear-gradient(90deg, transparent, var(--accent), transparent); z-index:var(--z-content); opacity:0.6; }
.top-line { top: 0; left:0; right:0; animation: scanline 4s linear infinite; }
@keyframes scanline { 0% { transform:translateY(0); opacity:0; } 50% { opacity:0.8; } 100% { transform:translateY(300px); opacity:0; } }

.premium-nav-btn { position:relative; padding:10px 24px; font-size:14px; font-weight:600; background:rgba(255,255,255,0.03); color:#fff; border:1px solid rgba(255,255,255,0.1); border-radius:30px; cursor:pointer; overflow:hidden; transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.premium-nav-btn::before { content:''; position:absolute; inset:0; background:radial-gradient(circle at center, rgba(255,255,255,0.2) 0%, transparent 70%); opacity:0; transition:opacity 0.3s; pointer-events:none; }
.premium-nav-btn:hover { border-color:rgba(255,255,255,0.3); box-shadow:0 0 20px rgba(255,255,255,0.1); }
.premium-nav-btn:hover::before { opacity:1; }

.badge-shimmer { display:inline-flex; align-items:center; gap:8px; padding:6px 20px; border-radius:30px; background:rgba(94,106,210,0.1); border:1px solid rgba(24,86,255,0.3); color:#a5b4fc; font-size:13px; font-weight:600; letter-spacing:0.5px; position:relative; overflow:hidden; }
.badge-shimmer::after { content:''; position:absolute; top:0; left:-100%; width:50%; height:100%; background:linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent); animation: badgeSweep 3s infinite; transform: skewX(-20deg); }
@keyframes badgeSweep { 0% { left: -100%; } 100% { left: 200%; } }

.landing-title { font-family:var(--font-display); font-size:clamp(48px, 6vw, 84px); font-weight:800; line-height:1.05; margin-bottom:24px; letter-spacing:-2px; z-index:var(--z-sticky); position:relative; }
.text-glow { text-shadow: 0 0 60px rgba(255,255,255,0.2); color:#fff; }
.gradient-text-anim { background: linear-gradient(270deg, #FFFFFF, #B4C6FF, #00D4FF, #5e6ad2, #FFFFFF); background-size: 300% 300%; -webkit-background-clip: text; -webkit-text-fill-color: transparent; animation: textShimmer 8s ease infinite; }
@keyframes textShimmer { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }

.btn-conic { position:relative; padding:18px 48px; border-radius:40px; background:#000; color:#fff; font-size:16px; font-weight:700; cursor:pointer; border:none; z-index:var(--z-base); outline:none; transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.btn-conic::before { content:''; position:absolute; z-index:-2; inset:-2px; border-radius:42px; background:conic-gradient(from var(--angle), var(--accent), #00D4FF, #AE21FF, var(--accent)); animation: spin 4s linear infinite; }
.btn-conic::after { content:''; position:absolute; z-index:-1; inset:2px; border-radius:38px; background:rgba(10,10,15, 0.9); backdrop-filter:blur(10px); transition:background 0.3s; }
.btn-conic:hover { transform: scale(1.05) translateY(-2px); box-shadow: 0 20px 40px rgba(94,106,210,0.4); }
.btn-conic:hover::after { background:rgba(24,86,255,0.2); }
@property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }

.hero-mockup { width: 100%; max-width: 900px; height: 420px; background: rgba(10, 10, 15, 0.6); border: 1px solid rgba(255,255,255,0.1); border-radius: 24px; box-shadow: 0 40px 100px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.05) inset, 0 0 40px rgba(24,86,255,0.2); backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px); margin: 60px auto 0; position: relative; z-index: 5; padding: 24px; display: flex; flex-direction: column; transform: perspective(1200px) rotateX(12deg) translateY(0); filter: drop-shadow(0 0 2rem rgba(24,86,255,0.2)); animation: floatMockup 8s infinite alternate cubic-bezier(0.3, 0.1, 0.3, 1); overflow: hidden; }
@keyframes floatMockup { 0% { transform: perspective(1200px) rotateX(12deg) translateY(0); } 100% { transform: perspective(1200px) rotateX(14deg) translateY(-20px); } }
.mockup-grid { position:absolute; inset:0; background-image:linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px); background-size:40px 40px; pointer-events:none; z-index:0;}
.m-header { display: flex; gap:8px; margin-bottom: 24px; position:relative; z-index:var(--z-base); }
.m-dot { width: 10px; height: 10px; border-radius: 50%; opacity:0.8; }
.m-dot.r { background: #FF5A52; } .m-dot.y { background: #E6C02A; } .m-dot.g { background: #53C22B; }
.m-top-bar { position:absolute; left:50%; transform:translateX(-50%); top:16px; background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.05); padding:6px 60px; border-radius:8px; font-size:10px; color:rgba(255,255,255,0.3); font-family:monospace; }
.m-stats { display: flex; gap: 16px; margin-bottom: 24px; position:relative; z-index:var(--z-base); }
.m-card { flex:1; background: rgba(255,255,255,0.02); border-radius: 16px; padding: 20px; border: 1px solid rgba(255,255,255,0.03); display:flex; flex-direction:column; justify-content:center; position:relative; overflow:hidden;}
.m-card::before { content:''; position:absolute; top:0; left:0; width:100%; height:2px; background:linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent); opacity:0; transition:opacity 0.3s;}
.m-card:hover::before { opacity:1; }
.m-val { font-size: 28px; font-weight: 800; color: #fff; margin-bottom: 8px; font-family: var(--font-display); letter-spacing:-0.5px;}
.m-lbl { font-size: 11px; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 1px; font-weight:600;}
.m-val.green { color: #07CA6B; text-shadow: 0 0 16px rgba(7,202,107,0.4); }
.m-chart-area { flex: 1; display:flex; align-items:flex-end; gap:16px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.05); position:relative; z-index:var(--z-base); }
.m-chart-area::before { content:'';position:absolute; bottom:0; left:0; right:0; height:1px; background:rgba(255,255,255,0.1); }
.m-bar { flex: 1; background: linear-gradient(180deg, rgba(24,86,255,0.6) 0%, rgba(24,86,255,0.05) 100%); border:1px solid rgba(94,106,210,0.4); border-bottom:none; border-radius: 8px 8px 0 0; position: relative; animation: growBar 2.5s cubic-bezier(0.1, 0.8, 0.2, 1) forwards; transform-origin: bottom; opacity:0; box-shadow:inset 0 2px 10px rgba(255,255,255,0.2); overflow:hidden;}
.m-bar::after { content:'';position:absolute;top:0;left:0;right:0;height:100%;background:linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 100%);opacity:0.5;}
@keyframes growBar { 0% { transform: scaleY(0); opacity:0; } 100% { transform: scaleY(1); opacity:1; } }
.m-bar-green { flex:1; background: linear-gradient(180deg, rgba(7,202,107,0.8) 0%, rgba(7,202,107,0.1) 100%); border:1px solid rgba(7,202,107,0.5); border-bottom:none; border-radius: 8px 8px 0 0; position:relative; animation: growBar 2.5s cubic-bezier(0.1, 0.8, 0.2, 1) forwards; animation-delay: 0.6s !important; transform-origin: bottom; opacity:0; box-shadow: 0 0 30px rgba(7,202,107,0.3), inset 0 2px 10px rgba(255,255,255,0.4); overflow:visible;}
.m-bar-green::before { content:''; position:absolute; inset:0; background:linear-gradient(transparent, rgba(255,255,255,0.4), transparent); animation: sweepUp 2s linear infinite; }
@keyframes sweepUp { 0% { transform: translateY(100%); } 100% { transform: translateY(-100%); } }

.feature-card { transition:all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); border:1px solid rgba(255,255,255,0.05); background:rgba(255,255,255,0.02); }
.feature-card:hover { transform:translateY(-8px); border-color:rgba(94,106,210,0.4); background:rgba(24,86,255,0.05); box-shadow: 0 20px 40px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1); }
.feature-icon { width:56px; height:56px; border-radius:16px; margin-bottom:24px; display:flex; align-items:center; justify-content:center; transition:transform 0.4s; box-shadow:inset 0 1px 0 rgba(255,255,255,0.2); }
.feature-card:hover .feature-icon { transform:scale(1.1); }
.auth-block { background:rgba(10,10,15,0.8); border:1px solid rgba(255,255,255,0.08); border-radius:32px; padding:0; overflow:hidden; display:flex; flex-wrap:wrap; box-shadow:0 60px 140px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.1); backdrop-filter:blur(30px); }
.auth-input { background:rgba(0,0,0,0.4)!important; border:1px solid rgba(255,255,255,0.1)!important; border-radius:16px!important; padding:18px 20px!important; width:100%!important; color:#fff!important; font-size:15px!important; transition:all 0.3s!important; box-shadow:inset 0 2px 4px rgba(0,0,0,0.2)!important;}
.auth-input:focus { border-color:var(--accent)!important; background:rgba(24,86,255,0.05)!important; box-shadow:0 0 0 4px rgba(94,106,210,0.1), inset 0 1px 2px rgba(0,0,0,0.4)!important;}

/* --- Block 4: Dashboard bento (was inline L881) --- */
.glass-bento-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 24px; }
.glass-bento-card { position: relative; overflow: hidden; padding: 24px; border-radius: 20px; background: linear-gradient(160deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%); border: 1px solid rgba(255, 255, 255, 0.06); box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.05), 0 12px 30px -10px rgba(0, 0, 0, 0.5); backdrop-filter: blur(40px) saturate(130%); -webkit-backdrop-filter: blur(40px) saturate(130%); display: flex; flex-direction: column; justify-content: flex-end; min-height: 140px; transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s, box-shadow 0.3s; }
.glass-bento-card:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.12); box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.1), 0 16px 40px -10px rgba(0, 0, 0, 0.6); }
.glass-bg-glow { position: absolute; width: 260px; height: 260px; top: -80px; right: -80px; border-radius: 50%; opacity: 0.15; filter: blur(60px); pointer-events: none; z-index: 0; mix-blend-mode: screen; }
.glow-blue .glass-bg-glow { background: #2b5eff; }
.glow-green .glass-bg-glow { background: #07ca6b; }
.glow-red .glass-bg-glow { background: #ea2143; }
.glow-orange .glass-bg-glow { background: #e89558; }
.glow-purple .glass-bg-glow { background: #a855f7; }
.m-lbl-premium { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: rgba(255,255,255,0.45); margin-bottom: 12px; z-index: var(--z-content); position: relative; }
.th-vertical { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; height: 110px; display: flex; align-items: center; justify-content: flex-start; padding: 4px; box-sizing: border-box; font-size: 10px; letter-spacing: 0.5px; width: 100%; }
#plan-table th.vertical-cell { padding: 0; vertical-align: bottom; height: 110px; background: var(--bg-base); background-clip: padding-box; border-bottom: 2px solid rgba(255,255,255,0.1); }
#plan-table td.narrow-num { padding: 4px 2px; text-align: center; }
.v-big { font-size: 44px; font-weight: 800; letter-spacing: -1.5px; z-index: var(--z-content); position: relative; line-height: 1.1; }
.v-mid { font-size: 30px; font-weight: 700; letter-spacing: -1px; z-index: var(--z-content); position: relative; line-height: 1; }
.text-g-blue { color: #fff; text-shadow: 0 0 40px rgba(43,94,255,0.8); }
.text-g-green { color: #07ca6b; text-shadow: 0 0 40px rgba(7,202,107,0.5); }
.text-g-muted { color: rgba(255,255,255,0.8); }
.kpi-grid-premium { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi-card-glass { background: linear-gradient(160deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%); border: 1px solid rgba(255, 255, 255, 0.05); padding: 24px; border-radius: 16px; position: relative; overflow: hidden; display: flex; flex-direction: column; box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.03), 0 8px 24px -8px rgba(0, 0, 0, 0.3); backdrop-filter: blur(40px) saturate(130%); transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s; }
.kpi-card-glass:hover { border-color: rgba(255, 255, 255, 0.1); transform: translateY(-2px); box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.06), 0 12px 30px -10px rgba(0, 0, 0, 0.4); }
.kpi-l { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.6); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; position: relative; z-index: var(--z-content);}
.kpi-v { font-size: 26px; font-weight: 800; letter-spacing: -1px; position: relative; z-index: var(--z-content);}
@media (max-width: 900px) {
    .glass-bento-grid { grid-template-columns: 1fr; }
    .glass-bento-card[style*="span"] { grid-column: span 1 !important; }
    .kpi-grid-premium { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
    .kpi-grid-premium { grid-template-columns: 1fr; }
}
.skeleton-pulse { width: 50%; min-width: 60px; height: 1em; border-radius: 6px; background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.04) 75%); background-size: 200% 100%; animation: skelLoad 1.5s infinite linear; display: inline-block; vertical-align: middle; }
@keyframes skelLoad { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* --- Block 5: AI chat keyframes (was inline L2345) --- */
@keyframes fade-in-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ai-pulse { 0% { box-shadow: 0 0 0 0 rgba(167, 139, 250, 0.7); } 70% { box-shadow: 0 0 0 6px rgba(167, 139, 250, 0); } 100% { box-shadow: 0 0 0 0 rgba(167, 139, 250, 0); } }
.ai-chat-pane { transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1); }

/* --- Block 6: Explain modal (was inline L3942) --- */
.expl-header { padding:28px 28px 0; display:flex; align-items:flex-start; gap:16px; }
.expl-photo { width:64px; height:80px; border-radius:12px; object-fit:cover; background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.08); flex-shrink:0; }
.expl-info { flex:1; }
.expl-title { font-size:18px; font-weight:800; color:#fff; margin-bottom:4px; }
.expl-sub { font-size:12px; color:rgba(255,255,255,0.45); display:flex; gap:12px; flex-wrap:wrap; }
.expl-close { width:32px; height:32px; border-radius:10px; background:rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.08); color:rgba(255,255,255,0.5); font-size:18px; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:all 0.2s; flex-shrink:0; }
.expl-close:hover { background:rgba(234,33,67,0.15); color:#ef4444; border-color:rgba(234,33,67,0.3); }
.expl-section { padding:20px 28px 0; }
.expl-section-title { font-size:11px; text-transform:uppercase; letter-spacing:1.5px; color:rgba(255,255,255,0.35); font-weight:700; margin-bottom:12px; display:flex; align-items:center; gap:8px; }
.expl-section-title::after { content:''; flex:1; height:1px; background:rgba(255,255,255,0.06); }
.expl-metrics { display:grid; grid-template-columns:repeat(auto-fill, minmax(120px, 1fr)); gap:8px; }
.expl-metric { background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.06); border-radius:12px; padding:12px; text-align:center; transition:all 0.2s; }
.expl-metric:hover { background:rgba(255,255,255,0.06); border-color:rgba(255,255,255,0.12); transform:translateY(-1px); }
.expl-metric-val { font-size:20px; font-weight:800; color:#fff; line-height:1.1; }
.expl-metric-lbl { font-size:10px; color:rgba(255,255,255,0.4); margin-top:4px; letter-spacing:0.5px; }
.expl-formula { background:rgba(24,86,255,0.06); border:1px solid rgba(24,86,255,0.15); border-radius:14px; padding:16px 20px; margin:12px 0 0; font-family:'JetBrains Mono', monospace; font-size:12px; color:rgba(255,255,255,0.7); line-height:1.8; }
.expl-formula b { color:#fff; font-weight:700; }
.expl-formula .val-green { color:#07ca6b; font-weight:700; }
.expl-formula .val-red { color:#ef4444; font-weight:700; }
.expl-formula .val-blue { color:#5e6ad2; font-weight:700; }
.expl-formula .val-yellow { color:#f59e0b; font-weight:700; }
.expl-wh-cards { display:flex; flex-direction:column; gap:8px; }
.expl-wh-card { background:rgba(255,255,255,0.02); border:1px solid rgba(255,255,255,0.06); border-radius:14px; padding:14px 18px; transition:all 0.2s; }
.expl-wh-card:hover { background:rgba(255,255,255,0.04); border-color:rgba(255,255,255,0.12); }
.expl-wh-name { font-size:14px; font-weight:700; color:#fff; margin-bottom:8px; display:flex; align-items:center; justify-content:space-between; }
.expl-wh-ship { font-size:18px; font-weight:900; color:var(--accent, #5e6ad2); }
.expl-wh-row { display:flex; flex-wrap:wrap; gap:6px 16px; font-size:11px; color:rgba(255,255,255,0.5); }
.expl-wh-row span { display:flex; align-items:center; gap:4px; }
.expl-wh-reason { margin-top:8px; font-size:11px; color:rgba(255,255,255,0.6); background:rgba(255,255,255,0.03); border-radius:8px; padding:8px 12px; line-height:1.5; border-left:3px solid rgba(94,106,210,0.4); }
.expl-trend-bar { display:flex; align-items:center; gap:8px; margin-top:8px; }
.expl-trend-segment { height:6px; border-radius:3px; min-width:20px; transition: width 0.5s; }
.expl-footer { padding:20px 28px 28px; text-align:center; }
.expl-footer-note { font-size:10px; color:rgba(255,255,255,0.25); line-height:1.5; }
@media(max-width:700px) {
    #explain-overlay .modal-content { max-width:100%; border-radius:16px 16px 0 0; max-height:85vh; }
    .expl-header { padding:20px 16px 0; }
    .expl-section { padding:16px 16px 0; }
    .expl-metrics { grid-template-columns:repeat(3, 1fr); }
    .expl-footer { padding:16px; }
}

/* ===== Accessibility: Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
