/* Paper Trading Dashboard — shared design system */

:root {
  --bg: #06090f;
  --bg-soft: #0a0f19;
  --card: rgba(16, 23, 37, 0.82);
  --card-solid: #0f1623;
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.26);
  --text: #e9eef8;
  --muted: #8b9ab2;
  --dim: #64748b;
  --accent: #3ddc97;
  --accent-2: #22d3ee;
  --accent-soft: rgba(61, 220, 151, 0.12);
  --danger: #ff7387;
  --danger-soft: rgba(255, 115, 135, 0.12);
  --amber: #f5c451;
  --amber-soft: rgba(245, 196, 81, 0.12);
  --radius: 18px;
  --shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.9);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 85% 60% at 50% 0%, #000 30%, transparent 78%);
  mask-image: radial-gradient(ellipse 85% 60% at 50% 0%, #000 30%, transparent 78%);
}

.glow {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
}
.glow-1 { width: 540px; height: 540px; top: -240px; left: -140px; background: radial-gradient(circle, rgba(61, 220, 151, 0.26), transparent 70%); }
.glow-2 { width: 640px; height: 640px; top: -280px; right: -200px; background: radial-gradient(circle, rgba(34, 211, 238, 0.18), transparent 70%); }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 9, 15, 0.74);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, #4dffb0, #159a6b);
  box-shadow: 0 8px 22px -10px rgba(61, 220, 151, 0.9);
  flex: none;
}
.brand-mark svg { width: 19px; height: 19px; color: #04140d; }

.brand-text { display: flex; flex-direction: column; line-height: 1.05; font-size: 15px; letter-spacing: 0.2px; }
.brand-text strong { font-weight: 700; }
.brand-text span { font-size: 10px; color: var(--muted); letter-spacing: 0.18em; text-transform: uppercase; margin-top: 3px; }

.nav { display: flex; align-items: center; gap: 4px; margin-left: 10px; }
.nav a {
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.nav a:hover { color: var(--text); background: rgba(148, 163, 184, 0.08); }
.nav a.active { color: var(--text); background: rgba(148, 163, 184, 0.1); }

.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.07);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.tag-warn { color: var(--amber); border-color: rgba(245, 196, 81, 0.3); background: var(--amber-soft); }
.tag-ok { color: var(--accent); border-color: rgba(61, 220, 151, 0.3); background: var(--accent-soft); }
.tag-bad { color: var(--danger); border-color: rgba(255, 115, 135, 0.3); background: var(--danger-soft); }
.tag-ghost { background: transparent; }
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05); }

.clock-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(6, 9, 15, 0.5);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}
.clock-chip svg { width: 14px; height: 14px; }

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.06);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.icon-btn:hover { color: var(--text); background: rgba(148, 163, 184, 0.12); border-color: var(--line-strong); }
.icon-btn svg { width: 16px; height: 16px; transition: transform 0.5s ease; }
.icon-btn.spinning svg { transform: rotate(360deg); }

/* ---------- Page shell ---------- */

.wrap { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 26px 24px 40px; }

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  padding: 28px 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(20, 32, 51, 0.92), rgba(9, 14, 23, 0.95));
  box-shadow: var(--shadow);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(620px 220px at 100% 0, rgba(61, 220, 151, 0.14), transparent 62%);
}
.hero-copy { position: relative; z-index: 1; min-width: 260px; }

