:root {
  color-scheme: light;
  --bg: #f6f6f2;
  --panel: #ffffff;
  --panel-soft: #f3f5f1;
  --panel-warm: #fbfaf5;
  --line: #dfded8;
  --line-strong: #cfcac0;
  --text: #111111;
  --muted: #767b7c;
  --muted-strong: #4a514f;
  --green: #3f9b69;
  --green-deep: #1f6f4b;
  --green-soft: #edf8f1;
  --red: #df4d4a;
  --red-deep: #a53432;
  --red-soft: #fff1f0;
  --amber: #b98629;
  --amber-soft: #fff7e6;
  --graphite: #1b1c1a;
  --graphite-soft: #f0f0eb;
  --glass: rgba(255, 255, 255, 0.72);
  --ink: #0f0f0f;
  --shadow: 0 24px 70px rgba(35, 38, 33, 0.12);
  --shadow-soft: 0 12px 32px rgba(35, 38, 33, 0.08);
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(246, 246, 242, 0.94) 420px),
    var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 246, 242, 0.98) 520px),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.page-shell {
  width: min(1500px, calc(100% - 48px));
  margin: 0 auto 64px;
}

.system-banner {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 44px minmax(180px, 1fr) minmax(0, auto);
  gap: 12px;
  align-items: center;
  min-height: 68px;
  border-bottom: 1px solid var(--line);
  padding: 10px 2px;
  background: rgba(250, 250, 250, 0.94);
  backdrop-filter: blur(16px);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--ink);
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 900;
}

.brand-copy p,
.brand-copy h1 {
  margin: 0;
}

.brand-copy p {
  color: var(--ink);
  font-size: 19px;
  font-weight: 850;
  line-height: 1;
}

.brand-copy h1 {
  margin-top: 1px;
  color: #676767;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
}

.brand-copy span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.system-actions,
.compact-actions,
.view-tabs,
.filter-rail,
.track-mode,
.form-actions {
  display: flex;
  align-items: center;
}

.system-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.status-badge,
.state-pill,
.inline-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--muted-strong);
  background: var(--panel);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.status-badge.ok,
.state-pill.long,
.state-pill.ftp,
.state-pill.tp1,
.state-pill.tp2,
.state-pill.tp3,
.state-pill.active,
.state-pill.holding,
.state-pill.open {
  color: var(--green);
  border-color: #c8e7d4;
  background: var(--green-soft);
}

.status-badge.error,
.state-pill.short,
.state-pill.sl {
  color: var(--red);
  border-color: #f5c7c7;
  background: var(--red-soft);
}

.state-pill.ambiguous,
.state-pill.manual_closed,
.state-pill.expired {
  color: var(--amber);
  border-color: #ead8b5;
  background: var(--amber-soft);
}

.state-pill.muted {
  color: var(--muted);
  background: var(--panel-soft);
}

.tool-btn,
.primary-tool,
.view-tab,
.filter-chip,
.icon-btn {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--panel);
  font-weight: 700;
}

.primary-tool {
  border-color: var(--ink);
  color: #ffffff;
  background: var(--ink);
}

.tool-btn:hover,
.primary-tool:hover,
.view-tab:hover,
.filter-chip:hover,
.icon-btn:hover {
  border-color: var(--ink);
}

main {
  padding-top: 44px;
}

.view-tabs {
  gap: 24px;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--line);
}

.view-tab {
  min-height: 43px;
  border: 0;
  border-radius: 0;
  padding: 0 2px;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 850;
}

.view-tab.is-active {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--ink);
}

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

.stat-card {
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 20px;
  background: var(--panel);
}

.stat-card span,
.stat-card small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.stat-card strong {
  display: block;
  margin: 7px 0 2px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 25px;
  letter-spacing: 0;
}

.stat-card:nth-child(4) strong {
  color: var(--ink);
}

.stat-card:nth-child(7) strong,
.stat-card:nth-child(8) strong {
  color: var(--amber);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 2px;
}

.section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.2;
}

.section-heading span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}

.compact-actions {
  gap: 8px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
  outline: none;
}

input,
select {
  min-height: 36px;
  padding: 0 11px;
}

textarea {
  min-height: 410px;
  padding: 14px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.06);
}

.filter-rail,
.advanced-panel,
.data-flow-controls,
.import-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.filter-rail {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding: 13px 14px;
}

.filter-rail span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.filter-chip {
  min-height: 30px;
  border-radius: 999px;
  color: var(--muted-strong);
  background: var(--panel-soft);
}

.filter-chip.is-active {
  color: #ffffff;
  border-color: var(--ink);
  background: var(--ink);
}

.advanced-panel {
  margin-top: 14px;
  overflow: hidden;
}

.advanced-panel summary {
  min-height: 40px;
  padding: 11px 14px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}

.advanced-panel summary::-webkit-details-marker {
  display: none;
}

.advanced-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 150px 170px;
  gap: 8px;
  padding: 0 14px 14px;
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.load-more-row {
  display: flex;
  justify-content: center;
  margin: 20px 0 4px;
}

.load-more-row [hidden] {
  display: none;
}

.signal-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.signal-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.signal-card.is-selected {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.06);
}

.signal-card.long {
  border-left: 4px solid var(--green);
}

.signal-card.short {
  border-left: 4px solid var(--red);
}

.signal-card.lunai-pick {
  background: #fffdf7;
}

.card-top {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
}

.card-top strong,
.card-top small,
.card-meta span,
.card-meta small {
  display: block;
}

.card-top strong {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 850;
}

.card-top small,
.card-meta small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.card-meta {
  text-align: right;
}

.card-meta span {
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--muted-strong);
  background: var(--panel-soft);
  font-size: 11px;
  font-weight: 800;
}

.signal-card.ftp .card-meta span,
.signal-card.tp1 .card-meta span,
.signal-card.tp2 .card-meta span,
.signal-card.tp3 .card-meta span,
.signal-card.active .card-meta span,
.signal-card.holding .card-meta span,
.signal-card.open .card-meta span {
  color: var(--green);
  border-color: #c8e7d4;
  background: var(--green-soft);
}

