:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --bg-2: #101720;
  --panel: rgba(21, 29, 38, 0.94);
  --panel-2: rgba(28, 39, 50, 0.86);
  --line: rgba(177, 202, 216, 0.16);
  --text: #edf4f8;
  --muted: #9fb0bb;
  --dim: #738391;
  --cyan: #2ee8d6;
  --amber: #f3b34c;
  --green: #7ce38b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 0;
  min-height: 100dvh;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(135deg, rgba(46, 232, 214, 0.05), transparent 28%),
    linear-gradient(180deg, #0b0f14 0%, #101720 58%, #0b0f14 100%);
  color: var(--text);
  letter-spacing: 0;
}

html,
body {
  overflow-x: hidden;
}

button {
  border: 1px solid rgba(46, 232, 214, 0.28);
  border-radius: 8px;
  background: rgba(46, 232, 214, 0.12);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  padding: 10px 14px;
}

[hidden] {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100dvh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100dvh;
  max-width: 100vw;
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background: rgba(9, 13, 18, 0.88);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: block;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 28px rgba(243, 179, 76, 0.22);
}

.brand strong, .brand small { display: block; }
.brand > div {
  min-width: 0;
}

.brand strong {
  font-size: 14px;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.brand small, .rail-foot span { color: var(--dim); font-size: 12px; }

nav { display: grid; gap: 8px; }
nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 8px;
}
nav a.active, nav a:hover {
  color: var(--text);
  background: rgba(237, 244, 248, 0.08);
}

.rail-signal-history {
  min-height: 0;
  border: 1px solid rgba(177, 202, 216, 0.16);
  border-radius: 8px;
  background: rgba(21, 29, 38, 0.54);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.rail-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rail-history-head strong {
  color: var(--text);
  font-size: 13px;
}

.rail-history-head span {
  color: var(--dim);
  font-size: 11px;
}

#rail-signal-history {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
  max-height: 260px;
  overflow: auto;
  scrollbar-width: thin;
}

#rail-signal-history li {
  border: 1px solid rgba(177, 202, 216, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.028);
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

#rail-signal-history strong,
#rail-signal-history span {
  display: block;
}

#rail-signal-history strong {
  color: var(--text);
  font-size: 12px;
}

#rail-signal-history em {
  display: inline-flex;
  margin-top: 5px;
  border-radius: 999px;
  background: rgba(46, 232, 214, 0.1);
  color: var(--cyan);
  padding: 3px 7px;
  font-style: normal;
  font-weight: 800;
}

.rail-foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: grid;
  gap: 6px;
}

main {
  padding: 22px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 18px;
}

h1, h2, p { margin: 0; }
h1 { font-size: clamp(28px, 4vw, 54px); line-height: 1; max-width: 780px; }
h2 { font-size: 18px; }
p { color: var(--muted); line-height: 1.55; margin-top: 8px; }

.status-stack {
  display: grid;
  gap: 8px;
  justify-items: end;
  color: var(--dim);
  font-size: 13px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(46, 232, 214, 0.25);
  background: rgba(46, 232, 214, 0.08);
  border-radius: 999px;
  padding: 9px 12px;
}

.kline-toggle {
  justify-self: end;
  border: 1px solid rgba(177, 202, 216, 0.24);
  border-radius: 999px;
  background: rgba(23, 33, 45, 0.78);
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  letter-spacing: 0;
  padding: 9px 12px;
  min-width: 86px;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.kline-toggle:hover,
.kline-toggle:focus-visible {
  border-color: rgba(46, 232, 214, 0.48);
  color: var(--text);
  outline: none;
}

.kline-toggle.is-on {
  border-color: rgba(46, 232, 214, 0.54);
  background: rgba(46, 232, 214, 0.12);
  color: var(--cyan);
  box-shadow: 0 0 24px rgba(46, 232, 214, 0.14);
}

.live-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 18px var(--cyan);
  animation: pulse 1.6s ease-in-out infinite;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.kpi-grid article, .panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.24);
}

