/* ==========================================================================
   REGIME, design system (mockup)
   Ciemny fintech, gęsty informacyjnie. Serif do nagłówków (powaga raportu
   analitycznego), mono do liczb (tabular figures), sans do treści.
   ========================================================================== */

:root {
  --bg: #0b0a08;
  --bg-1: #12100b;
  --bg-elevated: #171410;
  --bg-card: #17140f;
  --bg-card-hover: #1c1912;
  --bg-inset: #0f0d09;
  --border: #2b2620;
  --border-soft: #1e1b15;
  --border-strong: #4a4230;

  --text: #efe9db;
  --text-dim: #a89f8a;
  --text-faint: #6f6858;

  --accent: #d4af37;          /* sygnal / zloto, akcja */
  --accent-dim: rgba(212,175,55,.16);
  --accent-strong: #f1cf5a;
  --positive: #8fd18b;         /* zielen oliwkowa, pozytyw */
  --positive-dim: rgba(143,209,139,0.15);

  --info: #9fb4d6;            /* AI / analiza, neutralnie chlodny */
  --info-dim: rgba(159,180,214,0.14);

  --danger: #e0685f;
  --danger-dim: rgba(224,104,95,0.15);
  --flash-pos: rgba(143,209,139,0.38);
  --flash-neg: rgba(224,104,95,0.34);

  --warning: #d99a3c;
  --warning-dim: rgba(217,154,60,0.15);

  --neutral: #a89f8a;
  --neutral-dim: rgba(168,159,138,0.13);

  --font-serif: Iowan Old Style, Palatino Linotype, Palatino, Georgia, "Noto Serif", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Consolas, "Roboto Mono", monospace;

  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 14px;

  --shadow-card: 0 1px 0 rgba(255,255,255,0.02) inset, 0 8px 24px -12px rgba(0,0,0,0.6);
  --shadow-pop: 0 20px 60px -20px rgba(0,0,0,0.7);

  --sidebar-w: 232px;

  /* Kolory wykresów canvas (siatka, osie, linia zera, etykiety), czytane w JS
     przez getComputedStyle zamiast zaszytych na sztywno rgba(255,255,255,…),
     żeby wykresy podążały za motywem ciemny/jasny bez przeładowania strony. */
  --chart-grid: rgba(241,207,90,0.05);
  --chart-grid-strong: rgba(241,207,90,0.16);
  --chart-zero: rgba(212,175,55,0.30);
  --chart-tick: rgba(241,207,90,0.09);
  --chart-tick-strong: rgba(241,207,90,0.17);
  --chart-tick-soft: rgba(241,207,90,0.07);
  --chart-axis-text: rgba(168,159,138,0.9);
  --chart-axis-text-soft: rgba(168,159,138,0.85);
  --chart-veil: rgba(241,207,90,0.02);
  --chart-crosshair: rgba(241,231,219,0.55);
  --chart-label-soft: rgba(239,233,219,0.55);
  --chart-needle: #efe9db;
  --chart-mc-shadow: rgba(159,180,214,0.06);

  /* Dolny koniec gradientu sidebara, zaszyty osobno bo #0a0b10 nie jest
     żadną wartością z palety (ciemniejszy niż --bg), tylko celowym
     pogłębieniem cienia u dołu panelu. */
  --sidebar-fade: #0a0906;
}

/* ==========================================================================
   TRYB JASNY, html[data-theme="light"]
   Komplet nadpisań zmiennych z :root. Biel złamana, karty białe, tekst
   grafitowy, bordery subtelne. Akcenty przyciemnione względem wersji ciemnej
   (limonka na bieli słabo kontrastuje), warianty akcentu z drawera mają
   osobne, jasno-motywowe wartości w app.js (HQ_ACCENTS_LIGHT).
   ========================================================================== */

html[data-theme="light"] {
  color-scheme: light;

  --bg: #f8f6f0;
  --bg-1: #f1ede2;
  --bg-elevated: #fffdf8;
  --bg-card: #fffdf8;
  --bg-card-hover: #f3efe4;
  --bg-inset: #f1ede1;
  --border: #e3dcc9;
  --border-soft: #ece6d7;
  --border-strong: #c9bd9c;

  --text: #1d1a14;
  --text-dim: #5c5644;
  --text-faint: #837c68;

  --accent: #a8860b;
  --accent-dim: rgba(168,134,11,0.14);
  --accent-strong: #8a6c08;
  --positive: #4f7a49;
  --positive-dim: rgba(79,122,73,0.14);

  --info: #4f6f9f;
  --info-dim: rgba(79,111,159,0.12);

  --danger: #b8483f;
  --danger-dim: rgba(184,72,63,0.12);
  --flash-pos: rgba(95,138,89,0.28);
  --flash-neg: rgba(184,72,63,0.24);

  --warning: #a1650a;
  --warning-dim: rgba(161,101,10,0.12);

  --neutral: #726b58;
  --neutral-dim: rgba(114,107,88,0.10);

  --shadow-card: 0 1px 0 rgba(255,255,255,0.7) inset, 0 8px 24px -14px rgba(58,49,20,0.14);
  --shadow-pop: 0 20px 60px -20px rgba(58,49,20,0.22);

  --chart-grid: rgba(58,49,20,0.07);
  --chart-grid-strong: rgba(58,49,20,0.15);
  --chart-zero: rgba(168,134,11,0.32);
  --chart-tick: rgba(58,49,20,0.10);
  --chart-tick-strong: rgba(58,49,20,0.20);
  --chart-tick-soft: rgba(58,49,20,0.06);
  --chart-axis-text: rgba(70,63,45,0.85);
  --chart-axis-text-soft: rgba(70,63,45,0.72);
  --chart-veil: rgba(58,49,20,0.035);
  --chart-crosshair: rgba(58,49,20,0.55);
  --chart-label-soft: rgba(46,40,26,0.62);
  --chart-needle: #2e281a;
  --chart-mc-shadow: rgba(79,111,159,0.08);
  --sidebar-fade: #ece5d3;
}

/* Elementy z kolorami zaszytymi na sztywno (nie zmienną), które inaczej
   zostałyby nieczytelne na jasnym tle: banner AI (jasnoniebieski tekst na
   prawie białym tle) i poważna flaga ryzyka (jasnoróżowy tekst). */
html[data-theme="light"] .ai-banner { color: #6b5308; }
html[data-theme="light"] .ai-banner strong { color: #4a3a05; }
html[data-theme="light"] .flag-item.severe { color: #7a1421; }
html[data-theme="light"] .btn:hover { border-color: #b7bcc9; }
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #9aa0b0; }

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(ellipse 900px 500px at 85% -10%, rgba(159,180,214,0.07), transparent 60%),
    radial-gradient(ellipse 700px 500px at -5% 20%, rgba(212,175,55,0.04), transparent 55%);
  background-attachment: fixed;
}

/* subtle grain overlay for texture without external assets */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.025;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; margin: 0; letter-spacing: 0.2px; }

a { color: inherit; text-decoration: none; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

::selection { background: var(--accent-dim); color: var(--accent-strong); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #444a63; }

/* ---------------------------------------------------------------- Layout */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, var(--bg-1), var(--sidebar-fade) 60%);
  border-right: 1px solid var(--border-soft);
  padding: 22px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px;
}

.brand-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: conic-gradient(from 220deg, var(--accent), var(--accent-strong) 40%, var(--positive) 70%, var(--accent));
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 6px 16px -6px rgba(212,175,55,0.35);
}
.brand-mark::after {
  content: "";
  position: absolute; inset: 5px;
  background: var(--bg-1);
  border-radius: 4px;
  clip-path: polygon(0 100%, 30% 40%, 55% 65%, 78% 20%, 100% 45%, 100% 100%);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--font-serif); font-size: 17px; letter-spacing: 0.5px; }
.brand-text span { font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 1.4px; }
.brand-text .brand-author {
  font-size: 9.5px; text-transform: none; letter-spacing: 0.2px;
  color: var(--text-faint); opacity: 0.75; margin-top: 3px;
  font-family: var(--font-sans); font-weight: 500;
}

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  width: fit-content;
  margin: 0 6px;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 3px var(--warning-dim); animation: pulse-dot 2.4s ease-in-out infinite; }
.status-pill.live .status-dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.status-pill strong { color: var(--text); }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

nav.primary-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }

.nav-section-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--text-faint); padding: 10px 10px 6px;
}

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 500;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-link:hover { background: var(--bg-card); color: var(--text); }
.nav-link.active { background: var(--bg-card); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.nav-link.active::before {
  content: "";
  position: absolute; left: -16px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 16px; border-radius: 3px;
  background: var(--accent);
}
.nav-link .icon { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.9; }
.nav-link .badge-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 999px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px 10px 2px;
  border-top: 1px solid var(--border-soft);
  display: flex; flex-direction: column; gap: 8px;
}
.capital-mini { display: flex; justify-content: space-between; align-items: baseline; }
.capital-mini .label { font-size: 10.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 1px; }
.capital-mini .value { font-family: var(--font-mono); font-size: 15px; color: var(--text); }
.capital-mini .value small { color: var(--text-faint); font-size: 10px; }

.main {
  min-width: 0;
  padding: 26px 34px 60px;
}

.topbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 26px;
  gap: 20px;
  flex-wrap: wrap;
}

.page-title { font-size: 25px; }
.page-sub { color: var(--text-dim); font-size: 13px; margin-top: 6px; max-width: 62ch; }

.topbar-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ------------------------------------------------------------- Buttons */

.btn {
  font-family: var(--font-sans);
  font-size: 13px; font-weight: 600;
  padding: 9px 15px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { background: var(--bg-card-hover); border-color: #454a63; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #241b04; }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }

.btn-danger { background: transparent; border-color: rgba(224,104,95,0.4); color: var(--danger); }
.btn-danger:hover { background: var(--danger-dim); border-color: var(--danger); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover { background: var(--bg-card); color: var(--text); }

.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* --------------------------------------------------------------- Cards */

.grid { display: grid; gap: 18px; }
.grid > * { min-width: 0; }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-span-2 { grid-column: span 2; }
.grid-span-3 { grid-column: span 3; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 20px;
}
.card-flush { padding: 0; overflow: hidden; }

.card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 14px; gap: 12px;
}
.card-head h3 { font-size: 14.5px; }
.card-head .hint { font-size: 11.5px; color: var(--text-faint); margin-top: 3px; }

.card-eyebrow {
  font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 4px; display: block;
}

/* ------------------------------------------------------------ Stat tile */

.stat-tile { display: flex; flex-direction: column; gap: 8px; }
.stat-tile .stat-value {
  font-family: var(--font-mono); font-size: 27px; color: var(--text);
  letter-spacing: -0.5px;
}
.stat-tile .stat-value.positive { color: var(--accent); }
.stat-tile .stat-value.negative { color: var(--danger); }
.stat-tile .stat-delta { font-size: 12px; font-family: var(--font-mono); display: flex; align-items: center; gap: 5px; }
.stat-tile .stat-delta.positive { color: var(--accent); }
.stat-tile .stat-delta.negative { color: var(--danger); }
.stat-tile .stat-delta.neutral { color: var(--text-faint); }
.stat-foot { font-size: 11px; color: var(--text-faint); }

/* ------------------------------------------------------------------ Tags */

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px; font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.2px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.tag-long { background: var(--accent-dim); color: var(--accent); border-color: rgba(212,175,55,0.3); }
.tag-short { background: var(--danger-dim); color: var(--danger); border-color: rgba(224,104,95,0.3); }
.tag-info { background: var(--info-dim); color: var(--info); border-color: rgba(159,180,214,0.3); }
.tag-warning { background: var(--warning-dim); color: var(--warning); border-color: rgba(255,180,84,0.3); }
.tag-neutral { background: var(--neutral-dim); color: var(--text-dim); border-color: var(--border-strong); }
.tag-outline { background: transparent; border-color: var(--border-strong); color: var(--text-dim); }

.dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.dot-accent { background: var(--accent); }
.dot-danger { background: var(--danger); }
.dot-warning { background: var(--warning); }
.dot-info { background: var(--info); }
.dot-neutral { background: var(--text-faint); }

/* ------------------------------------------------------------------ Table */

table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table th {
  text-align: left; font-weight: 600; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-faint);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
table.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
  color: var(--text);
}
table.data-table tbody tr { transition: background 0.12s ease; }
table.data-table tbody tr:hover { background: var(--bg-card-hover); }
table.data-table tbody tr:last-child td { border-bottom: none; }
.table-scroll { overflow-x: auto; }
/* table-fit: tabela ma się zmieścić w karcie, nadmiar tekstu przycinany wielokropkiem */
table.data-table.table-fit { table-layout: fixed; width: 100%; }
table.data-table.table-fit th,
table.data-table.table-fit td {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding-left: 12px; padding-right: 12px;
}
table.data-table.table-fit .tag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.text-pos { color: var(--accent); }
.text-neg { color: var(--danger); }
.text-dim { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }

.asset-cell { display: flex; align-items: center; gap: 9px; }
.asset-glyph {
  width: 26px; height: 26px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  background: var(--bg-inset); border: 1px solid var(--border-strong);
  color: var(--text-dim);
}

/* ------------------------------------------------------------------ Meter */

.meter { height: 6px; border-radius: 4px; background: var(--bg-inset); overflow: hidden; border: 1px solid var(--border-soft); }
.meter > span { display: block; height: 100%; border-radius: 4px; }
.meter.risk-low > span { background: var(--accent); }
.meter.risk-med > span { background: var(--warning); }
.meter.risk-high > span { background: var(--danger); }

/* ------------------------------------------------------------------ Badges for regime states */

.regime-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px; font-weight: 700;
  border: 1px solid transparent;
}
.regime-down { background: var(--danger-dim); color: var(--danger); border-color: rgba(224,104,95,0.35); }
.regime-up { background: var(--accent-dim); color: var(--accent); border-color: rgba(212,175,55,0.35); }
.regime-side { background: var(--neutral-dim); color: var(--text-dim); border-color: var(--border-strong); }

/* ------------------------------------------------------------ Capability strip */

.capability-strip {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px;
  margin-bottom: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  background: var(--bg-inset);
  font-size: 12px; color: var(--text-dim);
}
.cap-item { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.cap-sep { color: var(--text-faint); }

/* ------------------------------------------------------------------ AI banner */

.ai-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--info-dim), transparent 90%);
  border: 1px solid rgba(159,180,214,0.28);
  font-size: 12.5px;
  color: #d7e2f0;
}
.ai-banner strong { color: #fff; }
.ai-banner .ai-glyph {
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #c9d6ea, var(--info));
  flex-shrink: 0;
  box-shadow: 0 0 14px rgba(159,180,214,0.5);
  position: relative;
}
.ai-banner .ai-glyph::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.4);
  animation: ring-pulse 2.6s ease-out infinite;
}
@keyframes ring-pulse {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(2.1); opacity: 0; }
}