.signal-card.sl .card-meta span {
  color: var(--red);
  border-color: #f5c7c7;
  background: var(--red-soft);
}

.side-chip {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 13px;
}

.side-chip.long {
  color: #ffffff;
  background: var(--green);
}

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

.strategy-line {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 850;
}

.strategy-line.long {
  color: var(--green);
}

.strategy-line.short {
  color: var(--red);
}

.side-win-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  align-items: center;
  min-height: 38px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  background: var(--panel-soft);
}

.side-win-line span,
.side-win-line small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 800;
}

.side-win-line strong {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
}

.side-win-line small {
  grid-column: 1 / -1;
  font-family: var(--mono);
  font-size: 10px;
}

.side-win-line.long {
  border-color: #dcefe3;
  background: var(--green-soft);
}

.side-win-line.long strong {
  color: var(--green);
}

.side-win-line.short {
  border-color: #f5d4d4;
  background: var(--red-soft);
}

.side-win-line.short strong {
  color: var(--red);
}

.lunai-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  margin-top: 10px;
  border: 1px solid #ecdcb9;
  border-radius: 8px;
  padding: 7px 9px;
  background: var(--amber-soft);
}

.lunai-badge strong,
.lunai-badge span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lunai-badge strong {
  color: var(--amber);
  font-size: 12px;
}

.lunai-badge span {
  color: var(--muted-strong);
  font-family: var(--mono);
  font-size: 10px;
}

.pnl-block {
  min-height: 62px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--panel-warm);
}

.pnl-block > span,
.price-grid span,
.target-tile > span,
.detail-grid div > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.pnl-block strong {
  display: block;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 23px;
  line-height: 1.1;
}

.source-snapshot-line {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.price-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.price-grid div,
.detail-grid div {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel);
}

.price-grid strong,
.detail-grid strong,
.target-tile strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
}

.target-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}

.target-tile {
  min-height: 52px;
  border: 1px solid #dcefe3;
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--green-soft);
}

.target-tile.stop {
  border-color: #f5d4d4;
  background: var(--red-soft);
}

.target-tile.risk {
  border-color: #edd8aa;
  background: var(--amber-soft);
}

.target-tile.risk strong {
  color: var(--amber);
}

.target-tile.is-hit {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.target-tile small {
  display: block;
  margin-top: 3px;
  color: var(--muted-strong);
  font-family: var(--mono);
  font-size: 10px;
}

.table-panel {
  overflow: auto;
  max-height: calc(100vh - 280px);
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.table-panel.split {
  max-height: 340px;
}

table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  height: 46px;
  border-bottom: 1px solid var(--line);
  padding: 0 14px;
  overflow: hidden;
  color: var(--ink);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted-strong);
  background: var(--panel);
  font-size: 12px;
  font-weight: 750;
}

tr:last-child td {
  border-bottom: 0;
}

.data-flow-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 110px 100px auto auto auto;
  gap: 8px;
  align-items: center;
  margin-top: 18px;
  padding: 14px;
}

.import-panel {
  margin-top: 18px;
  padding: 16px;
}

.import-grid {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.import-grid label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.source-config-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.form-actions {
  gap: 10px;
  margin-top: 10px;
}

.position-dialog {
  width: min(1050px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.position-dialog::backdrop {
  background: rgba(17, 17, 17, 0.34);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 78px;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
}

.dialog-head p,
.dialog-head h2 {
  margin: 0;
}

.dialog-head p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.dialog-head h2 {
  margin-top: 4px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.2;
}

.icon-btn {
  width: 36px;
  padding: 0;
  font-size: 20px;
}

.detail-body {
  padding: 18px;
}

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

.symbol-history {
  display: grid;
  gap: 18px;
}

.symbol-history h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.symbol-overview,
.symbol-strategy-grid {
  display: grid;
  gap: 12px;
}

.symbol-overview {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.symbol-strategy-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.symbol-main-stat,
.symbol-stat-card {
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
}

.symbol-main-stat > span,
.symbol-main-stat small,
.symbol-stat-card > span,
.symbol-stat-card small,
.symbol-stat-card em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
}

.symbol-main-stat strong,
.symbol-stat-card strong {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 25px;
}

.symbol-stat-card b {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 16px;
}

.edge-panel {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(31, 33, 30, 0.08);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.edge-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.edge-head h3,
.edge-head p {
  margin: 0;
}

.edge-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.edge-action {
  min-width: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  text-align: right;
  background: rgba(245, 246, 242, 0.82);
}

.edge-action strong,
.edge-action span {
  display: block;
  font-family: var(--mono);
}

.edge-action strong {
  color: var(--green);
  font-size: 15px;
}

.edge-action.skip-or-probe strong,
.edge-action.wait-for-more-data strong {
  color: var(--red);
}

.edge-action span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.edge-mini-grid,
.edge-target-grid {
  display: grid;
  gap: 8px;
}

.edge-mini-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.edge-target-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.edge-mini-grid article,
.edge-target-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.7);
}

.edge-mini-grid span,
.edge-mini-grid small,
.edge-target-card span,
.edge-target-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.edge-mini-grid strong,
.edge-target-card strong {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 18px;
}

.edge-target-card.is-active {
  border-color: rgba(62, 143, 101, 0.42);
  background: rgba(62, 143, 101, 0.1);
}

.edge-reasons {
  display: grid;
  gap: 6px;
}

.edge-reasons span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.symbol-history-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.symbol-history-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.symbol-history-panel {
  max-height: 430px;
  margin-top: 0;
}

.symbol-history-table {
  min-width: 680px;
}

.detail-targets {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 12px 0;
}

.timeline {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.event-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-soft);
}

.event-row span,
.event-row small,
.event-row strong {
  display: block;
}

.event-row span,
.event-row small {
  color: var(--muted);
  font-size: 11px;
}

.event-row strong {
  margin: 3px 0;
  color: var(--ink);
  font-size: 13px;
}

.track-form {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-top: 1px solid var(--line);
}

.track-mode {
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.track-mode label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.track-mode input {
  width: auto;
  min-height: auto;
}

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

#tickFields {
  grid-template-columns: 1fr;
}

/* 2026-05 LunAI visual refresh */
.system-banner {
  min-height: 76px;
  border-bottom: 1px solid rgba(31, 33, 30, 0.09);
  padding: 12px 0;
  background: rgba(246, 246, 242, 0.86);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.88) inset;
}

