:root {
  --bg: #02050b;
  --bg-2: #050910;
  --panel: #0a111c;
  --panel-2: #0f1827;
  --text: #f5f1e7;
  --muted: #acb4c2;
  --line: #263549;
  --line-hi: #3e4d65;
  --accent: #ffb347;
  --accent-2: #ff9f2e;
  --green: #56d67e;
  --red: #ff6b6b;
  --amber: #ffbf5f;
  --alt-grey: #8f97a3;
  --bevel-hi: rgba(255, 210, 130, 0.18);
  --bevel-lo: rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", "Helvetica Neue", "Arial", sans-serif;
  background:
    linear-gradient(180deg, var(--bg), var(--bg-2));
  color: var(--text);
  line-height: 1.4;
  font-feature-settings: "tnum" 1;
}

.hidden { display: none !important; }


.suite-nav {
  position: sticky;
  top: 0;
  z-index: 70;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(7,10,14,.92);
  backdrop-filter: blur(10px);
}

.suite-nav-shell {
  width: 100%;
  position: relative;
}

.suite-nav-toggle {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 0 14px;
  list-style: none;
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  color: #d7e1e7;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.suite-nav-toggle::-webkit-details-marker { display: none; }
.suite-nav-toggle::after {
  content: '▾';
  font-size: 10px;
  transition: transform .18s ease;
}

.suite-nav-shell[open] .suite-nav-toggle::after { transform: rotate(180deg); }

.suite-nav-panel {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.suite-nav-links,
.suite-nav-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.suite-nav-link,
.suite-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  color: #d7e1e7;
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.suite-nav-link.active,
.suite-nav-btn-primary {
  color: var(--accent);
  border-color: rgba(255,179,71,0.35);
  background: rgba(255,179,71,0.08);
}

@media (max-width: 720px) {
  .suite-nav {
    padding: 10px 12px;
  }

  .suite-nav-toggle {
    display: inline-flex;
  }

  .suite-nav-panel {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    background: rgba(7,10,14,.98);
    box-shadow: 0 18px 48px rgba(0,0,0,.45);
    z-index: 80;
  }

  .suite-nav-shell[open] .suite-nav-panel {
    display: grid;
  }

  .suite-nav-panel .suite-nav-links,
  .suite-nav-panel .suite-nav-actions {
    display: grid;
  }

  .suite-nav-panel .suite-nav-link,
  .suite-nav-panel .suite-nav-btn {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (min-width: 721px) {
  .suite-nav-toggle {
    display: none;
  }

  .suite-nav-panel {
    display: flex !important;
    position: static;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
}

.suite-feedback-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,0.7);
}

.suite-feedback-card {
  width: min(560px, 100%);
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}

.suite-feedback-head,
.suite-feedback-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.suite-feedback-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.suite-feedback-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent);
}

.suite-feedback-form {
  display: grid;
  gap: 10px;
}

.suite-feedback-input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

.suite-feedback-textarea {
  resize: vertical;
  min-height: 120px;
}

.suite-feedback-status {
  font-size: 12px;
  color: var(--muted);
}

.suite-feedback-status.success { color: var(--green); }
.suite-feedback-status.error { color: var(--red); }
.suite-feedback-honeypot { display: none; }

.scanline {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.02) 0px,
    rgba(255, 255, 255, 0.02) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.18;
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 1420px;
  margin: 0 auto;
  padding: 16px;
}

h1, h2 {
  margin: 0 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1 {
  font-size: clamp(1.3rem, 1.9vw, 2rem);
  color: #f5e9cf;
  font-weight: 800;
}

h2 {
  font-size: 0.82rem;
  color: #e8d9b7;
  font-weight: 800;
}

.kicker {
  margin: 0 0 6px 0;
  font-size: 10px;
  color: var(--amber);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
}

.sub {
  color: var(--muted);
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.45;
}

.panel {
  position: relative;
  overflow: visible;
  z-index: 1;
  isolation: isolate;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 2px solid var(--line);
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow:
    inset 1px 1px 0 var(--bevel-hi),
    inset -1px -1px 0 var(--bevel-lo),
    0 0 0 1px rgba(255, 191, 95, 0.06);
}

.panel:hover,
.panel:focus-within {
  z-index: 40;
}

.pixel-shell { clip-path: none; }
.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.status-pills { display: flex; flex-wrap: wrap; gap: 8px; }

.pill {
  padding: 4px 10px;
  border: 1px solid #5c4b2e;
  border-radius: 2px;
  font-size: 11px;
  color: #f0dfbd;
  background: rgba(26, 22, 15, 0.75);
}

.pill.live {
  border-color: rgba(102, 209, 122, 0.65);
  color: var(--green);
  box-shadow: none;
}

.controls .row { display: flex; gap: 10px; align-items: center; }
.wrap { flex-wrap: wrap; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.data-loader-grid {
  grid-template-columns: 130px 170px minmax(320px, 1fr);
  align-items: start;
}

.data-loader-grid select[multiple] {
  min-height: 104px;
}

.loader-actions {
  gap: 8px;
}

.loader-actions button {
  min-width: 132px;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.65fr);
  gap: 12px;
  align-items: start;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.compact {
  margin-top: 4px;
}

.strategy-stack {
  display: grid;
  gap: 12px;
}

.strategy-groups {
  display: grid;
  gap: 12px;
}

.config-card {
  border: 1px solid rgba(255, 191, 95, 0.12);
  background: linear-gradient(180deg, rgba(11, 17, 27, 0.95), rgba(7, 11, 18, 0.9));
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.04), inset -1px -1px 0 rgba(0,0,0,0.5);
  padding: 12px;
}

.config-card-head {
  margin-bottom: 10px;
}

.config-card-head h3 {
  margin: 0;
  color: #f2dfbb;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.config-card-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.config-grid {
  display: grid;
  gap: 10px;
}

.config-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.config-grid.single-col {
  grid-template-columns: minmax(0, 1fr);
}

.risk-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.risk-side {
  border: 1px solid rgba(85, 100, 126, 0.4);
  background: rgba(12, 18, 29, 0.72);
  padding: 10px;
}

.risk-side-head {
  margin-bottom: 10px;
  color: #ffd89b;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.strategy-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding-top: 2px;
}

.settings-note {
  margin-top: 0;
}

.time-session-picks {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d3c4a4;
}

.checkline input[type="checkbox"] {
  width: 14px;
  height: 14px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  color: #d3c4a4;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.opt-meta {
  margin-left: 6px;
  font-size: 9px;
  color: #9fb7d9;
  letter-spacing: 0.08em;
  font-weight: 700;
}

input, select, button {
  background: linear-gradient(180deg, #111621, #0a0b0d);
  color: var(--text);
  border: 1px solid #4b3f2c;
  border-radius: 2px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 12px;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.09), inset -1px -1px 0 rgba(0,0,0,0.45);
}

.range-control {
  display: grid;
  gap: 6px;
}

.range-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.range-value-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 179, 71, 0.35);
  background: rgba(255, 179, 71, 0.09);
  color: #ffd89b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.range-hint {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: none;
}