/* ------------------------------------------------------------------ Forms */

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text); }
.field .field-hint { font-size: 11.5px; color: var(--text-faint); }
.field input[type="text"], .field input[type="number"], .field input[type="password"], .field select {
  font-family: var(--font-mono);
  background: var(--bg-inset);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  width: 100%;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--info); box-shadow: 0 0 0 3px var(--info-dim); }
.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }

.slider-row { display: flex; align-items: center; gap: 14px; }
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 4px; border-radius: 4px;
  background: var(--border-strong);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent);
  border: 2px solid #241b04;
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(212,175,55,0.25);
}
.slider-value { font-family: var(--font-mono); font-size: 13px; min-width: 52px; text-align: right; color: var(--text); }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--border-soft);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-copy strong { display: block; font-size: 13px; }
.toggle-copy span { font-size: 11.5px; color: var(--text-faint); }

.switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px;
  transition: background 0.15s ease; cursor: pointer;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #cfd2db; transition: transform 0.15s ease;
}
.switch input:checked + .track { background: var(--accent-dim); box-shadow: inset 0 0 0 1px var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); background: var(--accent); }

.mode-select { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mode-option {
  border: 1px solid var(--border-strong);
  background: var(--bg-inset);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.mode-option.selected { border-color: var(--accent); background: var(--accent-dim); }
.mode-option h4 { font-size: 13px; margin-bottom: 5px; font-family: var(--font-sans); }
.mode-option p { font-size: 11.5px; color: var(--text-faint); margin: 0; }
.mode-option .mode-radio {
  width: 15px; height: 15px; border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  margin-bottom: 10px; position: relative;
}
.mode-option.selected .mode-radio { border-color: var(--accent); }
.mode-option.selected .mode-radio::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent);
}

/* ------------------------------------------------------------------ Misc */

.divider { height: 1px; background: var(--border-soft); margin: 22px 0; border: none; }

.kv-list { display: flex; flex-direction: column; gap: 11px; }
.kv-row { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; }
.kv-row .k { color: var(--text-faint); }
.kv-row .v { font-family: var(--font-mono); color: var(--text); }

.footer-note {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--text-faint);
  flex-wrap: wrap; gap: 8px;
}
.footer-note .disclaimer { max-width: 60ch; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-dim); }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-swatch { width: 10px; height: 3px; border-radius: 2px; }

.tooltip-note {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--bg-inset);
}

.reason-text { font-size: 12.5px; color: var(--text-dim); line-height: 1.6; }

.flag-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.flag-item {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12px; color: var(--text-dim);
  padding: 8px 10px;
  background: var(--bg-inset);
  border-radius: 6px;
  border: 1px solid var(--border-soft);
}
.flag-item.severe { border-color: rgba(224,104,95,0.3); color: #f2c9c4; }

.section-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text-faint); margin: 30px 0 14px; display: flex; align-items: center; gap: 10px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--border-soft); }

.pnl-live { display: inline-flex; align-items: center; gap: 6px; }
.pnl-live .blip { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: pulse-dot 1.8s ease-in-out infinite; }

canvas { display: block; max-width: 100%; }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 6px 12px; border-radius: 999px; font-size: 12px;
  border: 1px solid var(--border-strong); color: var(--text-dim);
  cursor: pointer; background: var(--bg-inset);
  transition: all 0.15s ease;
}
.chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.chip:hover { color: var(--text); }

/* KUP jako domyślna perspektywa skanera, wyróżniona nawet gdy filtr nieaktywny */
.chip.chip-kup-highlight {
  border-color: rgba(212,175,55,0.45);
  color: var(--accent);
  display: inline-flex; align-items: center; gap: 6px;
}
.chip.chip-kup-highlight.active { background: var(--accent-dim); }
.chip-kup-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

/* ------------------------------------------------------------- Animations */

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.reveal { animation: fade-up 0.5s cubic-bezier(0.16,1,0.3,1) both; }
.reveal-1 { animation-delay: 0.03s; }
.reveal-2 { animation-delay: 0.08s; }
.reveal-3 { animation-delay: 0.13s; }
.reveal-4 { animation-delay: 0.18s; }
.reveal-5 { animation-delay: 0.23s; }
.reveal-6 { animation-delay: 0.28s; }

/* ------------------------------------------------------------- Responsive */

@media (max-width: 1180px) {
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-span-2, .grid-span-3 { grid-column: span 2; }
}

/* ---- Hamburger mobilny (Aurum): pod 880px pasek boczny jest szufladą
   poza ekranem zamiast pelnowysokosciowego stosu na gorze strony, zeby
   9 pozycji nawigacji nie zjadalo ekranu 390px. Przelacznik .is-open na
   .sidebar dokladany/zdejmowany przez core.js. */
.au-hamburger {
  display: none;
  align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}
.au-hamburger svg { width: 18px; height: 18px; }
.au-sidebar-scrim {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 190;
}
.au-sidebar-scrim.is-open { display: block; }

@media (max-width: 880px) {
  .app-shell { grid-template-columns: 1fr; }
  .au-hamburger { display: inline-flex; }
  .sidebar {
    position: fixed; left: 0; top: 0; height: 100vh; width: 84vw; max-width: 300px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 200;
    box-shadow: var(--shadow-pop);
  }
  .sidebar.is-open { transform: translateX(0); }
  .main { padding: 20px; }
  .grid-cols-4, .grid-cols-3, .grid-cols-2 { grid-template-columns: 1fr; }
  .grid-span-2, .grid-span-3 { grid-column: span 1; }
  /* Kilka sekcji ustawia proporcje kolumn inline (np. "2fr 1fr"), co ma
     wyższą swoistość niż reguły klasowe powyżej: na mobile i tak zawsze
     jedna kolumna. */
  .grid { grid-template-columns: 1fr !important; }
  /* Nieprzełamywalne frazy (np. "Out&#8209;of&#8209;sample") wymuszają
     min-content szerszy niż wąski ekran, więc te siatki też się składają. */
  .method-compare { grid-template-columns: 1fr 1fr; }
  .method-compare > *, .mode-select > * { min-width: 0; }
}

@media (max-width: 420px) {
  .method-compare { grid-template-columns: 1fr; }
}

/* ==========================================================================
   REGIME, upgrade wizualny: ticker live, hero, particle field, orbit,
   łuki SVG, streaming log. Zero zależności zewnętrznych.
   ========================================================================== */

/* ------------------------------------------------------------- Ticker bar */

.ticker-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 8px 8px 8px 14px;
  margin-bottom: 18px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--bg-inset);
  overflow: hidden;
}

/* ---------------------------------------------------------- MH monogram */

.mh-mono { display: block; color: var(--accent); }
.mh-badge {
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--bg-elevated);
  opacity: 0.85;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.mh-badge:hover { opacity: 1; border-color: rgba(212,175,55,0.35); }

.footer-author {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--text-faint);
}
.footer-author a { color: var(--text-dim); text-decoration: underline; text-underline-offset: 2px; }
.footer-author a:hover { color: var(--accent); }

.author-signature {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  margin: 4px 0 18px;
  border-radius: var(--radius);
  border: 1px dashed var(--border-strong);
  background: var(--bg-inset);
  font-size: 12.5px;
  color: var(--text-dim);
}
.author-signature .mh-mono { flex-shrink: 0; width: 24px; height: 18px; }
.author-signature strong { color: var(--text); font-weight: 600; }
.ticker-status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  flex-shrink: 0;
  padding: 5px 11px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700; letter-spacing: 0.8px;
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  background: var(--bg-elevated);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.ticker-status-badge .status-dot { width: 6px; height: 6px; background: var(--warning); box-shadow: 0 0 0 3px var(--warning-dim); }
.ticker-status-badge.is-live { color: var(--accent); border-color: rgba(212,175,55,0.35); background: var(--accent-dim); }
.ticker-status-badge.is-live .status-dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.ticker-status-badge.is-sim { color: var(--warning); border-color: rgba(255,180,84,0.35); background: var(--warning-dim); }
.ticker-status-badge.is-sim .status-dot { background: var(--warning); animation: pulse-dot 1.2s ease-in-out infinite; }
/* .is-stream: dane płyną WebSocketem (Binance combined stream) zamiast
   pollingu REST co 7 s, patrz wireLiveSocket w app.js. Kropka koloru --info
   zamiast --accent, żeby dało się to odróżnić na pierwszy rzut oka. */
.ticker-status-badge.is-live.is-stream .status-dot { background: var(--info); box-shadow: 0 0 0 3px rgba(159,180,214,0.3); }

.ticker-viewport { flex: 1; min-width: 0; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); }
.ticker-track { display: flex; align-items: center; gap: 26px; width: max-content; animation: ticker-scroll 34s linear infinite; }
.ticker-track:hover { animation-play-state: paused; }
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.ticker-item { display: inline-flex; align-items: baseline; gap: 7px; font-family: var(--font-mono); font-size: 12.5px; white-space: nowrap; color: var(--text-dim); text-decoration: none; cursor: pointer; }
.ticker-item .t-sym { color: var(--text); font-weight: 700; }
.ticker-item .t-price { color: var(--text); transition: color 0.4s ease; }
.ticker-item .t-chg { font-size: 11px; }
.ticker-item .t-chg.pos { color: var(--accent); }
.ticker-item .t-chg.neg { color: var(--danger); }
.ticker-item .t-price.flash-up { color: var(--accent); }
.ticker-item .t-price.flash-down { color: var(--danger); }
.ticker-item:hover { text-decoration: underline; text-underline-offset: 3px; filter: brightness(1.2); }

/* ------------------------------------------------------------- Symbole klikalne
   .sym-link, wspólna klasa dla każdego wystąpienia pary w tabelach/kartach
   linkowanego do karty instrumentu (aktywo.html?s=SYMBOL). Kolor dziedziczony
   z otoczenia, hover podświetla akcentem z cienkim podkreśleniem. */

.sym-link { color: inherit; text-decoration: none; cursor: pointer; }
.sym-link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* --------------------------------------------------------------- Hero band */

.hero-band {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  isolation: isolate;
  margin-bottom: 20px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-pop);
}
.hero-band::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,9,13,0.35) 0%, rgba(8,9,13,0.72) 55%, rgba(8,9,13,0.96) 100%);
  z-index: 0;
}
.hero-band-bg {
  position: absolute; inset: -6% -6%;
  background-size: cover;
  background-position: center;
  will-change: transform;
  z-index: -1;
  filter: saturate(1.08);
}
.hero-band-inner { position: relative; z-index: 1; padding: 54px 40px 34px; }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(30px, 4.2vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.5px;
  color: #fdfdf9;
  max-width: 16ch;
  text-shadow: 0 4px 30px rgba(0,0,0,0.5);
}
.hero-sub { color: rgba(233,234,238,0.8); font-size: 14px; max-width: 56ch; margin-top: 14px; line-height: 1.6; }

.hero-capital-row {
  display: flex; align-items: flex-end; gap: 34px; flex-wrap: wrap;
  margin-top: 30px; padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.12);
}
.hero-capital { display: flex; flex-direction: column; gap: 6px; }
.hero-capital .hc-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.4px; color: rgba(233,234,238,0.55); }
.hero-capital .hc-value { font-family: var(--font-mono); font-size: clamp(30px, 3.4vw, 44px); color: var(--accent); letter-spacing: -1px; text-shadow: 0 0 26px rgba(212,175,55,0.35); }
.hero-capital .hc-value small { font-size: 15px; color: rgba(233,234,238,0.55); font-family: var(--font-sans); font-weight: 500; margin-left: 4px; }
.hero-stat { display: flex; flex-direction: column; gap: 6px; }
.hero-stat .hs-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.4px; color: rgba(233,234,238,0.5); }
.hero-stat .hs-value { font-family: var(--font-mono); font-size: 18px; color: #fdfdf9; }

.hero-band.hero-compact .hero-band-inner { padding: 30px 32px; }
.hero-band.hero-compact .hero-title { font-size: clamp(22px, 2.6vw, 30px); max-width: none; }

/* --------------------------------------------------------- Particle field */

.particle-field { position: absolute; inset: 0; z-index: -1; opacity: 0.7; pointer-events: none; }

/* ------------------------------------------------------------ Scroll reveal */

.scroll-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1), transform 0.6s cubic-bezier(0.16,1,0.3,1);
}
.scroll-reveal.in-view { opacity: 1; transform: translateY(0); }

/* --------------------------------------------------------- Card hover glow */

.card { position: relative; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-card), 0 0 0 1px rgba(212,175,55,0.12), 0 16px 40px -18px rgba(212,175,55,0.22); }
.mode-option:hover, .source-card:hover { transform: none; }

/* -------------------------------------------------------------- Draw-in path */

.draw-in { clip-path: inset(0 100% 0 0); transition: clip-path 1.5s cubic-bezier(0.16,1,0.3,1); }
.draw-in.drawn { clip-path: inset(0 0% 0 0); }

/* ------------------------------------------------------------ Streaming log */

.stream-log {
  background: var(--bg-inset);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 12px 0;
  height: 214px;
  overflow: hidden;
  position: relative;
}
.stream-log-inner { height: 100%; overflow-y: auto; padding: 0 14px; scroll-behavior: smooth; }
.stream-log-inner::-webkit-scrollbar { width: 6px; }
.stream-line {
  display: flex; gap: 9px; align-items: baseline;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--text-dim);
  padding: 4px 0;
  animation: stream-in 0.35s ease both;
}
.stream-line .st-time { color: var(--text-faint); flex-shrink: 0; }
.stream-line .st-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
@keyframes stream-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* -------------------------------------------------------------- AI core hero */

.ai-core-wrap {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 100%; max-width: 320px; aspect-ratio: 1;
  margin: 0 auto;
}
.ai-core-img {
  width: 68%; height: 68%; border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 60px 10px rgba(159,180,214,0.35), 0 0 120px 30px rgba(212,175,55,0.12);
  animation: core-pulse 4s ease-in-out infinite;
  position: relative; z-index: 2;
}
@keyframes core-pulse {
  0%, 100% { box-shadow: 0 0 50px 6px rgba(159,180,214,0.3), 0 0 100px 24px rgba(212,175,55,0.1); }
  50% { box-shadow: 0 0 74px 16px rgba(159,180,214,0.48), 0 0 150px 40px rgba(212,175,55,0.2); }
}
.ai-orbit {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1px dashed rgba(159,180,214,0.18);
  animation: orbit-spin linear infinite;
}
.ai-orbit.o1 { inset: 6%; animation-duration: 26s; }
.ai-orbit.o2 { inset: -6%; animation-duration: 40s; animation-direction: reverse; border-color: rgba(212,175,55,0.14); }
@keyframes orbit-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.orbit-label {
  position: absolute; top: 50%; left: 50%;
  transform-origin: 0 0;
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10px; white-space: nowrap;
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  padding: 4px 9px; border-radius: 999px; color: var(--text-dim);
  animation: label-orbit linear infinite;
}
.orbit-label .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
@keyframes label-orbit { from { transform: rotate(0deg) translateX(var(--orbit-r)) rotate(0deg); } to { transform: rotate(360deg) translateX(var(--orbit-r)) rotate(-360deg); } }