.eyebrow {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.equity-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; }
.equity {
  font-size: clamp(2rem, 4vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(120deg, #ffffff, #9ef7cb 60%, #4ee0a0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}
.equity small { font-size: 0.45em; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); -webkit-text-fill-color: var(--muted); }
.hero-sub { margin: 12px 0 0; max-width: 46ch; font-size: 13.5px; line-height: 1.55; color: var(--muted); }

.stat-strip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(96px, 1fr));
  gap: 1px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
  overflow: hidden;
}
.stat { padding: 14px 16px; background: rgba(8, 13, 22, 0.86); }
.stat dt { font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); margin-bottom: 6px; }
.stat dd { margin: 0; font-family: var(--mono); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat dd.up { color: var(--accent); }
.stat dd.down { color: var(--danger); }

/* ---------- Cards & layout ---------- */

.layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; align-items: start; }
.col-main, .col-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
}
.card-head h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: 0.01em; }
.card-head p { margin: 5px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.card-body { padding: 0 20px 20px; }

.count {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 24px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.07);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Order ticket ---------- */

#trade-form { padding: 0 20px 20px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 15px; }
.field label, .field .label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(6, 9, 15, 0.6);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.input::placeholder { color: #526075; }
.input:hover { border-color: var(--line-strong); }
.input:focus {
  outline: none;
  border-color: rgba(61, 220, 151, 0.55);
  background: rgba(6, 9, 15, 0.85);
  box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.12);
}
#symbol { text-transform: uppercase; font-family: var(--mono); font-weight: 600; letter-spacing: 0.06em; }
#qty { text-align: center; font-family: var(--mono); font-weight: 600; }

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(6, 9, 15, 0.55);
}
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented span {
  display: block;
  padding: 10px;
  border-radius: 9px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.segmented label:hover span { color: var(--text); }
.segmented input[value="buy"]:checked + span { color: #062017; background: linear-gradient(135deg, #4dffb0, #25c98a); box-shadow: 0 6px 16px -10px rgba(61, 220, 151, 0.9); }
.segmented input[value="sell"]:checked + span { color: #24060b; background: linear-gradient(135deg, #ff8b9b, #f4576e); box-shadow: 0 6px 16px -10px rgba(255, 115, 135, 0.9); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent-2); outline-offset: 2px; }

.qty-row { display: grid; grid-template-columns: 46px 1fr 46px; gap: 8px; }
.step {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.07);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.step:hover { color: var(--text); background: rgba(148, 163, 184, 0.14); }
.step:active { transform: translateY(1px); }

.btn-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 4px;
  padding: 14px 18px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #4dffb0, #1fb87c);
  color: #03140d;
  font: 600 15px/1 var(--sans);
  cursor: pointer;
  box-shadow: 0 12px 28px -14px rgba(61, 220, 151, 0.95);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.04); box-shadow: 0 16px 32px -14px rgba(61, 220, 151, 1); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.65; cursor: progress; transform: none; box-shadow: none; }
.btn-primary svg { width: 17px; height: 17px; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
  font: 600 13.5px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.btn-secondary:hover { background: rgba(148, 163, 184, 0.15); border-color: rgba(148, 163, 184, 0.4); transform: translateY(-1px); }
.btn-secondary svg { width: 15px; height: 15px; }

.fineprint { margin: 14px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--dim); }

/* ---------- Trade history ---------- */

.table-wrap { overflow-x: auto; }
.trade-table { min-width: 560px; padding: 0 20px 18px; }

.table-head, .trade-row {
  display: grid;
  grid-template-columns: 76px 78px minmax(70px, 1fr) 62px 92px 104px;
  align-items: center;
  gap: 10px;
}
.table-head {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}
.table-head .num, .trade-row .num { text-align: right; }

.trade-row {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.07);
  font-size: 13px;
  transition: background 0.15s;
}
.trade-row:last-child { border-bottom: 0; }
.trade-row:hover { background: rgba(148, 163, 184, 0.06); }
.trade-row .time { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.trade-row .sym { font-family: var(--mono); font-weight: 600; letter-spacing: 0.05em; }
.trade-row .num { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); }
.trade-row .num.strong { color: var(--text); font-weight: 600; }