.brand-mark {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(145deg, #050606, #262923 76%);
  box-shadow:
    0 14px 28px rgba(15, 15, 15, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.brand-mark::after {
  content: "";
  position: absolute;
  right: 9px;
  top: 9px;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 999px;
  transform: rotate(24deg);
}

.brand-copy p {
  font-size: 20px;
}

.system-actions {
  gap: 8px;
}

.status-badge {
  min-height: 31px;
  border-color: rgba(31, 33, 30, 0.09);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.tool-btn,
.primary-tool,
.filter-chip,
.icon-btn {
  min-height: 36px;
  border-color: rgba(31, 33, 30, 0.1);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.92) inset;
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.primary-tool {
  border-color: #10110f;
  background: linear-gradient(180deg, #242821, #0f100e);
}

.tool-btn:hover,
.primary-tool:hover,
.filter-chip:hover,
.icon-btn:hover {
  border-color: rgba(31, 33, 30, 0.32);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.overview-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 0.76fr) minmax(320px, 1.24fr);
  align-items: stretch;
  min-height: 236px;
  margin: 0 0 26px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(246, 246, 242, 0.98) 0%, rgba(246, 246, 242, 0.88) 34%, rgba(246, 246, 242, 0) 66%),
    url("/static/assets/lunai-signal-field-v1.png") center right / cover no-repeat;
}

.overview-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(31, 33, 30, 0.2), transparent);
}

.overview-copy {
  position: relative;
  z-index: 1;
  align-self: center;
  padding: 28px 0 30px;
}

.hero-eyebrow {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid rgba(31, 33, 30, 0.1);
  border-radius: 999px;
  padding: 0 11px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.78);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 850;
}

.overview-copy h2 {
  margin: 18px 0 16px;
  color: #070806;
  font-size: 46px;
  line-height: 1.02;
}

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

.hero-status-row span {
  min-height: 34px;
  border: 1px solid rgba(31, 33, 30, 0.09);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 800;
}

.overview-visual {
  min-height: 236px;
}

.view-tabs {
  position: sticky;
  top: 76px;
  z-index: 10;
  gap: 4px;
  margin-bottom: 26px;
  border: 1px solid rgba(31, 33, 30, 0.08);
  border-radius: 8px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px);
}

.view-tab {
  min-height: 38px;
  border-radius: 6px;
  padding: 0 16px;
}

.view-tab.is-active {
  color: #ffffff;
  background: var(--graphite);
  box-shadow: none;
}

.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  border-color: rgba(31, 33, 30, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(249, 249, 245, 0.98));
  box-shadow: var(--shadow-soft);
}

.stat-card::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green), rgba(185, 134, 41, 0.55), transparent);
}

.stat-card:nth-child(4)::before {
  background: linear-gradient(90deg, #121411, rgba(185, 134, 41, 0.54), transparent);
}

.stat-card:nth-child(7)::before,
.stat-card:nth-child(8)::before {
  background: linear-gradient(90deg, var(--amber), rgba(223, 77, 74, 0.42), transparent);
}

.stat-card strong {
  font-size: 27px;
}

.section-heading {
  min-height: 54px;
  border-bottom: 1px solid rgba(31, 33, 30, 0.08);
  padding-bottom: 10px;
}

.filter-rail,
.advanced-panel,
.data-flow-controls,
.import-panel,
.table-panel {
  border-color: rgba(31, 33, 30, 0.08);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.82) inset;
  backdrop-filter: blur(14px);
}

.filter-chip {
  min-height: 32px;
  background: var(--graphite-soft);
}

.filter-chip.is-active {
  border-color: var(--graphite);
  background: var(--graphite);
}

input,
select,
textarea {
  border-color: rgba(31, 33, 30, 0.1);
  background: rgba(255, 255, 255, 0.78);
}

.signal-grid {
  gap: 16px;
}

.signal-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(31, 33, 30, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 248, 243, 0.98));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.84) inset;
}

.signal-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--green);
  opacity: 0.92;
}

.signal-card.short::before {
  background: var(--red);
}

.signal-card.lunai-pick {
  border-color: rgba(185, 134, 41, 0.32);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 250, 239, 0.98));
}