/* ------------------------------------------------------------------ SVG arc */

.risk-arc-wrap { display: flex; align-items: center; gap: 14px; }
.risk-arc { flex-shrink: 0; overflow: visible; }
.risk-arc .arc-track { fill: none; stroke: var(--border-strong); stroke-width: 8; stroke-linecap: round; }
.risk-arc .arc-value { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 1.1s cubic-bezier(0.16,1,0.3,1); }
.risk-arc-label { display: flex; flex-direction: column; gap: 3px; }
.risk-arc-label .ra-pct { font-family: var(--font-mono); font-size: 20px; color: var(--text); }
.risk-arc-label .ra-name { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.8px; }

/* -------------------------------------------------------------- Flow lines */

.flow-line { stroke: rgba(159,180,214,0.55); stroke-dasharray: 5 5; animation: flow-dash 1.1s linear infinite; }
.flow-line.accent { stroke: rgba(212,175,55,0.6); }
.flow-line.slow { animation-duration: 1.8s; }
.flow-node { transition: stroke 0.3s ease; }
@keyframes flow-dash { to { stroke-dashoffset: -20; } }
.flow-counter { font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------- Methods hero band */

.method-hero-body { position: relative; z-index: 1; padding: 40px 34px; display: flex; flex-direction: column; gap: 6px; }

/* -------------------------------------------------------- Reduced motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .ticker-track { animation: none !important; }
  .hero-band-bg { transform: none !important; }
  .draw-in { clip-path: inset(0 0% 0 0) !important; }
}

@media (max-width: 880px) {
  .hero-band-inner { padding: 34px 20px 26px; }
  .hero-title { max-width: none; }
  .hero-capital-row { gap: 20px; }
  .ai-core-wrap { max-width: 220px; }
  .orbit-label { display: none; }
}

/* ==========================================================================
   REGIME, Skaner + Konsensus: tabela sortowalna, pasek trend score, głosy
   komponentów, plakietka symulacji, pasek utylizacji GPU.
   ========================================================================== */

/* ------------------------------------------------------------ Sortable th */

th.sortable-th {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 20px !important;
}
th.sortable-th::after {
  content: "";
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-bottom: 4.5px solid var(--text-faint);
  opacity: 0.5;
}
th.sortable-th:hover::after { opacity: 0.9; }
th.sortable-th.sort-asc::after {
  border-bottom: 4.5px solid var(--accent);
  border-top: none;
  opacity: 1;
}
th.sortable-th.sort-desc::after {
  border-bottom: none;
  border-top: 4.5px solid var(--accent);
  opacity: 1;
}

/* ------------------------------------------------------------ Trend score */

.trend-score-wrap { display: flex; align-items: center; gap: 8px; min-width: 108px; }
.trend-score-bar {
  width: 64px; height: 6px; border-radius: 4px;
  background: var(--bg-inset); border: 1px solid var(--border-soft);
  overflow: hidden; flex-shrink: 0;
}
.trend-score-bar > span { display: block; height: 100%; border-radius: 4px; }
.trend-score-num { font-family: var(--font-mono); font-size: 12px; width: 26px; text-align: right; flex-shrink: 0; }

/* -------------------------------------------------------------- Sim badge */

.sim-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.4px;
  color: var(--text-faint);
  border: 1px dashed var(--border-strong);
  padding: 1px 5px; border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}
.live-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.4px;
  color: var(--accent);
  border: 1px solid rgba(212,175,55,0.35);
  background: var(--accent-dim);
  padding: 1px 5px; border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ---------------------------------------------------------- Scanner header */

.scanner-count {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--text-dim);
}

/* ------------------------------------------------------------- Vote panel */

.vote-panel { display: flex; flex-direction: column; gap: 10px; }
.vote-row { display: grid; grid-template-columns: 118px 1fr 40px; align-items: center; gap: 10px; }
.vote-name { font-size: 11.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vote-bar-track {
  position: relative;
  height: 10px; border-radius: 5px;
  background: var(--bg-inset); border: 1px solid var(--border-soft);
  overflow: hidden;
}
.vote-bar-track .vote-mid { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--border-strong); }
.vote-bar-fill { position: absolute; top: 0; bottom: 0; border-radius: 5px; }
.vote-bar-fill.pos { left: 50%; background: linear-gradient(90deg, rgba(212,175,55,0.55), var(--accent)); }
.vote-bar-fill.neg { right: 50%; background: linear-gradient(270deg, rgba(224,104,95,0.55), var(--danger)); }
.vote-pct { font-family: var(--font-mono); font-size: 11px; text-align: right; color: var(--text-dim); }

.consensus-result {
  display: flex; align-items: center; gap: 18px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--bg-inset);
  border: 1px solid var(--border-soft);
  margin-top: 4px;
}
.consensus-result .cr-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-faint); }
.consensus-result .cr-value { font-family: var(--font-serif); font-size: 22px; }
.consensus-result .cr-conf { font-family: var(--font-mono); font-size: 13px; color: var(--text-dim); margin-left: auto; text-align: right; }

/* --------------------------------------------------------- GPU utilization */

.gpu-util-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.gpu-util-row .meter { flex: 1; height: 8px; }
.gpu-util-row .meter > span { background: linear-gradient(90deg, var(--info), #c9d6ea); transition: width 1.2s ease; }
.gpu-util-value { font-family: var(--font-mono); font-size: 13px; color: var(--text); min-width: 34px; text-align: right; }

/* ------------------------------------------------------------ Scale strip */

.scale-figure { display: flex; flex-direction: column; gap: 4px; }
.scale-figure .sf-value { font-family: var(--font-mono); font-size: 30px; color: var(--text); letter-spacing: -0.5px; }
.scale-figure .sf-label { font-size: 11.5px; color: var(--text-faint); }

@media (max-width: 880px) {
  .vote-row { grid-template-columns: 90px 1fr 36px; }
  .consensus-result { flex-wrap: wrap; }
}

/* ------------------------------------------------------------- Pick cards */

.picks-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.pick-card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  border-width: 1px;
}
.pick-card.is-buy { border-color: rgba(212,175,55,0.32); background: linear-gradient(160deg, rgba(212,175,55,0.07), var(--bg-card) 55%); }
.pick-card.is-short { border-color: rgba(224,104,95,0.3); background: linear-gradient(160deg, rgba(224,104,95,0.06), var(--bg-card) 55%); }

.pick-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pick-pair { display: flex; align-items: center; gap: 9px; font-family: var(--font-serif); font-size: 17px; color: var(--text); }
.pick-direction {
  font-family: var(--font-mono); font-size: 22px; font-weight: 700; letter-spacing: 0.5px;
}
.pick-direction.buy { color: var(--accent); }
.pick-direction.short { color: var(--danger); }

.pick-confidence { display: flex; flex-direction: column; gap: 5px; }
.pick-confidence-row { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.6px; }
.pick-confidence-row strong { font-family: var(--font-mono); color: var(--text); font-size: 12.5px; text-transform: none; letter-spacing: 0; }

.pick-figures { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.pick-figure { background: var(--bg-inset); border: 1px solid var(--border-soft); border-radius: 7px; padding: 9px 10px; }
.pick-figure .pf-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-faint); }
.pick-figure .pf-value { font-family: var(--font-mono); font-size: 13.5px; margin-top: 3px; color: var(--text); }
.pick-figure .pf-value.pos { color: var(--accent); }
.pick-figure .pf-value.neg { color: var(--danger); }

.pick-reason { font-size: 12px; color: var(--text-dim); line-height: 1.55; }
.pick-spark { width: 100%; }
.pick-cta {
  margin-top: auto; align-self: flex-start;
  font-size: 12px; font-weight: 600; color: var(--text-dim);
  display: inline-flex; align-items: center; gap: 5px;
}
.pick-card.is-buy .pick-cta { color: var(--accent); }
.pick-card.is-short .pick-cta { color: var(--danger); }
.pick-cta:hover { text-decoration: underline; }

.picks-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 30px 0 14px; }
.picks-head h2 { font-family: var(--font-serif); font-size: 19px; }
.picks-head .picks-scan-time { font-size: 11.5px; color: var(--text-faint); font-family: var(--font-mono); }

@media (max-width: 1180px) {
  .picks-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 880px) {
  .picks-grid { grid-template-columns: 1fr; }
  .pick-figures { grid-template-columns: 1fr 1fr 1fr; }
}

/* ============================================================ Nav: badge LIVE */
/* Znacznik przy pozycjach nawigacji wskazujących na dane pobierane na żywo
   (Derywaty, Sentyment). Odróżnia się od .badge-count (statyczna liczba)
   delikatnym pulsem, tak jak .live-badge w kartach. */

.nav-link .badge-live {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 3px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.4px;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(212,175,55,0.35);
  padding: 1px 6px; border-radius: 999px;
}
.nav-link .badge-live::before {
  content: "";
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

/* ============================================================ Widżety pulpitu */
/* Trzy karty pod "Dzisiejsze typy silnika" na pulpicie (index.html):
   Fear & Greed (LIVE, alternative.me), Funding 8h (LIVE, Binance) i
   statyczna mini-karta walidacji strategii. Logika pobierania w app.js,
   sekcja "Widżety pulpitu, dane rynkowe". */

.widget-card { display: flex; flex-direction: column; gap: 12px; }
.widget-card .card-head { margin-bottom: 0; }

.widget-fng-body { display: flex; align-items: center; gap: 14px; }
.widget-fng-arc { flex-shrink: 0; }
.widget-fng-figures { display: flex; flex-direction: column; gap: 2px; }
.widget-fng-value { font-family: var(--font-mono); font-size: 30px; color: var(--text); line-height: 1; }
.widget-fng-label { font-size: 12.5px; color: var(--text-dim); font-weight: 600; }
.widget-fng-spark { width: 100%; opacity: 0.85; }

.widget-pipeline {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.widget-pipeline-step {
  font-size: 10.5px; font-weight: 600;
  padding: 4px 8px; border-radius: 999px;
  border: 1px solid var(--border-soft);
  color: var(--text-faint);
  background: var(--bg-inset);
}
.widget-pipeline-step.is-done {
  color: var(--text-dim);
  border-color: var(--border-strong);
}
.widget-pipeline-step.is-current {
  color: #241b04;
  background: var(--accent);
  border-color: var(--accent);
}
.widget-pipeline-metric {
  display: flex; align-items: baseline; gap: 8px;
  padding-top: 4px;
}

/* ==========================================================================
   REGIME, panel preferencji pulpitu (drawer): przycisk w ticker-bar,
   overlay + panel wysuwany z prawej, przełączniki, ikonka oka przy sekcjach
   pulpitu, licznik watchlisty w sidebarze, toasty. Markup wstrzykuje app.js,
   żeby nie kopiować go do każdej strony. Gęstość/animacje/pasek notowań
   sterowane klasami na <html> (hq-density-compact, hq-motion-off,
   hq-ticker-off), nadpisywanymi bardzo wcześnie w app.js.
   ========================================================================== */

.hq-settings-btn {
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--bg-elevated);
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.hq-settings-btn svg { width: 16px; height: 16px; }
.hq-settings-btn:hover { color: var(--text); border-color: rgba(212,175,55,0.35); background: var(--bg-card-hover); }
.hq-settings-btn:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.hq-settings-btn[aria-expanded="true"] { color: var(--accent); border-color: rgba(212,175,55,0.4); background: var(--accent-dim); }

.hq-drawer-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(5,6,9,0.6);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.hq-drawer-overlay.is-open { opacity: 1; }

.hq-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 1001;
  width: min(360px, 100vw);
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
}
.hq-drawer.is-open { transform: translateX(0); }

.hq-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.hq-drawer-head h3 { font-size: 16px; }
.hq-drawer-close {
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px; border: 1px solid transparent; background: transparent; color: var(--text-dim);
  cursor: pointer;
}
.hq-drawer-close svg { width: 15px; height: 15px; }
.hq-drawer-close:hover { background: var(--bg-card); color: var(--text); }
.hq-drawer-close:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }

.hq-drawer-body { flex: 1; overflow-y: auto; padding: 6px 20px 20px; }

.hq-pref-group { padding: 16px 0; border-bottom: 1px solid var(--border-soft); }
.hq-pref-group:last-child { border-bottom: none; }
.hq-pref-label { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 10px; }

.hq-swatch-row { display: flex; gap: 12px; }
.hq-swatch {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--sw);
  border: 2px solid transparent;
  box-shadow: 0 0 0 1px var(--border-soft);
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.hq-swatch:hover { transform: scale(1.08); }
.hq-swatch:focus-visible { outline: 2px solid var(--info); outline-offset: 3px; }
.hq-swatch.is-active { box-shadow: 0 0 0 2px var(--bg-elevated), 0 0 0 4px var(--sw); }
.hq-swatch.is-active::after {
  content: "";
  position: absolute; inset: 0; margin: auto;
  width: 8px; height: 8px; border-radius: 50%;
  background: #241b04;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.5);
}

.hq-choice-row { display: flex; gap: 8px; }
.hq-choice {
  flex: 1;
  padding: 9px 10px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--bg-inset);
  color: var(--text-dim);
  font-size: 12.5px; font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s ease;
}
.hq-choice:hover { color: var(--text); }
.hq-choice.is-active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.hq-choice:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }

.hq-pref-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
}
.hq-pref-row-copy { display: flex; flex-direction: column; gap: 2px; }
.hq-pref-row-copy strong { font-size: 12.5px; }
.hq-pref-row-copy span { font-size: 11px; color: var(--text-faint); }
.hq-dash-list .hq-pref-row { padding: 8px 0; font-size: 12.5px; color: var(--text-dim); }

.hq-drawer-foot { padding: 14px 20px 18px; border-top: 1px solid var(--border-soft); flex-shrink: 0; }
.hq-drawer-foot .btn { width: 100%; justify-content: center; }
.hq-drawer-foot-row { display: flex; gap: 8px; margin-bottom: 8px; }
.hq-drawer-foot-row .btn { flex: 1; }

/* ==========================================================================
   REGIME, globalna wyszukiwarka (paleta komend, Ctrl+K): przycisk-lupka
   w ticker-bar (obok przycisku preferencji) + modal z listą par filtrowaną
   na żywo. Markup wstrzykuje app.js, tak samo jak panel preferencji.
   ========================================================================== */

.hq-search-btn {
  display: inline-flex; align-items: center; gap: 7px;
  flex-shrink: 0;
  height: 30px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--bg-elevated);
  color: var(--text-dim);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.hq-search-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.hq-search-btn:hover { color: var(--text); border-color: rgba(212,175,55,0.35); background: var(--bg-card-hover); }