.side {
  display: inline-flex;
  justify-content: center;
  min-width: 54px;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.side.buy { color: var(--accent); background: var(--accent-soft); }
.side.sell { color: var(--danger); background: var(--danger-soft); }

/* ---------- Positions ---------- */

.position-list { padding: 0 20px 6px; }
.position { padding: 14px 0; border-top: 1px solid rgba(148, 163, 184, 0.08); }
.position:first-child { border-top: 0; padding-top: 4px; }
.position-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ticker { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(61, 220, 151, 0.22);
  background: linear-gradient(140deg, rgba(61, 220, 151, 0.18), rgba(34, 211, 238, 0.1));
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}
.ticker strong { display: block; font-family: var(--mono); font-size: 14px; letter-spacing: 0.05em; }
.ticker span { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.position-top .num { text-align: right; }
.position-top .num strong { display: block; font-family: var(--mono); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.position-top .num span { display: block; margin-top: 2px; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }

.range { margin-top: 12px; }
.range-track {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 115, 135, 0.35), rgba(148, 163, 184, 0.18) 35%, rgba(148, 163, 184, 0.18) 65%, rgba(61, 220, 151, 0.35));
}
.range-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, rgba(61, 220, 151, 0.5), rgba(61, 220, 151, 0.85)); }
.range-marker {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #eafff6;
  border: 2px solid #0b1320;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.18);
}
.range-labels { display: flex; justify-content: space-between; margin-top: 7px; font-family: var(--mono); font-size: 10.5px; color: var(--dim); }
.range-labels .stop { color: rgba(255, 115, 135, 0.85); }
.range-labels .target { color: rgba(61, 220, 151, 0.9); }

/* ---------- Session clock ---------- */

.session-body { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 0 20px 20px; }
.session-clock { display: flex; align-items: baseline; gap: 6px; font-family: var(--mono); font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.session-clock .unit { font-family: var(--sans); font-size: 12px; font-weight: 500; color: var(--dim); letter-spacing: 0.08em; text-transform: uppercase; }
.session-meta { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Settings page ---------- */

.page-head { margin: 4px 0 22px; }
.page-head h1 { margin: 0 0 8px; font-size: clamp(1.6rem, 3vw, 2.1rem); letter-spacing: -0.02em; }
.page-head p { margin: 0; max-width: 68ch; font-size: 14px; line-height: 1.6; color: var(--muted); }

.settings-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 18px; align-items: start; }
.settings-grid .span-all { grid-column: 1 / -1; }

.status-list { display: flex; flex-direction: column; }
.status-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; border-top: 1px solid rgba(148, 163, 184, 0.08); font-size: 13px; }
.status-row:first-child { border-top: 0; padding-top: 0; }
.status-row .k { color: var(--muted); }
.status-row .v { font-family: var(--mono); font-size: 12.5px; color: var(--text); text-align: right; word-break: break-word; }

.form-grid { padding: 0 20px 20px; }
.form-grid .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 6px; }
.hint { font-size: 11.5px; line-height: 1.5; color: var(--dim); margin: -4px 0 0; }

.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { position: relative; counter-increment: step; padding: 0 0 18px 40px; font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -1px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: rgba(148, 163, 184, 0.08);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.steps li:last-child { padding-bottom: 0; }
.steps strong { color: var(--text); font-weight: 600; }
.steps a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(61, 220, 151, 0.35); }
.steps a:hover { border-bottom-color: var(--accent); }

.code {
  display: block;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(6, 9, 15, 0.7);
  font-family: var(--mono);
  font-size: 12px;
  color: #b9c7dc;
  overflow-x: auto;
  white-space: pre;
}

.notice {
  padding: 13px 16px;
  border-radius: 13px;
  border: 1px solid rgba(245, 196, 81, 0.25);
  background: var(--amber-soft);
  font-size: 12.5px;
  line-height: 1.55;
  color: #f3d99b;
}
.notice-ok { border-color: rgba(61, 220, 151, 0.25); background: var(--accent-soft); color: #b6f5d8; }

.key-hint { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }

/* ---------- Footer / toast / misc ---------- */

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--dim);
}
.footer p { margin: 0; }