.signal-card:hover {
  border-color: rgba(31, 33, 30, 0.16);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.card-top {
  padding-top: 4px;
}

.side-chip {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 18px rgba(35, 38, 33, 0.1);
}

.side-chip.short {
  color: #ffffff;
  background: var(--red);
}

.card-meta span {
  min-height: 26px;
  border-color: rgba(31, 33, 30, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.strategy-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.strategy-line::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

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

.path-meter span {
  position: relative;
  min-height: 22px;
  overflow: hidden;
  border: 1px solid rgba(31, 33, 30, 0.08);
  border-radius: 999px;
  background: rgba(31, 33, 30, 0.05);
}

.path-meter span::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--green);
  opacity: 0;
}

.path-meter.short span::before {
  background: var(--red);
}

.path-meter span.is-reached::before {
  opacity: 0.18;
}

.path-meter span:first-child::before {
  opacity: 0.12;
}

.path-meter.is-loss span:first-child::before {
  background: var(--red);
  opacity: 0.2;
}

.path-meter i {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 20px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.path-meter span.is-reached i {
  color: var(--green-deep);
}

.path-meter.short span.is-reached i,
.path-meter.is-loss i {
  color: var(--red-deep);
}

.side-win-line,
.pnl-block,
.price-grid div,
.target-tile,
.detail-grid div,
.symbol-stat-card {
  border-color: rgba(31, 33, 30, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.side-win-line.long {
  border-color: rgba(63, 155, 105, 0.22);
  background: rgba(255, 255, 255, 0.72);
}

.side-win-line.short {
  border-color: rgba(223, 77, 74, 0.22);
  background: rgba(255, 255, 255, 0.72);
}

.lunai-badge {
  border-color: rgba(185, 134, 41, 0.26);
  background: linear-gradient(90deg, rgba(255, 247, 230, 0.98), rgba(255, 255, 255, 0.74));
}

.regime-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin: 12px 0 16px;
  padding: 14px 16px;
  border: 1px solid rgba(31, 33, 30, 0.08);
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.92), rgba(247, 248, 244, 0.82)),
    radial-gradient(circle at 12% 0%, rgba(63, 155, 105, 0.12), transparent 42%);
  box-shadow: 0 10px 28px rgba(35, 38, 33, 0.045);
}

.regime-panel.short {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.94), rgba(255, 246, 246, 0.86)),
    radial-gradient(circle at 12% 0%, rgba(223, 77, 74, 0.14), transparent 42%);
}

.regime-panel.long {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.94), rgba(241, 249, 244, 0.88)),
    radial-gradient(circle at 12% 0%, rgba(63, 155, 105, 0.15), transparent 42%);
}

.regime-panel.risk-off {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.94), rgba(255, 249, 237, 0.88)),
    radial-gradient(circle at 12% 0%, rgba(185, 134, 41, 0.14), transparent 42%);
}

.panel-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.regime-panel strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
}

.regime-panel small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.regime-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 8px;
}

.regime-metrics span {
  display: grid;
  gap: 2px;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid rgba(31, 33, 30, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.regime-metrics b {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 850;
}

.signal-card.lunai-v2-pick {
  border-color: rgba(31, 33, 30, 0.24);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.84) inset,
    0 16px 42px rgba(35, 38, 33, 0.075);
}

.signal-card.lunai-v2-pick::after {
  content: "";
  position: absolute;
  inset: 4px 4px auto auto;
  width: 34px;
  height: 2px;
  border-radius: 999px;
  background: var(--graphite);
  opacity: 0.72;
}

.signal-card.lunai-v3-pick {
  border-color: rgba(64, 133, 91, 0.34);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 18px 46px rgba(57, 98, 75, 0.11);
}

.signal-card.lunai-v3-pick::after {
  content: "";
  position: absolute;
  inset: 4px 4px auto auto;
  width: 38px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(64, 133, 91, 0.92), rgba(31, 33, 30, 0.82));
}

.strategy-line {
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.reliability-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(31, 33, 30, 0.1);
  background: rgba(246, 246, 242, 0.96);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.reliability-pill.high {
  border-color: rgba(64, 133, 91, 0.18);
  background: rgba(229, 244, 234, 0.96);
  color: var(--green);
}

.reliability-pill.medium {
  border-color: rgba(185, 134, 41, 0.2);
  background: rgba(255, 247, 230, 0.94);
  color: var(--amber);
}

.reliability-pill.unknown {
  border-color: rgba(31, 33, 30, 0.08);
  background: rgba(241, 241, 236, 0.92);
  color: var(--muted);
}

.lunai-badge.v2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 3px 8px;
  min-height: 42px;
  padding: 7px 10px;
  border-color: rgba(31, 33, 30, 0.14);
  background: linear-gradient(90deg, rgba(31, 33, 30, 0.96), rgba(63, 155, 105, 0.88));
}

.lunai-badge.v2 strong,
.lunai-badge.v2 b,
.lunai-badge.v2 span {
  color: #ffffff;
}

.lunai-badge.v2 strong,
.lunai-badge.v2 b {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.lunai-badge.v2 strong {
  min-width: 0;
  font-size: 12px;
}

.lunai-badge.v2 b {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 850;
}

.lunai-badge.v2 span {
  grid-column: 1 / -1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  opacity: 0.86;
  line-height: 1.35;
}

.lunai-badge.v3 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 3px 8px;
  min-height: 44px;
  padding: 7px 10px;
  border-color: rgba(64, 133, 91, 0.22);
  background:
    linear-gradient(90deg, rgba(22, 38, 29, 0.98), rgba(64, 133, 91, 0.94)),
    #203328;
}

.lunai-badge.v3 strong,
.lunai-badge.v3 b,
.lunai-badge.v3 span {
  color: #ffffff;
}

