:root {
  --bg: #0b1426;
  --bg-2: #101d36;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.1);
  --ink: #eef3fb;
  --ink-2: #a8b6cc;
  --ink-3: #74839b;
  --accent: #3b82f6;
  --accent-2: #22d3ee;
  --accent-3: #f59e0b;
  --good: #22c55e;
  --bad: #f43f5e;
  --glow: rgba(59, 130, 246, 0.35);
}

body[data-theme='global-trader'] {
  --bg: #07101f;
  --bg-2: #0d1d3a;
  --accent: #3b82f6;
  --accent-2: #22d3ee;
  --accent-3: #f59e0b;
  --glow: rgba(59, 130, 246, 0.4);
}

body[data-theme='global-asset-manager'] {
  --bg: #120a24;
  --bg-2: #22113f;
  --accent: #a855f7;
  --accent-2: #f472b6;
  --accent-3: #fbbf24;
  --glow: rgba(168, 85, 247, 0.4);
}

body[data-theme='ventum'] {
  --bg: #04150f;
  --bg-2: #0a2a1e;
  --accent: #22c55e;
  --accent-2: #a3e635;
  --accent-3: #38bdf8;
  --glow: rgba(34, 197, 94, 0.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }

body {
  font-family: Inter, 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 0% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    radial-gradient(1000px 700px at 100% 100%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 60%),
    linear-gradient(160deg, var(--bg), var(--bg-2));
  background-attachment: fixed;
  transition: background 0.6s ease;
  overflow-x: hidden;
}

.app { height: 100vh; display: flex; flex-direction: column; }
.pill[hidden] { display: none; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(8px);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand__mark {
  display: grid;
  place-items: center;
  min-width: 46px;
  height: 46px;
  padding: 0 8px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 24px -8px var(--glow);
}
.brand__text { display: grid; min-width: 0; }
.brand__text small { color: var(--ink-3); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.brand__text strong { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__right { display: flex; gap: 8px; flex-shrink: 0; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: var(--surface);
}
.pill--preview { color: var(--accent-3); border-color: color-mix(in srgb, var(--accent-3) 45%, transparent); }
.pill--live { color: #fff; background: color-mix(in srgb, var(--bad) 75%, transparent); border-color: transparent; }
.pill--live i { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: blink 1s infinite; }

.screen { flex: 1; display: flex; padding: 20px 28px; min-height: 0; overflow-y: auto; }
.screen--run { overflow: hidden; }
.screen[hidden] { display: none; }

.picker, .loading, .done { margin: auto; width: 100%; text-align: center; }
.picker { max-width: 980px; }
.picker h1, .loading h1, .done h1 { margin: 0 0 10px; font-size: clamp(28px, 3vw, 44px); letter-spacing: -0.02em; }
.picker p, .loading p, .done p { margin: 0 0 28px; color: var(--ink-2); font-size: clamp(15px, 1.2vw, 18px); }
.picker__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.picker__card {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 24px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  text-align: left;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.picker__card:hover { transform: translateY(-3px); border-color: var(--card-accent); }
.picker__card span { display: grid; place-items: center; min-width: 52px; height: 52px; padding: 0 10px; border-radius: 10px; background: var(--card-accent); font-weight: 800; }
.picker__card strong { font-size: 20px; }
.picker__card small { color: var(--ink-2); font-size: 14px; line-height: 1.4; }

.loading { max-width: 560px; }
.loading__orb {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 40%, transparent), transparent 70%);
}
.loading__orb::before, .loading__orb::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--accent);
  border-right-color: var(--accent-2);
  animation: spin 1.1s linear infinite;
}
.loading__orb::after { inset: 14px; border-top-color: var(--accent-2); border-right-color: transparent; border-left-color: var(--accent); animation-duration: 1.6s; animation-direction: reverse; }
.loading__orb span { font-weight: 800; font-size: 22px; letter-spacing: 0.04em; }
.loading__steps { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 10px; text-align: left; }
.loading__steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-3);
  font-weight: 500;
  transition: all 0.3s ease;
}
.loading__steps li i { width: 20px; height: 20px; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--ink-3); display: grid; place-items: center; font-style: normal; font-size: 12px; }
.loading__steps li.is-active { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.loading__steps li.is-active i { border-color: var(--accent); border-top-color: transparent; animation: spin 0.8s linear infinite; }
.loading__steps li.is-done { color: var(--ink-2); }
.loading__steps li.is-done i { border-color: var(--good); background: var(--good); color: #04150f; }
.loading__bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.loading__bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.25s linear; }

.run { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; min-height: 0; }
.run__main { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 16px; min-width: 0; min-height: 0; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); min-width: 0; }
.kpi small { display: block; color: var(--ink-3); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.kpi strong { display: block; margin: 6px 0 2px; font-family: 'JetBrains Mono', monospace; font-size: clamp(18px, 1.6vw, 26px); white-space: nowrap; }
.kpi span { font-size: 13px; font-weight: 700; }
.up { color: var(--good); }
.down { color: var(--bad); }

.chart-card { display: flex; flex-direction: column; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); min-height: 0; }
.chart-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.chart-card__head h2 { margin: 0; font-size: 17px; }
.chart-card__head small { color: var(--ink-3); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 3px; border-radius: 2px; }
.chart-card__plot { position: relative; flex: 1; min-height: 160px; }
#chart { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.lower { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.panel { padding: 14px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); min-width: 0; }
.panel h3 { margin: 0 0 12px; font-size: 14px; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 54px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .track { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 999px; transition: width 0.8s ease; }
.bar-row b { font-family: 'JetBrains Mono', monospace; text-align: right; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; height: 128px; align-content: start; overflow: hidden; }
.feed li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; font-size: 13px; color: var(--ink-2); animation: slide-in 0.4s ease; }
.feed li time { font-family: 'JetBrains Mono', monospace; color: var(--ink-3); }
.feed li strong { color: var(--ink); font-weight: 600; }