.kpi-grid article {
  padding: 16px;
}

.kpi-grid span {
  color: var(--dim);
  font-size: 12px;
}

.kpi-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

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

.pool-stack > * {
  min-width: 0;
}

.panel {
  padding: 16px;
  min-width: 0;
}

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

.panel-head.compact {
  align-items: center;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

table {
  border-collapse: collapse;
  min-width: 720px;
  width: 100%;
  font-size: 13px;
}

th, td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--dim);
  font-weight: 600;
  background: rgba(255,255,255,0.03);
}

td { color: var(--muted); }
td strong, .symbol { color: var(--text); }

.empty-row td {
  grid-column: 1 / -1;
  justify-content: center;
  min-height: 54px;
  color: var(--muted);
}

.candidate-row,
.selected-row {
  outline: none;
}

.candidate-row:hover,
.candidate-row:focus-visible,
.selected-row:hover,
.selected-row:focus-visible {
  background: rgba(46, 232, 214, 0.045);
}

.candidate-row:hover .symbol,
.candidate-row:focus-visible .symbol,
.selected-row:hover .symbol,
.selected-row:focus-visible .symbol {
  color: var(--cyan);
}

.preselection-table td:nth-child(6),
.preselection-table td:nth-child(7) {
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

.tag {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 700;
}

.BUY_SETUP { color: #062017; background: var(--green); }
.BUY_SETUP_PAUSED { color: #1f1700; background: #f6d66c; }
.LIMIT_UP_QUEUE_ONLY { color: #2b1a00; background: var(--amber); }
.WATCH, .WATCH_CLOSED, .WATCH_AUCTION { color: var(--cyan); background: rgba(46, 232, 214, 0.1); }

.pressure-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  border: 1px solid rgba(46, 232, 214, 0.28);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--cyan);
  background: rgba(46, 232, 214, 0.1);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.pressure-sub {
  display: block;
  margin-top: 5px;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.3;
}

.pressure-empty {
  color: var(--dim);
}

.pressure-flash {
  border-color: rgba(255, 255, 255, 0.46);
  color: #081017;
  background:
    linear-gradient(90deg, #ff5b82, #f3b34c, #7ce38b, #2ee8d6, #8fb2ff, #ff5b82);
  background-size: 260% 100%;
  animation: pressureRainbow 1.15s linear infinite, pressureGlow 1.5s ease-in-out infinite;
  box-shadow: 0 0 22px rgba(46, 232, 214, 0.18);
}

.buy-signal-flash {
  border: 1px solid rgba(255, 255, 255, 0.62);
  color: #071018;
  background:
    linear-gradient(90deg, #ff5b82, #f3b34c, #7ce38b, #2ee8d6, #8fb2ff, #ff5b82);
  background-size: 260% 100%;
  animation: pressureRainbow 1.15s linear infinite, pressureGlow 1.5s ease-in-out infinite;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 0 22px rgba(246, 214, 108, 0.28);
}

.pressure-top td:first-child {
  box-shadow: inset 3px 0 0 rgba(46, 232, 214, 0.7);
}

.pressure-top-1 td:first-child { box-shadow: inset 3px 0 0 #ff5b82; }
.pressure-top-2 td:first-child { box-shadow: inset 3px 0 0 #f3b34c; }
.pressure-top-3 td:first-child { box-shadow: inset 3px 0 0 #2ee8d6; }

.buy-pressure-signal td:first-child {
  box-shadow: inset 4px 0 0 rgba(246, 214, 108, 0.92);
}

.reason-list {
  list-style: none;
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
}

.reason-list li {
  display: flex;
  gap: 7px;
  line-height: 1.35;
}

.reason-list li::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  margin-top: 0.55em;
  border-radius: 50%;
  background: rgba(46, 232, 214, 0.68);
}

.thinking {
  max-height: 650px;
  overflow: auto;
}

#thinking-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

#thinking-list li {
  border-left: 2px solid rgba(46, 232, 214, 0.48);
  background: rgba(255,255,255,0.04);
  border-radius: 0 8px 8px 0;
  padding: 12px;
  color: var(--muted);
  line-height: 1.5;
}

#thinking-list li strong,
#thinking-list li span {
  display: block;
}

#thinking-list li strong {
  color: var(--text);
  margin-bottom: 8px;
}

#thinking-list li span + span {
  margin-top: 4px;
}

.signal-history {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.signal-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.signal-history-head h3 {
  margin: 0;
  font-size: 14px;
}

.signal-history-head button {
  padding: 6px 9px;
  font-size: 12px;
}

#signal-history-list {
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
}

#signal-history-list li {
  border-left: 2px solid rgba(243, 179, 76, 0.58);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 0 8px 8px 0;
  padding: 10px;
  color: var(--muted);
  line-height: 1.45;
}

#signal-history-list li strong,
#signal-history-list li span {
  display: block;
}

#signal-history-list li strong {
  color: var(--text);
  margin-bottom: 6px;
}

