/* ---------- Tokens ---------- */
:root {
  --bg: #07090a;
  --panel: #0e1310;
  --panel-2: #131a16;
  --border: #212a24;
  --border-soft: #171f1a;
  --text: #eef1ee;
  --text-muted: #8a9890;
  --text-dim: #56645c;
  --accent: #4aa3df;
  --accent-soft: rgba(74, 163, 223, 0.14);
  --accent-glow: rgba(74, 163, 223, 0.45);
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.12);
  --red: #ea6a63;
  --red-soft: rgba(234, 106, 99, 0.12);
  --radius: 12px;
  --radius-sm: 7px;
  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

body {
  background-image:
    radial-gradient(circle at 12% -10%, rgba(74, 163, 223, 0.1), transparent 45%),
    radial-gradient(circle at 92% 18%, rgba(52, 211, 153, 0.05), transparent 40%),
    linear-gradient(rgba(74, 163, 223, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 163, 223, 0.05) 1px, transparent 1px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0px, rgba(255,255,255,0.012) 1px, transparent 1px, transparent 3px);
  background-size: auto, auto, 46px 46px, 46px 46px, auto;
  background-attachment: fixed;
  animation: grid-drift 70s linear infinite;
}
@keyframes grid-drift {
  from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0; }
  to { background-position: 0 0, 0 0, 46px 46px, 46px 46px, 0 0; }
}

.cursor-blink { color: var(--accent); animation: cursor-blink 1.1s steps(1) infinite; margin-left: 1px; }
@keyframes cursor-blink { 50%, 100% { opacity: 0; } }

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

a { color: inherit; }
button { font-family: inherit; }
::selection { background: var(--accent-soft); color: var(--accent); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; transition: background .15s; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ---------- Shell ---------- */
.shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--border-soft);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 8px;
}
.brand .mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.01em;
}
.brand .mark span { color: var(--accent); }
.brand .tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s;
}
.nav-item svg { width: 16px; height: 16px; opacity: 0.85; flex-shrink: 0; }
.nav-item { transition: background .15s, color .15s, box-shadow .15s; }
.nav-item:hover { color: var(--text); background: var(--panel-2); }
.nav-item.active {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 4px 22px -4px var(--accent-glow), 0 0 0 1px rgba(74,163,223,0.3);
}
.nav-item.active svg { opacity: 1; }
.nav-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 6px;
}
.nav-item.active .nav-badge { color: #ffffff; background: rgba(255,255,255,0.18); border-color: transparent; }

.sidebar-foot {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
  padding: 0 8px;
  line-height: 1.6;
}

.market-clock {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mc-berlin {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}
.mc-berlin-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.mc-berlin-time {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
  letter-spacing: 0.02em;
}
.mc-session {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
}
.mc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
  flex: none;
}
.mc-session.open .mc-dot {
  background: var(--green);
  box-shadow: 0 0 6px 0 var(--green-soft);
}
.mc-name {
  color: var(--text-muted);
  font-weight: 600;
  min-width: 58px;
}
.mc-session.open .mc-name { color: var(--text); }
.mc-status {
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: 10.5px;
  margin-left: auto;
}
.mc-session.open .mc-status { color: var(--green); }

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

.view { display: none; }
.view.active { display: block; }

.view-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.view-header h1 {
  font-family: var(--font-display);
  font-size: 24px;
  margin: 0 0 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.view-header p { margin: 0; color: var(--text-muted); font-size: 13px; }

/* ---------- Buttons / inputs ---------- */
.btn {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s, transform 0.05s;
}
.btn:hover { border-color: #333c52; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 0 0 rgba(74,163,223,0);
  transition: border-color 0.15s, transform 0.05s, box-shadow 0.2s, background 0.15s;
}
.btn-primary:hover { background: #6ab8e8; border-color: #6ab8e8; box-shadow: 0 6px 22px -6px var(--accent-glow); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(1px); box-shadow: none; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); background: var(--panel-2); }
.btn-danger { color: var(--red); }
.btn-sm { padding: 6px 11px; font-size: 12px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11.5px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.02em; }
.field .hint { font-size: 11px; color: var(--text-dim); }

input, select, textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
  width: 100%;
}
input:focus, select:focus, textarea:focus, button:focus-visible, .nav-item:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; min-height: 70px; font-family: var(--font-body); }
input[type="number"], input.mono { font-family: var(--font-mono); }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; border-top: 1px solid var(--border-soft); padding-top: 16px; }

