/* ═══════════════════════════════════════════════════════════════════
   CHM Finance — Global Styles
   ═══════════════════════════════════════════════════════════════════ */

/* --- Design Tokens --- */
:root {
  --bg-primary: #0A0A0A;
  --bg-secondary: #050505;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-solid: #0F0F0F;
  --bg-input: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.14);
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.62);
  --text-muted: rgba(255, 255, 255, 0.38);
}

/* Light theme overrides — triggered by <html class="light"> from shell.js.
 * Using !important across the board because many dashboard pages hardcode
 * dark colors inline (bg-slate-800/50, linear-gradient, etc) and we want
 * the theme flip to win unconditionally. */
html.light {
  --bg-primary: #F5F6F8;
  --bg-secondary: #EDEEF2;
  --bg-card: rgba(0, 0, 0, 0.04);
  --bg-card-solid: #FFFFFF;
  --bg-input: rgba(0, 0, 0, 0.04);
  --border: rgba(0, 0, 0, 0.1);
  --border-light: rgba(0, 0, 0, 0.18);
  --text-primary: #0A0A0A;
  --text-secondary: rgba(0, 0, 0, 0.7);
  --text-muted: rgba(0, 0, 0, 0.5);
  color-scheme: light;
}
html.light body { color: #0A0A0A !important; background: #F5F6F8 !important; }

/* Sidebar + topbar — they hardcode #0A0A0A gradients, override hard */
html.light .sidebar {
  background: linear-gradient(180deg, #FFFFFF 0%, #F5F6F8 100%) !important;
  border-right-color: rgba(0, 0, 0, 0.08) !important;
}
html.light .sidebar-logo,
html.light .sidebar-logo a { color: #0A0A0A !important; }
html.light .sidebar-link { color: rgba(0, 0, 0, 0.65) !important; }
html.light .sidebar-link:hover { color: #0A0A0A !important; background: rgba(0, 0, 0, 0.05) !important; }
html.light .sidebar-link.active { color: #0A0A0A !important; background: rgba(255,90,31, 0.1) !important; }
html.light .sidebar-sub-badge { background: rgba(255,90,31, 0.08) !important; color: #FF5A1F !important; border-color: rgba(255,90,31, 0.2) !important; }

html.light .topbar {
  background: rgba(255, 255, 255, 0.85) !important;
  border-bottom-color: rgba(0, 0, 0, 0.08) !important;
  backdrop-filter: blur(20px);
}
html.light .topbar-search input,
html.light .topbar-search { background: rgba(0, 0, 0, 0.04) !important; color: #0A0A0A !important; }
html.light .topbar-username { color: rgba(0, 0, 0, 0.8) !important; }

/* Cards + stats */
html.light .card,
html.light .stat-card {
  background: #FFFFFF !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  color: #0A0A0A !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 10px 20px -10px rgba(0, 0, 0, 0.08) !important;
}
html.light .stat-card-label { color: rgba(0, 0, 0, 0.55) !important; }
html.light .stat-card-value { color: #0A0A0A !important; }

/* Utility text colors */
html.light .text-white { color: #0A0A0A !important; }
html.light .text-slate-300 { color: rgba(0, 0, 0, 0.75) !important; }
html.light .text-slate-400 { color: rgba(0, 0, 0, 0.55) !important; }
html.light .text-slate-500 { color: rgba(0, 0, 0, 0.45) !important; }
html.light .text-slate-600 { color: rgba(0, 0, 0, 0.35) !important; }

/* Utility bg-slate-*/*, bg-indigo-500/10, etc — normalise dashboard cards */
html.light [class*="bg-slate-800"] { background: rgba(0, 0, 0, 0.04) !important; }
html.light [class*="bg-slate-900"] { background: rgba(0, 0, 0, 0.06) !important; }
html.light [class*="border-slate-700"],
html.light [class*="border-slate-800"] { border-color: rgba(0, 0, 0, 0.1) !important; }

/* Inputs */
html.light input,
html.light select,
html.light textarea {
  background: #FFFFFF !important;
  color: #0A0A0A !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
}
html.light input::placeholder,
html.light textarea::placeholder { color: rgba(0, 0, 0, 0.4) !important; }

/* Headings */
html.light h1, html.light h2, html.light h3, html.light h4 { color: #0A0A0A !important; }

:root {
  --accent-blue: #FF5A1F;
  --accent-blue-light: #FF8C5A;
  --accent-cyan: #FF8C5A;
  --accent-purple: #FF5A1F;
  --accent-green: #2B5936;
  --accent-green-light: #66876E;
  --accent-red: #522525;
  --accent-red-light: #826262;
  --accent-yellow: #826262;
  --accent-orange: #826262;
  --gradient-primary: linear-gradient(180deg, #FF7840 0%, #FF5A1F 60%, #C44610 100%);
  --gradient-cyan: linear-gradient(180deg, #FF8C5A, #FF5A1F);
  --gradient-green: linear-gradient(180deg, #66876E, #2B5936);
  --shadow-glow: 0 8px 32px rgba(255,90,31, 0.18), 0 0 0 1px rgba(255,140,90, 0.18);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-deep: 0 2px 4px rgba(0, 0, 0, 0.5), 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 30px 60px rgba(0, 0, 0, 0.4);
  --shadow-emboss-light: inset 0 1px 1px rgba(255, 255, 255, 0.28), inset 0 -1px 3px rgba(0, 0, 0, 0.6);
  --shadow-emboss-dark: inset 0 1px 1px rgba(255, 255, 255, 0.1), inset 0 -2px 6px rgba(0, 0, 0, 0.7);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;
  --radius-pill: 9999px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --blur: 24px;
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 500ms cubic-bezier(.16,1,.3,1);
  --ease: cubic-bezier(.16,1,.3,1);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.5;
  letter-spacing: -0.005em;
  overflow-x: hidden;
}
h1, h2, h3, h4, h5, h6 { font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; color: #fff; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; font-weight: 500; }
input, select, textarea {
  font-family: inherit;
  font-weight: 500;
  font-size: 14px;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  outline: none;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent-blue-light);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(255,90,31, 0.18);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
img { max-width: 100%; display: block; }
::selection { background: rgba(255,90,31, 0.4); color: #fff; }

/* --- Utility Classes --- */
.container { width: min(1280px, 92%); margin: 0 auto; }
.container-sm { width: min(960px, 92%); margin: 0 auto; }
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.text-cyan { color: var(--accent-cyan); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 2rem; }
.text-4xl { font-size: 2.5rem; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.font-mono { font-family: var(--font-mono); }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.hidden { display: none !important; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }
.w-full { width: 100%; }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

/* --- Buttons (pill family with embossed inset highlights) --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0;
  border: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  color: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), inset 0 -1px 2px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.4);
  transition: transform .25s var(--ease), filter .25s var(--ease), background .25s var(--ease);
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover { background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.03)); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:focus-visible { outline: 2px solid var(--accent-blue-light); outline-offset: 3px; }
.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.28), inset 0 -1px 3px rgba(0, 0, 0, 0.6), 0 4px 8px -2px rgba(0, 0, 0, 0.6), 0 12px 24px -6px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255,90,31, 0.35);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); background: var(--gradient-primary); }
.btn-ghost {
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  color: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), inset 0 -1px 2px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.4);
}
.btn-ghost:hover { background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.03)); }
.btn-success {
  background: linear-gradient(180deg, #66876E 0%, #2B5936 60%, #1E3E26 100%);
  color: #fff;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.22), inset 0 -1px 3px rgba(0, 0, 0, 0.5), 0 4px 8px -2px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(43, 89, 54, 0.4);
}
.btn-success:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-danger {
  background: linear-gradient(180deg, #826262 0%, #522525 60%, #391A1A 100%);
  color: #fff;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.22), inset 0 -1px 3px rgba(0, 0, 0, 0.5), 0 4px 8px -2px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(82, 37, 37, 0.4);
}
.btn-danger:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-sm { padding: 6px 16px; font-size: 12px; line-height: 16px; }
.btn-lg { padding: 14px 28px; font-size: 15px; line-height: 22px; }
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* --- Cards (glass surface with deep shadow stack) --- */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  backdrop-filter: blur(var(--blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.06);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .5s var(--ease);
}
.card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 30px 60px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}
.card-glow:hover {
  border-color: rgba(255,140,90, 0.35);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 30px 60px rgba(255,90,31, 0.18), inset 0 1px 1px rgba(255, 255, 255, 0.12);
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
}
.badge-blue   { background: rgba(255,90,31, 0.18);  color: #FF8C5A; border-color: rgba(255,140,90, 0.25); }
.badge-green  { background: rgba(43, 89, 54, 0.28);   color: #99AF9F; border-color: rgba(102, 135, 110, 0.3); }
.badge-red    { background: rgba(82, 37, 37, 0.32);   color: #C8B9B9; border-color: rgba(130, 98, 98, 0.3); }
.badge-cyan   { background: rgba(255,90,31, 0.14);  color: #FF8C5A; border-color: rgba(255,140,90, 0.22); }
.badge-yellow { background: rgba(130, 98, 98, 0.22);  color: #C8B9B9; border-color: rgba(130, 98, 98, 0.3); }
.badge-purple { background: rgba(255,90,31, 0.18);  color: #FF8C5A; border-color: rgba(255,140,90, 0.25); }

/* --- Sidebar (Dashboard pages) --- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: linear-gradient(180deg, #0A0A0A 0%, #050505 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 50;
  /* Smooth collapse/expand: width animates in 240 ms with the same
     ease curve we use on the topbar shift, so the rail and the
     content slide together. transform stays for the mobile slide-in. */
  transition: transform var(--transition-normal),
              width 240ms cubic-bezier(.4, 0, .2, 1);
  will-change: width;
}
.sidebar-logo {
  padding: 22px 24px;
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo span { color: var(--accent-blue-light); }
.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  transition: color var(--transition-fast), background var(--transition-fast);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}
.sidebar-link:hover { color: #fff; background: rgba(255, 255, 255, 0.04); }
.sidebar-link.active {
  color: #fff;
  background: linear-gradient(180deg, rgba(255,90,31, 0.22), rgba(255,90,31, 0.06));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08), inset 0 0 0 1px rgba(255,140,90, 0.25);
}
.sidebar-link svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}
/* Sidebar promo — 3Commas-style teaser card above the footer.
   Upsell (non-Elite) or Academy link (Elite). Injected by shell.js. */

/* Sidebar AI-assistant entry — sits at TOP of .sidebar-nav, above Dashboard.
   <button> not <a>: the action is "open chat widget", not navigate. */
.sidebar-link-ai {
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.sidebar-link-ai svg { color: #FF8C5A; }
.sidebar-beta {
  margin-left: auto;
  font-size: 9px;
  letter-spacing: .1em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,90,31,.18);
  color: #FF8C5A;
  font-weight: 700;
}
html.light .sidebar-beta { background: rgba(255,90,31,.15); color: #C44610; }

/* Topbar left-side sidebar collapse toggle. Desktop-only; mobile uses
   the existing .lg:hidden #sidebar-toggle hamburger. */
.shell-side-toggle {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.72);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  margin-right: 8px;
  flex-shrink: 0;
}
.shell-side-toggle:hover {
  background: rgba(255,140,90,.12);
  border-color: rgba(255,90,31,.3);
  color: #FF8C5A;
}
html.light .shell-side-toggle { background: rgba(0,0,0,.04); border-color: rgba(0,0,0,.1); color: rgba(10,10,10,.7); }
html.light .shell-side-toggle:hover { background: rgba(255,90,31,.08); border-color: rgba(255,90,31,.3); color: #C44610; }
@media (max-width: 1024px) {
  /* Mobile: hide desktop toggle. The hamburger (#sidebar-toggle) already handles mobile open/close. */
  .shell-side-toggle { display: none; }
}

/* Sidebar collapsed state — slim 64px icon rail. Text labels, promo,
   footer extras, sub-badge collapse out. Topbar + main-content shift
   to match the narrower sidebar. */
.topbar,
.main-content {
  /* Sync with .sidebar width transition (240ms cubic-bezier) so the
     three layers slide together as one premium motion. */
  transition: width 240ms cubic-bezier(.4, 0, .2, 1),
              left 240ms cubic-bezier(.4, 0, .2, 1),
              margin-left 240ms cubic-bezier(.4, 0, .2, 1),
              padding 200ms ease;
}

body.sidebar-collapsed .sidebar {
  width: 64px !important;
  overflow: hidden;
  padding: 0 !important;
}
/* Hard-clip everything inside the collapsed rail so wide children
   (badges, promos, sub-text, multi-line tooltips) can't bleed out
   to the right of the 64-px column while sidebar.js animates. */
body.sidebar-collapsed .sidebar > *,
body.sidebar-collapsed .sidebar-nav > *,
body.sidebar-collapsed .sidebar-footer > * {
  max-width: 64px;
  overflow: hidden;
  box-sizing: border-box;
}
body.sidebar-collapsed .sidebar-nav {
  padding: 8px 0 !important;
  gap: 6px;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}
body.sidebar-collapsed .sidebar-footer {
  padding: 8px 0 !important;
  border-top: 1px solid var(--border);
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 6px;
}
/* 40×40 centered chip, dead-centre in the 64-px rail. Both
   `align-items:center` (on the parent flex column) AND `margin:0 auto`
   (on the link itself) — belt + braces against any inherited
   align-self / left-aligned base rule from the expanded mode. */
body.sidebar-collapsed .sidebar-link,
body.sidebar-collapsed .sidebar-footer .sidebar-link {
  /* grid + place-items:center is the most robust centring primitive —
     ignores text-align / direction / justify-self overrides from
     base rules. */
  display: grid !important;
  place-items: center !important;
  width: 40px !important;
  height: 40px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  border-radius: 10px !important;
  font-size: 0 !important;
  line-height: 0 !important;
  white-space: nowrap;
  text-align: center !important;
  box-sizing: border-box !important;
  flex-shrink: 0;
  align-self: center !important;
  justify-self: center !important;
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}
body.sidebar-collapsed .sidebar-link:hover {
  background: rgba(255, 255, 255, .06);
  transform: translateY(-1px);
}
body.sidebar-collapsed .sidebar-link.active {
  background: linear-gradient(135deg, rgba(255,90,31,.22), rgba(255,140,90,.08)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    inset 0 0 0 1px rgba(255,140,90,.32),
    0 4px 14px -4px rgba(255,90,31,.45) !important;
}
body.sidebar-collapsed .sidebar-link > svg {
  font-size: initial !important;
  line-height: initial !important;
  flex-shrink: 0;
  width: 20px !important;
  height: 20px !important;
  display: block !important;
  margin: 0 !important;
  /* Force the 24×24 viewBox to fill its 20×20 box: some path-only
     SVGs render with intrinsic whitespace inside the viewBox that
     visually shifts them off-axis. preserveAspectRatio:xMidYMid meet
     is the default; we keep it but pin the box itself. */
  object-fit: contain;
}
body.sidebar-collapsed .sidebar-link > *:not(svg),
body.sidebar-collapsed .sidebar-beta,
body.sidebar-collapsed .sidebar-promo,
body.sidebar-collapsed .sidebar-footer-extras,
body.sidebar-collapsed .sidebar-sub-badge,
body.sidebar-collapsed .sidebar-logo { display: none !important; }
body.sidebar-collapsed .sidebar-footer { padding: 10px 0; }
body.sidebar-collapsed .sidebar-footer .sidebar-link { display: flex; }
body.sidebar-collapsed .topbar { left: 64px; }
body.sidebar-collapsed .main-content { margin-left: 64px; }
/* Tooltips via title= attribute show the label on hover when collapsed */
body.sidebar-collapsed .sidebar-link { position: relative; }

/* Anti-flash: hide nav + topbar-actions + sidebar-footer until shell.js
   has injected its chrome. shell.js sets <html data-chrome-ready="1"> at
   end of boot(). Container (sidebar, topbar) stays visible so there's no
   layout shift, only the contents fade in over 140ms. Tight enough that
   users perceive it as "instant" but hides the old-items → new-items
   reshuffle. */
html:not([data-chrome-ready]) .sidebar-nav,
html:not([data-chrome-ready]) .sidebar-footer,
html:not([data-chrome-ready]) .topbar-actions {
  opacity: 0;
}
html[data-chrome-ready] .sidebar-nav,
html[data-chrome-ready] .sidebar-footer,
html[data-chrome-ready] .topbar-actions {
  opacity: 1;
  transition: opacity .14s ease-out;
}

/* Sidebar footer extras — Chat/Email/Ideas row + community icons + app badges.
   Every flex container uses `display: flex !important` to defeat any
   tailwind preflight or cascade rule that could flip children to block. */
.sidebar-footer-extras {
  display: flex !important;
  flex-direction: column;
  gap: 16px;
  padding: 14px 16px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
}
.sbf-row {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  flex-wrap: nowrap;
}
.sbf-link {
  display: inline-block;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font-size: 12px;
  color: rgba(255,255,255,.6);
  text-decoration: none;
  cursor: pointer;
  transition: color .15s;
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
}
.sbf-link:hover { color: #FF8C5A; }
html.light .sbf-link { color: rgba(10,10,10,.6); }
html.light .sbf-link:hover { color: #C44610; }

.sbf-community,
.sbf-apps {
  display: flex !important;
  flex-direction: column;
  gap: 8px;
}
.sbf-community-label,
.sbf-apps-label {
  display: block;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  font-weight: 500;
  line-height: 1;
}
html.light .sbf-community-label,
html.light .sbf-apps-label { color: rgba(10,10,10,.45); }

.sbf-community-icons {
  display: flex !important;
  flex-direction: row;
  gap: 8px;
}
.sbf-community-icons a {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.75);
  transition: background .15s, color .15s, transform .15s;
  flex-shrink: 0;
}
.sbf-community-icons a:hover {
  background: rgba(255,90,31,.15);
  color: #FF8C5A;
  transform: translateY(-1px);
}
html.light .sbf-community-icons a { background: rgba(0,0,0,.05); color: rgba(10,10,10,.7); }
html.light .sbf-community-icons a:hover { background: rgba(255,90,31,.12); color: #C44610; }

.sbf-apps-badges {
  display: flex !important;
  flex-direction: row;
  gap: 8px;
}
.sbf-app-badge {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 6px;
  border-radius: 8px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.72);
  text-decoration: none;
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  transition: background .15s, border-color .15s, color .15s;
}
.sbf-app-badge svg { flex-shrink: 0; }
.sbf-app-badge span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sbf-app-badge:hover { background: rgba(255,255,255,.07); border-color: rgba(255,140,90,.3); color: #fff; }
html.light .sbf-app-badge { background: rgba(0,0,0,.03); border-color: rgba(0,0,0,.08); color: rgba(10,10,10,.7); }
html.light .sbf-app-badge:hover { background: rgba(0,0,0,.05); border-color: rgba(255,90,31,.3); color: #0A0A0A; }

.sbf-legal {
  display: flex !important;
  flex-direction: row;
  gap: 6px;
  align-items: center;
  font-size: 10px;
  color: rgba(255,255,255,.35);
}
.sbf-legal a { color: inherit; text-decoration: none; }
.sbf-legal a:hover { color: #FF8C5A; }
html.light .sbf-legal { color: rgba(10,10,10,.4); }

/* Topbar account pill — "РЕАЛЬНЫЙ АККАУНТ ▾" equivalent */
.shell-acct {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 9999px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.85);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: background .15s, border-color .15s;
  margin-right: 8px;
}
.shell-acct:hover { background: rgba(255,255,255,.07); border-color: rgba(255,140,90,.3); }
.shell-acct-mode {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255,140,90,.15);
  color: #FF8C5A;
}
.shell-acct-mode[data-mode="live"] { background: rgba(102,135,110,.2); color: #8FBF95; }
.shell-acct-val { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
html.light .shell-acct { background: rgba(0,0,0,.03); border-color: rgba(0,0,0,.1); color: #0A0A0A; }
html.light .shell-acct:hover { background: rgba(0,0,0,.05); border-color: rgba(255,90,31,.3); }
@media (max-width: 760px) { .shell-acct-val { display: none; } }

/* ── Topbar plan-pill + dropdown ("Pro ▾" inspired-by-3Commas-but-better) */
.shell-plan-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 8px;
  height: 30px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1;
  white-space: nowrap;
  background: var(--plan-bg, rgba(148,163,184,.12));
  color: var(--plan-fg, #CBD5E1);
  border: 1px solid var(--plan-ring, rgba(148,163,184,.22));
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease, background .15s, border-color .15s;
  margin-right: 8px;
  flex-shrink: 0;
  font-family: inherit;
}
.shell-plan-pill:hover { transform: translateY(-1px); filter: brightness(1.12); }
.shell-plan-pill[aria-expanded="true"] { filter: brightness(1.18); }

.shell-plan-pill-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--plan-dot, #94A3B8);
  box-shadow: 0 0 6px var(--plan-dot, #94A3B8), inset 0 1px 1px rgba(255,255,255,.3);
  flex-shrink: 0;
}
.shell-plan-pill-name { line-height: 1; }
.shell-plan-pill-chev { opacity: .72; transition: transform .18s; flex-shrink: 0; }
.shell-plan-pill[aria-expanded="true"] .shell-plan-pill-chev { transform: rotate(180deg); }

/* Free is the default state — give it a gentle "Upgrade" hint glow on
   hover so users see it's clickable but not screaming at them. */
.shell-plan-pill-free:hover {
  background: rgba(255,140,90,.12);
  border-color: rgba(255,140,90,.3);
  color: #FF8C5A;
}
.shell-plan-pill-free:hover .shell-plan-pill-dot {
  background: #FF8C5A;
  box-shadow: 0 0 8px rgba(255,140,90,.5), inset 0 1px 1px rgba(255,255,255,.3);
}
/* Elite pill — pulsing gold ring to make premium users feel special */
.shell-plan-pill-elite .shell-plan-pill-dot {
  animation: shellPlanGoldPulse 2s ease-in-out infinite;
}
@keyframes shellPlanGoldPulse {
  0%, 100% { box-shadow: 0 0 6px rgba(253,224,71,.6), inset 0 1px 1px rgba(255,255,255,.3); }
  50%      { box-shadow: 0 0 14px rgba(253,224,71,.9), inset 0 1px 1px rgba(255,255,255,.4); }
}
@media (max-width: 640px) {
  .shell-plan-pill-name { display: none; }
  .shell-plan-pill { padding: 6px; }
}

.shell-plan-dd {
  position: fixed;
  z-index: 9999;
  width: 360px;
  max-width: calc(100vw - 24px);
  background: linear-gradient(180deg, #14141c 0%, #0e0e14 100%);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  box-shadow: 0 20px 60px -10px rgba(0,0,0,.7), 0 0 0 1px rgba(255,140,90,.06);
  padding: 16px;
  display: none;
  flex-direction: column;
  gap: 14px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .14s ease, transform .14s ease;
}
.shell-plan-dd.open { display: flex; opacity: 1; transform: translateY(0); }
html.light .shell-plan-dd { background: linear-gradient(180deg, #fff 0%, #F6F7FB 100%); border-color: rgba(0,0,0,.1); box-shadow: 0 20px 60px -10px rgba(0,0,0,.18); }

.shell-plan-dd-head { padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.06); }
html.light .shell-plan-dd-head { border-bottom-color: rgba(0,0,0,.06); }
.shell-plan-dd-title { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.5); font-weight: 500; }
html.light .shell-plan-dd-title { color: rgba(10,10,10,.5); }

.shell-plan-ladder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  padding: 8px 4px;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 10px;
}
html.light .shell-plan-ladder { background: rgba(0,0,0,.02); border-color: rgba(0,0,0,.06); }
.shell-plan-ladder-pill {
  flex: 1;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,.4);
  padding: 5px 4px;
  border-radius: 6px;
  transition: all .15s;
}
.shell-plan-ladder-pill.done  { color: rgba(255,140,90,.5); }
.shell-plan-ladder-pill.active {
  background: linear-gradient(135deg, #FF8C5A, #FF5A1F);
  color: #0A0A0A;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(255,90,31,.35);
}
.shell-plan-ladder-sep { color: rgba(255,255,255,.2); font-size: 12px; margin: 0 -2px; }
html.light .shell-plan-ladder-pill { color: rgba(10,10,10,.4); }
html.light .shell-plan-ladder-pill.done  { color: rgba(196,70,16,.65); }
html.light .shell-plan-ladder-sep { color: rgba(10,10,10,.2); }

.shell-plan-metrics { display: flex; flex-direction: column; gap: 12px; }
.shell-plan-metric { display: flex; flex-direction: column; gap: 6px; }
.shell-plan-metric-head { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; gap: 8px; }
.shell-plan-metric-label { color: rgba(255,255,255,.82); font-weight: 500; display: inline-flex; align-items: center; gap: 9px; }
html.light .shell-plan-metric-label { color: rgba(10,10,10,.8); }
.shell-plan-metric-value { color: #fff; font-size: 12px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
html.light .shell-plan-metric-value { color: #0A0A0A; }

/* Icon chip — soft orange gradient square with 16px SVG inside. */
.shell-plan-metric-ic-wrap {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, rgba(255,140,90,.18) 0%, rgba(255,90,31,.08) 100%);
  border: 1px solid rgba(255,140,90,.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #FF8C5A;
  flex-shrink: 0;
  box-shadow: inset 0 1px 1px rgba(255,255,255,.06);
}
.shell-plan-metric-ic { width: 14px; height: 14px; }
html.light .shell-plan-metric-ic-wrap { background: linear-gradient(135deg, rgba(255,140,90,.14), rgba(255,90,31,.04)); border-color: rgba(255,140,90,.3); color: #C44610; }
.shell-plan-metric-bar {
  height: 5px;
  background: rgba(255,255,255,.05);
  border-radius: 3px;
  overflow: hidden;
}
html.light .shell-plan-metric-bar { background: rgba(0,0,0,.06); }
.shell-plan-metric-bar-fill { height: 100%; transition: width .3s ease; border-radius: 3px; }
.shell-plan-metric-bar-unlim {
  height: 100%;
  background: linear-gradient(90deg, #4ade80 0%, #4ade80 30%, transparent 50%, #4ade80 70%, #4ade80 100%);
  background-size: 200% 100%;
  animation: shellPlanShimmer 2.4s linear infinite;
  opacity: .5;
}
@keyframes shellPlanShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.shell-plan-next {
  padding: 16px;
  background: linear-gradient(135deg, rgba(255,90,31,.14), rgba(255,140,90,.04));
  border: 1px solid rgba(255,140,90,.25);
  border-radius: 12px;
}
.shell-plan-next-head {
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.shell-plan-next-ic-wrap {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, #FF7840, #FF5A1F);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 2px 8px rgba(255,90,31,.4), inset 0 1px 1px rgba(255,255,255,.2);
}
.shell-plan-next-ic-wrap .shell-plan-metric-ic { width: 14px; height: 14px; }
html.light .shell-plan-next-head { color: #0A0A0A; }

.shell-plan-next-list { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 6px; }
.shell-plan-next-list li {
  font-size: 12px;
  color: rgba(255,255,255,.78);
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.shell-plan-next-list li .shell-plan-metric-ic {
  width: 14px; height: 14px;
  color: #8FBF95;
  flex-shrink: 0;
  margin-top: 2px;
}
html.light .shell-plan-next-list li { color: rgba(10,10,10,.78); }
html.light .shell-plan-next-list li .shell-plan-metric-ic { color: #2B5936; }

.shell-plan-cta {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, #FF7840 0%, #FF5A1F 60%, #C44610 100%);
  color: #fff !important;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: inset 0 1px 1px rgba(255,255,255,.25), 0 4px 10px -2px rgba(255,90,31,.4);
  transition: transform .15s, filter .15s;
}
.shell-plan-cta:hover { transform: translateY(-1px); filter: brightness(1.06); }

.shell-plan-max {
  padding: 18px 16px;
  background: linear-gradient(135deg, rgba(250,204,21,.1), rgba(250,204,21,.02));
  border: 1px solid rgba(250,204,21,.25);
  border-radius: 12px;
  text-align: center;
}
.shell-plan-max-ic-wrap {
  width: 46px; height: 46px;
  margin: 0 auto;
  border-radius: 12px;
  background: linear-gradient(135deg, #FDE047, #EAB308);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0A0A0A;
  box-shadow: 0 4px 14px rgba(250,204,21,.35), inset 0 1px 1px rgba(255,255,255,.4);
}
.shell-plan-max-ic-wrap .shell-plan-metric-ic { width: 22px; height: 22px; stroke-width: 2; }

/* Topbar quick actions — "+ Создать бота" + "Upgrade" pills.
   Injected by shell.js.injectTopbarQuickActions(). Sits before the
   lang/theme/avatar stack inside .topbar-actions. */
.shell-quick { display: inline-flex; align-items: center; gap: 8px; }
.shell-quick a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .15s ease, filter .15s ease, background .15s ease, border-color .15s ease;
}
.shell-pill-create {
  color: rgba(255,255,255,.92);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.08);
}
.shell-pill-create:hover { background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.03)); transform: translateY(-1px); }
.shell-pill-upgrade {
  color: #fff;
  background: linear-gradient(180deg, #FF7840 0%, #FF5A1F 60%, #C44610 100%);
  border: 1px solid rgba(255,90,31,.45);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.28), inset 0 -1px 2px rgba(0,0,0,.22), 0 4px 10px -2px rgba(255,90,31,.35);
}
.shell-pill-upgrade:hover { filter: brightness(1.08); transform: translateY(-1px); }
html.light .shell-pill-create { color: #0A0A0A; background: #fff; border-color: rgba(0,0,0,.1); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
html.light .shell-pill-create:hover { background: #F6F7FB; }
@media (max-width: 640px) {
  .shell-pill-create span, .shell-pill-upgrade span { display: none; }
  .shell-quick a { padding: 8px; }
}

.sidebar-promo {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 16px;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(255,90,31,.12) 0%, rgba(255,90,31,.02) 100%);
  border: 1px solid rgba(255,90,31,.22);
  color: rgba(255,255,255,.85);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.sidebar-promo:hover {
  transform: translateY(-1px);
  border-color: rgba(255,140,90,.45);
  background: linear-gradient(160deg, rgba(255,90,31,.18) 0%, rgba(255,90,31,.04) 100%);
}
.sidebar-promo-ic {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 8px;
  background: rgba(255,90,31,.2);
  color: #FF8C5A;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}
.sidebar-promo-body { flex: 1; min-width: 0; }
.sidebar-promo-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
  margin-bottom: 3px;
}
.sidebar-promo-sub {
  font-size: 11px;
  color: rgba(255,255,255,.55);
  line-height: 1.4;
}
.sidebar-promo-arrow {
  color: #FF8C5A;
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}
html.light .sidebar-promo {
  background: linear-gradient(160deg, rgba(255,90,31,.1), rgba(255,255,255,.6));
  color: #0A0A0A;
}
html.light .sidebar-promo-title { color: #0A0A0A; }
html.light .sidebar-promo-sub { color: rgba(10,10,10,.6); }
.sidebar-sub-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(255,90,31, 0.18), rgba(255,90,31, 0.04));
  border: 1px solid rgba(255,140,90, 0.25);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 18px;
  color: #FF8C5A;
  font-weight: 500;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.06);
}

/* --- Top Bar (Dashboard pages) --- */
.topbar {
  position: fixed;
  top: 0;
  left: 260px;
  right: 0;
  height: 64px;
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(var(--blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.4);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 40;
}
/* Compact icon-only search trigger — opens a dropdown panel below on click,
   modeled on Linear / Bybit (post-2024) / Bitsgap. Saves 240+px of topbar
   width while still keeping a global search affordance one click away. */
.topbar-search {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  color: rgba(255,255,255,.62);
  transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}
.topbar-search:hover { border-color: rgba(255,140,90,.4); background: rgba(255,90,31,.08); color: #FFB28A; }
.topbar-search.open { border-color: rgba(255,140,90,.55); color: #FF8C5A; background: rgba(255,90,31,.1); }
.topbar-search > svg { width: 17px; height: 17px; stroke: currentColor; flex-shrink: 0; pointer-events: none; }
.topbar-search > input { display: none; }       /* legacy markup hides */
.topbar-search-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(360px, calc(100vw - 24px));
  background: linear-gradient(180deg, #14171F 0%, #0E1117 100%);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0,0,0,.5), 0 24px 48px -12px rgba(0,0,0,.4);
  padding: 12px;
  display: none;
  z-index: 200;
  animation: tbSearchSlide .15s ease-out;
}
.topbar-search.open .topbar-search-panel { display: block; }
.topbar-search-panel input {
  width: 100%; height: 38px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 9px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  outline: none;
  box-shadow: none;
}
.topbar-search-panel input::placeholder { color: rgba(255,255,255,.4) }
.topbar-search-panel input:focus { border-color: rgba(255,140,90,.6); background: rgba(255,255,255,.06) }
.topbar-search-section { margin-top: 10px }
.topbar-search-section-title {
  font-size: 9px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(255,255,255,.4);
  padding: 8px 4px 4px;
}
.topbar-search-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: rgba(255,255,255,.78);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background .12s ease, color .12s ease;
}
.topbar-search-link:hover { background: rgba(255,255,255,.05); color: #fff }
.topbar-search-link svg { width: 14px; height: 14px; stroke: currentColor; opacity: .65; flex-shrink: 0 }
.topbar-search-link .lock { margin-left: auto; font-size: 10px; color: #FFB28A; opacity: .8 }
@keyframes tbSearchSlide {
  from { opacity: 0; transform: translateY(-4px) }
  to   { opacity: 1; transform: translateY(0) }
}
html.light .topbar-search { background: rgba(0,0,0,.04); color: rgba(10,10,10,.7); border-color: rgba(0,0,0,.1) }
html.light .topbar-search:hover { background: rgba(255,90,31,.08); color: #C44610 }
html.light .topbar-search-panel { background: #fff; border-color: rgba(0,0,0,.08) }
html.light .topbar-search-panel input { background: rgba(0,0,0,.03); color: #0A0A0A; border-color: rgba(0,0,0,.08) }
html.light .topbar-search-link { color: rgba(10,10,10,.78) }
html.light .topbar-search-link:hover { background: rgba(0,0,0,.04); color: #0A0A0A }
html.light .topbar-search-section-title { color: rgba(10,10,10,.5) }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

/* ═══════════════════════════════════════════════════════════════════
 * TOPBAR BUTTONS — unified Aura-pill system
 *   • Lang toggle (EN/RU/…)
 *   • Theme toggle (moon/sun)
 *   • Notification bell
 *   • User avatar
 * All 4 use the same 40×40 circle + glass shell + orange hover glow.
 * ═══════════════════════════════════════════════════════════════════ */
.shell-topbar-btn,
.topbar-notification,
.topbar-avatar {
  position: relative;
  width: 40px; height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 12.5px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.95);
  background: linear-gradient(180deg, rgba(255,255,255,.06) 0%, rgba(255,255,255,.015) 100%);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.08),
    inset 0 -1px 2px rgba(0,0,0,.4),
    0 2px 6px -1px rgba(0,0,0,.45);
  cursor: pointer;
  transition:
    background .18s cubic-bezier(.4,0,.2,1),
    border-color .18s cubic-bezier(.4,0,.2,1),
    box-shadow .18s cubic-bezier(.4,0,.2,1),
    transform .18s cubic-bezier(.4,0,.2,1);
}
.shell-topbar-btn:hover,
.topbar-notification:hover,
.topbar-avatar:hover {
  background: linear-gradient(180deg, rgba(255,140,90,.15) 0%, rgba(255,90,31,.04) 100%);
  border-color: rgba(255,140,90,.38);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.12),
    0 4px 14px -2px rgba(255,90,31,.35),
    0 0 0 1px rgba(255,140,90,.25);
  transform: translateY(-1px);
}
.shell-topbar-btn:active,
.topbar-notification:active,
.topbar-avatar:active { transform: translateY(0) scale(.97); }
.shell-topbar-btn:focus-visible,
.topbar-notification:focus-visible,
.topbar-avatar:focus-visible {
  outline: 2px solid var(--aura-accent, #FF5A1F);
  outline-offset: 3px;
}
.shell-topbar-btn svg,
.topbar-notification svg { width: 18px; height: 18px; stroke-width: 1.8; }

/* Language button — override min-width since the circle is already 40px */
.shell-topbar-btn { min-width: 40px; letter-spacing: .02em; }

/* Notification bell — badge (dot → count) */
.topbar-notification .dot {
  position: absolute;
  top: 5px; right: 5px;
  min-width: 16px; height: 16px; padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #FF7840, #FF5A1F 60%, #C44610);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  font-variant-numeric: tabular-nums;
  border-radius: 9999px;
  border: 2px solid #0A0A0A;
  box-shadow: 0 0 10px rgba(255,90,31,.55);
  animation: pulseBadge 2.4s ease-in-out infinite;
}
@keyframes pulseBadge {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}

/* User avatar — orange gradient replaces old blue (Aura brand) */
.topbar-avatar {
  background: linear-gradient(180deg, #FF7840 0%, #FF5A1F 55%, #C44610 100%);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .01em;
  text-transform: uppercase;
  text-shadow: 0 1px 1px rgba(0,0,0,.3);
  border-color: rgba(255,140,90,.5);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.32),
    inset 0 -1px 2px rgba(0,0,0,.35),
    0 0 0 1px rgba(255,90,31,.4),
    0 4px 12px -2px rgba(255,90,31,.38);
}
.topbar-avatar:hover {
  filter: brightness(1.08) saturate(1.05);
  background: linear-gradient(180deg, #FF8750 0%, #FF6530 55%, #D04A15 100%);
  border-color: rgba(255,140,90,.65);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.4),
    0 6px 18px -2px rgba(255,90,31,.55),
    0 0 0 1px rgba(255,140,90,.55);
}

/* Light-mode overrides */
html.light .shell-topbar-btn,
html.light .topbar-notification {
  background: linear-gradient(180deg, rgba(0,0,0,.04), rgba(0,0,0,.01)) !important;
  border-color: rgba(0,0,0,.12) !important;
  color: rgba(10,10,10,.88) !important;
  box-shadow: inset 0 1px 1px rgba(255,255,255,.6), 0 1px 2px rgba(0,0,0,.05) !important;
}
html.light .shell-topbar-btn:hover,
html.light .topbar-notification:hover {
  background: linear-gradient(180deg, rgba(255,90,31,.12), rgba(255,90,31,.02)) !important;
  border-color: rgba(255,90,31,.4) !important;
}
html.light .topbar-notification .dot { border-color: #F6F7FB; }

/* ── Market tickers (topbar) ── */
.shell-market {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 12px 0 0;      /* was margin-left:18px when it sat in left group */
  flex-wrap: nowrap;       /* never break into two rows — unified topbar */
  flex-shrink: 0;
}
.shell-tick {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 12px 0 6px;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-pill);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.05), inset 0 -1px 2px rgba(0,0,0,.35);
  transition: border-color .2s ease, transform .2s ease;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  line-height: 1;
  /* Reserve enough room for "$1,234,567" + delta so live updates and the
     loading→ready transition don't reflow neighbouring topbar elements. */
  min-width: 152px;
  justify-content: flex-start;
}
.shell-tick:hover { border-color: rgba(255,255,255,.18); transform: translateY(-1px); }
.shell-tick-glyph {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: -0.02em;
  box-shadow: inset 0 -1px 2px rgba(0,0,0,.28), 0 1px 2px rgba(0,0,0,.35);
  flex-shrink: 0;
}
.shell-tick-body { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.shell-tick-code {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,.55);
  text-transform: uppercase;
}
.shell-tick-price {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
  display: inline-block;
  min-width: 64px;       /* fits up to "$999,999" so the corner doesn't shift */
}
.shell-tick-delta {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-variant-numeric: tabular-nums;
  background: rgba(148,163,184,.1);
  color: #94a3b8;
  line-height: 1;
  display: inline-flex;
  justify-content: center;
  min-width: 56px;       /* "▼ 12.34%" max */
}
.shell-tick[data-trend="up"]   .shell-tick-delta { background: rgba(74,222,128,.12);  color: #4ade80; }
.shell-tick[data-trend="down"] .shell-tick-delta { background: rgba(248,113,113,.12); color: #f87171; }

/* Fear & Greed pill — color shifts with level */
.shell-fng {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-pill);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.05), inset 0 -1px 2px rgba(0,0,0,.35);
  font-size: 12px;
  transition: border-color .2s ease;
  position: relative;
}
.shell-fng:hover { border-color: rgba(255,255,255,.18); }
.shell-fng-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: rgba(255,255,255,.55);
  text-transform: uppercase;
}
.shell-fng-value {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  display: inline-block;
  min-width: 24px;       /* fits 0..100 (3 chars) without reflowing */
  text-align: center;
}
.shell-fng-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 6px currentColor;
}
.shell-fng[data-level="extreme-fear"] { border-color: rgba(239,68,68,.35); }
.shell-fng[data-level="extreme-fear"] .shell-fng-dot { background: #ef4444; color: #ef4444; }
.shell-fng[data-level="extreme-fear"] .shell-fng-value { color: #fca5a5; }
.shell-fng[data-level="fear"] { border-color: rgba(249,115,22,.32); }
.shell-fng[data-level="fear"] .shell-fng-dot { background: #f97316; color: #f97316; }
.shell-fng[data-level="fear"] .shell-fng-value { color: #fdba74; }
.shell-fng[data-level="neutral"] { border-color: rgba(148,163,184,.28); }
.shell-fng[data-level="neutral"] .shell-fng-dot { background: #94a3b8; color: #94a3b8; }
.shell-fng[data-level="greed"] { border-color: rgba(74,222,128,.32); }
.shell-fng[data-level="greed"] .shell-fng-dot { background: #4ade80; color: #4ade80; }
.shell-fng[data-level="greed"] .shell-fng-value { color: #86efac; }
.shell-fng[data-level="extreme-greed"] { border-color: rgba(16,185,129,.4); }
.shell-fng[data-level="extreme-greed"] .shell-fng-dot { background: #10b981; color: #10b981; }
.shell-fng[data-level="extreme-greed"] .shell-fng-value { color: #6ee7b7; }

/* Light-mode overrides */
html.light .shell-tick, html.light .shell-fng {
  background: linear-gradient(180deg, rgba(0,0,0,.03), rgba(0,0,0,.01)) !important;
  border-color: rgba(0,0,0,.1) !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.05), inset 0 1px 1px rgba(255,255,255,.6) !important;
}
html.light .shell-tick-code, html.light .shell-fng-label { color: rgba(10,10,10,.55) !important; }
html.light .shell-tick-price, html.light .shell-fng-value { color: #0A0A0A !important; }

/* Hide market block on narrow screens so topbar stays usable */
/* Progressive shrink as topbar gets narrower — hide F&G first (least
   critical), then ETH ticker, then the entire bar. BTC stays longest. */
@media (max-width: 1200px) { .shell-fng { display: none; } }
@media (max-width: 1024px) { #tickEth { display: none; } }
@media (max-width: 900px)  { .shell-market { display: none; } }

/* Mid-range responsive (1024-1500 px): keep the topbar from spilling
   off-screen by tightening padding + reducing the BTC/ETH ticker
   gap. Also lets stat-card grids breathe. */
@media (max-width: 1500px) {
  .topbar { padding: 0 16px; }
  .topbar-actions { gap: 8px; }
  .main-content { padding-left: 24px; padding-right: 24px; }
}
@media (max-width: 1300px) {
  .topbar { padding: 0 12px; }
  .topbar-actions { gap: 6px; }
  .main-content { padding-left: 16px; padding-right: 16px; }
  /* Drop the search-pill width so it doesn't push action buttons off-screen */
  .topbar-search { max-width: 220px; }
  .stat-card { padding: 18px; }
  .stat-card-icon { width: 36px; height: 36px; }
}

/* ── Dashboard action bar: status pill + Quick Trade + Pause all ──
 * Premium glass-pill system. No saturated gradients, no emoji glyphs,
 * no border-glow rings. Typography: tight Inter 13px / 600. Icons are
 * stroke-only (1.7px) so the row reads as a single design language.
 */
.chm-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 18px 0 16px;
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--radius-pill);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -.005em;
  color: rgba(226,232,240,.82);
  white-space: nowrap;
  transition: border-color .2s ease, background .2s ease;
}
.chm-status:hover {
  border-color: rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
}
.chm-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  flex-shrink: 0;
  position: relative;
}
/* Subtle pulse halo (instead of the old shadow blur) — feels more techy */
.chm-status-dot::after {
  content: ''; position: absolute; inset: -3px;
  border-radius: 50%; background: inherit;
  opacity: .35; animation: chmHalo 2.6s ease-in-out infinite;
}
@keyframes chmHalo {
  0%, 100% { transform: scale(1);   opacity: .35; }
  50%      { transform: scale(1.7); opacity: 0; }
}
.chm-status[data-state="ok"]      { color: #d1fae5; }
.chm-status[data-state="ok"]      .chm-status-dot { background: #34d399; }
.chm-status[data-state="warn"]    { color: #fde68a; }
.chm-status[data-state="warn"]    .chm-status-dot { background: #f59e0b; }
.chm-status[data-state="down"]    { color: #fecaca; }
.chm-status[data-state="down"]    .chm-status-dot { background: #ef4444; }
.chm-status[data-state="loading"] .chm-status-dot { background: #64748b; }
.chm-status[data-state="loading"] .chm-status-dot::after { display: none; }

/* Action pills — primary (Quick Trade) and secondary (Pause all). */
.chm-action {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-pill);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -.005em;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .18s cubic-bezier(.4,0,.2,1), background .18s ease, box-shadow .18s ease, border-color .18s ease;
  line-height: 1;
  position: relative;
  isolation: isolate;
}
.chm-action svg { flex-shrink: 0; opacity: .92; }
.chm-action:active { transform: translateY(0) scale(.98); }
.chm-action:focus-visible { outline: 2px solid rgba(255,255,255,.35); outline-offset: 3px; }

/* Primary — refined amber. Minimal gradient, single inset highlight,
   single soft warm shadow. No border ring, no rim glow — those look
   loud at retail size. */
.chm-action-primary {
  background: linear-gradient(180deg, #FF9059 0%, #FF6A1F 60%, #D94A0F 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.32),
    0 1px 2px rgba(120,40,0,.3),
    0 8px 20px -8px rgba(255,90,31,.55);
}
.chm-action-primary:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #FFA070 0%, #FF7A30 60%, #E45A1A 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.4),
    0 2px 4px rgba(120,40,0,.32),
    0 12px 26px -6px rgba(255,90,31,.7);
}
.chm-action-primary svg { color: rgba(255,255,255,.98); }

/* Secondary danger — dark slate with restrained red. Pause is a safety
   action, not a celebration; should read as "considered" not "alarming". */
.chm-action-danger {
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.01));
  border: 1px solid rgba(248,113,113,.32);
  color: #fca5a5;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.chm-action-danger:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(248,113,113,.12), rgba(248,113,113,.02));
  border-color: rgba(248,113,113,.5);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 6px 16px -6px rgba(239,68,68,.4);
}
.chm-action-danger svg { color: currentColor; }

/* Light mode overrides */
/* ── Premium chart range selector (segmented control + toggle) ── */
.chm-seg {
  display: inline-flex;
  align-items: center;
  padding: 5px;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 9999px;
  gap: 2px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 1px 3px rgba(0,0,0,.2);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
}
.chm-seg-btn {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -.005em;
  color: rgba(226,232,240,.55);
  background: transparent;
  border: 0;
  padding: 7px 16px;
  border-radius: 9999px;
  cursor: pointer;
  transition: color .15s ease, background .15s ease, transform .15s ease;
  white-space: nowrap;
  line-height: 1;
}
.chm-seg-btn:hover { color: rgba(255,255,255,.95); background: rgba(255,255,255,.04); }
.chm-seg-btn.active {
  color: #fff;
  background: linear-gradient(180deg, rgba(255,140,90,.22), rgba(255,90,31,.08));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 2px 6px -1px rgba(255,90,31,.4), 0 0 0 1px rgba(255,140,90,.32);
}
.chm-seg-divider {
  width: 1px; height: 22px; background: rgba(255,255,255,.1); margin: 0 6px;
}
.chm-seg-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  border-radius: 9999px;
  cursor: pointer;
  user-select: none;
  transition: background .15s ease;
}
.chm-seg-toggle:hover { background: rgba(255,255,255,.04); }
.chm-seg-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.chm-seg-toggle-track {
  width: 26px; height: 14px; border-radius: 9999px;
  background: rgba(255,255,255,.1);
  position: relative; transition: background .18s ease;
  flex-shrink: 0;
}
.chm-seg-toggle-thumb {
  position: absolute; top: 1px; left: 1px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff;
  transition: transform .18s cubic-bezier(.4,0,.2,1), background .18s ease;
}
.chm-seg-toggle input:checked ~ .chm-seg-toggle-track { background: #FF7A30; }
.chm-seg-toggle input:checked ~ .chm-seg-toggle-track .chm-seg-toggle-thumb { transform: translateX(12px); }
.chm-seg-toggle-label {
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(226,232,240,.65);
  letter-spacing: -.005em;
}
.chm-seg-toggle:hover .chm-seg-toggle-label { color: #fff; }
html.light .chm-seg { background: rgba(0,0,0,.025); border-color: rgba(0,0,0,.06); }
html.light .chm-seg-btn { color: rgba(10,10,10,.55); }
html.light .chm-seg-btn:hover { color: rgba(10,10,10,.95); }
html.light .chm-seg-btn.active { background: #fff; color: #0A0A0A; box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 1px 3px rgba(0,0,0,.08); }
html.light .chm-seg-divider { background: rgba(0,0,0,.08); }
html.light .chm-seg-toggle-track { background: rgba(0,0,0,.1); }
html.light .chm-seg-toggle-label { color: rgba(10,10,10,.65); }

/* ── Calendar / chart legend — glass chip per item ── */
.chm-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-family: 'Inter', sans-serif;
}
.chm-legend-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: 9999px;
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(255,255,255,.07);
  font-size: 11px; font-weight: 600;
  color: rgba(226,232,240,.78);
  letter-spacing: -.005em;
  line-height: 1;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease;
}
.chm-legend-item:hover { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.14); }
.chm-legend-sw {
  width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}
.chm-legend-sw-up   { background: linear-gradient(180deg, #6ee7a8, #34d399); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 0 6px rgba(52,211,153,.4); }
.chm-legend-sw-down { background: linear-gradient(180deg, #fca5a5, #ef4444); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 0 6px rgba(239,68,68,.4); }
.chm-legend-sw-flat { background: linear-gradient(180deg, rgba(148,163,184,.4), rgba(100,116,139,.3)); }
html.light .chm-legend-item { background: rgba(0,0,0,.03); border-color: rgba(0,0,0,.07); color: rgba(10,10,10,.7); }
html.light .chm-legend-item:hover { background: rgba(0,0,0,.05); border-color: rgba(0,0,0,.12); }

/* ── Compact "ghost" link pill (e.g. "Все →" / "Вся история →") ── */
.chm-link-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px;
  border-radius: 9999px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  font-family: 'Inter', sans-serif;
  font-size: 11.5px; font-weight: 600;
  color: rgba(255,140,90,.86);
  text-decoration: none;
  letter-spacing: -.005em;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.chm-link-pill:hover {
  background: rgba(255,90,31,.1);
  border-color: rgba(255,140,90,.32);
  color: #fff;
  transform: translateX(2px);
}
.chm-link-pill svg { opacity: .85; }
html.light .chm-link-pill { background: rgba(255,90,31,.05); border-color: rgba(255,90,31,.18); color: #C44610; }
html.light .chm-link-pill:hover { color: #fff; background: linear-gradient(180deg,#FF7840,#FF5A1F); border-color: rgba(255,90,31,.5); }

/* ── Count pill (e.g. "0" next to "Открытые позиции") ── */
.chm-count-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 22px;
  padding: 0 8px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 9999px;
  font-family: 'JetBrains Mono', 'Inter', monospace;
  font-size: 11px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: rgba(226,232,240,.7);
  letter-spacing: -.01em;
}
html.light .chm-count-pill {
  background: rgba(0,0,0,.04); border-color: rgba(0,0,0,.07); color: rgba(10,10,10,.7);
}

/* ── Premium empty state for dashboard cards ── */
.dash-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 18px 24px;
  text-align: center;
  gap: 8px;
}
.dash-empty.dash-empty-sm { padding: 18px 12px; gap: 4px; }
.dash-empty-ic {
  width: 44px; height: 44px;
  border-radius: 12px;
  background:
    radial-gradient(80% 80% at 50% 0%, rgba(255,140,90,.18), transparent 70%),
    linear-gradient(160deg, rgba(255,255,255,.04), rgba(255,255,255,.01));
  border: 1px solid rgba(255,140,90,.22);
  color: #FFB28A;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 6px 16px -8px rgba(255,90,31,.4);
}
.dash-empty-title {
  font-family: 'Inter', sans-serif;
  font-size: 13.5px; font-weight: 600;
  color: rgba(255,255,255,.85);
  letter-spacing: -.01em;
}
.dash-empty-sub {
  font-family: 'Inter', sans-serif;
  font-size: 11.5px; font-weight: 500;
  color: rgba(255,255,255,.5);
  line-height: 1.5;
  max-width: 260px;
}
.dash-empty-cta {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-family: 'Inter', sans-serif;
  font-size: 11.5px; font-weight: 600;
  color: #FFB28A;
  background: rgba(255,90,31,.08);
  border: 1px solid rgba(255,140,90,.28);
  text-decoration: none;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.dash-empty-cta:hover {
  background: rgba(255,90,31,.16);
  color: #fff;
  transform: translateY(-1px);
}
html.light .dash-empty-title { color: rgba(10,10,10,.85); }
html.light .dash-empty-sub { color: rgba(10,10,10,.55); }
html.light .dash-empty-ic { color: #C44610; }
html.light .dash-empty-cta { color: #C44610; }
html.light .dash-empty-cta:hover { color: #fff; background: linear-gradient(180deg,#FF7840,#FF5A1F); border-color: rgba(255,90,31,.5); }

/* Light mode overrides */
html.light .chm-status {
  background: rgba(0,0,0,.025) !important;
  border-color: rgba(0,0,0,.08) !important;
  color: rgba(10,10,10,.75) !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), inset 0 1px 1px rgba(255,255,255,.6) !important;
}
html.light .chm-status[data-state="ok"]   { border-color: rgba(22,163,74,.35) !important; color: #166534 !important; }
html.light .chm-status[data-state="warn"] { border-color: rgba(202,138,4,.35) !important; color: #854d0e !important; }
html.light .chm-status[data-state="down"] { border-color: rgba(220,38,38,.35) !important; color: #991b1b !important; }
/* Older .topbar-notification / .topbar-avatar / .shell-topbar-btn light-mode
   rules removed — the unified block above (lines ~417-545) now handles all
   four topbar buttons consistently. */
.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01));
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.topbar-user:hover { background: rgba(255,255,255,0.06); border-color: var(--border-light); }
.topbar-username { font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, 0.92); }

/* --- Main Content Area (Dashboard pages) --- */
.main-content {
  margin-left: 260px;
  margin-top: 64px;
  padding: 28px;
  min-height: calc(100vh - 64px);
}

/* --- Stat Cards --- */
.stat-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  backdrop-filter: blur(var(--blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.06);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .5s var(--ease);
}
.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-light);
}
.stat-card-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  box-shadow: inset 0 1px 1px rgba(255,255,255,.08), inset 0 -1px 2px rgba(0,0,0,.5);
  color: #FF8C5A;
}
.stat-card-value {
  font-family: var(--font-sans);
  /* clamp shrinks the number on narrow grid cells (1200-1400 px range,
     where 4 columns squeeze each card to ~250 px). Was a fixed 30 px,
     which pushed values like "$1,386.36 · 13.9%" into a second line. */
  font-size: clamp(20px, 1.85vw, 30px);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: #fff;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}
.stat-card-label {
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 17px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.stat-card-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
}
.stat-card-trend.up { color: #99AF9F; }
.stat-card-trend.down { color: #C8B9B9; }

/* --- Tables --- */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 20px 25px -5px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
}
thead { background: rgba(255, 255, 255, 0.025); }
th {
  text-align: left;
  padding: 14px 18px;
  font-weight: 500;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  white-space: nowrap;
}
td {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.86);
}
tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* --- Toggle Switch --- */
.toggle {
  position: relative;
  width: 46px;
  height: 26px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 9999px;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}
.toggle.active, .toggle.on {
  background: var(--gradient-primary);
  border-color: rgba(255,140,90, 0.45);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255,90,31, 0.3), 0 0 12px rgba(255,90,31, 0.35);
}
.toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), inset 0 -1px 1px rgba(0, 0, 0, 0.1);
  transition: transform var(--transition-fast);
}
.toggle.active::after, .toggle.on::after { transform: translateX(20px); }

/* --- Progress Bar --- */
.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 9999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}
.progress-bar-fill {
  height: 100%;
  border-radius: 9999px;
  background: var(--gradient-primary);
  box-shadow: 0 0 12px rgba(255,90,31, 0.5);
  transition: width var(--transition-slow);
}

/* --- Modals --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)), var(--bg-card-solid);
  backdrop-filter: blur(var(--blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.4);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: min(520px, 90vw);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 30px 60px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  transform: translateY(20px);
  transition: transform var(--transition-normal);
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.modal-header h2, .modal-header h3 { font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: -0.025em; }
.modal-close {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.modal-close:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

/* --- Tabs --- */
.tabs {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}
.tab {
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
}
.tab:hover { color: #fff; }
.tab.active {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), inset 0 -1px 2px rgba(0, 0, 0, 0.4), 0 4px 10px -2px rgba(255,90,31, 0.5);
}

/* --- Pulse Animation --- */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.pulse { animation: pulse 2s infinite; }

/* --- Skeleton Loading --- */
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.skeleton {
  background: var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
  animation: shimmer 1.5s infinite;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.16); }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .topbar { left: 0; }
  .main-content { margin-left: 0; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .topbar-search { display: none; }
  .main-content { padding: 18px; }
  .card { padding: 18px; }
  .toast-container { top: 72px; left: 12px; right: 12px; }
  .toast { min-width: 0; width: 100%; }
}

/* --- Toasts / Notifications --- */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)), var(--bg-card-solid);
  backdrop-filter: blur(var(--blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.4);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 25px 50px -12px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.08);
  animation: slideIn 0.3s var(--ease);
  min-width: 300px;
}
.toast.success { border-left: 3px solid #66876E; }
.toast.error   { border-left: 3px solid #826262; }
.toast.warning { border-left: 3px solid #FF8C5A; }
@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* --- Liquid Glass Effect --- */
.liquid-glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  backdrop-filter: blur(var(--blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .5s var(--ease);
}
.liquid-glass::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  pointer-events: none;
}
.liquid-glass:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 30px 60px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}
.liquid-glass-strong {
  background: linear-gradient(180deg, rgba(255,90,31, 0.14), rgba(255,90,31, 0.04) 60%, rgba(10, 10, 10, 0.6));
  backdrop-filter: blur(var(--blur)) saturate(1.5);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.5);
  border: 1px solid rgba(255,140,90, 0.35);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 30px 60px rgba(255,90,31, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.12);
}

/* --- Confidence Bar --- */
.confidence-bar {
  height: 6px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}
.confidence-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width var(--transition-slow);
}
.confidence-bar-fill.high   { background: linear-gradient(90deg, #66876E, #2B5936); box-shadow: 0 0 10px rgba(43, 89, 54, 0.5); }
.confidence-bar-fill.medium { background: linear-gradient(90deg, #FF8C5A, #FF5A1F); box-shadow: 0 0 10px rgba(255,90,31, 0.4); }
.confidence-bar-fill.low    { background: linear-gradient(90deg, #826262, #522525); box-shadow: 0 0 10px rgba(82, 37, 37, 0.4); }

/* --- Tailwind radii overrides (normalize to our system 12/16/24/9999) --- */
.rounded-md  { border-radius: 12px !important; }
.rounded-lg  { border-radius: 12px !important; }
.rounded-xl  { border-radius: 16px !important; }
.rounded-2xl { border-radius: 24px !important; }
.rounded-3xl { border-radius: 24px !important; }

/* --- Tailwind utility colour overrides (legacy slate/indigo → new palette) --- */
.bg-slate-700, .bg-slate-700\/50, .bg-slate-800, .bg-slate-800\/30, .bg-slate-800\/50, .bg-slate-900, .bg-slate-900\/50 { background-color: rgba(255, 255, 255, 0.04) !important; }
.border-slate-700, .border-slate-800, .border-slate-800\/50, .border-slate-900 { border-color: rgba(255, 255, 255, 0.08) !important; }
.bg-indigo-500, .bg-indigo-600 { background-color: #FF5A1F !important; }
.bg-indigo-500\/10, .bg-indigo-500\/20, .bg-indigo-600\/10 { background-color: rgba(255,90,31, 0.18) !important; }
.bg-slate-500\/10, .bg-slate-500\/15 { background-color: rgba(255, 255, 255, 0.04) !important; }
.text-indigo-300, .text-indigo-400, .text-indigo-500 { color: #FF8C5A !important; }
.text-cyan-400, .text-cyan-300 { color: #FF8C5A !important; }
.text-purple-400 { color: #FF8C5A !important; }
.text-emerald-400, .text-green-400 { color: #99AF9F !important; }
.text-red-400, .text-rose-400 { color: #C8B9B9 !important; }
.text-amber-400, .text-yellow-400 { color: #C8B9B9 !important; }
.text-slate-300, .text-slate-400, .text-slate-500 { color: rgba(255, 255, 255, 0.62) !important; }
.text-slate-600, .text-slate-700 { color: rgba(255, 255, 255, 0.38) !important; }
.bg-emerald-500, .bg-green-500, .bg-emerald-500\/10, .bg-green-500\/10 { background-color: rgba(43, 89, 54, 0.28) !important; }
.bg-red-500, .bg-rose-500, .bg-red-500\/10, .bg-rose-500\/10 { background-color: rgba(82, 37, 37, 0.32) !important; }
.from-indigo-500, .to-indigo-500, .via-indigo-500 { --tw-gradient-from: #FF5A1F !important; --tw-gradient-to: #FF5A1F !important; }

/* ── Help tips (?-icon + popover) ──────────────────────────────────────
   Used everywhere there is a metric or term that may confuse a beginner.
   Markup is generated by help-tips.js — author-side just adds
   data-help="key" to the label element (key resolves in HELP_TEXTS),
   or data-help-text="..." for one-off custom copy.
*/
.help-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 5px;
  padding: 0;
  border: 0;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.55);
  border-radius: 50%;
  cursor: help;
  vertical-align: middle;
  transition: background .15s, color .15s, transform .15s;
  outline: none;
  flex-shrink: 0;
}
/* Center the ?-icon on the label baseline ONLY for label-style hosts.
   The earlier `*:has(> .help-tip)` was too broad and forced flex on
   the topbar account/plan pills (DEMO/Free/EN/theme), shoving the
   right-side icons out of the page. Whitelist the actual label
   containers instead — stat-card-label, bp-stat-label, table headers,
   form labels — where flex-centering is desired. */
.stat-card-label:has(> .help-tip),
.bp-stat-label:has(> .help-tip),
th:has(> .help-tip),
label:has(> .help-tip),
h2:has(> .help-tip),
h3:has(> .help-tip) {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.stat-card-label:has(> .help-tip) > .help-tip,
.bp-stat-label:has(> .help-tip) > .help-tip,
th:has(> .help-tip) > .help-tip,
label:has(> .help-tip) > .help-tip,
h2:has(> .help-tip) > .help-tip,
h3:has(> .help-tip) > .help-tip {
  margin-left: 0;
  vertical-align: baseline;
}
.help-tip:hover,
.help-tip:focus-visible {
  background: rgba(255,140,90,.22);
  color: #FF8C5A;
  transform: scale(1.08);
}
.help-tip:focus-visible {
  box-shadow: 0 0 0 3px rgba(255,90,31,.18);
}
html.light .help-tip {
  background: rgba(0,0,0,.06);
  color: rgba(10,10,10,.55);
}
html.light .help-tip:hover,
html.light .help-tip:focus-visible {
  background: rgba(255,90,31,.15);
  color: #C44610;
}

.help-tip-pop {
  position: absolute;
  z-index: 9999;
  max-width: 320px;
  padding: 12px 14px;
  background: linear-gradient(180deg,#1a1a1a 0%,#0e0e0e 100%);
  border: 1px solid rgba(255,140,90,.22);
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.55;
  color: rgba(255,255,255,.85);
  letter-spacing: .005em;
  box-shadow:
    0 1px 0 rgba(255,255,255,.06) inset,
    0 12px 32px -8px rgba(0,0,0,.65),
    0 0 0 1px rgba(255,140,90,.08);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .15s ease, transform .15s ease;
}
.help-tip-pop.show { opacity: 1; transform: translateY(0); }
.help-tip-pop.flip-up { transform: translateY(4px); }
.help-tip-pop.flip-up.show { transform: translateY(0); }
.help-tip-pop strong { color: #fff; font-weight: 600; }
.help-tip-pop a { color: #FF8C5A; text-decoration: none; }
.help-tip-pop a:hover { text-decoration: underline; }
html.light .help-tip-pop {
  background: #fff;
  border-color: rgba(255,90,31,.32);
  color: rgba(10,10,10,.85);
  box-shadow:
    0 12px 32px -8px rgba(0,0,0,.18),
    0 0 0 1px rgba(255,90,31,.1);
}
html.light .help-tip-pop strong { color: #0A0A0A; }

/* ── Avatar dropdown menu (premium consolidated nav) ──────────────────
   Replaces standalone EN / theme / bell topbar buttons with a single
   menu that drops from the avatar circle. Body marker
   `.shell-avatar-menu` (set by shell.js when injected) hides the
   redundant standalone buttons. */
body.shell-avatar-menu #shellLang,
body.shell-avatar-menu #shellTheme,
body.shell-avatar-menu .topbar-notification {
  display: none !important;
}
.avatar-menu {
  position: absolute;
  z-index: 9999;
  min-width: 260px;
  padding: 8px;
  background: linear-gradient(180deg, #161618 0%, #0e0e10 100%);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  box-shadow:
    0 1px 0 rgba(255,255,255,.05) inset,
    0 24px 48px -12px rgba(0,0,0,.7),
    0 0 0 1px rgba(255,140,90,.06);
  font-family: 'Inter', sans-serif;
  opacity: 0;
  transform: translateY(-6px) scale(.98);
  pointer-events: none;
  transition: opacity .18s cubic-bezier(.4,0,.2,1), transform .18s cubic-bezier(.4,0,.2,1);
}
.avatar-menu.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
html.light .avatar-menu {
  background: #fff;
  border-color: rgba(0,0,0,.08);
  box-shadow: 0 24px 48px -12px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.04);
}

.avatar-menu-head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  margin-bottom: 6px;
}
html.light .avatar-menu-head { border-bottom-color: rgba(0,0,0,.06); }
.avatar-menu-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #FF7840, #FF5A1F 60%, #C44610);
  color: #fff; font-weight: 600; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 4px 10px -2px rgba(255,90,31,.4);
}
.avatar-menu-id { min-width: 0; flex: 1; }
.avatar-menu-name {
  font-size: 14px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html.light .avatar-menu-name { color: #0A0A0A; }
.avatar-menu-email {
  font-size: 12px; color: rgba(255,255,255,.5);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px;
}
html.light .avatar-menu-email { color: rgba(10,10,10,.55); }

.avatar-menu-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px;
  background: transparent; border: 0; border-radius: 10px;
  color: rgba(255,255,255,.85);
  font-family: 'Inter', sans-serif; font-size: 13.5px; font-weight: 500;
  text-decoration: none; cursor: pointer;
  transition: background .15s ease, color .15s ease;
  text-align: left;
}
.avatar-menu-row:hover {
  background: rgba(255,255,255,.04);
  color: #fff;
}
html.light .avatar-menu-row { color: rgba(10,10,10,.78); }
html.light .avatar-menu-row:hover { background: rgba(0,0,0,.03); color: #0A0A0A; }
.avatar-menu-row svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .7; }
.avatar-menu-row:hover svg { opacity: 1; }
.avatar-menu-label { flex: 1; }
.avatar-menu-value {
  font-size: 12px; color: rgba(255,255,255,.55);
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}
html.light .avatar-menu-value { color: rgba(10,10,10,.5); }
.avatar-menu-badge {
  display: none;        /* shown only when count > 0 */
  min-width: 18px; height: 18px; padding: 0 6px;
  background: linear-gradient(180deg, #FF7840, #FF5A1F);
  color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 9px; align-items: center; justify-content: center;
}
.avatar-menu-divider {
  height: 1px;
  background: rgba(255,255,255,.06);
  margin: 6px 4px;
}
html.light .avatar-menu-divider { background: rgba(0,0,0,.06); }
.avatar-menu-logout { color: #fca5a5; }
.avatar-menu-logout:hover { background: rgba(239,68,68,.12); color: #fca5a5; }
html.light .avatar-menu-logout { color: #b91c1c; }
html.light .avatar-menu-logout:hover { background: rgba(239,68,68,.08); color: #b91c1c; }
