@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300..800;1,300..800&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap');

:root {
  --bg: #050505;
  --header: #0a0a0a;
  --panel: #080808;
  --panel-2: #101010;
  --card: #111111;
  --card-2: #151515;
  --field: #000000;
  --line: rgba(255,255,255,.10);
  --line-strong: rgba(255,255,255,.20);
  --text: #f8fafc;
  --soft-text: #cbd5e1;
  --muted: #64748b;
  --accent: #10b981;
  --accent-bright: #34d399;
  --accent-soft: rgba(16,185,129,.10);
  --good: #10b981;
  --bad: #f87171;
  --warn: #f59e0b;
  --radius: 8px;
  --shadow: 0 26px 70px rgba(0,0,0,.48);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% -10%, rgba(16,185,129,.14), transparent 26rem),
    radial-gradient(circle at 90% 4%, rgba(52,211,153,.06), transparent 24rem),
    var(--bg);
  color: var(--text);
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -.01em;
}

button, input, select, textarea { font: inherit; }
button {
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--text);
  background: var(--card-2);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease, opacity .16s ease;
}
button:hover { transform: translateY(-1px); }
button:active { transform: translateY(0); }
button:disabled { opacity: .55; cursor: not-allowed; }

.primary {
  background: var(--accent);
  color: #03110c;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 12px;
}
.primary:hover { background: var(--accent-bright); }
.ghost {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--soft-text);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 12px;
}
.ghost:hover { background: rgba(255,255,255,.05); color: #fff; border-color: rgba(255,255,255,.28); }
.danger { color: #fecaca; border-color: rgba(248,113,113,.42); }
.small { padding: 8px 10px; border-radius: 6px; font-size: 11px; }
.wide { width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.good { color: var(--good) !important; }
.bad { color: var(--bad) !important; }
code { color: var(--accent-bright); font-family: "JetBrains Mono", monospace; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10,10,10,.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.header-inner {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto;
  min-height: 64px;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 22px;
}
.brand-wrap { display: flex; align-items: center; gap: 12px; min-width: 280px; }
.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--accent);
  color: #03110c;
  font-weight: 950;
  box-shadow: 0 0 35px rgba(16,185,129,.28);
}
.brand-title {
  color: #fff;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: -.03em;
  line-height: 1;
}
.brand-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  max-width: 460px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  color: var(--soft-text);
  border-radius: 6px;
  padding: 0 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.file-button:hover { background: rgba(255,255,255,.05); color: #fff; }
.file-button input { display: none; }

.shell {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  padding: 22px 0 48px;
}
.panel {
  background: rgba(8,8,8,.96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.side-panel {
  padding: 16px;
  height: fit-content;
  position: sticky;
  top: 86px;
}
.main-area { min-width: 0; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.panel-head.compact { margin-bottom: 12px; }
.eyebrow {
  color: var(--accent-bright);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 10px;
  font-weight: 900;
}
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(32px, 5vw, 58px); line-height: .95; letter-spacing: -.07em; }

.campaign-title-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.campaign-title-row h1 {
  cursor: text;
}
.title-edit {
  margin-top: 10px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(148,163,184,.22);
  background: rgba(255,255,255,.03);
  color: var(--muted);
  padding: 0;
  display: grid;
  place-items: center;
}
.title-edit:hover {
  color: var(--accent-bright);
  border-color: rgba(16,185,129,.55);
  background: rgba(16,185,129,.10);
}
.refresh-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 21px;
  line-height: 1;
}
h2 { margin-bottom: 0; font-size: 20px; letter-spacing: -.04em; }
h3 { margin-bottom: 0; font-size: 17px; letter-spacing: -.03em; }
h4 { margin-bottom: 12px; font-size: 14px; color: #fff; }

.campaign-list { display: grid; gap: 8px; margin: 12px 0 14px; }
.campaign-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 8px;
  padding: 14px;
  color: var(--text);
}
.campaign-item:hover { border-color: rgba(16,185,129,.36); background: #121212; }
.campaign-item.active {
  border-color: rgba(16,185,129,.70);
  background: linear-gradient(135deg, rgba(16,185,129,.12), rgba(17,17,17,.96));
  box-shadow: inset 0 0 0 1px rgba(16,185,129,.16), 0 0 34px rgba(16,185,129,.08);
}
.campaign-item strong { display: block; margin-bottom: 6px; font-size: 14px; }
.campaign-item span { color: var(--muted); font-size: 12px; font-weight: 700; }
.side-note {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #050505;
}
.side-note strong { display: block; font-size: 12px; color: #fff; margin-bottom: 6px; }
.side-note span { display: block; color: var(--muted); font-size: 12px; line-height: 1.5; }

.empty {
  min-height: 520px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 48px;
}
.empty > * { max-width: 560px; }
.empty-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 8px;
  background: var(--accent-soft);
  border: 1px solid rgba(16,185,129,.24);
  color: var(--accent-bright);
  font-size: 28px;
  font-weight: 900;
}
.empty h2 { margin: 6px 0 8px; font-size: 36px; }
.empty p { color: var(--muted); line-height: 1.6; margin-bottom: 18px; }

.hero-card {
  padding: 24px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  background:
    linear-gradient(135deg, rgba(16,185,129,.10), rgba(8,8,8,.90) 38%),
    #080808;
}
.hero-copy p { margin: 0; color: var(--muted); font-weight: 800; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.readout-card { padding: 18px; margin-bottom: 16px; }
.strategy-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.strategy-row strong { color: #fff; font-size: 15px; }
.strategy-pill {
  border: 1px solid rgba(16,185,129,.42);
  background: var(--accent-soft);
  color: var(--accent-bright);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.readout-card p { margin: 0; color: var(--soft-text); line-height: 1.65; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  min-height: 112px;
}
.stat:before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.035), transparent 50%);
  pointer-events: none;
}
.stat span { display: block; color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .11em; margin-bottom: 10px; }
.stat strong { display: block; color: #fff; font-size: 28px; letter-spacing: -.05em; font-family: "JetBrains Mono", ui-monospace, monospace; }
.stat small { display: block; color: var(--muted); margin-top: 8px; font-size: 11px; }
.stat.hot { border-color: rgba(16,185,129,.52); box-shadow: inset 0 0 0 1px rgba(16,185,129,.12); }
.stat.total { border-color: rgba(52,211,153,.42); }

.risk-box { padding: 18px; margin-bottom: 16px; }
.risk-box h3 { margin-bottom: 14px; }
.risk-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.risk-grid div {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.risk-grid span { color: var(--muted); display: block; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .10em; margin-bottom: 8px; }
.risk-grid strong { font-size: 22px; font-family: "JetBrains Mono", ui-monospace, monospace; }

.two-col { display: grid; grid-template-columns: 1fr 1.12fr; gap: 16px; }
.section-card { padding: 16px; }
.pill { border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 9px; color: var(--soft-text); font-size: 12px; font-weight: 900; font-family: "JetBrains Mono", monospace; }
.list, .trade-log { display: grid; gap: 10px; }
.option-card, .trade-card {
  background: #0d0d0d;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
}
.option-card strong, .trade-card strong { color: #fff; }
.meta { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 7px; }
.mark-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; margin-top: 12px; }
.mark-row.has-assignment { grid-template-columns: 1fr auto auto auto; }
.small.assign { color: #fed7aa; border-color: rgba(251,146,60,.45); background: rgba(251,146,60,.10); }
.small.assign:hover { border-color: rgba(251,146,60,.8); }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; gap: 12px; }
.gap { gap: 10px; flex-wrap: wrap; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.74); backdrop-filter: blur(6px); z-index: 100; }
.modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, calc(100vw - 28px));
  max-height: calc(100vh - 34px);
  overflow: auto;
  background: #080808;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 18px;
  z-index: 120;
}
.modal.wide { width: min(1050px, calc(100vw - 28px)); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.modal-head h2 { margin: 4px 0 4px; font-size: 24px; }
.modal-head p { margin: 0; }
.icon { font-size: 24px; line-height: 1; padding: 5px 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.five { grid-template-columns: 1.05fr .8fr 1fr .8fr .8fr; }
.option-fill-grid { grid-template-columns: 1.2fr 1.2fr 1.2fr auto; align-items: end; }
.fast-add { height: 42px; margin-top: 18px; white-space: nowrap; }
.fill-flash { border-color: var(--accent-bright) !important; box-shadow: 0 0 0 3px rgba(16,185,129,.22), 0 0 28px rgba(16,185,129,.28) !important; animation: fillPulse 1.05s ease-in-out 2; }
@keyframes fillPulse { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
label { color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .10em; }
input, select, textarea {
  width: 100%;
  margin-top: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 11px 12px;
  background: var(--field);
  color: var(--text);
  outline: none;
  font-weight: 800;
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16,185,129,.10); }
input[readonly] { color: var(--accent-bright); background: rgba(16,185,129,.06); }
.full { display: block; margin-top: 12px; }
.section {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b0b0b;
}
.section-title {
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: 12px;
}
.mini-card { border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: #050505; }
.collar-legs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }

.steps { display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: center; gap: 8px; margin-bottom: 18px; }
.steps > span:not(.step) { height: 1px; background: var(--line); }
.step {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  font-family: "JetBrains Mono", monospace;
}
.step.active { border-color: var(--accent); color: #03110c; background: var(--accent); box-shadow: 0 0 28px rgba(16,185,129,.25); }
.step-copy { margin-bottom: 14px; }
.step-copy h3 { margin-bottom: 6px; }
.step-copy p { margin: 0; }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.choice {
  min-height: 92px;
  background: var(--card);
  border: 1px solid var(--line);
  text-align: left;
  padding: 15px;
}
.choice:hover { border-color: rgba(16,185,129,.42); background: #141414; }
.choice strong { display: block; color: #fff; font-size: 13px; margin-bottom: 8px; }
.choice span { display: block; color: var(--muted); font-size: 12px; line-height: 1.45; }
.choice.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(16,185,129,.14); }
.choice.selected span { color: var(--soft-text); }
.review { display: grid; gap: 9px; }
.review-line, .review-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  background: #0d0d0d;
  border-radius: 8px;
  padding: 13px;
}
.review-total { border-color: var(--accent); background: var(--accent-soft); }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: #080808;
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 13px 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 160;
  font-weight: 800;
}

@media (max-width: 1180px) {
  .header-inner { grid-template-columns: 1fr; padding: 14px 0; align-items: start; }
  .brand-subtitle { white-space: normal; }
  .top-actions { justify-content: flex-start; }
  .shell { grid-template-columns: 1fr; }
  .side-panel { position: static; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell, .header-inner { width: min(100vw - 22px, 1480px); }
  .hero-card { align-items: stretch; flex-direction: column; }
  .hero-actions { justify-content: flex-start; }
  .stats-grid, .grid.two, .grid.three, .grid.five, .option-fill-grid, .choice-grid, .collar-legs, .risk-grid { grid-template-columns: 1fr; }
  .mark-row { grid-template-columns: 1fr; }
  .modal-actions { flex-direction: column; }
  .modal-actions button, .fast-add { width: 100%; }
}

.choice-grid.simple-actions {
  grid-template-columns: repeat(5, minmax(130px, 1fr));
}

@media (max-width: 980px) {
  .choice-grid.simple-actions { grid-template-columns: repeat(2, 1fr); }
}


/* Option chain, Thinkorswim-style */
.option-tools { margin-top: 12px; align-items: end; }
.compact-label {
  width: 118px;
  display: inline-block;
  margin-left: auto;
}
.compact-label select { padding: 8px 10px; margin-top: 5px; }
.simple-head h2 { margin: 0; }
.chain-head-right { display: flex; align-items: end; gap: 12px; }
.option-chain-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #070709;
}
.chain-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: #0a0a0d;
}
.chain-head h4 { margin: 3px 0 0; }
.chain-status {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  text-align: right;
}
.option-chain-empty {
  padding: 24px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.expiry-block { border-bottom: 1px solid var(--line); }
.expiry-block:last-child { border-bottom: 0; }
.expiry-toggle {
  width: 100%;
  border-radius: 0;
  border: 0;
  background: #09090b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  text-align: left;
  color: var(--soft-text);
}
.expiry-toggle:hover { transform: none; background: rgba(255,255,255,.035); }
.expiry-main {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}
.expiry-date { color: #fff; font-size: 13px; font-weight: 950; text-transform: uppercase; }
.expiry-dte { color: var(--muted); font-size: 11px; font-weight: 900; }
.expiry-badges { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.chain-badge {
  border: 1px solid rgba(16,185,129,.24);
  color: var(--accent-bright);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .10em;
  text-transform: uppercase;
}
.chain-badge.blue { color: #60a5fa; border-color: rgba(96,165,250,.28); background: rgba(96,165,250,.08); }
.chain-table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
.chain-table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--soft-text);
}
.chain-table thead tr {
  background: rgba(2,6,23,.88);
  color: #94a3b8;
  border-bottom: 1px solid var(--line);
}
.chain-table th {
  padding: 9px 8px;
  text-transform: uppercase;
  letter-spacing: .09em;
  font-size: 10px;
  font-weight: 950;
  white-space: nowrap;
}
.chain-table td {
  padding: 9px 8px;
  border-bottom: 1px solid rgba(255,255,255,.055);
  white-space: nowrap;
}
.chain-table tbody tr { background: transparent; }
.chain-table tbody tr:hover { background: rgba(255,255,255,.035); }
.chain-table tr.itm { background: rgba(245,158,11,.045); }
.chain-table tr.atm { background: rgba(245,158,11,.09); box-shadow: inset 0 1px 0 rgba(245,158,11,.18), inset 0 -1px 0 rgba(245,158,11,.18); }
.chain-table tr.selected { background: rgba(16,185,129,.12); box-shadow: inset 3px 0 0 var(--accent); }
.chain-table .num { text-align: right; }
.chain-table .center { text-align: center; }
.chain-table .strike-cell {
  background: #13131a;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 950;
  text-align: center;
  border-left: 1px solid rgba(255,255,255,.10);
  border-right: 1px solid rgba(255,255,255,.10);
}
.atm-pill {
  display: inline-block;
  margin-left: 6px;
  border-radius: 4px;
  padding: 1px 4px;
  background: rgba(245,158,11,.16);
  color: #fbbf24;
  font-size: 8px;
  font-weight: 950;
}
.greeks-soft { color: #94a3b8; }
.use-contract {
  height: 28px;
  padding: 0 10px;
  font-size: 10px;
}
.chain-small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

@media (max-width: 760px) {
  .compact-label { width: 100%; margin-left: 0; }
  .chain-head { align-items: flex-start; flex-direction: column; }
  .chain-head-right { width: 100%; align-items: flex-start; flex-direction: column; }
  .chain-status { text-align: left; }
}

/* Trade book delete control */
.campaign-row {
  position: relative;
  display: block;
}
.campaign-row .campaign-item {
  margin: 0;
  padding-right: 48px;
}
.campaign-row.active .campaign-item {
  border-color: rgba(16,185,129,.70);
  background: linear-gradient(135deg, rgba(16,185,129,.12), rgba(17,17,17,.96));
  box-shadow: inset 0 0 0 1px rgba(16,185,129,.16), 0 0 34px rgba(16,185,129,.08);
}
.campaign-trash {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: #fecaca;
  padding: 0;
  font-size: 15px;
  display: grid;
  place-items: center;
  opacity: .72;
}
.campaign-trash:hover {
  opacity: 1;
  color: #fff;
  background: rgba(248,113,113,.12);
}

/* Ticker analysis */
.analysis-search {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 16px;
}
.analysis-error {
  border: 1px solid rgba(248,113,113,.38);
  background: rgba(248,113,113,.09);
  color: #fecaca;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-weight: 800;
}
.analysis-results { display: grid; gap: 14px; }
.analysis-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(16,185,129,.08), rgba(8,8,8,.98));
}
.analysis-title-row h3 { margin-top: 4px; }
.analysis-grid { display: grid; gap: 12px; }
.analysis-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.analysis-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.analysis-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.analysis-card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 8px;
  padding: 14px;
  min-height: 112px;
}
.analysis-card.tall { min-height: 160px; }
.analysis-card > span {
  display: block;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.analysis-card strong {
  display: block;
  color: #fff;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 24px;
  line-height: 1.1;
  word-break: break-word;
}
.analysis-card small {
  display: block;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.45;
  font-weight: 700;
}
.signal-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.signal-list span {
  border: 1px solid rgba(148,163,184,.20);
  color: var(--soft-text);
  background: rgba(255,255,255,.035);
  border-radius: 999px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 800;
}
.analysis-levels, .indicator-table {
  display: grid;
  gap: 8px;
}
.analysis-levels div, .indicator-table div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.analysis-levels div:last-child, .indicator-table div:last-child { border-bottom: 0; }
.analysis-levels b, .indicator-table b {
  color: #fff;
  font-size: 12px;
}
.analysis-levels em, .indicator-table em {
  color: var(--muted);
  font-style: normal;
  text-align: right;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.5;
}
.analysis-levels small { display: inline; margin: 0; color: var(--muted); }
.analysis-notes p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
  font-weight: 700;
}
.analysis-notes p:last-child { margin-bottom: 0; }

@media (max-width: 980px) {
  .analysis-grid.four, .analysis-grid.three, .analysis-grid.two { grid-template-columns: 1fr; }
  .analysis-search { grid-template-columns: 1fr; }
}