.side-toggle { display: flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.side-toggle button {
  flex: 1; padding: 9px; background: var(--bg); border: none; color: var(--text-muted); cursor: pointer; font-weight: 600; font-size: 13px;
}
.side-toggle button.active.long { background: var(--green-soft); color: var(--green); }
.side-toggle button.active.short { background: var(--red-soft); color: var(--red); }

/* ---------- Cards / stats ---------- */
.filters-bar {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px;
  align-items: center;
}
.filters-bar select, .filters-bar input { width: auto; min-width: 140px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.stat-cell {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 16px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  animation: stat-in .4s ease both;
}
.stat-cell:nth-child(1) { animation-delay: 0s; }
.stat-cell:nth-child(2) { animation-delay: .04s; }
.stat-cell:nth-child(3) { animation-delay: .08s; }
.stat-cell:nth-child(4) { animation-delay: .12s; }
.stat-cell:nth-child(5) { animation-delay: .16s; }
.stat-cell:nth-child(6) { animation-delay: .2s; }
@keyframes stat-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.stat-cell:hover { transform: translateY(-2px); }
.stat-cell:has(.value.pos) {
  border-color: rgba(52,211,153,0.25);
  background: linear-gradient(180deg, rgba(52,211,153,0.07), transparent 60%), var(--panel);
  box-shadow: 0 0 0 1px rgba(52,211,153,0.06), 0 12px 28px -16px rgba(52,211,153,0.45);
}
.stat-cell:has(.value.neg) {
  border-color: rgba(234,106,99,0.25);
  background: linear-gradient(180deg, rgba(234,106,99,0.07), transparent 60%), var(--panel);
  box-shadow: 0 0 0 1px rgba(234,106,99,0.06), 0 12px 28px -16px rgba(234,106,99,0.45);
}
.stat-cell .label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-dim);
  margin-bottom: 9px;
  font-weight: 600;
}
.stat-cell .value {
  font-family: var(--font-mono);
  font-size: 21px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.value.pos { color: var(--green); text-shadow: 0 0 16px rgba(52,211,153,0.35); }
.value.neg { color: var(--red); text-shadow: 0 0 16px rgba(234,106,99,0.35); }
.value.neutral { color: var(--accent); text-shadow: 0 0 16px rgba(74,163,223,0.3); }

.panel {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 20px;
  transition: border-color .2s, box-shadow .2s;
}
.panel:hover { border-color: var(--border); box-shadow: 0 16px 36px -22px rgba(0,0,0,0.6); }
.panel-title {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-sub { color: var(--text-dim); font-size: 11.5px; margin: 0 0 14px; font-family: var(--font-mono); }

.chart-wrap { position: relative; height: 260px; }
.chart-wrap canvas { filter: drop-shadow(0 0 8px rgba(74,163,223,0.3)); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.breakdown-row {
  display: grid;
  grid-template-columns: 110px 1fr 60px 90px 70px;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12.5px;
}
.breakdown-row:last-child { border-bottom: none; }
.breakdown-row .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breakdown-row .bar-track { height: 6px; background: var(--border-soft); border-radius: 4px; overflow: hidden; }
.breakdown-row .bar-fill { height: 100%; background: var(--accent); }
.breakdown-row .pnl { font-family: var(--font-mono); text-align: right; }
.breakdown-row .wr { font-family: var(--font-mono); color: var(--text-muted); text-align: right; }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
  font-size: 13px;
}
.empty-state .big { font-family: var(--font-display); font-size: 15px; color: var(--text-muted); margin-bottom: 6px; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  white-space: nowrap;
}
tbody tr { cursor: pointer; transition: background 0.1s; }
tbody tr:hover { background: var(--panel-2); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-family: var(--font-body);
  font-weight: 600;
  white-space: nowrap;
}
.chip.long { background: var(--green-soft); color: var(--green); box-shadow: 0 0 0 1px rgba(52,211,153,0.18); }
.chip.short { background: var(--red-soft); color: var(--red); box-shadow: 0 0 0 1px rgba(234,106,99,0.18); }
.chip.status-open { background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 1px rgba(74,163,223,0.2); }
.chip.status-closed { background: rgba(131,139,160,0.14); color: var(--text-muted); }
.chip.status-cancelled { background: rgba(131,139,160,0.08); color: var(--text-dim); }
.chip.setup-chip { background: var(--panel-2); color: var(--text-muted); border: 1px solid var(--border); }
.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* ---------- Setups / Exchanges cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.setup-card, .exchange-card {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.setup-card .head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.setup-card .name { font-family: var(--font-display); font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.setup-card .desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; margin-bottom: 10px; }
.setup-card ul { margin: 0; padding-left: 16px; font-size: 12px; color: var(--text-muted); }
.setup-card .stats-mini { display: flex; gap: 14px; margin-top: 10px; font-family: var(--font-mono); font-size: 11.5px; }
.setup-card .actions, .exchange-card .actions { display: flex; gap: 6px; margin-top: 12px; }

.exchange-card .head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.exchange-card .name { font-family: var(--font-display); font-weight: 600; font-size: 14.5px; }
.exchange-card .badge { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); text-transform: uppercase; }
.exchange-card .meta { font-size: 12px; color: var(--text-muted); line-height: 1.7; }
.exchange-card .meta b { color: var(--text); font-weight: 600; }

.banner {
  border: 1px solid rgba(74, 163, 223, 0.3);
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 13px 16px;
  font-size: 12.5px;
  color: #a9d4f0;
  margin-bottom: 20px;
  line-height: 1.6;
}
.banner b { color: var(--accent); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(6, 8, 12, 0.7);
  display: none; align-items: flex-start; justify-content: center;
  padding: 40px 20px; z-index: 100; overflow-y: auto;
  backdrop-filter: blur(2px);
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  width: 100%;
  max-width: 620px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h2 { font-family: var(--font-display); font-size: 16px; margin: 0; }
.modal-close { cursor: pointer; color: var(--text-dim); background: none; border: none; font-size: 18px; }
.modal-close:hover { color: var(--text); }

.toast {
  position: fixed; bottom: 22px; right: 22px; z-index: 200;
  background: var(--panel-2); border: 1px solid var(--border);
  padding: 11px 16px; border-radius: var(--radius-sm);
  font-size: 12.5px; display: none; max-width: 340px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.toast.show { display: block; }
.toast.error { border-color: rgba(229,89,93,0.4); color: #f2a3a5; }
.toast.success { border-color: rgba(63,191,127,0.4); color: #a6e6c4; }

.checklist-input { display: flex; flex-direction: column; gap: 6px; }
.checklist-row { display: flex; gap: 6px; }
.checklist-row input { flex: 1; }

/* ---------- Exchange symbol picker ---------- */
.symbol-picker { position: relative; }
.symbol-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); max-height: 220px; overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.symbol-option {
  padding: 8px 12px; font-size: 12.5px; font-family: var(--font-mono);
  cursor: pointer;
}
.symbol-option:hover { background: var(--panel); color: var(--accent); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip-removable {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 6px 4px 10px; border-radius: 20px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-family: var(--font-mono); font-weight: 600;
}
.chip-removable button {
  background: none; border: none; color: inherit; cursor: pointer;
  font-size: 14px; line-height: 1; padding: 2px;
}

/* ---------- Calendar ---------- */
.cal-nav { display: flex; align-items: center; gap: 12px; }
.cal-month-label { font-family: var(--font-display); font-weight: 700; font-size: 14px; min-width: 130px; text-align: center; }

.cal-source-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.cal-source-tab {
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 12.5px; font-weight: 700;
}
.cal-source-tab:hover { color: var(--text); }
.cal-source-tab.active { background: var(--accent); border-color: var(--accent); color: #ffffff; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 20px;
}
.cal-dow {
  text-align: center; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-dim); padding-bottom: 4px; font-weight: 600;
}
.cal-cell {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  min-height: 78px;
  padding: 8px;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 4px;
}
.cal-cell:hover { border-color: var(--border); }
.cal-cell.empty { background: transparent; border-color: transparent; cursor: default; }
.cal-cell.pos { border-color: rgba(52,211,153,0.25); background: linear-gradient(180deg, rgba(52,211,153,0.08), transparent 70%), var(--panel); }
.cal-cell.neg { border-color: rgba(234,106,99,0.25); background: linear-gradient(180deg, rgba(234,106,99,0.08), transparent 70%), var(--panel); }
.cal-cell.selected { outline: 1.5px solid var(--accent); }
.cal-cell .cal-daynum-row { display: flex; align-items: center; justify-content: space-between; }
.cal-cell .cal-daynum { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }
.cal-cell.today { border-color: var(--accent); }
.cal-cell.today .cal-daynum {
  background: var(--accent); color: #ffffff;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.cal-cell .cal-task-dot {
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: 9px; font-weight: 700; font-family: var(--font-mono);
  display: flex; align-items: center; justify-content: center;
}
.cal-cell .cal-pnl { font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; }
.cal-cell .cal-count { font-size: 10.5px; color: var(--text-dim); margin-top: auto; }

/* ---------- Daily tasks ---------- */
.task-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 2px; border-bottom: 1px solid var(--border-soft);
}
.task-row:last-child { border-bottom: none; }
.task-row .task-check {
  width: 18px; height: 18px; border-radius: 5px; flex-shrink: 0;
  border: 1.5px solid var(--border); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.task-row .task-check svg { width: 12px; height: 12px; color: #fff; opacity: 0; }
.task-row.done .task-check { background: var(--accent); border-color: var(--accent); }
.task-row.done .task-check svg { opacity: 1; }
.task-row .task-text { flex: 1; font-size: 13px; cursor: pointer; }
.task-row.done .task-text { color: var(--text-dim); text-decoration: line-through; }
.task-row .task-remove {
  opacity: 0; background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 15px;
  padding: 2px 6px;
}
.task-row:hover .task-remove { opacity: 1; }
.task-row .task-remove:hover { color: var(--red); }
.task-empty { color: var(--text-dim); font-size: 12.5px; padding: 10px 2px; }

/* ---------- Global reminder banner ---------- */
.global-banner {
  border: 1px solid rgba(234, 106, 99, 0.3);
  background: var(--red-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
}
.global-banner-text {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: #f0a5a1; font-weight: 600;
}
.global-banner-text svg { width: 18px; height: 18px; color: var(--red); flex-shrink: 0; }
.global-banner-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.global-banner-chip {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px 3px 3px 10px; border-radius: 20px;
  background: var(--panel-2); border: 1px solid var(--border);
  font-size: 12px; font-family: var(--font-mono); color: var(--text);
}
.global-banner-chip [data-open] { cursor: pointer; padding: 2px 0; }
.global-banner-chip [data-open]:hover { color: #f0a5a1; }
.global-banner-chip .chip-dismiss {
  display: inline-flex; align-items: center;
  margin-left: 4px; padding: 3px 8px; border-radius: 16px;
  background: transparent; border: 1px solid transparent;
  color: var(--text-dim); font-size: 11px; font-family: var(--font-body); font-weight: 600;
  cursor: pointer;
}
.global-banner-chip .chip-dismiss:hover { background: var(--green-soft); border-color: rgba(52,211,153,0.3); color: var(--green); }

/* ---------- Auth ---------- */
.auth-screen {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  padding: 20px;
}
.auth-card {
  width: 100%; max-width: 360px;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 28px 26px;
}
.auth-card .brand { justify-content: center; }
.auth-sub { text-align: center; color: var(--text-muted); font-size: 13px; margin: 0 0 20px; }
.auth-tabs {
  display: flex; border: 1px solid var(--border); border-radius: 999px;
  padding: 3px; margin-bottom: 20px;
}
.auth-tab {
  flex: 1; border: none; background: transparent; color: var(--text-muted);
  font-family: inherit; font-size: 13px; font-weight: 700; padding: 8px;
  border-radius: 999px; cursor: pointer;
}
.auth-tab.active { background: var(--accent); color: #ffffff; }
.auth-form { display: flex; flex-direction: column; }
.auth-submit { width: 100%; justify-content: center; margin-top: 18px; }
.auth-error { color: var(--red); font-size: 12.5px; margin-top: 14px; text-align: center; min-height: 1em; }

.account-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px; margin-bottom: 10px; font-family: var(--font-body);
  color: var(--text-muted); font-size: 11.5px;
}

/* ---------- Reviews ---------- */
.review-card {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.review-card .head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.review-card .name { font-family: var(--font-display); font-weight: 600; font-size: 14.5px; }
.review-card .desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; margin-bottom: 8px; }
.review-card ul { margin: 0 0 10px; padding-left: 16px; font-size: 12px; color: var(--text-muted); }
.review-card .actions { display: flex; gap: 6px; margin-top: 10px; }

/* ---------- Learn: video/image rows in modal ---------- */
.video-row { display: flex; gap: 8px; }
.video-row .v-title { flex: 0 0 34%; }
.video-row .v-url { flex: 1; }

.topic-image-card {
  position: relative;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.topic-image-card img { width: 100%; height: 90px; object-fit: cover; border-radius: 5px; }
.topic-image-card .img-caption { font-size: 12px; }
#tp-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }

/* ---------- Learn: topic accordion ---------- */
.topic-card {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.topic-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  cursor: pointer;
}
.topic-head:hover { background: var(--panel-2); }
.topic-head-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topic-head-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.chevron { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-dim); transition: transform 0.18s; }
.chevron.open { transform: rotate(90deg); color: var(--accent); }
.topic-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.topic-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.2s ease; }
.topic-body.open { grid-template-rows: 1fr; }
.topic-body-inner { overflow: hidden; padding: 0 18px; }
.topic-body.open .topic-body-inner { padding: 2px 18px 18px; border-top: 1px solid var(--border-soft); }

.topic-notes { font-size: 13px; line-height: 1.7; color: var(--text); margin: 16px 0; white-space: normal; }

.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 6px; }
.video-embed-ratio { position: relative; width: 100%; padding-top: 56.25%; border-radius: var(--radius-sm); overflow: hidden; background: #000; }
.video-embed-ratio iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-caption { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.video-link {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  color: var(--text); font-size: 13px; font-weight: 600; text-decoration: none;
}
.video-link:hover { border-color: var(--border); background: var(--panel-2); }
.video-link svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }

.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.topic-image { display: block; text-decoration: none; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); overflow: hidden; }
.topic-image img { width: 100%; height: 110px; object-fit: cover; display: block; }
.topic-image-caption { font-size: 11.5px; color: var(--text-muted); padding: 6px 8px; }

/* ---------- Dashboard widget reordering ---------- */
.dashboard-widgets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  align-items: start;
}
.dash-widget { position: relative; }
.dash-widget.wide { grid-column: 1 / -1; }
.dash-widget.panel { margin-bottom: 0; }
.dash-widget-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 16px;
  margin-bottom: 8px;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 3px;
  cursor: grab;
  border-radius: 6px;
  user-select: none;
  opacity: 0.35;
  transition: opacity 0.15s, background 0.15s;
  touch-action: none;
}
.dash-widget-handle:hover { opacity: 1; background: var(--panel-2); }
.dash-widget-handle:active { cursor: grabbing; }
/* The stats widget has no .panel background of its own, so its handle
   would otherwise float as a couple of unexplained dots in empty space —
   give it a faint permanent chip so it reads as a control, not a glitch. */
.dash-widget:not(.panel) .dash-widget-handle { opacity: 0.5; background: var(--panel-2); width: 34px; margin: 0 auto 8px; }
.dash-widget.dragging { opacity: 0.4; }
.dash-widget.drag-over-before { box-shadow: inset 0 3px 0 var(--accent); }
.dash-widget.drag-over-after { box-shadow: inset 0 -3px 0 var(--accent); }

/* ---------- Sidebar nav reordering ---------- */
.nav-item.dragging { opacity: 0.4; }
.nav-item.drag-over-before { box-shadow: inset 0 2px 0 var(--accent); }
.nav-item.drag-over-after { box-shadow: inset 0 -2px 0 var(--accent); }

/* ---------- News ---------- */
.news-filters-bar { justify-content: space-between; }
.news-impact-filters { display: flex; gap: 14px; flex-wrap: wrap; }
.news-check {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--text-muted); font-weight: 600; cursor: pointer;
}
.news-check input { width: auto; accent-color: var(--accent); }

.news-day-group { margin-bottom: 22px; }
.news-day-header {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding-bottom: 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border-soft);
}
.news-row {
  display: grid;
  grid-template-columns: 56px 52px 68px 1fr 90px 90px;
  align-items: center;
  gap: 12px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12.5px;
}
.news-row:last-child { border-bottom: none; }
.news-row.past { opacity: 0.45; }
.news-time { font-family: var(--font-mono); color: var(--text-dim); }
.news-currency { font-family: var(--font-mono); font-weight: 700; color: var(--text-muted); }
.news-impact-badge {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  text-align: center; padding: 3px 6px; border-radius: 20px; white-space: nowrap;
}
.news-row.impact-high .news-impact-badge { background: var(--red-soft); color: var(--red); }
.news-row.impact-medium .news-impact-badge { background: rgba(232,163,61,0.14); color: #e8a33d; }
.news-row.impact-low .news-impact-badge { background: var(--panel-2); color: var(--text-dim); }
.news-row.impact-holiday .news-impact-badge { background: var(--accent-soft); color: var(--accent); }
.news-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-fc, .news-prev { font-family: var(--font-mono); color: var(--text-dim); text-align: right; white-space: nowrap; }

@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; }
  .nav { flex-direction: row; }
  /* Animating background-position repaints the full viewport every frame —
     fine on desktop, but a real jank/stutter source on phone GPUs. Keep the
     static gradient look, drop the continuous drift. */
  body { animation: none; }
  .chart-wrap canvas { filter: none; }
  .sidebar-foot { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .dashboard-widgets { grid-template-columns: 1fr; }
  .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .news-row {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  }
  .news-row .news-title { flex-basis: 100%; white-space: normal; order: 1; }
  .news-row .news-fc, .news-row .news-prev { text-align: left; order: 2; }
}