.lunai-badge.v3 strong,
.lunai-badge.v3 b {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.lunai-badge.v3 strong {
  min-width: 0;
  font-size: 12px;
}

.lunai-badge.v3 b {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 850;
}

.lunai-badge.v3 span {
  grid-column: 1 / -1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  opacity: 0.88;
  line-height: 1.35;
}

.pnl-block {
  background: linear-gradient(180deg, rgba(250, 250, 247, 0.98), rgba(242, 244, 239, 0.98));
}

.pnl-block strong {
  font-size: 25px;
}

.position-size-line {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.35;
}

.target-tile {
  background: rgba(237, 248, 241, 0.82);
}

.target-tile.stop {
  border-color: rgba(223, 77, 74, 0.18);
  background: rgba(255, 241, 240, 0.85);
}

.target-tile.risk {
  border-color: rgba(185, 134, 41, 0.2);
  background: rgba(255, 247, 230, 0.88);
}

.target-tile.is-hit {
  border-color: rgba(31, 33, 30, 0.34);
  box-shadow:
    inset 0 0 0 1px rgba(31, 33, 30, 0.12),
    0 8px 20px rgba(35, 38, 33, 0.07);
}

th {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.position-dialog {
  border-color: rgba(31, 33, 30, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 249, 245, 0.98));
}

.dialog-head {
  background: linear-gradient(90deg, rgba(246, 246, 242, 0.98), rgba(255, 255, 255, 0.88));
}

/* 2026-05 proportion refinement: calmer, denser, more premium */
.page-shell {
  width: min(1320px, calc(100% - 96px));
  margin-bottom: 88px;
}

main {
  padding-top: 30px;
}

.system-banner {
  grid-template-columns: 38px minmax(180px, 1fr) minmax(0, auto);
  min-height: 60px;
  padding: 8px 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  font-size: 16px;
}

.brand-mark::after {
  right: 8px;
  top: 8px;
  width: 13px;
  height: 13px;
  border-width: 2px;
}

.brand-copy p {
  font-size: 18px;
}

.brand-copy h1 {
  font-size: 10px;
}

.brand-copy span {
  margin-top: 4px;
  font-size: 10px;
}

.system-actions {
  gap: 6px;
}

.status-badge,
.inline-status {
  min-height: 26px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 720;
}

.tool-btn,
.primary-tool,
.view-tab,
.filter-chip,
.icon-btn {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 760;
}

.overview-hero {
  min-height: 148px;
  margin: 0 0 30px;
  background:
    linear-gradient(90deg, rgba(246, 246, 242, 0.98) 0%, rgba(246, 246, 242, 0.88) 38%, rgba(246, 246, 242, 0.22) 72%),
    url("/static/assets/lunai-signal-field-v1.png") center right / cover no-repeat;
}

.overview-copy {
  padding: 18px 0;
}

.hero-eyebrow {
  min-height: 24px;
  padding: 0 10px;
  font-size: 10px;
}

.overview-copy h2 {
  margin: 10px 0 12px;
  font-size: 32px;
  letter-spacing: 0;
}

.hero-status-row {
  gap: 6px;
}

.hero-status-row span {
  min-height: 28px;
  padding: 6px 10px;
  font-size: 11px;
}

.overview-visual {
  min-height: 148px;
}

.view-tabs {
  top: 60px;
  margin-bottom: 32px;
  padding: 4px;
}

.view-tab {
  min-height: 32px;
  padding: 0 13px;
}

.stats-grid {
  gap: 12px;
  margin-bottom: 40px;
}

.stat-card {
  min-height: 84px;
  padding: 14px 16px;
  box-shadow: 0 10px 28px rgba(35, 38, 33, 0.055);
}

.stat-card::before {
  left: 16px;
  right: 16px;
  height: 2px;
}

.stat-card span,
.stat-card small {
  font-size: 11px;
}

.stat-card strong {
  margin: 5px 0 1px;
  font-size: 21px;
}

.section-heading {
  min-height: 46px;
  padding-bottom: 8px;
}

.section-heading h2 {
  font-size: 21px;
}

.compact-actions {
  gap: 7px;
}

input,
select {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.filter-rail {
  gap: 7px;
  margin-top: 16px;
  padding: 10px 12px;
}

.filter-chip {
  min-height: 28px;
}

.advanced-panel {
  margin-top: 10px;
}

.advanced-panel summary {
  min-height: 34px;
  padding: 9px 12px;
  font-size: 12px;
}

.advanced-grid {
  padding: 0 12px 12px;
}

.signal-grid {
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  align-items: start;
  gap: 14px;
  margin-top: 18px;
}

.signal-card {
  border-left: 1px solid rgba(31, 33, 30, 0.08);
  padding: 11px 12px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.signal-card.long,
.signal-card.short {
  border-left: 1px solid rgba(31, 33, 30, 0.08);
}

.signal-card::before {
  height: 3px;
}

.signal-card:hover {
  box-shadow: 0 16px 38px rgba(35, 38, 33, 0.1);
  transform: translateY(-1px);
}

.card-top {
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  padding-top: 2px;
}

.card-top strong {
  font-size: 13px;
}

.card-top small,
.card-meta small {
  font-size: 9px;
}

.card-meta span {
  min-height: 22px;
  padding: 2px 7px;
  font-size: 10px;
}

.side-chip {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.strategy-line {
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
}

.strategy-line::before {
  width: 6px;
  height: 6px;
}

.path-meter {
  gap: 3px;
  margin-top: 8px;
}

.path-meter span {
  min-height: 16px;
}

.path-meter i {
  min-height: 14px;
  font-size: 8px;
}

.side-win-line {
  min-height: 34px;
  margin-top: 7px;
  border-radius: 6px;
  padding: 5px 8px;
}

.side-win-line span,
.side-win-line small {
  font-size: 9px;
}

.side-win-line strong {
  font-size: 13px;
}

.lunai-badge {
  min-height: 28px;
  margin-top: 7px;
  border-radius: 6px;
  padding: 5px 8px;
}

.lunai-badge strong {
  font-size: 10px;
}

.lunai-badge span {
  font-size: 9px;
}

.pnl-block {
  min-height: 48px;
  margin-top: 9px;
  border-radius: 6px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.68);
}

.pnl-block > span,
.price-grid span,
.target-tile > span,
.detail-grid div > span {
  font-size: 9px;
}

.pnl-block strong {
  margin-top: 4px;
  font-size: 19px;
}

.source-snapshot-line {
  margin-top: 4px;
  font-size: 9px;
}

.price-grid {
  gap: 6px;
  margin-top: 6px;
}

.price-grid div,
.detail-grid div {
  min-height: 36px;
  border-radius: 6px;
  padding: 6px 8px;
}

.price-grid strong,
.detail-grid strong,
.target-tile strong {
  margin-top: 3px;
  font-size: 11px;
}

.target-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-top: 6px;
}

.target-tile {
  min-height: 32px;
  border-radius: 6px;
  padding: 5px 7px;
  background: rgba(255, 255, 255, 0.62);
}

.target-tile.stop {
  background: rgba(255, 255, 255, 0.62);
}

.target-tile.risk {
  background: rgba(255, 255, 255, 0.62);
}

.target-tile:not(.stop):not(.risk) > span {
  color: var(--green-deep);
}

.target-tile.stop > span {
  color: var(--red-deep);
}

.target-tile.risk > span {
  color: var(--amber);
}

.target-tile small {
  margin-top: 2px;
  font-size: 8px;
}

.table-panel {
  margin-top: 16px;
}

.load-more-row {
  margin: 24px 0 8px;
}

.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  grid-column: 1 / -1;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel);
}