.empty { padding: 28px 12px 32px; text-align: center; }
.empty svg { width: 34px; height: 34px; color: #3b485c; margin-bottom: 10px; }
.empty p { margin: 0; font-size: 13px; color: var(--muted); }
.empty span { display: block; margin-top: 4px; font-size: 11.5px; color: var(--dim); }

.skeleton-list { padding: 12px 20px 20px; display: flex; flex-direction: column; gap: 8px; }
.skeleton {
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.07), rgba(148, 163, 184, 0.15), rgba(148, 163, 184, 0.07));
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 10px; max-width: min(360px, calc(100vw - 40px)); }
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(15, 23, 37, 0.97);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.9);
  font-size: 13px;
  line-height: 1.45;
  animation: toast-in 0.25s ease-out;
}
.toast::before { content: ""; width: 3px; border-radius: 999px; background: var(--accent); flex: none; }
.toast.err::before { background: var(--danger); }
.toast.out { animation: toast-out 0.2s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .layout, .settings-grid { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .hero { padding: 22px; }
}

@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; gap: 10px 14px; padding: 10px 16px; }
  .nav { order: 3; width: 100%; margin-left: 0; }
  .topbar-actions { gap: 8px; }
  .clock-chip { display: none; }
  .wrap { padding: 18px 16px 32px; }
  .form-grid .row { grid-template-columns: 1fr; }
  .stat dd { font-size: 15px; }
  .trade-table { min-width: 0; }
  .table-head, .trade-row { grid-template-columns: 62px 70px minmax(60px, 1fr) 84px; }
  .table-head span:nth-child(4), .trade-row .num:nth-child(4),
  .table-head span:nth-child(5), .trade-row .num:nth-child(5) { display: none; }
}