.run__side { display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; }
.timer { position: relative; width: 150px; height: 150px; margin: 0 auto; flex-shrink: 0; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer__track { fill: none; stroke: var(--surface-2); stroke-width: 8; }
.timer__ring { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 326.73; stroke-dashoffset: 0; transition: stroke-dashoffset 0.25s linear, stroke 0.3s ease; filter: drop-shadow(0 0 8px var(--glow)); }
.timer.is-low .timer__ring { stroke: var(--bad); }
.timer__value { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.timer__value strong { font-family: 'JetBrains Mono', monospace; font-size: 44px; line-height: 1; }
.timer__value small { color: var(--ink-3); font-size: 12px; margin-top: 6px; text-transform: uppercase; letter-spacing: 0.08em; }
.round { text-align: center; color: var(--ink-2); font-weight: 600; font-size: 14px; }

.notes { flex: 1; min-height: 0; overflow: hidden; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.notes h3 { margin: 0 0 12px; font-size: 14px; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; }
.notes__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.notes__list li {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--surface);
  opacity: 0.55;
  transition: all 0.4s ease;
}
.notes__list li strong { display: block; font-size: 14px; margin-bottom: 4px; }
.notes__list li span { display: block; font-size: 12.5px; line-height: 1.4; color: var(--ink-2); }
.notes__list li.is-active {
  opacity: 1;
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  box-shadow: 0 10px 30px -14px var(--glow);
  transform: translateX(-4px);
}
.notes__list li.is-key strong { color: var(--accent-3); }

.done { max-width: 760px; }
.done__badge {
  width: 88px;
  height: 88px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 42px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 16px 40px -14px var(--glow);
  animation: pop 0.5s ease;
}
.done__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.done__stats .kpi { text-align: left; }
.callout {
  padding: 14px 18px;
  margin-bottom: 24px;
  border-radius: 12px;
  text-align: left;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
  border: 1px solid color-mix(in srgb, var(--accent-3) 40%, transparent);
  background: color-mix(in srgb, var(--accent-3) 10%, transparent);
}
.callout strong { color: var(--accent-3); }
.done__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  min-height: 48px;
  padding: 0 26px;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  border: 1px solid var(--line);
  transition: transform 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--ghost { background: var(--surface); color: var(--ink); }
.btn--primary { border: 0; color: #fff; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--accent-2))); box-shadow: 0 10px 24px -10px var(--glow); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: 0.25; } }
@keyframes slide-in { from { opacity: 0; transform: translateY(-6px); } }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }

@media (max-width: 1100px), (max-height: 760px) {
  .app { height: auto; min-height: 100vh; }
  .screen--run { overflow: visible; }
  .run__main { grid-template-rows: auto 340px auto; }
}

@media (max-width: 1100px) {
  .run { grid-template-columns: 1fr; }
  .run__side { display: grid; grid-template-columns: 170px minmax(0, 1fr); align-items: start; }
  .round { grid-column: 1; }
  .notes { grid-column: 2; grid-row: 1 / span 2; }
}

@media (max-width: 720px) {
  .topbar { padding: 12px 16px; }
  .screen { padding: 16px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lower { grid-template-columns: 1fr; }
  .run__side { grid-template-columns: 1fr; }
  .notes { grid-column: auto; grid-row: auto; }
  .pill--preview { display: none; }
}

.spotlight {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  pointer-events: none;
}
.spotlight__card {
  width: min(620px, 100%);
  padding: 22px 26px 18px;
  border-radius: 16px;
  text-align: center;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: 0 24px 60px -24px var(--glow), 0 0 0 6px color-mix(in srgb, var(--accent) 8%, transparent);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.spotlight__card.is-swapping { opacity: 0; transform: translateY(8px) scale(0.98); }
.spotlight__card small {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-3);
  background: color-mix(in srgb, var(--accent-3) 14%, transparent);
}
.spotlight__card strong { display: block; font-size: clamp(20px, 1.7vw, 28px); margin-bottom: 8px; }
.spotlight__card p { margin: 0 0 14px; color: var(--ink-2); font-size: clamp(15px, 1.15vw, 18px); line-height: 1.5; }
.spotlight__dots { display: flex; justify-content: center; gap: 6px; }
.spotlight__dots i { width: 22px; height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; position: relative; }
.spotlight__dots i.is-done { background: var(--accent); }
.spotlight__dots i.is-active::after { content: ''; position: absolute; inset: 0; background: var(--accent); transform-origin: left; animation: fill var(--note-ms, 6s) linear forwards; }

.notes__list li span { display: none; }
.notes__list li { padding: 9px 12px; }
.notes__list li strong { margin: 0; font-size: 13.5px; }
.notes__list li.is-active { transform: none; }

.session { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.session h3 { margin: 0 0 10px; font-size: 14px; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; }
.session dl { margin: 0; display: grid; gap: 8px; }
.session dl div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.session dt { color: var(--ink-3); }
.session dd { margin: 0; font-family: 'JetBrains Mono', monospace; font-weight: 700; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 26px;
  padding: 14px 20px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check__box { width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--ink-3); display: grid; place-items: center; transition: all 0.15s ease; }
.check input:checked + .check__box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .check__box::after { content: '✓'; color: #fff; font-weight: 800; font-size: 15px; }
.check input:focus-visible + .check__box { box-shadow: 0 0 0 3px var(--glow); }

.report { margin: auto; width: 100%; max-width: 760px; text-align: center; }
.report h1 { margin: 0 0 8px; font-size: clamp(28px, 3vw, 44px); letter-spacing: -0.02em; }
.report > p { margin: 0 0 24px; color: var(--ink-2); font-size: clamp(15px, 1.2vw, 18px); }
.score { position: relative; width: 190px; height: 190px; margin: 0 auto 26px; }
.score svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score__track { fill: none; stroke: var(--surface-2); stroke-width: 10; }
.score__ring { fill: none; stroke: var(--accent); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1.2s ease; filter: drop-shadow(0 0 10px var(--glow)); }
.score__value { position: absolute; inset: 0; display: grid; place-content: center; }
.score__value strong { font-family: 'JetBrains Mono', monospace; font-size: 56px; line-height: 1; }
.score__value small { color: var(--ink-3); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 6px; }
.report__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; text-align: left; }
.report__grid .kpi strong { font-family: Inter, 'Segoe UI', sans-serif; font-size: clamp(17px, 1.3vw, 22px); white-space: normal; }
@media (max-width: 720px) { .report__grid { grid-template-columns: 1fr; } }

@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.check--compact { display: flex; width: 100%; margin: 14px 0 10px; padding: 10px 12px; font-size: 14px; gap: 10px; }
.check--compact .check__box { width: 20px; height: 20px; flex-shrink: 0; }
.check--compact input:checked + .check__box::after { font-size: 13px; }
.btn--end {
  width: 100%;
  min-height: 42px;
  font-size: 15px;
  color: #fff;
  border: 0;
  background: color-mix(in srgb, var(--bad) 80%, transparent);
}
.btn--end:hover { background: var(--bad); }
.timer__value strong { font-size: 40px; }