.hq-search-btn:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.hq-search-kbd {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  color: var(--text-faint);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 1px 5px;
  line-height: 1.5;
}
@media (max-width: 880px) { .hq-search-kbd { display: none; } }

.hq-cmdk-overlay {
  position: fixed; inset: 0; z-index: 1100;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 12vh 20px 20px;
  background: rgba(6,7,10,0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none; /* [hidden] samo nie wystarczy: author "display:flex" bije UA [hidden]{display:none}, więc bez tego niewidoczny overlay łapał kliknięcia na całej stronie */
  transition: opacity 0.18s ease;
}
.hq-cmdk-overlay.is-open { opacity: 1; pointer-events: auto; }

.hq-cmdk {
  width: min(480px, 100%);
  max-height: 76vh;
  display: flex; flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  transform: translateY(-8px);
  opacity: 0;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.hq-cmdk-overlay.is-open .hq-cmdk { transform: translateY(0); opacity: 1; }

.hq-cmdk-input-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.hq-cmdk-input-wrap svg { width: 16px; height: 16px; color: var(--text-faint); flex-shrink: 0; }
.hq-cmdk-input {
  flex: 1; min-width: 0;
  background: transparent; border: none; outline: none;
  color: var(--text); font-size: 14px; font-family: var(--font-sans);
}
.hq-cmdk-input::placeholder { color: var(--text-faint); }

.hq-cmdk-list { flex: 1; overflow-y: auto; padding: 8px; }
.hq-cmdk-section-label {
  padding: 8px 10px 4px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--text-faint);
}
.hq-cmdk-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-dim);
}
.hq-cmdk-item-sym { color: var(--text); font-weight: 600; font-family: var(--font-mono); font-size: 12.5px; }
.hq-cmdk-item-name { flex: 1; min-width: 0; color: var(--text-faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hq-cmdk-item-star { color: #ffcc4d; flex-shrink: 0; display: inline-flex; }
.hq-cmdk-item.is-active, .hq-cmdk-item:hover { background: var(--bg-card-hover); color: var(--text); }
.hq-cmdk-empty { padding: 22px 10px; text-align: center; color: var(--text-faint); font-size: 12.5px; }

/* ------------------------------------------- Sekcje pulpitu, ikonka oka */

.dash-section-title { display: flex; align-items: center; gap: 8px; }
.dash-eye-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  padding: 0;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.dash-eye-btn svg { width: 13px; height: 13px; }
.dash-section-title:hover .dash-eye-btn,
.dash-eye-btn:focus-visible { opacity: 1; }
.dash-eye-btn:hover { color: var(--text); background: var(--bg-card); }
.dash-eye-btn:focus-visible { outline: 2px solid var(--info); outline-offset: 1px; }

/* --------------------------------------------------- Watchlist sidebar */

.nav-watchlist-line {
  display: flex; align-items: center; gap: 6px;
  padding: 0 10px 8px 36px;
  margin-top: -2px;
  font-size: 10.5px; color: var(--text-faint);
}
.nav-watchlist-line .wl-count {
  font-family: var(--font-mono); font-size: 10px; color: var(--accent);
  background: var(--accent-dim); border: 1px solid rgba(212,175,55,0.3);
  padding: 1px 6px; border-radius: 999px;
}

/* ------------------------------------------------------------- Toasty */

.hq-toast-stack {
  position: fixed; right: 18px; bottom: 18px; z-index: 1200;
  display: flex; flex-direction: column-reverse; gap: 8px;
  pointer-events: none;
}
.hq-toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 12.5px;
  box-shadow: var(--shadow-pop);
  animation: hq-toast-in 0.25s cubic-bezier(0.16,1,0.3,1) both;
  max-width: 320px;
}
.hq-toast.is-leaving { animation: hq-toast-out 0.22s ease both; }
@keyframes hq-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes hq-toast-out { from { opacity: 1; } to { opacity: 0; transform: translateY(4px); } }
.hq-toast .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

/* -------------------------------------------------- Gęstość: kompaktowa */

html.hq-density-compact .card { padding: 13px 14px; }
html.hq-density-compact .main { padding: 18px 22px 40px; }
html.hq-density-compact .grid { gap: 12px; }
html.hq-density-compact table.data-table td { padding: 9px 12px; }
html.hq-density-compact table.data-table th { padding: 9px 12px; }
html.hq-density-compact body { font-size: 13px; }
html.hq-density-compact .stat-tile .stat-value { font-size: 22px; }
html.hq-density-compact .hero-band-inner { padding: 34px 28px 24px; }
html.hq-density-compact .picks-grid,
html.hq-density-compact .grid-cols-3,
html.hq-density-compact .grid-cols-4 { gap: 12px; }

/* --------------------------------- Animacje wyłączone (przełącznik ręczny,
   dodatkowo do prefers-reduced-motion, ta sama logika co media query) */

html.hq-motion-off *, html.hq-motion-off *::before, html.hq-motion-off *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}
html.hq-motion-off .ticker-track { animation: none !important; }
html.hq-motion-off .hero-band-bg { transform: none !important; }
html.hq-motion-off .draw-in { clip-path: inset(0 0% 0 0) !important; }

/* ------------------------------------------------- Pasek notowań ukryty */

html.hq-ticker-off .ticker-viewport { display: none; }

@media (max-width: 420px) {
  .hq-drawer { width: 100vw; }
}

/* ============================================================================
   TRYB EDYCJI PULPITU
   Pasek narzędzi stały nad sekcjami pulpitu (chipy silnika + przycisk
   "Dostosuj pulpit") i tryb edycji z przeciąganiem sekcji/kart, ukrywaniem
   i mini-galerią widżetów. Wyłącznie index.html, patrz app.js.
   ========================================================================= */

.dash-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 10px 14px; margin: 16px 0 6px;
}
.dash-toolbar-left { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.dash-toolbar-right { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }

/* Pasek szybkich akcji, pod paskiem statusu, nad dash-toolbar (centrum sterowania) */
.dash-quick-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.dash-quick-actions .qa-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px; margin-left: 6px;
  border-radius: 999px; background: var(--accent-dim); color: var(--accent);
  font-family: var(--font-mono); font-size: 10px; line-height: 16px;
}

/* Karta "Sterowanie silnikiem" na pulpicie, wzorowana na konsola.html */
.dash-mode-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.dash-engine-select {
  background: var(--bg-inset); border: 1px solid var(--border); border-radius: 7px;
  padding: 6px 8px; font-size: 12px; color: var(--text); width: 100%;
}

/* Szybki backtest, mini-launcher */
.qbt-progress-wrap { margin: 10px 0; }
.qbt-progress-wrap .meter > span { transition: width 0.12s linear; }
.qbt-result-grid { display: flex; flex-wrap: wrap; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-soft); }

/* Filtr wpływu w kalendarzu wydarzeń, chipy odświeżania spreadu */
.dash-inline-controls { display: flex; align-items: center; gap: 6px; }

/* Zapisywalne układy pulpitu (wzór OpenBB dashboards) */
.dash-layout-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.dash-layout-label { font-size: 11px; color: var(--text-faint); margin-right: 2px; }
button.dash-layout-chip,
button.roai-tile { font: inherit; }
.dash-layout-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 11px; font-size: 11.5px; color: var(--text-dim);
  cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
button.dash-layout-chip:hover { border-color: var(--accent); color: var(--text); }
.dash-layout-chip-custom { padding: 0; gap: 0; }
.dash-layout-chip-custom button[data-layout-custom] {
  background: none; border: none; padding: 5px 4px 5px 11px; font-family: var(--font-sans); font-size: 11.5px; color: var(--text-dim); cursor: pointer;
}
.dash-layout-chip-custom button[data-layout-custom]:hover { color: var(--text); }
.dash-layout-del {
  background: none; border: none; padding: 5px 9px 5px 2px; color: var(--text-faint); cursor: pointer; display: inline-flex;
}
.dash-layout-del svg { width: 9px; height: 9px; }
.dash-layout-del:hover { color: var(--danger); }

.dash-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 13px; font-size: 12px;
  font-family: var(--font-mono); color: var(--text);
  cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
button.dash-chip { font: inherit; font-family: var(--font-mono); }
.dash-chip:hover { border-color: var(--border-strong); background: var(--bg-card-hover); }
.dash-chip:active { transform: scale(0.97); }
.dash-chip:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.dash-chip-static { cursor: default; }
.dash-chip-static:hover { border-color: var(--border); background: var(--bg-elevated); transform: none; }
.dash-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; box-shadow: 0 0 0 3px var(--accent-dim); }
.dash-chip.is-paused .dash-chip-dot { background: var(--danger); box-shadow: 0 0 0 3px rgba(224,104,95,0.16); }
.dash-chip-count { color: var(--accent); font-weight: 600; }

.dash-edit-hint { font-size: 11.5px; color: var(--text-faint); }

/* Uchwyt przeciągania + X, wstrzykiwane raz, widoczne tylko w trybie edycji.
   Kotwiczone w rogu karty/sekcji absolutnie, żeby nie ruszać istniejącego
   układu nagłówków (różne strony/karty mają różny markup nagłówka). */
[data-dash-section] { position: relative; }
.dash-controls { position: absolute; top: -14px; right: 4px; display: none; gap: 6px; z-index: 3; }
html[data-dash-edit] .dash-controls { display: flex; }
.dash-drag-handle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px; color: var(--text-faint);
  cursor: grab; flex-shrink: 0; background: var(--bg-elevated); border: 1px solid var(--border);
}
.dash-drag-handle:active { cursor: grabbing; }
.dash-drag-handle svg { width: 13px; height: 13px; }
.dash-hide-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px; color: var(--text-faint);
  cursor: pointer; flex-shrink: 0; background: var(--bg-elevated); border: 1px solid var(--border);
}
.dash-hide-btn:hover { color: var(--danger); border-color: rgba(224,104,95,0.4); }
.dash-hide-btn svg { width: 12px; height: 12px; }

html[data-dash-edit] [data-dash-section],
html[data-dash-edit] .dashboard-widgets > .card {
  outline: 1.5px dashed var(--border-strong); outline-offset: 6px;
  border-radius: var(--radius-lg);
  animation: dashJiggle 2.6s ease-in-out infinite;
  cursor: default;
}
html[data-dash-edit] [data-dash-section]:nth-of-type(2n) { animation-delay: -1.3s; }
html[data-dash-edit] .dashboard-widgets > .card:nth-child(2n) { animation-delay: -0.7s; }
html[data-dash-edit] [data-dash-section].is-dragging,
html[data-dash-edit] .dashboard-widgets > .card.is-dragging { animation: none; opacity: 0.45; }
html[data-dash-edit] [data-dash-section].is-drag-over,
html[data-dash-edit] .dashboard-widgets > .card.is-drag-over { outline-color: var(--accent); }
@keyframes dashJiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-0.35deg); }
  75% { transform: rotate(0.35deg); }
}

/* Kafelek "+ Dodaj widżet", tylko w trybie edycji, na końcu gridu widżetów */
.dash-add-widget-tile {
  display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; min-height: 140px; border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg); background: transparent; color: var(--text-faint);
  cursor: pointer; font-size: 13px; font-family: inherit;
}
html[data-dash-edit] .dash-add-widget-tile { display: flex; }
.dash-add-widget-tile:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }
.dash-add-widget-tile svg { width: 22px; height: 22px; }

/* Mini-galeria widżetów */
.dash-gallery-overlay {
  position: fixed; inset: 0; background: rgba(6,7,10,0.68); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 90;
  opacity: 0; pointer-events: none; transition: opacity 0.18s ease; padding: 20px;
}
.dash-gallery-overlay.is-open { opacity: 1; pointer-events: auto; }
.dash-gallery {
  width: 100%; max-width: 420px; max-height: 80vh; overflow-y: auto;
  background: var(--bg-card); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  padding: 18px; transform: translateY(10px); transition: transform 0.18s ease;
}
.dash-gallery-overlay.is-open .dash-gallery { transform: translateY(0); }
.dash-gallery-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dash-gallery-head h3 { font-size: 15px; }
.dash-gallery-list { display: flex; flex-direction: column; gap: 8px; }
.dash-gallery-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-elevated); cursor: pointer; text-align: left; width: 100%;
  color: var(--text); font-size: 13px; font-family: inherit;
}
.dash-gallery-item:hover { border-color: var(--accent); background: var(--accent-dim); }
.dash-gallery-empty { color: var(--text-faint); font-size: 12.5px; padding: 8px 2px; }

/* Watchlist edytowalna inline: X przy parze + input dodawania */
.watchlist-row-remove {
  width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 5px; color: var(--text-faint); cursor: pointer; background: none; border: none; flex-shrink: 0;
}
.watchlist-row-remove:hover { color: var(--danger); background: rgba(224,104,95,0.12); }
.watchlist-row-remove svg { width: 10px; height: 10px; }
.watchlist-add-row { display: flex; gap: 6px; margin-top: 4px; }
.watchlist-add-row input {
  flex: 1; min-width: 0; background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; font-size: 12px; font-family: var(--font-mono); color: var(--text);
}
.watchlist-add-row input:focus-visible { outline: 2px solid var(--info); outline-offset: 1px; border-color: var(--info); }
.watchlist-add-row button {
  flex-shrink: 0; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 12px; font-size: 12px; color: var(--text); cursor: pointer;
}
.watchlist-add-row button:hover { border-color: var(--accent); color: var(--accent); }

/* Widżet: Notatnik */
.widget-note textarea {
  width: 100%; min-height: 118px; resize: vertical; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  font-size: 12.5px; font-family: var(--font-mono); color: var(--text); line-height: 1.5;
}
.widget-note textarea:focus-visible { outline: 2px solid var(--info); outline-offset: 1px; border-color: var(--info); }
.widget-note-status { font-size: 10.5px; color: var(--text-faint); text-align: right; }

/* Widżet: Zegar sesji */
.widget-sessionclock .sc-clocks { display: flex; gap: 18px; }
.widget-sessionclock .sc-clock { display: flex; flex-direction: column; gap: 2px; }
.widget-sessionclock .sc-clock .sc-time { font-family: var(--font-mono); font-size: 20px; color: var(--text); }
.widget-sessionclock .sc-clock .sc-tz { font-size: 10.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.8px; }
.sc-session-row { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; }
.sc-session-row .sc-session-name { color: var(--text-faint); }
.sc-session-badge { font-family: var(--font-mono); font-size: 10.5px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-faint); }
.sc-session-badge.is-open { color: var(--accent); border-color: rgba(212,175,55,0.35); background: var(--accent-dim); }

/* ==========================================================================
   REGIME, pulpit ERP (index.html): pasek statusu, dwukolumnowy obszar
   roboczy, taby w panelu lewym, wiersze kompaktowe typów, tabela pozycji,
   widżety mini w prawej kolumnie. Gęsto, bez animacji reveal na starcie.
   ========================================================================== */