.empty-state.compact {
  min-height: 90px;
}

.positive {
  color: var(--green);
}

.negative {
  color: var(--red);
}

.is-hidden {
  display: none;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  border: 1px solid #222222;
  border-radius: 8px;
  padding: 12px 14px;
  color: #ffffff;
  background: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .system-banner {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .overview-hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 168px;
    background:
      linear-gradient(90deg, rgba(246, 246, 242, 0.98), rgba(246, 246, 242, 0.62)),
      url("/static/assets/lunai-signal-field-v1.png") center right / cover no-repeat;
  }

  .overview-visual {
    display: none;
  }

  .system-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

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

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

  .regime-panel {
    grid-template-columns: 1fr;
  }

  .data-flow-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1500px);
  }

  main {
    padding-top: 22px;
  }

  .system-banner,
  .section-heading,
  .compact-actions {
    align-items: stretch;
  }

  .system-banner {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px 0;
  }

  .overview-hero {
    min-height: 144px;
    margin-bottom: 18px;
  }

  .overview-copy {
    padding: 18px 0;
  }

  .overview-copy h2 {
    font-size: 30px;
  }

  .hero-status-row span {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
  }

  .view-tabs {
    position: static;
  }

  .brand-mark {
    display: none;
  }

  .brand-copy span {
    display: none;
  }

  .system-actions,
  .section-heading,
  .compact-actions,
  .view-tabs,
  .filter-rail {
    flex-direction: column;
  }

  .system-actions > *,
  .compact-actions > *,
  .view-tabs > *,
  .filter-rail > * {
    width: 100%;
  }

  .system-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .system-actions > * {
    width: auto;
  }

  #liveToggleBtn {
    grid-column: 1 / -1;
  }

  .view-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 6px;
  }

  .view-tabs > * {
    width: auto;
  }

  .stats-grid,
  .signal-grid,
  .advanced-grid,
  .data-flow-controls,
  .detail-grid,
  .detail-targets,
  .symbol-overview,
  .symbol-strategy-grid,
  .track-fields,
  .import-grid {
    grid-template-columns: 1fr;
  }

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

  .regime-panel {
    gap: 12px;
    padding: 12px;
  }

  .regime-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .regime-metrics span {
    min-height: 48px;
    padding: 7px 8px;
  }

  .stat-card {
    min-height: 74px;
    padding: 12px;
  }

  .stat-card strong {
    font-size: 20px;
  }

  .symbol-history-head {
    align-items: stretch;
    flex-direction: column;
  }

  .edge-head {
    display: grid;
  }

  .edge-mini-grid,
  .edge-target-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-panel {
    max-height: none;
  }
}

/* 2026-05 top chrome cohesion */
html {
  background:
    linear-gradient(180deg, #f7f8f5 0, #f1f3ef 340px, #f6f6f2 100%),
    var(--bg);
}

body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0, rgba(246, 247, 244, 0.78) 96px, rgba(246, 246, 242, 0) 360px),
    var(--bg);
}

.page-shell {
  width: min(1360px, calc(100% - 72px));
  padding-top: 12px;
}