#signal-history-list li span + span {
  margin-top: 4px;
}

#signal-history-list .tag {
  display: inline-flex;
  margin: 0 3px;
  padding: 3px 7px;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.learning-panel {
  margin-top: 12px;
}

.learning-status {
  border: 1px solid rgba(243, 179, 76, 0.35);
  border-radius: 999px;
  color: var(--amber);
  background: rgba(243, 179, 76, 0.08);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
}

.learning-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.learning-grid div,
.weights-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.learning-grid span,
.weights-grid span {
  color: var(--dim);
  display: block;
  font-size: 12px;
}

.learning-grid strong,
.weights-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.weights-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.weights-grid strong {
  color: var(--cyan);
  font-size: 18px;
}

.learning-feed {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 16px;
}

.learning-feed h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.learning-feed ol {
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.learning-feed li {
  border-left: 2px solid rgba(243, 179, 76, 0.5);
  padding: 8px 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  border-radius: 0 8px 8px 0;
  line-height: 1.45;
}

.method-card {
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 8px;
  padding: 15px;
  min-height: 190px;
}

.method-card span {
  color: var(--amber);
  font-size: 12px;
  font-weight: 700;
}

.method-card h3 {
  margin: 10px 0 8px;
  font-size: 16px;
}

.method-card p {
  font-size: 13px;
}

.risk {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 520px);
  gap: 18px;
  align-items: center;
}

.risk-contract {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.risk-contract span, .risk-contract strong {
  border: 1px solid var(--line);
  padding: 10px;
  border-radius: 8px;
}

.risk-contract span { color: var(--dim); }

.kline-popover {
  position: fixed;
  z-index: 70;
  width: calc(100vw - 24px);
  max-width: none;
  border: 1px solid rgba(177, 202, 216, 0.32);
  border-radius: 8px;
  background: rgba(9, 14, 20, 0.99);
  box-shadow: 0 28px 96px rgba(0, 0, 0, 0.62);
  padding: 14px;
  pointer-events: none;
}

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

.kline-head strong,
.kline-head span {
  display: block;
}

.kline-head strong {
  font-size: 16px;
}

.kline-head span {
  color: var(--dim);
  font-size: 13px;
}

#kline-status {
  border: 1px solid rgba(46, 232, 214, 0.22);
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(46, 232, 214, 0.08);
  padding: 5px 8px;
  white-space: nowrap;
}

#kline-canvas {
  display: block;
  width: 100%;
  height: clamp(390px, 56dvh, 520px);
  border: 1px solid rgba(177, 202, 216, 0.22);
  border-radius: 8px;
  background: rgba(11, 17, 24, 0.96);
}

.kline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 13px;
}

.kline-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.kline-legend i {
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: var(--muted);
}