.status-strip {
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px;
  padding: 8px; margin: 12px 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  background: var(--bg-inset);
}
.status-tile {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
  font-family: var(--font-mono);
  color: var(--text-dim);
  text-decoration: none;
  min-height: 40px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
a.status-tile { cursor: pointer; }
a.status-tile:hover { border-color: var(--border-strong); background: var(--bg-card-hover); }
.status-tile-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; box-shadow: 0 0 0 3px var(--accent-dim); }
.status-tile-dot.is-paused,
.status-tile.is-paused .status-tile-dot { background: var(--danger); box-shadow: 0 0 0 3px rgba(224,104,95,0.16); }
.status-tile.is-stopping .status-tile-dot { background: var(--warning); box-shadow: 0 0 0 3px rgba(247,185,85,0.18); }
.status-tile.is-stopped .status-tile-dot { background: var(--danger); box-shadow: 0 0 0 3px rgba(224,104,95,0.16); }
.status-tile.is-stopped .status-tile-value,
.status-tile.is-stopping .status-tile-value { color: var(--danger); }
.status-tile-body { display: flex; flex-direction: column; gap: 1px; line-height: 1.25; }
.status-tile-label { font-size: 9.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.6px; font-family: var(--font-sans); }
.status-tile-value { font-size: 13px; color: var(--text); font-weight: 600; }
.status-tile-value.pos { color: var(--accent); }
.status-tile-value.neg { color: var(--danger); }
.status-tile-value.warn { color: var(--warning); }

.dash-workarea { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.dash-workarea .card { padding: 12px 14px; }
.dash-workarea .card-head { margin-bottom: 8px; }
.dash-workarea table.data-table th { padding: 8px 10px; font-size: 10px; }
.dash-workarea table.data-table td { padding: 8px 10px; font-size: 12px; }
.dash-workarea .kv-list { gap: 8px; }
.dash-workarea hr.divider { margin: 10px 0; }

.panel-head-slim {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 7px; margin-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}
.panel-head-slim h3 { font-size: 13px; }
.panel-head-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.main-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.main-tab-btn {
  font-family: var(--font-sans); font-size: 12px; font-weight: 600;
  padding: 6px 10px; border-radius: 6px;
  border: 1px solid transparent;
  background: transparent; color: var(--text-faint);
  cursor: pointer; white-space: nowrap;
}
.main-tab-btn:hover { color: var(--text); background: var(--bg-card); }
.main-tab-btn.is-active { color: var(--text); background: var(--bg-elevated); border-color: var(--border-strong); }
.main-tab-panel { display: none; }
.main-tab-panel.is-active { display: block; }

.equity-metrics-row { display: flex; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-soft); }
.equity-metric { flex: 1; min-width: 120px; padding: 0 14px; border-left: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: 3px; }
.equity-metric:first-child { border-left: none; padding-left: 0; }
.equity-metric .em-label { font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.6px; }
.equity-metric .em-value { font-family: var(--font-mono); font-size: 15px; color: var(--text); }
.equity-metric .em-value.pos { color: var(--accent); }
.equity-metric .em-value.neg { color: var(--danger); }

.picks-compact { display: flex; flex-direction: column; }
.pick-row-compact { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); flex-wrap: wrap; }
.pick-row-compact:last-child { border-bottom: none; }
.pick-row-compact .pick-pair { display: flex; align-items: center; gap: 8px; font-size: 12.5px; min-width: 128px; flex-shrink: 0; }
.pick-row-compact .pick-direction { flex-shrink: 0; }
.pick-row-compact .pick-row-meter-wrap { flex: 1; min-width: 90px; display: flex; align-items: center; gap: 8px; }
.pick-row-compact .pick-row-meter-wrap .meter { flex: 1; }
.pick-row-compact .pick-conf-num { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-dim); width: 32px; text-align: right; flex-shrink: 0; }
.pick-row-figures { display: flex; gap: 16px; flex-shrink: 0; }
.pick-row-figures .pf-label { font-size: 9.5px; }
.pick-row-figures .pf-value { font-size: 12px; }
.pick-row-reason { flex-basis: 100%; font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }

.widget-card.is-mini { gap: 8px; }
.widget-card.is-mini .card-head h3 { font-size: 12.5px; }
.widget-card.is-mini .card-head .hint { display: none; }
.widget-card.is-mini .widget-fng-value { font-size: 22px; }
.widget-card.is-mini .widget-fng-arc { width: 88px; height: 50px; }

.stream-log.is-compact { height: 168px; }

@media (max-width: 1180px) {
  .dash-workarea { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .status-strip { gap: 6px; padding: 6px; }
  .status-tile { padding: 5px 9px; min-height: 36px; }
  .pick-row-compact { gap: 8px; }
  .pick-row-figures { gap: 10px; }
}

/* ==========================================================================
   REGIME, warstwa interakcji terminalowej: menu kontekstowe, skróty
   klawiszowe, centrum alertów, stopka statusu, heatmapa, głębia rynku,
   splitter kolumn pulpitu. Markup wstrzykuje app.js, ta sama zasada co
   panel preferencji i paleta wyszukiwania wyżej w tym pliku.
   ========================================================================== */

/* ---------------------------------------------------------- Menu kontekstowe */

.hq-ctxmenu {
  position: fixed;
  z-index: 1300;
  min-width: 200px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-pop);
  padding: 6px;
  font-size: 12.5px;
}
.hq-ctxmenu-head {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  padding: 6px 10px 8px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 4px;
}
.hq-ctxmenu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 12.5px;
  cursor: pointer;
}
.hq-ctxmenu-item:hover,
.hq-ctxmenu-item:focus-visible { background: var(--bg-card-hover); outline: none; }

/* ---------------------------------------------------------- Skróty klawiszowe */

.hq-kbd {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
  background: var(--bg-inset);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 2px 7px;
  min-width: 22px;
  justify-content: center;
}
.hq-kbd-sm { font-size: 9.5px; padding: 1px 5px; min-width: 16px; }

.hq-shortcuts-overlay {
  position: fixed; inset: 0; z-index: 1100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5,6,9,0.6);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 20px;
}
.hq-shortcuts-overlay.is-open { opacity: 1; pointer-events: auto; }
.hq-shortcuts {
  width: min(420px, 100%);
  max-height: 80vh;
  overflow-y: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-pop);
  transform: translateY(8px);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.hq-shortcuts-overlay.is-open .hq-shortcuts { transform: translateY(0); opacity: 1; }
.hq-shortcuts-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-soft);
}
.hq-shortcuts-head h3 { font-size: 15px; }
.hq-shortcuts-list { padding: 8px 18px 16px; display: flex; flex-direction: column; gap: 4px; }
.hq-shortcuts-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12.5px;
  color: var(--text-dim);
}
.hq-shortcuts-row:last-child { border-bottom: none; }

/* ---------------------------------------------------------- Centrum alertów */

.hq-notif-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--bg-elevated);
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.hq-notif-btn svg { width: 16px; height: 16px; }
.hq-notif-btn:hover { color: var(--text); border-color: rgba(212,175,55,0.35); background: var(--bg-card-hover); }
.hq-notif-btn:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.hq-notif-btn[aria-expanded="true"] { color: var(--accent); border-color: rgba(212,175,55,0.4); background: var(--accent-dim); }
.hq-notif-badge {
  position: absolute; top: -3px; right: -3px;
  min-width: 15px; height: 15px; padding: 0 3px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 9.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-inset);
}

.hq-notif-panel {
  position: fixed;
  z-index: 1100;
  width: min(340px, calc(100vw - 24px));
  max-height: 70vh;
  overflow-y: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-pop);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.hq-notif-panel.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.hq-notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12.5px; font-weight: 600; color: var(--text);
  position: sticky; top: 0;
  background: var(--bg-elevated);
}
.hq-notif-readall {
  border: none; background: transparent; color: var(--accent);
  font-size: 11px; font-family: var(--font-sans); cursor: pointer; padding: 2px 4px;
}
.hq-notif-readall:hover { text-decoration: underline; }
.hq-notif-empty { padding: 20px 14px; font-size: 12px; color: var(--text-faint); text-align: center; }
.hq-notif-list { display: flex; flex-direction: column; }
.hq-notif-item {
  display: flex; align-items: flex-start; gap: 9px;
  width: 100%; text-align: left;
  padding: 10px 14px;
  border: none; border-bottom: 1px solid var(--border-soft);
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.hq-notif-item:last-child { border-bottom: none; }
.hq-notif-item:hover { background: var(--bg-card-hover); }
.hq-notif-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  margin-top: 5px; flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.hq-notif-item.is-read .hq-notif-dot { background: var(--text-faint); box-shadow: none; }
.hq-notif-item.is-read { opacity: 0.55; }
.hq-notif-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hq-notif-text { font-size: 12px; color: var(--text); line-height: 1.4; }
.hq-notif-meta { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--text-faint); }

/* ---------------------------------------------------------- Stopka statusu */

.hq-statusbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
  height: 28px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-inset);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
  overflow-x: auto;
  white-space: nowrap;
}
.hq-statusbar-item { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; }
.hq-statusbar-sep { color: var(--text-faint); flex-shrink: 0; }
.hq-statusbar-spacer { flex: 1; min-width: 8px; }
.hq-statusbar-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0; }
.hq-statusbar-dot.is-ok { background: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }
.hq-statusbar-dot.is-err { background: var(--danger); box-shadow: 0 0 0 2px var(--danger-dim); }
body.hq-has-statusbar { padding-bottom: 34px; }
@media (max-width: 640px) {
  .hq-statusbar { font-size: 9.5px; gap: 8px; padding: 0 10px; }
  .hq-statusbar-item.text-faint:last-child { display: none; }
}

/* ---------------------------------------------------------- Heatmapa rynku */

.hq-heatmap-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.hq-heatmap-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  height: 62px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.hq-heatmap-tile:hover { transform: scale(1.04); border-color: var(--border-strong); z-index: 1; }
.hq-heatmap-tile.is-loading {
  grid-column: 1 / -1;
  color: var(--text-faint);
  font-size: 11.5px;
  border-style: dashed;
}
.hq-heatmap-sym { font-size: 11px; font-weight: 700; letter-spacing: 0.3px; }
.hq-heatmap-price { font-size: 10px; color: var(--text-dim); }
.hq-heatmap-chg { font-size: 10.5px; font-weight: 600; }
@media (max-width: 480px) {
  .hq-heatmap-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------------------------------------------------------- Splitter kolumn */

.dash-workarea { position: relative; }
.dash-split-handle {
  position: absolute;
  top: 0; bottom: 0;
  width: 12px;
  margin-left: -6px;
  cursor: col-resize;
  z-index: 5;
  display: flex; align-items: center; justify-content: center;
  touch-action: none;
}
.dash-split-handle::before {
  content: "";
  width: 3px;
  height: 44px;
  border-radius: 3px;
  background: var(--border-strong);
  transition: background 0.15s ease, height 0.15s ease;
}
.dash-split-handle:hover::before,
.dash-split-handle:focus-visible::before,
.dash-split-handle.is-dragging::before { background: var(--accent); height: 64px; }
.dash-split-handle:focus-visible { outline: none; }
@media (max-width: 1180px) {
  .dash-split-handle { display: none !important; }
}

/* ==========================================================================
   REGIME, modal generyczny (wzór z pozycje.html, wyniesiony tu żeby każda
   strona mogła go użyć bez duplikowania <style> w <head>). Klasy .hq-modal /
   .hq-modal-box / .hq-modal-actions, otwarcie przez dodanie .open.
   ========================================================================== */
.hq-modal {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  background: rgba(6,7,10,0.72);
  backdrop-filter: blur(3px);
  padding: 20px;
}
.hq-modal.open { display: flex; }
.hq-modal-box {
  width: min(460px, 94vw);
  max-height: 88vh; overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-pop);
}
.hq-modal-box h3 { font-size: 16px; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.hq-modal-box .hq-modal-sub { font-size: 12px; color: var(--text-faint); margin-bottom: 16px; }
.hq-modal-actions { display: flex; gap: 10px; margin-top: 18px; justify-content: flex-end; }
.hq-modal-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.hq-modal-field label { font-size: 11.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.4px; }
.hq-modal-field select,
.hq-modal-field input[type="text"],
.hq-modal-field input[type="number"] {
  background: var(--bg-inset); border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 11px; font-family: var(--font-mono); font-size: 13px; color: var(--text);
}
.hq-modal-choice-row { display: flex; gap: 8px; }
.hq-modal-choice-row .hq-choice { flex: 1; }
.hq-modal-box-wide { width: min(560px, 94vw); }
.hq-modal-chart-wrap { margin-top: 16px; }
.hq-modal-bar-chart { width: 100%; display: block; max-width: 100%; }

/* ==========================================================================
   REGIME, asystent Qwen (wzór OpenBB Copilot): przycisk pływający + panel
   czatu. Wstrzykiwane przez app.js (initChatWidget) na wybranych stronach.
   Przesunięty względem stosu toastów (ten sam róg ekranu), żeby się nie
   nakładały; z-index niżej niż toasty, żeby te zawsze były czytelne.
   ========================================================================== */
.hq-chat-fab {
  position: fixed; right: 22px; bottom: 96px; z-index: 1100;
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #241b04;
  border: none; box-shadow: var(--shadow-pop);
  cursor: pointer; transition: transform 0.15s ease;
}
.hq-chat-fab:hover { transform: scale(1.06); }
.hq-chat-fab svg { width: 24px; height: 24px; }

.hq-chat-panel {
  position: fixed; right: 22px; bottom: 158px; z-index: 1090;
  width: min(340px, calc(100vw - 44px));
  max-height: min(480px, calc(100vh - 200px));
  display: flex; flex-direction: column;
  background: var(--bg-card); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-pop);
  opacity: 0; transform: translateY(10px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}
.hq-chat-panel.is-open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.hq-chat-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 14px 14px 10px; border-bottom: 1px solid var(--border-soft);
}
.hq-chat-head strong { font-size: 13.5px; display: block; }
.hq-chat-sub { display: block; font-size: 10.5px; color: var(--text-faint); font-family: var(--font-mono); margin-top: 2px; }
.hq-chat-close { background: none; border: none; color: var(--text-faint); cursor: pointer; padding: 2px; }
.hq-chat-close svg { width: 14px; height: 14px; }
.hq-chat-body { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-height: 140px; }
.hq-chat-msg { font-size: 12.5px; line-height: 1.5; padding: 8px 11px; border-radius: 10px; max-width: 92%; }
.hq-chat-msg-bot { background: var(--bg-inset); color: var(--text-dim); align-self: flex-start; border: 1px solid var(--border-soft); }
.hq-chat-msg-user { background: var(--accent-dim); color: var(--text); align-self: flex-end; }
.hq-chat-typing { display: flex; gap: 4px; padding: 10px 12px; }
.hq-chat-typing span { width: 5px; height: 5px; border-radius: 50%; background: var(--text-faint); animation: hqChatTyping 1s infinite ease-in-out; }
.hq-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.hq-chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes hqChatTyping { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }
.hq-chat-note { font-size: 10px; color: var(--text-faint); padding: 0 14px 8px; line-height: 1.4; }
.hq-chat-form { display: flex; gap: 8px; padding: 10px 14px 14px; border-top: 1px solid var(--border-soft); }
.hq-chat-form input {
  flex: 1; background: var(--bg-inset); border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 11px; font-size: 12.5px; color: var(--text);
}
.hq-chat-form button {
  background: var(--accent); color: #241b04; border: none; border-radius: 8px;
  padding: 9px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
@media (max-width: 560px) {
  .hq-chat-fab { right: 14px; bottom: 84px; }
  .hq-chat-panel { right: 12px; bottom: 144px; width: calc(100vw - 24px); }
}

/* ==========================================================================
   REGIME, konsola silnika (konsola.html): log z filtrem poziomu, suwaki
   strojenia na żywo, karty stanu.
   ========================================================================== */
.hq-console-log-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.hq-console-log-filters { display: flex; align-items: center; gap: 6px; }
.hq-loglvl-chip {
  font-family: var(--font-mono); font-size: 10.5px; padding: 4px 9px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-faint); cursor: pointer; background: var(--bg-elevated);
}
.hq-loglvl-chip.active { color: var(--text); border-color: var(--accent); background: var(--accent-dim); }
.stream-line.lvl-WARN .st-time { color: var(--warning); }
.stream-line.lvl-DEBUG { opacity: 0.72; }