input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  padding: 0;
  border: 1px solid #4b3f2c;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 179, 71, 0.12), rgba(255, 159, 46, 0.32));
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.06), inset -1px -1px 0 rgba(0,0,0,0.45);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #c18434;
  background: linear-gradient(180deg, #ffd08a, #ff9f2e);
  box-shadow: 0 1px 6px rgba(0,0,0,0.4);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #c18434;
  background: linear-gradient(180deg, #ffd08a, #ff9f2e);
  box-shadow: 0 1px 6px rgba(0,0,0,0.4);
  cursor: pointer;
}

input[type="range"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.is-disabled {
  opacity: 0.52;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(255, 179, 71, 0.35);
}

button {
  cursor: pointer;
  background: linear-gradient(180deg, #8a6030, #5d3e18);
  border-color: #c18434;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  box-shadow:
    inset 1px 1px 0 rgba(255,219,164,0.28),
    inset -1px -1px 0 rgba(50,24,6,0.6),
    1px 1px 0 rgba(0,0,0,0.45);
}

button:hover { filter: brightness(1.06); }

button.secondary {
  background: linear-gradient(180deg, #2f3948, #1f2733);
  border-color: #55647e;
}

.muted {
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
  line-height: 1.45;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 9px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 9px;
  background: linear-gradient(180deg, rgba(14, 19, 30, 0.95), rgba(9, 12, 18, 0.92));
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.06), inset -1px -1px 0 rgba(0,0,0,0.5);
}

.metric .k {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.metric .v {
  font-size: 19px;
  font-weight: 800;
  margin-top: 4px;
  line-height: 1.05;
  color: #f3e8cd;
}

.tip-target {
  position: relative;
}

.tip-target[data-tip] {
  cursor: help;
}

.floating-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 99999;
  max-width: 320px;
  padding: 8px 9px;
  border-radius: 4px;
  border: 1px solid #5e4a2e;
  background: rgba(10, 12, 18, 0.98);
  color: #f3e8cd;
  font-size: 11px;
  line-height: 1.35;
  white-space: normal;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 0, 0);
  transition: opacity 90ms ease;
}

.floating-tooltip.is-visible {
  opacity: 1;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.07), inset -1px -1px 0 rgba(0,0,0,0.5);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1560px;
}

th, td {
  border-bottom: 1px solid #2c271e;
  padding: 8px 9px;
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #171e2d;
  color: #ffd89b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  font-weight: 800;
}

tr:hover { background: rgba(255, 179, 71, 0.09); }
tr.selected {
  background: rgba(255, 179, 71, 0.18);
  box-shadow: inset 3px 0 0 #ffb347;
}

.status-chip {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid #55647e;
  background: rgba(17, 27, 42, 0.8);
  color: #e7edf7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 10px;
  font-weight: 700;
}

.alt-row td { color: #c7cfdb; }
.alt-cell {
  color: var(--alt-grey) !important;
  background: rgba(149, 158, 170, 0.09);
}

.pct-good { color: var(--green); font-weight: 700; }
.pct-bad { color: var(--red); font-weight: 700; }
.move-yes { color: var(--green); font-weight: 700; }
.move-no { color: var(--red); font-weight: 700; }

.risk-cell {
  min-width: 140px;
}

.cell-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  white-space: normal;
}

#tradeCanvas {
  width: 100%;
  height: auto;
  border: 2px solid var(--line);
  border-radius: 2px;
  background: #070707;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.08), inset -1px -1px 0 rgba(0,0,0,0.6);
  image-rendering: pixelated;
}

.lore-panel {
  border-color: #5a421e;
  background: linear-gradient(180deg, #101722, #0a111a);
}

.lore-text {
  margin: 0;
  color: #ffd494;
  line-height: 1.5;
  font-size: 12px;
  white-space: pre-wrap;
}

@media (max-width: 1180px) {
  .settings-layout { grid-template-columns: 1fr; }
  .risk-layout { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .hero { flex-direction: column; align-items: flex-start; }
  .data-loader-grid { grid-template-columns: 1fr; }
  .config-grid.two-col { grid-template-columns: 1fr; }
  .panel-head { flex-direction: column; }
  .strategy-action-bar > * { width: 100%; }
}