@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; }
}
/* ---------- Shared data tables ---------- */

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td { padding: 11px 14px; border-bottom: 1px solid rgba(148, 163, 184, 0.07); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: rgba(148, 163, 184, 0.05); }
.data-table .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.data-table.tight th, .data-table.tight td { padding: 7px 8px; font-size: 12px; }
.data-table .sub { display: block; font-size: 10.5px; opacity: 0.8; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.up { color: var(--accent); }
.down { color: var(--danger); }
.sym { font-family: var(--mono); font-weight: 600; letter-spacing: 0.05em; }
.sym-link { font-family: var(--mono); font-weight: 600; color: var(--text); text-decoration: none; border-bottom: 1px solid transparent; }
.sym-link:hover { color: var(--accent); border-bottom-color: rgba(61, 220, 151, 0.4); }
.text-link { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(61, 220, 151, 0.35); }
.text-link:hover { border-bottom-color: var(--accent); }
.clickable { cursor: pointer; }
.scanner-table td { white-space: nowrap; }
.scanner-table .spark { display: block; }

/* ---------- Buttons, fields, flash ---------- */

.btn-primary.sm, .btn-secondary.sm, .btn-ghost.sm {
  width: auto;
  padding: 9px 14px;
  font-size: 12.5px;
  border-radius: 10px;
  margin: 0;
}
.btn-primary.sm { display: inline-flex; gap: 6px; }
.btn-primary.sm svg { width: 14px; height: 14px; }
.btn-primary:disabled, .btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 13px/1 var(--sans);
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.btn-ghost:hover { color: var(--text); background: rgba(148, 163, 184, 0.08); }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.flash { margin-bottom: 16px; }
.notice-err { border-color: rgba(255, 115, 135, 0.3); background: var(--danger-soft); color: #ffc2ca; }
.input.sm { padding: 8px 10px; font-size: 13px; border-radius: 9px; }
.field.inline { flex-direction: row; align-items: center; gap: 9px; margin: 0; }
.field.inline label { white-space: nowrap; }
.speed-form { display: flex; gap: 6px; align-items: center; }
.stat dd .of { font-family: var(--sans); font-size: 10.5px; color: var(--dim); font-weight: 500; }

/* ---------- Toolbar ---------- */

.toolbar-card { padding: 14px 18px; margin-bottom: 18px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.toolbar .grow { flex: 1; }
.toolbar .grow .input { width: 100%; }
.toolbar-meta { margin-left: auto; font-size: 11.5px; color: var(--dim); font-family: var(--mono); }

/* ---------- Overview bits ---------- */

.session-clock.big { font-size: 44px; }
.clock-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.compact-hero { padding: 22px 24px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; position: relative; z-index: 1; }
.mover-list { padding: 0 16px 12px; }
.mover {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 4px; border-top: 1px solid rgba(148, 163, 184, 0.08);
  text-decoration: none; color: inherit;
}
.mover:first-child { border-top: 0; }
.mover:hover { background: rgba(148, 163, 184, 0.05); }
.mover-id { min-width: 92px; }
.mover-id strong { display: block; font-family: var(--mono); font-size: 13px; }
.mover-id span { display: block; font-size: 10.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.mover-spark { flex: 1; text-align: center; }
.mover-spark svg { max-width: 100%; }
.mover-num { text-align: right; min-width: 74px; }
.mover-num strong { display: block; font-family: var(--mono); font-size: 12.5px; }
.mover-num span { display: block; font-family: var(--mono); font-size: 11px; }
.feed { list-style: none; margin: 0; padding: 0 18px 16px; }
.feed.padded { padding: 4px 20px 18px; }
.feed li { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid rgba(148, 163, 184, 0.08); }
.feed li:first-child { border-top: 0; }
.feed-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); margin-top: 6px; flex: none; box-shadow: 0 0 0 3px rgba(245, 196, 81, 0.12); }
.feed strong { display: block; font-size: 12.5px; font-weight: 600; }
.feed span { display: block; font-size: 10.5px; color: var(--dim); font-family: var(--mono); margin-top: 2px; }
.file-list { display: flex; flex-direction: column; gap: 6px; }
.file-list code { font-family: var(--mono); font-size: 11.5px; color: var(--muted); padding: 5px 8px; border-radius: 7px; background: rgba(6, 9, 15, 0.5); border: 1px solid var(--line); }
/* ---------- Workbench ---------- */

.workbench-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.head-meta { display: flex; align-items: center; gap: 10px; }
.chart-wrap { padding: 4px 14px 16px; }
.chart-wrap.small svg { max-height: 300px; }
.chart-wrap.tiny svg { max-height: 175px; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-empty { padding: 40px 16px; text-align: center; color: var(--dim); font-size: 13px; }
.workbench-steps { counter-reset: none; list-style: none; margin: 0; padding: 0 20px 20px; }
.workbench-steps li { padding: 0; margin: 0; border-top: 1px solid rgba(148, 163, 184, 0.09); }
.workbench-steps li::before { display: none; }
.workbench-steps li:first-child { border-top: 0; }
.step-card { padding: 18px 0; }
.step-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.step-num {
  width: 26px; height: 26px; flex: none; display: grid; place-items: center;
  border-radius: 9px; border: 1px solid var(--line-strong);
  background: rgba(148, 163, 184, 0.08); font-family: var(--mono); font-size: 12px; font-weight: 700;
}
.step-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.step-head p { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); }
.step-head .tag { margin-left: auto; flex: none; }
.step-copy { margin: 0 0 12px; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.kv-inline { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.kv-inline strong { color: var(--text); font-family: var(--mono); }
.kv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 4px 0 14px; }
.kv-grid div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(6, 9, 15, 0.35); }
.kv-grid span { display: block; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.kv-grid strong { display: block; margin-top: 3px; font-family: var(--mono); font-size: 13.5px; }
.compact-form { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.compact-form .field { margin: 0; }
.inline-form { flex-direction: row; align-items: center; flex-wrap: wrap; }
.step-details { margin: 8px 0 12px; border: 1px solid var(--line); border-radius: 11px; padding: 0 14px 4px; background: rgba(6, 9, 15, 0.3); }
.step-details summary { cursor: pointer; padding: 11px 0; font-size: 12.5px; color: var(--muted); }
.step-details summary:hover { color: var(--text); }
.step-details[open] { padding-bottom: 12px; }
.verdict { margin: 0 0 14px; padding: 13px 16px; border-radius: 12px; border: 1px solid rgba(61, 220, 151, 0.24); background: var(--accent-soft); font-size: 13px; line-height: 1.55; color: #c5f8e0; }
.odds { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.odd { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(6, 9, 15, 0.4); }
.odd span { display: block; font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--dim); }
.odd strong { display: block; margin-top: 3px; font-family: var(--mono); font-size: 15px; }
.odd.up strong { color: var(--accent); }
.odd.down strong { color: var(--danger); }
.reasons { margin: 0 0 10px; padding-left: 18px; font-size: 12.5px; color: var(--danger); line-height: 1.6; }
.reasons.warn { color: var(--amber); }
.detail-line { margin: 4px 0; font-size: 12px; line-height: 1.5; }
.detail-line.warn { color: var(--amber); }

/* ---------- Tickets ---------- */

.ticket-list { display: flex; flex-direction: column; gap: 14px; padding: 0 20px 20px; }
.ticket { border: 1px solid var(--line-strong); border-radius: 14px; padding: 16px; background: rgba(6, 9, 15, 0.4); }
.ticket.blocked { border-color: rgba(255, 115, 135, 0.28); background: rgba(255, 115, 135, 0.04); }
.ticket-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ticket-title { display: flex; align-items: center; gap: 11px; }
.ticket-title strong { display: block; font-family: var(--mono); font-size: 15px; }
.ticket-title span { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.ticket-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.ticket-grid span { display: block; font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--dim); }
.ticket-grid strong { display: block; margin-top: 3px; font-family: var(--mono); font-size: 13px; }
.ticket-why { margin: 0 0 10px; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.ticket-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.ticket-foot .fineprint { margin: 0; }
.raw-json { margin: 0; max-height: 380px; overflow: auto; padding: 14px; border-radius: 11px; background: rgba(6, 9, 15, 0.65); border: 1px solid var(--line); font-family: var(--mono); font-size: 11.5px; color: #b9c7dc; }
/* ---------- News ---------- */

.news-list { display: flex; flex-direction: column; }
.news-item { padding: 16px 20px; border-top: 1px solid rgba(148, 163, 184, 0.08); }
.news-item:first-child { border-top: 0; }
.news-item.important { background: rgba(245, 196, 81, 0.03); }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 7px; font-size: 11px; }
.news-item h3 { margin: 0 0 5px; font-size: 14px; font-weight: 600; line-height: 1.4; }
.news-item h3 a { color: var(--text); text-decoration: none; }
.news-item h3 a:hover { color: var(--accent); }
.news-item p { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { text-decoration: none; }
.earnings-block { padding: 12px 0; border-top: 1px solid rgba(148, 163, 184, 0.08); }
.earnings-block:first-child { border-top: 0; padding-top: 0; }
.earnings-block h3 { margin: 0 0 8px; font-size: 13px; font-family: var(--mono); }
.earnings-block h3 span { font-family: var(--sans); font-weight: 400; font-size: 11px; color: var(--dim); margin-left: 6px; }

/* ---------- Assistant ---------- */

.chat-card { display: flex; flex-direction: column; min-height: 620px; }
.chat-head-actions { display: flex; align-items: center; gap: 8px; }
.chat-head-actions form { margin: 0; }
.chat-log { flex: 1; overflow-y: auto; padding: 6px 20px 12px; max-height: 560px; display: flex; flex-direction: column; gap: 14px; }
.chat-intro { padding: 26px 0; color: var(--muted); font-size: 13px; }
.chat-intro p { margin: 0; line-height: 2.2; }
.chat-intro .chip { border: 1px solid var(--line); background: rgba(148, 163, 184, 0.06); color: var(--muted); border-radius: 999px; padding: 6px 11px; font: 500 12px/1 var(--sans); cursor: pointer; margin-right: 4px; }
.chat-intro .chip:hover { color: var(--text); border-color: var(--line-strong); }
.msg { display: flex; flex-direction: column; gap: 5px; max-width: 92%; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg-role { font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.msg-body { padding: 11px 14px; border-radius: 13px; border: 1px solid var(--line); background: rgba(6, 9, 15, 0.5); font-size: 13px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.msg.user .msg-body { background: rgba(61, 220, 151, 0.1); border-color: rgba(61, 220, 151, 0.24); }
.msg.assistant .msg-body { background: rgba(15, 23, 37, 0.75); }
.msg.assistant .msg-body:empty { display: none; }
.msg-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.msg-note { margin: 2px 0 0; font-size: 11.5px; color: var(--amber); }
.err-text { color: var(--danger) !important; }
.tools { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.tool-card { border: 1px solid var(--line); border-radius: 10px; background: rgba(6, 9, 15, 0.45); overflow: hidden; }
.tool-card summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 11px; cursor: pointer; font-size: 11.5px; list-style: none; }
.tool-card summary::-webkit-details-marker { display: none; }
.tool-name { font-family: var(--mono); color: var(--text); }
.tool-state { font-size: 10.5px; color: var(--muted); }
.tool-state.up { color: var(--accent); }
.tool-state.down { color: var(--danger); }
.tool-output { margin: 0; padding: 11px; max-height: 260px; overflow: auto; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 11px; line-height: 1.55; color: #b9c7dc; white-space: pre-wrap; }
.chat-form { display: flex; gap: 10px; align-items: flex-end; padding: 14px 20px 4px; border-top: 1px solid var(--line); }
.chat-form textarea {
  flex: 1; resize: none; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(6, 9, 15, 0.6); color: var(--text); font: inherit; font-size: 13.5px; line-height: 1.5;
}
.chat-form textarea:focus { outline: none; border-color: rgba(61, 220, 151, 0.55); box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.12); }
.chat-form .btn-primary { width: auto; padding: 12px 18px; margin: 0; flex: none; }
.chat-foot { padding: 0 20px 16px; margin: 8px 0 0; }
.assistant-layout .col-main { min-width: 0; }

/* ---------- Assistant floating button ---------- */

.fab {
  position: fixed; left: 20px; bottom: 20px; z-index: 50;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 15px; border-radius: 999px;
  border: 1px solid rgba(61, 220, 151, 0.3);
  background: rgba(11, 26, 21, 0.94);
  color: var(--accent); text-decoration: none;
  font-size: 12.5px; font-weight: 600;
  box-shadow: 0 14px 34px -16px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
}
.fab:hover { background: rgba(17, 40, 32, 0.98); transform: translateY(-1px); }
.fab svg { width: 16px; height: 16px; }

/* ---------- New responsive rules ---------- */

@media (max-width: 1100px) {
  .nav { overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .ticket-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .odds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .row3, .kv-grid { grid-template-columns: 1fr 1fr; }
  .chat-card { min-height: 520px; }
  .chat-log { max-height: 460px; }
}
@media (max-width: 620px) {
  .topbar-inner { flex-wrap: wrap; }
  .nav { order: 3; width: 100%; margin-left: 0; }
  .ticket-grid, .odds, .row3, .kv-grid { grid-template-columns: 1fr 1fr; }
  .ticket-foot { flex-direction: column; align-items: flex-start; }
  .chat-form { flex-direction: column; align-items: stretch; }
  .chat-form .btn-primary { width: 100%; }
  .fab span { display: none; }
  .fab { padding: 12px; }
  .toolbar-meta { margin-left: 0; width: 100%; }
}