.system-banner {
  top: 0;
  grid-template-columns: 40px minmax(210px, 1fr) minmax(0, auto);
  gap: 12px;
  min-height: 70px;
  border: 1px solid rgba(24, 26, 23, 0.09);
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  padding: 12px 14px 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 252, 0.94), rgba(247, 248, 245, 0.9));
  box-shadow:
    0 22px 50px rgba(28, 31, 27, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.system-banner::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(24, 26, 23, 0.08), transparent);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow:
    0 16px 28px rgba(13, 15, 13, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.brand-copy p {
  font-size: 19px;
  letter-spacing: 0;
}

.brand-copy h1 {
  margin-top: 2px;
  color: #585e5b;
  font-size: 10px;
  letter-spacing: 0;
}

.brand-copy span {
  margin-top: 5px;
  max-width: 520px;
  color: #727a76;
  font-size: 10px;
}

.system-actions {
  gap: 7px;
}

.status-badge {
  min-height: 30px;
  border-color: rgba(47, 59, 51, 0.1);
  background: rgba(255, 255, 255, 0.62);
  color: #616a65;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.status-badge.ok {
  border-color: rgba(63, 155, 105, 0.22);
  background: rgba(237, 248, 241, 0.74);
}

.tool-btn,
.primary-tool {
  min-height: 32px;
  border-radius: 10px;
  border-color: rgba(24, 26, 23, 0.1);
  background: rgba(255, 255, 255, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 4px 14px rgba(28, 31, 27, 0.035);
}

.primary-tool {
  border-color: rgba(13, 15, 13, 0.92);
  background: linear-gradient(180deg, #20221f, #0d0e0d);
}

main {
  padding-top: 18px;
}

.view-tabs {
  top: 70px;
  z-index: 19;
  gap: 3px;
  margin: -18px 0 30px;
  border: 1px solid rgba(24, 26, 23, 0.09);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  padding: 8px 9px;
  background:
    linear-gradient(180deg, rgba(247, 248, 245, 0.92), rgba(255, 255, 252, 0.88));
  box-shadow:
    0 26px 54px rgba(28, 31, 27, 0.07),
    inset 0 -1px 0 rgba(255, 255, 255, 0.92);
}

.view-tab {
  min-height: 34px;
  border-radius: 10px;
  padding: 0 15px;
  color: #6a706c;
  background: transparent;
  box-shadow: none;
}

.view-tab:hover {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: none;
  transform: none;
}

.view-tab.is-active {
  color: #ffffff;
  background: linear-gradient(180deg, #20221f, #111210);
  box-shadow:
    0 10px 20px rgba(17, 18, 16, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.overview-hero {
  border: 1px solid rgba(24, 26, 23, 0.08);
  border-radius: 16px;
  margin-top: 4px;
  overflow: hidden;
  box-shadow: 0 18px 42px rgba(28, 31, 27, 0.06);
}

.stats-grid {
  gap: 14px;
  margin-bottom: 34px;
}

.stat-card,
.filter-rail,
.advanced-panel,
.table-panel,
.import-panel,
.data-flow-controls,
.regime-panel {
  border-color: rgba(24, 26, 23, 0.08);
  background: rgba(255, 255, 255, 0.76);
  box-shadow:
    0 14px 34px rgba(28, 31, 27, 0.045),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.section-heading {
  margin-top: 4px;
  border-bottom-color: rgba(24, 26, 23, 0.07);
}

.filter-rail {
  margin-top: 14px;
  padding: 9px 11px;
}

.advanced-panel {
  margin-top: 9px;
}

.signal-grid {
  gap: 16px;
  margin-top: 20px;
}

.signal-card {
  border-color: rgba(24, 26, 23, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(250, 251, 248, 0.88));
  box-shadow:
    0 12px 30px rgba(28, 31, 27, 0.052),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.signal-card:hover {
  border-color: rgba(24, 26, 23, 0.16);
  box-shadow: 0 18px 42px rgba(28, 31, 27, 0.09);
}

@media (max-width: 1180px) {
  .page-shell {
    width: min(100% - 40px, 1360px);
  }

  .system-banner {
    top: 0;
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .view-tabs {
    top: 126px;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 18px, 1360px);
    padding-top: 8px;
  }

  .system-banner {
    position: static;
    border-radius: 14px;
    border-bottom: 1px solid rgba(24, 26, 23, 0.09);
  }

  .system-banner::after {
    display: none;
  }

  .view-tabs {
    top: auto;
    margin: 10px 0 20px;
    border: 1px solid rgba(24, 26, 23, 0.09);
    border-radius: 14px;
  }
}

/* 2026-05 pick badge readability */
.lunai-badge.v2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 3px 8px;
  min-height: 42px;
  padding: 7px 10px;
}

.lunai-badge.v2 strong,
.lunai-badge.v2 b {
  overflow: visible;
  color: #ffffff;
  text-overflow: clip;
  white-space: nowrap;
}

.lunai-badge.v2 strong {
  font-size: 12px;
  letter-spacing: 0;
}

.lunai-badge.v2 b {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 850;
}

.lunai-badge.v2 span {
  display: -webkit-box;
  grid-column: 1 / -1;
  min-width: 0;
  overflow: hidden;
  color: #ffffff;
  line-height: 1.35;
  opacity: 0.86;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* LunAI Lumen redesign */
:root {
  --bg: #f7f1e7;
  --panel: rgba(255, 253, 248, 0.86);
  --panel-soft: #fbf8f1;
  --panel-warm: #fffdfa;
  --line: #e7dccf;
  --line-strong: #d6c8b8;
  --text: #2d251f;
  --muted: #8a7d70;
  --muted-strong: #6f6256;
  --green: #4d7f5d;
  --green-deep: #2f6c49;
  --green-soft: #eef6ef;
  --red: #ba5b47;
  --red-deep: #9a412f;
  --red-soft: #fbede8;
  --amber: #b98a4d;
  --amber-soft: #f6ead7;
  --ink: #2f271f;
  --shadow: 0 18px 46px rgba(73, 56, 39, 0.09);
  --shadow-soft: 0 10px 24px rgba(73, 56, 39, 0.07);
}

html,
body {
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(247, 241, 231, 0.97) 430px),
    var(--bg);
  color: var(--text);
  letter-spacing: 0;
}

.page-shell {
  width: min(1780px, calc(100% - 52px));
  margin-bottom: 44px;
}

.system-banner {
  grid-template-columns: 42px minmax(175px, 0.8fr) auto minmax(36rem, 1.25fr);
  gap: 12px;
  min-height: 74px;
  border-bottom: 1px solid rgba(219, 208, 195, 0.86);
  background: rgba(255, 253, 248, 0.86);
  backdrop-filter: blur(18px);
}

.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: transparent;
  background: transparent;
  box-shadow: none;
}

.brand-mark::before {
  position: absolute;
  inset: 9px;
  border: 2px solid var(--amber);
  border-radius: 50%;
  content: "";
  box-shadow:
    0 -15px 0 -6px var(--amber),
    0 15px 0 -6px var(--amber),
    15px 0 0 -6px var(--amber),
    -15px 0 0 -6px var(--amber),
    11px 11px 0 -7px var(--amber),
    -11px -11px 0 -7px var(--amber),
    11px -11px 0 -7px var(--amber),
    -11px 11px 0 -7px var(--amber);
}

.brand-copy p {
  font-family: Georgia, "Times New Roman", "Noto Serif TC", serif;
  font-size: 21px;
  font-weight: 700;
}

.brand-copy h1 {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: none;
}

.brand-copy span {
  display: none;
}

.lumen-nav {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 28px;
  height: 74px;
}

.lumen-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 720;
  text-decoration: none;
  white-space: nowrap;
}

.lumen-nav a:first-child {
  color: var(--ink);
}

.lumen-nav a:first-child::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--amber);
  content: "";
}

.system-actions {
  gap: 8px;
}

.status-badge,
.tool-btn,
.primary-tool,
.filter-chip,
.inline-status {
  min-height: 34px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.76);
  color: var(--ink);
}

.status-badge {
  color: var(--muted-strong);
}

.status-badge.ok {
  border-color: #cfe0d0;
  color: var(--green);
  background: var(--green-soft);
}

.status-badge.error {
  border-color: #efc7bb;
  color: var(--red);
  background: var(--red-soft);
}

.primary-tool {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
  box-shadow: 0 8px 20px rgba(65, 48, 34, 0.14);
}

main {
  padding-top: 30px;
}

.overview-hero {
  min-height: 218px;
  grid-template-columns: minmax(420px, 0.74fr) minmax(520px, 1.26fr);
  overflow: hidden;
  margin-bottom: 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.overview-hero::after {
  display: none;
}

.overview-copy {
  position: relative;
  z-index: 2;
  padding: 22px 0 24px;
}

.hero-eyebrow {
  color: var(--green);
  font-weight: 800;
}

.overview-copy h2 {
  max-width: 620px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Noto Serif TC", serif;
  font-size: clamp(38px, 3.4vw, 64px);
  font-weight: 700;
  line-height: 1.08;
}

.overview-copy h2 {
  font-size: 0;
}

.overview-copy h2::before {
  content: "AI 訊號追蹤儀表板";
  font-size: clamp(38px, 3.4vw, 64px);
}

.overview-copy::after {
  display: block;
  max-width: 640px;
  margin-top: 12px;
  color: var(--muted-strong);
  font-size: 16px;
  line-height: 1.75;
  content: "Lumen 智能訊號引擎，為您捕捉高勝率交易機會，並用本地價格流追蹤每一筆 TP / SL。";
}

.overview-copy p {
  max-width: 640px;
  margin-top: 12px;
  color: var(--muted-strong);
  font-size: 16px;
  line-height: 1.75;
}

.hero-status-row {
  gap: 10px;
  margin-top: 22px;
}

.hero-status-row span {
  min-height: 36px;
  border-color: var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.72);
  color: var(--muted-strong);
}

.overview-visual {
  min-height: 218px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(247, 241, 231, 0.96), rgba(247, 241, 231, 0.42) 28%, rgba(247, 241, 231, 0.12)),
    url("/static/assets/lunai-signal-field-v1.png") center right / cover no-repeat;
  opacity: 0.94;
}

.view-tabs {
  position: sticky;
  top: 74px;
  z-index: 18;
  gap: 28px;
  margin: 0 0 16px;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 253, 248, 0.82);
  backdrop-filter: blur(14px);
}