.hq-engine-state-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.hq-engine-state-badge {
  font-family: var(--font-mono); font-size: 11.5px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-dim); background: var(--bg-elevated);
}
.hq-engine-state-badge.is-running { color: var(--accent); border-color: rgba(212,175,55,0.35); background: var(--accent-dim); }
.hq-engine-state-badge.is-stopping { color: var(--warning); border-color: rgba(247,185,85,0.35); background: rgba(247,185,85,0.12); }
.hq-engine-state-badge.is-stopped { color: var(--danger); border-color: rgba(224,104,95,0.35); background: var(--danger-dim); }

.hq-tune-row { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.hq-tune-row:last-child { border-bottom: none; }
.hq-tune-row-head { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-dim); }
.hq-tune-row-head strong { color: var(--text); }

.hq-force-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.hq-force-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--bg-inset);
  font-size: 12.5px;
}
.hq-force-item .btn { flex-shrink: 0; }

/* ==========================================================================
   REGIME, portfel.html: okna zwrotu (ROAI, wzór Ghostfolio), krzywa salda
   i X-Ray ryzyka.
   ========================================================================== */
.roai-row { display: flex; gap: 10px; flex-wrap: wrap; }
.roai-tile {
  flex: 1; min-width: 96px;
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border-soft);
  background: var(--bg-inset); cursor: pointer; text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.roai-tile:hover { border-color: var(--border-strong); }
.roai-tile.is-active { border-color: var(--accent); background: var(--accent-dim); }
.roai-tile-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-faint); }
.roai-tile-value { font-family: var(--font-mono); font-size: 16px; font-weight: 600; }
.roai-tile-value.pos { color: var(--accent); }
.roai-tile-value.neg { color: var(--danger); }

.xray-rules { display: flex; flex-direction: column; gap: 10px; }
.xray-rule { display: flex; gap: 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border-soft); background: var(--bg-inset); }
.xray-verdict {
  flex-shrink: 0; align-self: flex-start;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.4px;
  padding: 4px 9px; border-radius: 999px; min-width: 62px; text-align: center;
}
.xray-verdict.ok { color: var(--accent); background: var(--accent-dim); border: 1px solid rgba(212,175,55,0.35); }
.xray-verdict.warn { color: var(--warning); background: rgba(247,185,85,0.12); border: 1px solid rgba(247,185,85,0.35); }
.xray-verdict.risk { color: var(--danger); background: var(--danger-dim); border: 1px solid rgba(224,104,95,0.35); }
.xray-rule-body { display: flex; flex-direction: column; gap: 3px; }
.xray-rule-title { font-size: 12.5px; font-weight: 600; color: var(--text); }
.xray-rule-text { font-size: 12px; color: var(--text-dim); line-height: 1.5; }

.balance-chart-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; font-size: 11.5px; color: var(--text-dim); }
.balance-chart-legend .bcl-item { display: inline-flex; align-items: center; gap: 6px; }
.balance-chart-legend .bcl-swatch { width: 10px; height: 3px; border-radius: 2px; }

/* ==========================================================================
   REGIME, rozbudowa mockupu: pasek zwrotów okresowych (portfel.html),
   dziennik transakcji (pozycje.html), start/stop bota + tryb PAPER (globalnie),
   przegląd instancji botów (index.html), krzywa wartości portfela (portfel.html),
   rozszerzone statystyki i porównanie przebiegów (backtest.html), konfigurator
   wskaźników (aktywo.html). Wzorce FreqUI / OctoBot / Jesse / Ghostfolio.
   ========================================================================== */

/* ---- Pasek zwrotów okresowych (wzór Ghostfolio) ---- */
.period-strip-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 4px; }
@media (max-width: 720px) { .period-strip-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 460px) { .period-strip-grid { grid-template-columns: repeat(2, 1fr); } }
.period-tile {
  display: flex; flex-direction: column; gap: 5px;
  padding: 11px 12px; border-radius: 10px; border: 1px solid var(--border-soft);
  background: var(--bg-inset); min-width: 0;
}
.pt-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-faint); }
.pt-value { font-family: var(--font-mono); font-size: 15.5px; font-weight: 600; color: var(--text); }
.pt-value.pos { color: var(--accent); }
.pt-value.neg { color: var(--danger); }

/* ---- Dziennik transakcji (pozycje.html, wzór FreqUI) ---- */
.journal-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.journal-toolbar .field-inline { display: flex; flex-direction: column; gap: 4px; min-width: 128px; }
.journal-toolbar label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-faint); }
.journal-toolbar select, .journal-toolbar input[type="search"] {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 10px; font-size: 12.5px; color: var(--text); font-family: var(--font-sans);
}
.journal-toolbar select:focus, .journal-toolbar input[type="search"]:focus { outline: none; border-color: var(--info); box-shadow: 0 0 0 3px var(--info-dim); }
.journal-toolbar .field-inline.grow { flex: 1; min-width: 160px; }
.journal-summary-row { font-size: 11.5px; color: var(--text-faint); margin-top: 10px; }
.journal-summary-row strong.pos { color: var(--accent); }
.journal-summary-row strong.neg { color: var(--danger); }
table.journal-table th.sortable-th { cursor: pointer; user-select: none; white-space: nowrap; }
table.journal-table th.sortable-th::after { content: "⇅"; margin-left: 4px; opacity: 0.4; font-size: 9px; }
table.journal-table th.sort-asc::after { content: "↑"; opacity: 1; color: var(--accent); }
table.journal-table th.sort-desc::after { content: "↓"; opacity: 1; color: var(--accent); }
tr.journal-row-empty td { padding: 26px 16px; text-align: center; color: var(--text-faint); font-size: 13px; }
tr.journal-total-row td { font-weight: 700; border-top: 1px solid var(--border-strong); background: var(--bg-inset); }

/* ---- Start/stop bota + PAPER (globalnie, w pasku statusu) ---- */
.hq-bot-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; padding: 0; margin: 0; cursor: pointer;
  font-family: var(--font-mono); font-size: inherit; color: var(--text-dim);
}
.hq-bot-toggle:hover { color: var(--text); }
.hq-bot-toggle .hq-bot-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0; }
.hq-bot-toggle.is-running .hq-bot-dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); animation: pulse-dot 1.8s ease-in-out infinite; }
.hq-bot-toggle.is-running { color: var(--accent); }
.hq-paper-badge {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.5px;
  color: var(--info); border: 1px solid rgba(159,180,214,0.35); background: var(--info-dim);
  padding: 1px 6px; border-radius: 4px; cursor: help;
}

/* ---- Przegląd instancji botów (index.html, wzór OctoBot) ---- */
.bot-instances-grid { display: flex; flex-direction: column; gap: 8px; }
.bot-instance-card {
  display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center;
  padding: 11px 12px; border-radius: 10px; border: 1px solid var(--border-soft);
  background: var(--bg-inset); cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease;
}
.bot-instance-card:hover { border-color: var(--border-strong); }
.bot-instance-card.is-active { border-color: var(--accent); background: var(--accent-dim); }
.bic-name-row { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--text); grid-column: 1 / -1; }
.bic-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0; }
.bic-dot.is-running { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); animation: pulse-dot 1.8s ease-in-out infinite; }
.bic-status-text { font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.4px; margin-left: auto; }
button.bic-status-toggle {
  font-family: var(--font-sans); background: none; border: 1px solid transparent; border-radius: 999px;
  padding: 2px 8px; cursor: pointer; transition: border-color 0.15s ease, color 0.15s ease;
}
button.bic-status-toggle:hover { color: var(--text); border-color: var(--border); }
.bic-spark { width: 100px; height: 30px; flex-shrink: 0; }
.bic-figures { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.bic-pnl { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; }
.bic-pnl.pos { color: var(--accent); }
.bic-pnl.neg { color: var(--danger); }
.bic-meta { font-size: 10.5px; color: var(--text-faint); }

/* ---- Krzywa wartości portfela (portfel.html, wzór Ghostfolio) ---- */
.hq-canvas-tooltip {
  position: fixed; z-index: 40;
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  border-radius: 6px; padding: 7px 10px;
  font-family: var(--font-mono); font-size: 11px; color: var(--text);
  pointer-events: none; opacity: 0; transition: opacity 0.1s ease;
  box-shadow: var(--shadow-pop); white-space: nowrap;
}
.hq-canvas-tooltip.show { opacity: 1; }
.pv-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; font-size: 11.5px; color: var(--text-dim); }
.pv-legend .pvl-item { display: inline-flex; align-items: center; gap: 6px; }
.pv-legend .pvl-swatch { width: 10px; height: 3px; border-radius: 2px; }
.pv-legend .pvl-swatch.dot { width: 8px; height: 8px; border-radius: 50%; }

/* ---- Rozszerzone statystyki backtestu + porównanie przebiegów ---- */
.backtest-metrics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 4px; }
@media (max-width: 720px) { .backtest-metrics-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .backtest-metrics-grid { grid-template-columns: 1fr; } }
.bt-metric-tile {
  padding: 11px 12px; border-radius: 10px; border: 1px solid var(--border-soft); background: var(--bg-inset);
  display: flex; flex-direction: column; gap: 4px;
}
.bt-metric-tile .bmt-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-faint); }
.bt-metric-tile .bmt-value { font-family: var(--font-mono); font-size: 15.5px; font-weight: 600; color: var(--text); }
.bt-metric-tile .bmt-value.pos { color: var(--accent); }
.bt-metric-tile .bmt-value.neg { color: var(--danger); }

.runs-table th, .runs-table td { white-space: nowrap; }
.runs-table td.num, .runs-table th.num { text-align: right; }
.runs-checkbox { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.runs-compare-hint { font-size: 11.5px; color: var(--text-faint); margin-top: 10px; }
.runs-compare-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 11px; color: var(--text-dim); }
.runs-compare-legend .rcl-item { display: inline-flex; align-items: center; gap: 6px; }
.runs-compare-legend .rcl-swatch { width: 10px; height: 3px; border-radius: 2px; }

/* ---- Konfigurator wskaźników (aktywo.html, wzór TradingView) ---- */
.indic-btn-wrap { position: relative; display: inline-flex; }
.indic-gear-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text-faint);
  cursor: pointer; transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.indic-gear-btn svg { width: 15px; height: 15px; }
.indic-gear-btn:hover { color: var(--text); border-color: var(--border-strong); }
.indic-gear-btn[aria-expanded="true"] { color: var(--accent); border-color: rgba(212,175,55,0.4); background: var(--accent-dim); }
.indic-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30;
  width: 210px; background: var(--bg-elevated); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 8px; box-shadow: var(--shadow-pop);
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
}
.indic-menu.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.indic-menu-title { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-faint); padding: 4px 8px 8px; }
.indic-menu-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px; border-radius: 7px; font-size: 12.5px; color: var(--text-dim); cursor: pointer;
}
.indic-menu-item:hover { background: var(--bg-card-hover); color: var(--text); }
.indic-menu-item input { accent-color: var(--accent); width: 14px; height: 14px; flex-shrink: 0; }
.indic-menu-item .imi-swatch { width: 10px; height: 3px; border-radius: 2px; margin-left: auto; flex-shrink: 0; }

/* ==========================================================================
   REGIME, rozbudowa mockupu runda 2. Wspólne dla eksportu wykresu do PNG
   (przycisk generyczny), popovera drill-down transakcji (aktywo.html) i
   przewodnika po terminalu (index.html + globalny przycisk w drawerze).
   ========================================================================== */

/* ---- Eksport wykresu do PNG: mały przycisk obok karty wykresu ---- */
.chart-export-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px;
  padding: 5px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text-dim);
  cursor: pointer; transition: color 0.15s ease, border-color 0.15s ease;
}
.chart-export-btn:hover { color: var(--text); border-color: var(--border-strong); }
.chart-export-btn svg { width: 13px; height: 13px; }

/* ---- Drill-down transakcji na wykresie świecowym (aktywo.html) ---- */
.trade-modal-box { width: min(420px, 94vw); }
.trade-modal-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.trade-modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 14px 0; }
.trade-modal-grid .tmg-item .tmg-label { display: block; font-size: 10.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 2px; }
.trade-modal-grid .tmg-item .tmg-value { font-family: var(--font-mono); font-size: 13.5px; color: var(--text); }
.trade-modal-fills { margin-top: 4px; }
.trade-modal-fills-title { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 8px; }
.trade-fill-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; border-radius: 8px; background: var(--bg-inset); border: 1px solid var(--border-soft);
  font-family: var(--font-mono); font-size: 12px; color: var(--text-dim);
  margin-bottom: 6px;
}
.trade-fill-row:last-child { margin-bottom: 0; }
.trade-fill-row .tfr-price { color: var(--text); }

