:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #152033;
  --muted: #64748b;
  --line: #d9e0ea;
  --green: #11845b;
  --red: #b42318;
  --amber: #b76e00;
  --blue: #2457c5;
  --soft-green: #e8f7f0;
  --soft-red: #fff0ee;
  --soft-blue: #edf4ff;
  --shadow: 0 14px 40px rgba(31, 41, 55, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  align-items: center;
  background: #0f172a;
  color: #fff;
  display: flex;
  justify-content: space-between;
  min-height: 116px;
  padding: 24px clamp(18px, 4vw, 48px);
}

.topbar h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
  margin: 6px 0 0;
}

.eyebrow {
  color: #7dd3fc;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

.status-pill {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #dbeafe;
  padding: 10px 14px;
  white-space: nowrap;
}

.shell {
  display: grid;
  gap: 18px;
  margin: 0 auto;
  max-width: 1440px;
  padding: 20px clamp(14px, 3vw, 32px) 36px;
}

.control-panel,
.market-strip,
.workspace {
  display: grid;
  gap: 14px;
}

.control-panel {
  align-items: end;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  padding: 16px;
}

.control-group {
  display: grid;
  gap: 7px;
}

label,
.section-heading span,
.market-strip span,
.alert small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

select,
input[type="search"] {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 42px;
  padding: 0 12px;
  width: 100%;
}

input[type="range"] {
  accent-color: var(--blue);
  width: 100%;
}

.button-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

button {
  background: #111827;
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  min-height: 42px;
  padding: 0 14px;
}

button.secondary,
#notifyButton {
  background: var(--soft-blue);
  color: var(--blue);
}

.market-strip {
  grid-template-columns: repeat(6, 1fr);
}

.market-strip article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.market-strip strong {
  display: block;
  font-size: 25px;
  margin-top: 4px;
}

.workspace {
  align-items: start;
  grid-template-columns: 360px 1fr;
}

.alerts,
.signals {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
  padding: 16px;
}

.section-heading {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
}

.section-heading h2 {
  font-size: 18px;
  margin: 0;
}

.alert-feed,
.signal-grid {
  display: grid;
  gap: 12px;
}

.alert {
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  padding: 12px;
}

.alert.long {
  border-left-color: var(--green);
}

.alert.short {
  border-left-color: var(--red);
}

.alert h3 {
  font-size: 15px;
  margin: 4px 0;
}

.alert p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.signal-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.signal-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.signal-card.long {
  background: linear-gradient(180deg, var(--soft-green), #fff 42%);
}

.signal-card.short {
  background: linear-gradient(180deg, var(--soft-red), #fff 42%);
}

.signal-card.hold {
  background: linear-gradient(180deg, #fff8e8, #fff 42%);
}

.card-top {
  align-items: start;
  display: flex;
  justify-content: space-between;
}

.ticker {
  font-size: 24px;
  font-weight: 800;
}

.price {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.badge {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
  text-transform: uppercase;
}

.badge.long {
  background: var(--soft-green);
  color: var(--green);
}

.badge.short {
  background: var(--soft-red);
  color: var(--red);
}

.badge.hold {
  background: #fff5db;
  color: var(--amber);
}

.score-row {
  align-items: center;
  display: grid;
  gap: 9px;
  grid-template-columns: 1fr auto;
}

.score-track {
  background: #e5e7eb;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.score-bar {
  background: var(--blue);
  height: 100%;
}

.reason {
  color: #334155;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.meta-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

.meta-grid div {
  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 8px;
  padding: 9px;
}

.meta-grid span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.meta-grid strong {
  display: block;
  font-size: 13px;
  margin-top: 3px;
}

.detail-button {
  background: var(--soft-blue);
  color: var(--blue);
}

dialog {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
  max-width: 720px;
  width: min(720px, calc(100vw - 32px));
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.dialog-head {
  align-items: start;
  display: flex;
  justify-content: space-between;
}

#closeDialog {
  background: #f1f5f9;
  color: var(--ink);
  min-height: 34px;
  width: 38px;
}

.indicator-list {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.indicator-list li {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  list-style: none;
  padding: 10px;
}

.risk-note {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #7c2d12;
  line-height: 1.5;
  padding: 12px;
}

@media (max-width: 1100px) {
  .control-panel {
    grid-template-columns: repeat(2, 1fr);
  }

  .button-row {
    grid-column: span 2;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .signal-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: start;
    display: grid;
    gap: 16px;
  }

  .control-panel,
  .market-strip,
  .signal-grid {
    grid-template-columns: 1fr;
  }

  .button-row {
    grid-column: auto;
  }
}