.view-tab {
  min-height: 52px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 820;
}

.view-tab.is-active {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--amber);
}

.stats-grid {
  grid-template-columns: 1.18fr 1.18fr 1.1fr 1.3fr repeat(4, minmax(0, 0.95fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px 18px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.stat-card::before {
  opacity: 0.2;
}

.stat-card span,
.stat-card small {
  color: var(--muted);
}

.stat-card strong {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Noto Serif TC", serif;
  font-size: 28px;
  font-weight: 500;
}

.stat-card:nth-child(4) strong {
  color: var(--green);
}

.stat-card:nth-child(7) strong,
.stat-card:nth-child(8) strong {
  color: var(--red);
}

.section-heading {
  align-items: center;
  margin: 4px 0 12px;
}

.section-heading h2 {
  color: var(--ink);
  font-size: 18px;
}

.compact-actions {
  gap: 10px;
}

.compact-actions select,
.advanced-grid select,
.advanced-grid input,
.data-flow-controls input,
.data-flow-controls select,
textarea {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.78);
  color: var(--ink);
}

.filter-rail,
.advanced-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.72);
  box-shadow: none;
}

.filter-chip.is-active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.regime-panel {
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.regime-panel strong {
  color: var(--ink);
}

.regime-metrics span {
  border-color: var(--line);
  background: rgba(255, 253, 248, 0.72);
}

.signal-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.signal-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.84);
  padding: 14px 15px 13px;
  box-shadow: none;
}

.signal-card::before {
  height: 2px;
  opacity: 0.8;
}

.signal-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.card-top {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 8px;
}

.side-chip {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 13px;
}

.card-top strong {
  font-size: 17px;
}

.card-top small,
.card-meta small {
  color: var(--muted);
}

.card-meta span,
.state-pill {
  border-radius: 999px;
}

.strategy-line {
  margin: 7px 0 8px;
}

.path-meter {
  gap: 6px;
}

.path-meter span {
  min-height: 23px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.74);
}

.side-win-line,
.pnl-block,
.price-grid div,
.target-tile,
.symbol-stat-card {
  border-color: var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.82);
}

.side-win-line {
  min-height: 44px;
  margin-bottom: 8px;
}

.side-win-line strong {
  color: var(--green);
  font-size: 19px;
}

.side-win-line.short strong {
  color: var(--red);
}

.lunai-badge,
.lunai-badge.v2 {
  border: 1px solid #ead7bd;
  border-radius: 8px;
  background: #f7ead8;
  color: #92683d;
}

.lunai-badge strong,
.lunai-badge.v2 strong,
.lunai-badge.v2 b,
.lunai-badge span,
.lunai-badge.v2 span {
  color: #92683d;
}

.pnl-block {
  margin-bottom: 8px;
}

.pnl-block strong {
  font-family: Georgia, "Times New Roman", "Noto Serif TC", serif;
  font-size: 28px;
  font-weight: 500;
}

.price-grid {
  gap: 8px;
}

.price-grid div,
.target-tile {
  padding: 9px 10px;
}

.target-grid {
  gap: 8px;
}

.table-panel,
.data-flow-controls,
.source-panel,
.track-form,
.detail-panel,
.dialog-card {
  border-color: var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.82);
}

@media (max-width: 1500px) {
  .system-banner {
    grid-template-columns: 42px minmax(170px, 1fr) minmax(0, auto);
  }

  .lumen-nav {
    display: none;
  }

  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

@media (max-width: 1040px) {
  .overview-hero {
    grid-template-columns: 1fr;
  }

  .overview-visual {
    min-height: 170px;
  }

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

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 18px, 1780px);
  }

  .system-banner {
    position: static;
    grid-template-columns: 42px 1fr;
    border-radius: 0;
  }

  .system-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .view-tabs {
    top: 0;
    overflow-x: auto;
  }

  .stats-grid,
  .signal-grid {
    grid-template-columns: 1fr;
  }
}