/* ---- Słownik pojęć: podkreślone terminy + ikony "?" + wspólny popover ---- */
.hq-term {
  border-bottom: 1px dotted var(--text-faint);
  cursor: help;
  text-decoration: none;
  color: inherit;
}
.hq-term:hover, .hq-term:focus-visible { border-bottom-color: var(--accent); color: var(--text); }
.hq-info {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%; flex-shrink: 0;
  background: var(--bg-inset); border: 1px solid var(--border-strong); color: var(--text-faint);
  font-family: var(--font-mono); font-size: 9.5px; line-height: 1; cursor: help;
  margin-left: 4px; padding: 0; vertical-align: middle;
}
.hq-info:hover, .hq-info:focus-visible { color: var(--accent); border-color: var(--accent); }
.hq-term-pop {
  position: fixed; z-index: 1250;
  width: 320px; max-width: min(320px, calc(100vw - 24px));
  background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  padding: 14px 16px; box-shadow: var(--shadow-pop);
  opacity: 0; transform: translateY(4px); pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.hq-term-pop.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.hq-term-pop-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.hq-term-pop-title { font-size: 13.5px; font-weight: 700; color: var(--text); }
.hq-term-pop-close {
  background: none; border: none; color: var(--text-faint); cursor: pointer; padding: 2px;
  line-height: 1; flex-shrink: 0;
}
.hq-term-pop-close:hover { color: var(--text); }
.hq-term-pop-text { font-size: 12px; color: var(--text-dim); line-height: 1.55; }
.hq-term-pop-link { display: inline-block; margin-top: 10px; font-size: 11.5px; color: var(--accent); text-decoration: none; }
.hq-term-pop-link:hover { text-decoration: underline; }

/* ---- Karta "Jak czytać tę stronę?" ---- */
.hq-page-help {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--accent-dim); border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
  padding: 13px 16px; margin: 0 0 16px;
}
.hq-page-help-icon {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--border-strong); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
}
.hq-page-help-body { flex: 1; min-width: 0; }
.hq-page-help-title { font-size: 12.5px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.hq-page-help-text { font-size: 12px; color: var(--text-dim); line-height: 1.55; }
.hq-page-help-close {
  flex-shrink: 0; background: none; border: none; color: var(--text-faint); cursor: pointer;
  padding: 3px; line-height: 1;
}
.hq-page-help-close:hover { color: var(--text); }
.hq-page-help-restore {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-faint);
  background: none; border: none; cursor: pointer; padding: 0 0 14px; text-decoration: underline dotted;
}
.hq-page-help-restore:hover { color: var(--text); }

/* ---- "Co teraz robi system?" (index.html) ---- */
.hq-now-card { display: flex; gap: 12px; align-items: flex-start; }
.hq-now-dot {
  width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; flex-shrink: 0;
  background: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim);
}
.hq-now-text { font-size: 13px; color: var(--text); line-height: 1.6; }

/* ---- Strona Pomoc: słownik + FAQ ---- */
.hq-help-search {
  width: 100%; padding: 10px 14px; border-radius: 9px; border: 1px solid var(--border-soft);
  background: var(--bg-inset); color: var(--text); font-size: 13px; margin-bottom: 16px;
}
.hq-help-search:focus { outline: none; border-color: var(--accent); }
.hq-gloss-alpha { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.hq-gloss-alpha a {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); text-decoration: none;
  padding: 3px 7px; border-radius: 6px; border: 1px solid var(--border-soft);
}
.hq-gloss-alpha a:hover { color: var(--text); border-color: var(--border-strong); }
.hq-gloss-item { padding: 12px 0; border-bottom: 1px solid var(--border-soft); scroll-margin-top: 90px; }
.hq-gloss-item:last-child { border-bottom: none; }
.hq-gloss-term { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.hq-gloss-def { font-size: 12.5px; color: var(--text-dim); line-height: 1.6; }
.hq-gloss-empty { font-size: 12.5px; color: var(--text-faint); padding: 20px 0; }
.hq-steps-list { display: flex; flex-direction: column; gap: 12px; }
.hq-step-row { display: flex; gap: 12px; align-items: flex-start; }
.hq-step-num {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--bg-inset);
  border: 1px solid var(--border-strong); color: var(--accent); font-family: var(--font-mono);
  font-size: 11.5px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.hq-step-text { font-size: 12.5px; color: var(--text-dim); line-height: 1.6; padding-top: 2px; }
.hq-faq-item {
  border: 1px solid var(--border-soft); border-radius: 9px; margin-bottom: 8px; overflow: hidden;
  background: var(--bg-inset);
}
.hq-faq-item summary {
  cursor: pointer; list-style: none; padding: 12px 14px; font-size: 13px; font-weight: 600;
  color: var(--text); display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.hq-faq-item summary::-webkit-details-marker { display: none; }
.hq-faq-item summary::after { content: "+"; font-family: var(--font-mono); color: var(--text-faint); font-size: 15px; }
.hq-faq-item[open] summary::after { content: "\2212"; }
.hq-faq-item p { padding: 0 14px 14px; font-size: 12.5px; color: var(--text-dim); line-height: 1.6; margin: 0; }

/* ---- Matryca batch-backtestów (backtest.html, wzór Jesse Benchmark) ---- */
.matrix-table-wrap { overflow-x: auto; }
.matrix-table { width: 100%; border-collapse: separate; border-spacing: 4px; min-width: 480px; }
.matrix-table th { font-size: 11px; color: var(--text-faint); font-weight: 600; padding: 6px 8px; text-align: center; }
.matrix-table th:first-child { text-align: left; }
.matrix-table td.mx-strat { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; padding-right: 12px; }
.matrix-table td.mx-cell {
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; text-align: center;
  padding: 10px 8px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; color: var(--text);
}
.matrix-table td.mx-cell:hover { border-color: var(--border-strong); }
.matrix-table td.mx-cell.is-selected { outline: 2px solid var(--info); outline-offset: 1px; }
.matrix-metric-row { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.matrix-detail { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--bg-inset); font-size: 12px; color: var(--text-dim); }
.matrix-detail strong { color: var(--text); }
.matrix-detail-grid { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 8px; }

/* ==========================================================================
   REGIME, rozbudowa mockupu runda 4: Multi-wykres, Replay rynku, Tryb TV,
   Kalkulator wielkości pozycji. Reguły wspólne dla kilku stron trafiają tu
   (index.html nie ma własnego <style>), reguły lokalne jednej strony zostają
   w jej <style> (aktywo.html dla Replay, wykresy.html dla siatki 2×2).
   ========================================================================== */

/* ---- 4) Kalkulator wielkości pozycji (index.html, karta "sizer") ---- */
.sizer-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.sizer-field label { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.4px; }
.sizer-field input[type="text"],
.sizer-field input[type="number"] {
  background: var(--bg-inset); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-family: var(--font-mono); font-size: 13px; color: var(--text); width: 100%;
}
.sizer-field input:focus { outline: none; border-color: var(--border-strong); }
.sizer-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sizer-row-2 .sizer-field { margin-bottom: 0; }
.sizer-result { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.sizer-result .kv-row:not(:last-child) { margin-bottom: 8px; }
.sizer-warn { color: var(--warning); font-size: 11.5px; margin-top: 8px; }
@media (max-width: 480px) {
  .sizer-row-2 { grid-template-columns: 1fr; }
}

/* ---- 3) Tryb prezentacji (TV): przełącznik klasy hq-tv na <html>. Ukrywa
   sidebar, ticker zostaje, powiększa status-strip, workarea w jednej,
   wycentrowanej kolumnie. Przycisk wyjścia (X) budowany dynamicznie przez
   app.js, dopięty do <body>. Wyłącznie index.html (poniżej 768px ukryty
   przycisk startowy w pasku szybkich akcji, patrz [data-qa-tv] w app.js). ---- */
html.hq-tv .sidebar { display: none; }
html.hq-tv .app-shell { grid-template-columns: 1fr; }
html.hq-tv .dash-workarea { max-width: 1400px; margin-left: auto; margin-right: auto; grid-template-columns: 1fr; }
html.hq-tv .dash-col-right { display: none; }
html.hq-tv .status-strip { font-size: 130%; }
html.hq-tv .status-tile-value { font-size: 1.3em; }
html.hq-tv .status-tile-label { font-size: 0.95em; }
html.hq-tv .dash-toolbar,
html.hq-tv .dash-quick-actions,
html.hq-tv .footer-note { display: none; }
.hq-tv-exit-btn {
  position: fixed; top: 16px; right: 16px; z-index: 1300;
  width: 38px; height: 38px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-elevated); border: 1px solid var(--border-strong); color: var(--text-dim);
  box-shadow: var(--shadow-pop);
}
.hq-tv-exit-btn:hover { color: var(--text); border-color: var(--accent); }
.hq-tv-exit-btn svg { width: 18px; height: 18px; }
@media (max-width: 767px) {
  [data-qa-tv] { display: none; }
}

/* ---- 2) Replay rynku (aktywo.html): pasek sterowania pod paskiem
   interwałów. Reguły lokalne, żeby nie zaśmiecać stylów wspólnych. ---- */
.replay-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; margin: 10px 0 4px;
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  background: var(--bg-inset);
}
.replay-bar .replay-slider { flex: 1; min-width: 140px; }
.replay-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.4px;
  color: var(--warning); border: 1px solid rgba(247,185,85,0.4); background: var(--warning-dim);
  padding: 1px 5px; border-radius: 4px; margin-left: 8px; vertical-align: middle;
}

/* ---- 1) Multi-wykres (wykresy.html): siatka 2×2, reguły w tej stronie
   (patrz <style> w wykresy.html). Tu tylko odniesienie w komentarzu, żeby
   ta sekcja pozostała spisem całej rundy 4. ---- */

/* ==========================================================================
   Zwijanie kart pulpitu (index.html), generyczne + strojenie silnika osobno.
   Przycisk-chevron wstrzykuje wireDashCollapse() w app.js, obok tytułu karty
   (.panel-head-slim / .card-head), poza .dash-controls trybu edycji, żeby
   uchwyt przeciągania i X zostały widoczne nawet na zwiniętej karcie.
   ========================================================================== */

.dash-head-title-wrap { display: flex; align-items: center; gap: 6px; min-width: 0; }
.dash-head-title-wrap h3 { min-width: 0; }

.dash-collapse-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; flex-shrink: 0; padding: 0;
  background: transparent; border: 1px solid transparent; border-radius: 5px;
  color: var(--text-faint); cursor: pointer;
}
.dash-collapse-btn:hover { color: var(--text); border-color: var(--border-soft); background: var(--bg-elevated); }
.dash-collapse-chevron { transition: transform 0.15s ease; }
.card.is-collapsed .dash-collapse-btn .dash-collapse-chevron { transform: rotate(-90deg); }

.card.is-collapsed > :not(.panel-head-slim):not(.card-head):not(.dash-controls) { display: none; }

/* Strojenie parametrów silnika (karta "engine"): zwijane osobno, sztuczny
   klucz "engineTune" w tej samej mapie hq-dash-collapsed. */
.hq-tune-toggle {
  display: flex; align-items: center; gap: 6px;
  width: 100%; margin: 2px 0 4px; padding: 6px 2px 0;
  background: transparent; border: none; border-top: 1px solid var(--border-soft);
  color: var(--text-dim); font-family: var(--font-sans); font-size: 12px; font-weight: 600;
  cursor: pointer; text-align: left;
}
.hq-tune-toggle:hover { color: var(--text); }
.hq-tune-toggle-chevron { transition: transform 0.15s ease; flex-shrink: 0; }
.hq-tune-toggle[aria-expanded="true"] .hq-tune-toggle-chevron { transform: rotate(180deg); }
.hq-tune-body.is-collapsed { display: none; }

@media (max-width: 390px) {
  .panel-head-slim { row-gap: 8px; }
}

/* ==========================================================================
   Runda "metodologie z konkurencji": pairs trading BTC/ETH + CPCV/deflowany
   Sharpe (backtest.html), basis futures/spot + funding harvest (derywaty.html),
   Demon Shannona (portfel.html). Kolory z istniejących zmiennych motywu.
   ========================================================================== */

.pt-signal-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
@media (max-width: 720px) { .pt-signal-tiles { grid-template-columns: 1fr; } }

/* Siatka CPCV: 6 kolumn (bloki czasowe) x 5 wierszy (kombinacje) */
.cpcv-scroll { overflow-x: auto; margin-top: 10px; }
.cpcv-grid { display: grid; grid-template-columns: repeat(6, minmax(38px, 1fr)); gap: 4px; min-width: 320px; }
.cpcv-cell { height: 26px; border-radius: 4px; border: 1px solid var(--border-soft); }
.cpcv-cell.is-train { background: var(--bg-inset); }
.cpcv-cell.is-test { background: var(--accent-dim); border-color: rgba(212,175,55,0.4); }
.cpcv-cell.is-purge { background: var(--warning-dim); border: 1px dashed rgba(255,180,84,0.5); }
.cpcv-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 11.5px; color: var(--text-dim); }
.cpcv-legend-item { display: flex; align-items: center; gap: 6px; }
.cpcv-legend-swatch { width: 16px; height: 12px; border-radius: 3px; flex-shrink: 0; }

.dsr-tile-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
@media (max-width: 720px) { .dsr-tile-row { grid-template-columns: 1fr; } }
.dsr-arrow { display: flex; align-items: center; justify-content: center; color: var(--text-faint); font-size: 18px; }
@media (max-width: 720px) { .dsr-arrow { transform: rotate(90deg); } }


/* Demon Shannona (portfel.html) */
.shannon-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
@media (max-width: 720px) { .shannon-tiles { grid-template-columns: 1fr; } }

/* ============================================================
   Runda "funkcje z platform retail" (08-2026): Radar ruchu (skaner.html),
   notatki dziennika (pozycje.html), reguła jako zdanie (projektant.html),
   dostawcy sygnałów (sygnaly.html), sugerowane parametry siatki (konsola.html)
   ============================================================ */

/* Radar ruchu (skaner.html), wzór Altrady Quick Scanner */
.hq-radar-card { padding: 16px 18px; }
.hq-radar-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.hq-radar-sub { font-size: 12px; color: var(--text-dim); }
.hq-radar-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .hq-radar-grid { grid-template-columns: 1fr; } }
.hq-radar-col-title { font-size: 12px; font-weight: 700; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border-soft); }
.hq-radar-col-title-up { color: var(--accent); }
.hq-radar-col-title-down { color: var(--danger); }
.hq-radar-list { display: flex; flex-direction: column; gap: 4px; min-height: 40px; }
.hq-radar-row {
  display: grid; grid-template-columns: 1.2fr 0.9fr 0.8fr 1fr; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 6px; background: var(--bg-inset);
}
.hq-radar-pair { font-size: 12.5px; font-weight: 600; }
.hq-radar-price, .hq-radar-change, .hq-radar-vol { font-size: 12px; text-align: right; }
.hq-radar-change.positive { color: var(--accent); }
.hq-radar-change.negative { color: var(--danger); }
.hq-radar-vol { color: var(--text-faint); }
.hq-radar-empty { padding: 14px; text-align: center; color: var(--text-faint); font-size: 12px; }
.hq-radar-foot { margin-top: 10px; font-size: 11px; color: var(--text-faint); font-family: var(--font-mono); }
@media (max-width: 480px) {
  .hq-radar-row { grid-template-columns: 1fr 1fr; row-gap: 2px; }
  .hq-radar-vol { grid-column: 1 / -1; text-align: left; }
}