.kline-legend .ma5 { background: #f3b34c; }
.kline-legend .ma10 { background: #2ee8d6; }
.kline-legend .ma20 { background: #8fb2ff; }
.kline-legend .ma60 { background: #edf4f8; }

@keyframes pulse {
  50% { transform: scale(1.4); opacity: 0.45; }
}

@keyframes pressureRainbow {
  to { background-position: 260% 0; }
}

@keyframes pressureGlow {
  50% { filter: saturate(1.45) brightness(1.12); }
}

@media (prefers-reduced-motion: reduce) {
  .live-pill i { animation: none; }
  .pressure-flash { animation: none; }
  .buy-signal-flash { animation: none; }
}

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .rail {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    width: 100%;
  }
  .rail nav { grid-auto-flow: column; grid-auto-columns: max-content; }
  .rail-signal-history { width: 260px; flex: 0 0 260px; }
  .rail-foot { margin-left: auto; margin-top: 0; border-top: 0; padding-top: 0; }
  .risk { grid-template-columns: 1fr; }
  .learning-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .weights-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .learning-feed { grid-template-columns: 1fr; }
  .method-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  table { min-width: 720px; }
}

@media (min-width: 1101px) {
  .selected-table,
  .preselection-table {
    table-layout: fixed;
  }

  th, td { padding: 10px 8px; }
}

@media (min-width: 721px) {
  .selected-table,
  .preselection-table {
    display: block;
    min-width: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
  }

  .selected-table thead,
  .selected-table tbody,
  .preselection-table thead,
  .preselection-table tbody {
    display: block;
  }

  .selected-table thead tr,
  .selected-table tbody tr,
  .preselection-table thead tr,
  .preselection-table tbody tr {
    display: grid;
    align-items: stretch;
  }

  .selected-table thead tr,
  .selected-table tbody tr {
    grid-template-columns:
      108px
      86px
      86px
      104px
      120px
      minmax(148px, 1fr);
  }

  .preselection-table thead tr,
  .preselection-table tbody tr {
    grid-template-columns:
      98px
      70px
      70px
      104px
      128px
      minmax(156px, 0.72fr)
      minmax(220px, 1fr);
  }

  .selected-table thead tr,
  .preselection-table thead tr {
    min-height: 40px;
  }

  .selected-table tbody tr {
    min-height: 62px;
  }

  .preselection-table tbody tr {
    min-height: 64px;
  }

  .selected-table th,
  .selected-table td,
  .preselection-table th,
  .preselection-table td {
    display: flex;
    align-items: center;
    min-width: 0;
    width: auto !important;
    padding: 8px 10px;
    overflow: hidden;
  }

  .selected-table td:first-child,
  .preselection-table td:first-child {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }

  .selected-table td:nth-child(4),
  .preselection-table td:nth-child(4) {
    display: block;
    align-self: center;
    line-height: 1.35;
  }

  .selected-table td:nth-child(4) strong,
  .selected-table td:nth-child(4) span,
  .preselection-table td:nth-child(4) strong,
  .preselection-table td:nth-child(4) span {
    display: block;
  }

  .preselection-table td:nth-child(5),
  .preselection-table td:nth-child(6),
  .preselection-table td:nth-child(7) {
    display: block;
    align-self: center;
    max-height: 48px;
  }

  .preselection-table td:nth-child(6),
  .preselection-table td:nth-child(7) {
    line-height: 1.35;
  }

  .candidate-row .tag,
  .selected-row .tag,
  .pressure-badge {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .candidate-row .tag,
  .selected-row .tag {
    justify-content: center;
    min-width: 48px;
    padding: 5px 7px;
  }

  .preselection-table td:nth-child(6),
  .preselection-table td:nth-child(7) {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .reason-list {
    gap: 2px;
  }

  .reason-list li {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .reason-list li::before {
    display: inline-block;
    margin: 0 7px 0 0;
    vertical-align: middle;
  }
}

@media (min-width: 721px) and (max-width: 2299px) {
  .thinking {
    max-height: 560px;
  }
}

@media (max-width: 720px) {
  main { padding: 10px; }
  h1 { font-size: 30px; line-height: 1.04; }
  h2 { font-size: 17px; }
  p { font-size: 13px; }
  .topbar {
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
  }
  .status-stack { justify-items: start; }
  .live-pill { padding: 7px 10px; }
  .kline-toggle { display: none; }
  .kpi-grid { gap: 8px; margin-bottom: 8px; }
  .kpi-grid article { padding: 12px; }
  .kpi-grid span { font-size: 11px; }
  .kpi-grid strong { font-size: 24px; }
  .pool-stack { gap: 10px; }
  .panel { padding: 12px; }
  .panel-head {
    display: grid;
    gap: 10px;
  }
  .panel-head button {
    justify-self: start;
  }
  .learning-panel .panel-head.compact {
    display: grid;
    align-items: start;
  }
  .learning-status {
    justify-self: start;
  }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .learning-grid, .weights-grid, .method-grid, .risk-contract { grid-template-columns: 1fr; }
  .rail {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 12px;
    overflow: hidden;
  }
  .app-shell,
  main,
  .topbar,
  .topbar > div {
    min-width: 0;
    max-width: 100vw;
  }
  .rail nav {
    min-width: 0;
    overflow-x: auto;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 6px;
    scrollbar-width: none;
  }
  .rail nav::-webkit-scrollbar {
    display: none;
  }
  nav a {
    padding: 9px 10px;
    white-space: nowrap;
  }
  .rail-signal-history {
    grid-column: 1 / -1;
    width: 100%;
  }
  #rail-signal-history {
    max-height: 180px;
  }
  .rail-foot {
    display: none;
  }
  .kline-popover {
    display: none;
  }
  .table-wrap {
    overflow: visible;
  }
  table {
    display: block;
    min-width: 0;
    width: 100%;
    font-size: 13px;
  }
  thead {
    display: none;
  }
  tbody {
    display: grid;
    gap: 10px;
  }
  tbody tr {
    display: grid;
    width: 100%;
  }
  .candidate-row,
  .selected-row {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.026);
    padding: 10px;
  }
  .candidate-row:hover,
  .candidate-row:focus-visible,
  .selected-row:hover,
  .selected-row:focus-visible {
    background: rgba(46, 232, 214, 0.055);
  }
  .candidate-row td,
  .selected-row td {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    border-bottom: 0;
    padding: 5px 0;
    min-width: 0;
  }
  .candidate-row td::before,
  .selected-row td::before {
    content: attr(data-label);
    color: var(--dim);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.4;
  }
  .candidate-row td:first-child,
  .selected-row td:first-child {
    display: block;
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
    margin-bottom: 4px;
  }
  .candidate-row td:first-child::before,
  .selected-row td:first-child::before {
    content: none;
  }
  .candidate-row td:last-child,
  .selected-row td:last-child {
    padding-bottom: 0;
  }
  .candidate-row .tag,
  .selected-row .tag {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .pressure-badge {
    white-space: normal;
  }
  .pressure-top {
    border-color: rgba(46, 232, 214, 0.4);
    box-shadow: 0 0 24px rgba(46, 232, 214, 0.08);
  }
  .pressure-top td:first-child,
  .pressure-top-1 td:first-child,
  .pressure-top-2 td:first-child,
  .pressure-top-3 td:first-child {
    box-shadow: none;
  }
  .pressure-top-1 { border-color: rgba(255, 91, 130, 0.62); }
  .pressure-top-2 { border-color: rgba(243, 179, 76, 0.62); }
  .pressure-top-3 { border-color: rgba(46, 232, 214, 0.62); }
  .thinking {
    max-height: none;
  }
  #thinking-list li,
  #signal-history-list li,
  .learning-feed li {
    font-size: 13px;
    padding: 10px;
  }
  .risk {
    gap: 12px;
  }
}

@media (max-width: 380px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .candidate-row td,
  .selected-row td {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 8px;
  }
  h1 { font-size: 27px; }
}