/* Notatki dziennika (pozycje.html), wzór Altrady Trading Journal */
.hq-journal-note-btn {
  background: none; border: none; cursor: pointer; padding: 4px; color: var(--text-faint);
  display: inline-flex; align-items: center; justify-content: center; border-radius: 5px;
}
.hq-journal-note-btn:hover { background: var(--bg-inset); color: var(--text); }
.hq-journal-note-btn.is-filled { color: var(--accent); }
.hq-journal-note-row { display: none; background: var(--bg-inset); }
.hq-journal-note-row.is-open { display: table-row; }
.hq-journal-note-row td { padding: 10px 14px; }
.hq-journal-note-editor { display: flex; flex-direction: column; gap: 8px; max-width: 640px; }
.hq-journal-note-editor textarea {
  width: 100%; min-height: 64px; resize: vertical; background: var(--bg-elevated);
  border: 1px solid var(--border-soft); border-radius: 7px; color: var(--text);
  font-family: var(--font-sans); font-size: 12.5px; padding: 8px 10px;
}
.hq-journal-note-editor textarea:focus { outline: none; border-color: var(--accent); }
.hq-journal-note-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* Reguła jako zdanie (projektant.html), wzór Coinrule */
.hq-rule-sentence-card { margin-top: 16px; }
.hq-rule-sentence-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.hq-rule-sentence-text {
  font-size: 15px; line-height: 1.6; color: var(--text); background: var(--bg-inset);
  border: 1px solid var(--border-soft); border-radius: 8px; padding: 14px 16px;
}
.hq-rule-sentence-text strong { color: var(--accent); font-weight: 700; }

/* Dostawcy sygnałów (sygnaly.html), wzór Cryptohopper Marketplace */
.hq-providers-note { font-size: 11.5px; color: var(--text-faint); margin: -6px 0 12px; }
.hq-providers-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .hq-providers-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .hq-providers-grid { grid-template-columns: 1fr; } }
.hq-provider-card {
  background: var(--bg-inset); border: 1px solid var(--border-soft); border-radius: 10px;
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.hq-provider-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.hq-provider-name { font-size: 14px; font-weight: 700; }
.hq-provider-stars { color: var(--warning); font-size: 12.5px; letter-spacing: 1px; }
.hq-provider-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; font-size: 11.5px; }
.hq-provider-stats dt { color: var(--text-faint); }
.hq-provider-stats dd { margin: 0; font-family: var(--font-mono); font-size: 13px; color: var(--text); }
.hq-provider-fee { font-size: 12px; color: var(--text-dim); }
.hq-provider-follow-btn { margin-top: auto; }
.hq-provider-follow-btn.is-following { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* Sugerowane parametry siatki (konsola.html), wzór Pionex AI 2.0 */
.hq-grid-suggest-card { margin-top: 14px; }
.hq-grid-suggest-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.hq-grid-suggest-note { font-size: 11.5px; color: var(--text-faint); margin: -4px 0 10px; }
.hq-grid-window-chips { display: flex; gap: 8px; margin-bottom: 12px; }
.hq-grid-suggest-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 640px) { .hq-grid-suggest-tiles { grid-template-columns: 1fr 1fr; } }
.hq-grid-suggest-tile { background: var(--bg-elevated); border: 1px solid var(--border-soft); border-radius: 8px; padding: 10px 12px; }
.hq-grid-suggest-tile .label { font-size: 10.5px; color: var(--text-faint); display: block; margin-bottom: 4px; }
.hq-grid-suggest-tile .value { font-family: var(--font-mono); font-size: 14px; color: var(--text); }
.hq-grid-suggest-apply { margin-top: 12px; }

/* ==========================================================================
   Animacje "krypto" (rozbudowa 2026-08-19): sieć cząstek w hero prezentacji,
   strumień transakcji symulowanych, błysk zmiany ceny, puls plakietek LIVE,
   shimmer przy pierwszym ładowaniu. Wszystko respektuje prefers-reduced-motion
   (blok wyżej) i przełącznik ręczny html.hq-motion-off (ten sam blok globalny
   `*` zeruje animation-duration, więc te klasy nie potrzebują osobnych
   nadpisań). Nowe klasy z prefiksem hq-. */

/* -------------------------------------------------- Sieć cząstek w hero */
/* Wyłącznie prezentacja.html. Canvas leży NAD gradientem .hero-band::after
   (z-index tego samego poziomu co .hero-band-inner), ale POD treścią hero
   dzięki kolejności w DOM (patrz komentarz w app.js, wireHeroParticles).
   pointer-events:none, żeby linki/przyciski w hero zostały klikalne mimo że
   canvas geometrycznie je przykrywa. */
.hero-particle-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 1;
  pointer-events: none;
  display: block;
}

/* -------------------------------------------------- Strumień transakcji */
/* Karta pod hero na prezentacja.html, wiersze symulowanych transakcji
   wjeżdżające co kilka sekund (app.js, wireTxStream). */
.hq-tx-list { display: flex; flex-direction: column; gap: 8px; }
.hq-tx-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-inset);
  border: 1px solid var(--border-soft);
  font-size: 12.5px;
}
.hq-tx-row .sim-badge { margin-left: 0; flex-shrink: 0; }
.hq-tx-txt {
  font-family: var(--font-mono); color: var(--text-dim);
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hq-tx-pnl { font-family: var(--font-mono); font-weight: 600; flex-shrink: 0; }
.hq-tx-row-in { animation: hq-tx-slide-in 0.4s ease-out; }
@keyframes hq-tx-slide-in {
  0% { opacity: 0; transform: translateX(-14px); }
  100% { opacity: 1; transform: translateX(0); }
}

/* -------------------------------------------------- Błysk zmiany ceny */
/* window.hqFlash(el, dir) w app.js dokleja/zdejmuje te klasy. Tło z akcentu/
   czerwieni gasnące do przezroczystości, ~0,6 s. Nie koliduje z istniejącym
   .flash-up/.flash-down (te zmieniają tylko kolor tekstu tickera), oba efekty
   mogą działać naraz na tym samym elemencie. */
.hq-flash-up { animation: hq-flash-pos 0.9s ease-out; border-radius: 3px; }
.hq-flash-down { animation: hq-flash-neg 0.9s ease-out; border-radius: 3px; }
@keyframes hq-flash-pos {
  0% { background-color: var(--flash-pos, var(--accent-dim)); }
  100% { background-color: transparent; }
}
@keyframes hq-flash-neg {
  0% { background-color: var(--flash-neg, var(--danger-dim)); }
  100% { background-color: transparent; }
}

/* Kaskadowe wejście kafelków status stripu przy załadowaniu pulpitu */
.hq-tile-in { animation: hq-tile-in 0.5s ease-out backwards; }
@keyframes hq-tile-in {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: none; }
}
html.hq-motion-off .hq-tile-in { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .hq-tile-in { animation: none; }
}

/* -------------------------------------------------- Puls plakietki LIVE */
/* .live-badge (SYM/LIVE inline, patrz wyżej w pliku) nie miał żadnego pulsu,
   w odróżnieniu od .status-dot i .nav-link .badge-live, które już pulsują. */
.live-badge {
  position: relative;
  animation: hq-badge-pulse 2.2s ease-in-out infinite;
}
@keyframes hq-badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-dim); }
  50% { box-shadow: 0 0 0 4px var(--accent-dim); }
}

/* ---- .is-stream: dodatkowy stan na dowolnej .live-badge, gdy dane płyną
   przez WebSocket (Binance combined stream) zamiast pollingu REST. Sama
   plakietka zostaje LIVE (uczciwie, dane są realne), doklejona kropka +
   tooltip (title ustawiany w JS) mówią skąd realnie płyną. */
.live-badge.is-stream { border-color: rgba(122,162,255,0.4); }
.live-badge.is-stream::after {
  content: "";
  display: inline-block;
  width: 5px; height: 5px; border-radius: 50%;
  margin-left: 3px;
  background: var(--info);
  animation: hq-badge-pulse-stream 1.3s ease-in-out infinite;
}
@keyframes hq-badge-pulse-stream {
  0%, 100% { box-shadow: 0 0 0 0 rgba(122,162,255,0.4); }
  50% { box-shadow: 0 0 0 3px rgba(122,162,255,0.4); }
}

/* -------------------------------------------------- Shimmer ładowania */
/* .hq-skeleton na kontenerze karty czekającej na pierwszy render danych
   (spread giełd, heatmapa, głębia rynku), zdejmowane w JS przy pierwszym
   renderze (fallback lub live, cokolwiek przyjdzie pierwsze). */
.hq-skeleton { position: relative; overflow: hidden; }
.hq-skeleton::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
  opacity: 0.55;
  animation: hq-shimmer 1.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes hq-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@media (max-width: 640px) {
  .hq-tx-txt { font-size: 12px; }
}

/* ==========================================================================
   Rozbudowa ruchu na pulpicie (2026-08-19): kaskada kart, odometr liczb w
   tickerze/pozycjach, puls kafelków heatmapy, słupki głębi z tranzycją,
   radar odliczania, oddech silnika. Ta sama konwencja co blok wyżej: klasy
   hq-, respektuje prefers-reduced-motion i html.hq-motion-off. */

/* -------------------------------------------- Kaskadowe wejście kart pulpitu */
.hq-card-in { animation: hq-card-in 0.45s ease-out backwards; }
@keyframes hq-card-in {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: none; }
}
html.hq-motion-off .hq-card-in { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .hq-card-in { animation: none; }
}

/* -------------------------------------------- Odometr (ticker, PnL pozycji) */
/* window.hqAnimSwap(el, newText) w app.js dokleja span.hq-odo-cur przy
   pierwszym użyciu. Stara wartość gaśnie i wyjeżdża w górę (.hq-odo-out),
   nowa wjeżdża od dołu (.hq-odo-in-start -> stan bazowy), ~250 ms łącznie.
   Zwykły przepływ dokumentu (bez position:absolute), więc nie psuje
   szerokości/zawijania sąsiednich elementów tickera. */
.hq-odo-cur {
  display: inline-block;
  transition: transform 0.13s ease, opacity 0.13s ease;
  transform: none;
  opacity: 1;
}
.hq-odo-cur.hq-odo-out { transform: translateY(-6px); opacity: 0; }
.hq-odo-cur.hq-odo-in-start { transform: translateY(6px); opacity: 0; transition: none; }
html.hq-motion-off .hq-odo-cur { transition: none; }

/* -------------------------------------------- Puls kafelków heatmapy */
/* Doklejane w renderHeatmap (app.js) tylko na kafelkach, którym faktycznie
   zmieniła się cena/zmiana % między odświeżeniami. */
.hq-tile-pulse { animation: hq-tile-pulse 0.3s ease; }
@keyframes hq-tile-pulse {
  0% { filter: brightness(1.6); }
  100% { filter: brightness(1); }
}
html.hq-motion-off .hq-tile-pulse { animation: none; }

/* -------------------------------------------- Radar "Następny skan" */
/* Mały pierścień conic-gradient obok wartości odliczania, wypełnia się z
   --hq-radar-pct (ustawiane w wireStatusScanCountdown, ten sam licznik co
   tekst mm:ss). Donut zrobiony przez ::after z tłem karty na środku. */
.hq-radar-ring {
  --hq-radar-pct: 0%;
  width: 16px; height: 16px;
  border-radius: 50%;
  margin-left: auto;
  flex-shrink: 0;
  background: conic-gradient(var(--accent) var(--hq-radar-pct), var(--border-soft) 0);
  position: relative;
  /* Uwaga: --hq-radar-pct NIE jest zarejestrowane przez @property, więc
     conic-gradient nie interpoluje płynnie, stopniowanie co 1 s (ten sam
     interwał co tekst mm:ss w wireStatusScanCountdown) jest tu celowe,
     nie brakujące przejście. */
}
.hq-radar-ring::after {
  content: "";
  position: absolute; inset: 3px;
  border-radius: 50%;
  background: var(--bg-card);
}
.hq-radar-ping { animation: hq-radar-ping 0.5s ease-out; }
@keyframes hq-radar-ping {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
html.hq-motion-off .hq-radar-ping { animation: none; }

/* -------------------------------------------- Glow silnika (stan running) */
/* Czyta klasy JUŻ nadawane przez wireDashToolbarEngine (is-paused/
   is-stopped/is-stopping na .status-tile[data-dash-engine-chip]), nie
   duplikuje maszyny stanów: brak tych klas = running, kropka oddycha. */
.status-tile[data-dash-engine-chip]:not(.is-paused):not(.is-stopped):not(.is-stopping) .status-tile-dot {
  animation: hq-engine-glow 3s ease-in-out infinite;
}
@keyframes hq-engine-glow {
  0%, 100% { box-shadow: 0 0 0 3px var(--accent-dim); }
  50% { box-shadow: 0 0 0 6px var(--accent-dim), 0 0 10px 2px var(--accent-dim); }
}
html.hq-motion-off .status-tile[data-dash-engine-chip] .status-tile-dot { animation: none; }

/* ==========================================================================
   AURUM, klasy wlasne makiety akcji w zlocie (poza wspolnym szkieletem
   krypto). Prefiks .au- odroznia je od reszty stylow dziedziczonych.
   ========================================================================== */

/* Liczba w gramach zlota: serif, cyfry tabelaryczne, jednostka w malym spanie. */
.au-gold {
  font-family: var(--font-serif);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  color: var(--text);
}
.au-gold.is-pos { color: var(--positive); }
.au-gold.is-neg { color: var(--danger); }
.au-unit {
  font-family: var(--font-sans);
  font-size: 0.62em;
  color: var(--text-faint);
  margin-left: 3px;
  letter-spacing: 0.2px;
}

/* Plomba: blok wyszarzony z ikona klodki i podpisem, uzywany gdy okno
   decyzyjne jest zamkniete (poza kwartalem) albo dana czesc jest tylko
   podgladem. */
.au-sealed {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--bg-inset);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  color: var(--text-dim);
  filter: grayscale(0.35);
}
.au-sealed-icon {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-faint);
}
.au-sealed-body { flex: 1; min-width: 0; }
.au-sealed-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.au-sealed-sub { font-size: 12px; color: var(--text-faint); line-height: 1.5; }

/* Sekcja szumu: dane dzienne/miesieczne pokazane obok sygnalu kwartalnego,
   celowo obnizony kontrast, zeby wzrok szedl najpierw na kwartal. */
.au-noise {
  opacity: 0.62;
  filter: saturate(0.7);
}
.au-noise:hover,
.au-noise:focus-within { opacity: 0.9; filter: none; }
.au-noise-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-faint);
}

/* Etykieta linii bazowej "1 000 g Au" na wykresach porownawczych: samo
   zloto jako miara, pozioma linia stala niezaleznie od zakresu danych. */
.au-baseline {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-faint);
  letter-spacing: 0.2px;
}
.au-baseline::before {
  content: "";
  width: 12px; height: 0;
  border-top: 1.5px dashed var(--accent);
  display: inline-block;
}
