:root {
  --bg: #f4f2ec;
  --paper: #fffdf7;
  --ink: #1c2224;
  --muted: #65706c;
  --line: rgba(28, 34, 36, 0.13);
  --strong-line: rgba(28, 34, 36, 0.24);
  --green: #137c57;
  --green-soft: #d8efe4;
  --red: #b63a3a;
  --red-soft: #f4d8d4;
  --amber: #b87a18;
  --amber-soft: #f4e3bf;
  --blue: #2d68b8;
  --blue-soft: #d9e7f7;
  --violet: #7453a6;
  --teal: #1c8a92;
  --orange: #c25e2f;
  --shadow: 0 18px 46px rgba(35, 39, 33, 0.11);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.7), rgba(244, 242, 236, 0.95)),
    repeating-linear-gradient(90deg, rgba(28, 34, 36, 0.03) 0 1px, transparent 1px 80px);
  font-family:
    Inter, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1540px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

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

.app-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.app-tabs button {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 253, 247, 0.84);
  font-weight: 850;
}

.app-tabs button.active {
  color: var(--paper);
  border-color: var(--ink);
  background: var(--ink);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.25;
}

h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.subhead {
  max-width: 860px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.clock-card {
  min-width: 190px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.88);
  box-shadow: var(--shadow);
  text-align: right;
}

.clock-card span {
  display: block;
  font-size: 24px;
  font-weight: 850;
}

.clock-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.control-grid {
  display: grid;
  grid-template-columns: minmax(210px, 1.1fr) minmax(190px, 0.9fr) minmax(170px, 0.8fr) auto auto;
  gap: 12px;
  margin-bottom: 16px;
}

.field {
  position: relative;
  display: flex;
  min-height: 64px;
  align-items: end;
  gap: 8px;
  padding: 11px 12px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.86);
}

.field span {
  position: absolute;
  top: 9px;
  left: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
}

.field select {
  appearance: none;
  padding-right: 24px;
}

.field b {
  padding-bottom: 2px;
  color: var(--muted);
}

.primary-action,
.ghost-action {
  min-height: 64px;
  border-radius: var(--radius);
  font-weight: 850;
}

.primary-action {
  border: 1px solid #143f33;
  background: #173f35;
  color: #fffdf7;
}

.ghost-action {
  border: 1px solid var(--strong-line);
  background: rgba(255, 253, 247, 0.82);
  color: var(--ink);
}

.signal-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.55fr 1.2fr 1.2fr;
  gap: 12px;
  margin-bottom: 16px;
}

.signal-card {
  min-height: 126px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.signal-card-main {
  background:
    linear-gradient(135deg, rgba(19, 124, 87, 0.14), rgba(45, 104, 184, 0.1)),
    var(--paper);
}

.signal-card.up {
  background: linear-gradient(180deg, rgba(19, 124, 87, 0.16), rgba(255, 253, 247, 0.94));
}

.signal-card.down {
  background: linear-gradient(180deg, rgba(182, 58, 58, 0.16), rgba(255, 253, 247, 0.94));
}

.signal-card.watch {
  background: linear-gradient(180deg, rgba(160, 122, 48, 0.14), rgba(255, 253, 247, 0.94));
}

.card-label {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.signal-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1;
  letter-spacing: 0;
}

.signal-card small {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}

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

.live-card {
  min-height: 108px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.82);
}

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

.live-card span {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.live-card strong {
  margin-bottom: 8px;
  font-size: 27px;
  line-height: 1;
}

.live-card small {
  color: var(--muted);
  line-height: 1.45;
}

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

.accuracy-pill {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.accuracy-pill b,
.accuracy-pill span,
.accuracy-pill small {
  display: block;
}

.accuracy-pill b {
  margin-bottom: 4px;
  font-size: 12px;
}

.accuracy-pill span {
  margin-bottom: 4px;
  font-size: 22px;
  font-weight: 900;
}

.accuracy-pill small {
  color: var(--muted);
  font-size: 11px;
}

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

.interval-card {
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.84);
}

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

.interval-card span {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.interval-card strong {
  margin-bottom: 8px;
  font-size: 28px;
  line-height: 1;
}

.interval-card small {
  color: var(--muted);
  line-height: 1.45;
}

.interval-card.up {
  background: linear-gradient(180deg, rgba(19, 124, 87, 0.16), rgba(255, 253, 247, 0.92));
}

.interval-card.down {
  background: linear-gradient(180deg, rgba(182, 58, 58, 0.16), rgba(255, 253, 247, 0.92));
}

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

.performance-card {
  min-height: 92px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.82);
}

.performance-card b,
.performance-card strong,
.performance-card small {
  display: block;
}

.performance-card b {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
}

.performance-card strong {
  margin-bottom: 6px;
  font-size: 24px;
  line-height: 1;
}

.performance-card small {
  color: var(--muted);
  line-height: 1.45;
}

.performance-card.strong {
  background: linear-gradient(180deg, rgba(19, 124, 87, 0.14), rgba(255, 253, 247, 0.92));
}

.performance-card.baseline {
  background: linear-gradient(180deg, rgba(45, 104, 184, 0.12), rgba(255, 253, 247, 0.92));
}

.performance-card.neutral {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.12), rgba(255, 253, 247, 0.92));
}

.performance-card.down {
  background: linear-gradient(180deg, rgba(182, 58, 58, 0.13), rgba(255, 253, 247, 0.92));
}

.shadow-live-panel {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.shadow-live-card {
  min-height: 108px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.86);
}

.shadow-live-card b,
.shadow-live-card strong,
.shadow-live-card small {
  display: block;
}

.shadow-live-card b {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.shadow-live-card strong {
  margin-bottom: 7px;
  font-size: 24px;
  line-height: 1.1;
}

.shadow-live-card small {
  color: var(--muted);
  line-height: 1.45;
}

.shadow-live-card.up {
  background: linear-gradient(180deg, rgba(19, 124, 87, 0.15), rgba(255, 253, 247, 0.92));
}

.shadow-live-card.down {
  background: linear-gradient(180deg, rgba(182, 58, 58, 0.15), rgba(255, 253, 247, 0.92));
}

.shadow-live-card.watch {
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.14), rgba(255, 253, 247, 0.92));
}

.rhythm-guard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 4px solid var(--amber);
  background: rgba(255, 247, 225, 0.72);
}

.rhythm-guard:empty {
  display: none;
}

.rhythm-guard-item {
  min-width: 0;
}

.rhythm-guard-item b,
.rhythm-guard-item span,
.rhythm-guard-item small {
  display: block;
}

.rhythm-guard-item b {
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--muted);
}

.rhythm-guard-item span {
  font-size: 16px;
  font-weight: 900;
}

.rhythm-guard-item small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.rhythm-guard-item.observe span {
  color: var(--amber);
}

.rhythm-guard-item.reduce span {
  color: var(--red);
}

.interval-card.guard {
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.16), rgba(255, 253, 247, 0.92));
}

.shadow-paper-page {
  min-height: 620px;
}

.strategy-research-page {
  min-height: 620px;
}

.v5-observer-page {
  min-height: 620px;
}

.v6-research-page {
  min-height: 620px;
}

.v7-technical-page {
  min-height: 620px;
}

.v8-strategy-page {
  min-height: 620px;
}

.v6-rule-grid .performance-card {
  min-height: 132px;
}

.v8-rule-grid .performance-card {
  min-height: 128px;
}

.v6-signal-table {
  min-width: 1120px;
}

.v7-table {
  min-width: 1240px;
}

.v8-signal-table {
  min-width: 1180px;
}

.research-verdict-box {
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.86);
}

.research-verdict-box b,
.research-verdict-box strong,
.research-verdict-box small {
  display: block;
}

.research-verdict-box b {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.research-verdict-box strong {
  margin-bottom: 8px;
  font-size: 26px;
  line-height: 1.1;
}

.research-verdict-box small {
  color: var(--muted);
  line-height: 1.5;
}

.research-verdict-box.stop_trading {
  border-left-color: var(--red);
  background: linear-gradient(180deg, rgba(182, 58, 58, 0.13), rgba(255, 253, 247, 0.94));
}

.research-verdict-box.research_candidates {
  border-left-color: var(--green);
  background: linear-gradient(180deg, rgba(19, 124, 87, 0.13), rgba(255, 253, 247, 0.94));
}

.research-verdict-box.collect_more {
  border-left-color: var(--blue);
  background: linear-gradient(180deg, rgba(45, 104, 184, 0.12), rgba(255, 253, 247, 0.94));
}

.research-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 20px 0 10px;
}

.research-section-head h3 {
  margin-bottom: 0;
}

.research-section-head small {
  max-width: 620px;
  color: var(--muted);
  line-height: 1.5;
}

.research-table {
  min-width: 1080px;
}

.research-table td:first-child {
  font-weight: 800;
}

.v5-live-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.v5-policy-box {
  margin-top: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  background: rgba(217, 231, 247, 0.52);
}

.v5-policy-box b,
.v5-policy-box small {
  display: block;
}

.v5-policy-box b {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.v5-policy-box small {
  color: var(--muted);
  line-height: 1.55;
}

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

.shadow-account-card,
.shadow-strategy-box,
.shadow-position-box {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.86);
}

.shadow-account-card span,
.shadow-account-card strong,
.shadow-account-card small,
.shadow-strategy-box b,
.shadow-strategy-box strong,
.shadow-strategy-box small,
.shadow-position-box b,
.shadow-position-box strong,
.shadow-position-box small {
  display: block;
}

.shadow-account-card span,
.shadow-strategy-box b,
.shadow-position-box b {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.shadow-account-card strong,
.shadow-strategy-box strong,
.shadow-position-box strong {
  margin-bottom: 7px;
  font-size: 28px;
  line-height: 1;
}

.shadow-account-card small,
.shadow-strategy-box small,
.shadow-position-box small {
  color: var(--muted);
  line-height: 1.45;
}

.shadow-strategy-box {
  margin-top: 12px;
  background: linear-gradient(180deg, rgba(45, 104, 184, 0.12), rgba(255, 253, 247, 0.92));
}

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

.shadow-strategy-lines span {
  min-height: 52px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.72);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

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

.shadow-rule-card {
  min-height: 154px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.9);
}

.shadow-rule-card b,
.shadow-rule-card strong,
.shadow-rule-card small {
  display: block;
}

.shadow-rule-card b {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.shadow-rule-card strong {
  margin-bottom: 8px;
  font-size: 24px;
  line-height: 1;
}

.shadow-rule-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.shadow-rule-card.up {
  background: linear-gradient(180deg, rgba(19, 124, 87, 0.14), rgba(255, 253, 247, 0.94));
}

.shadow-rule-card.down {
  background: linear-gradient(180deg, rgba(182, 58, 58, 0.14), rgba(255, 253, 247, 0.94));
}

.shadow-rule-card.warming {
  background: linear-gradient(180deg, rgba(215, 157, 62, 0.14), rgba(255, 253, 247, 0.94));
}

.shadow-rule-card.neutral {
  background: linear-gradient(180deg, rgba(84, 96, 112, 0.11), rgba(255, 253, 247, 0.94));
}

.shadow-position-box {
  margin-top: 12px;
}

.shadow-position-box.up {
  background: linear-gradient(180deg, rgba(19, 124, 87, 0.14), rgba(255, 253, 247, 0.92));
}

.shadow-position-box.down {
  background: linear-gradient(180deg, rgba(182, 58, 58, 0.14), rgba(255, 253, 247, 0.92));
}

.shadow-trade-table-wrap {
  margin-top: 12px;
  overflow-x: auto;
}

.shadow-trade-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
  font-size: 13px;
}

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

.shadow-trade-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.shadow-trade-table .up,
.shadow-account-card .up,
.shadow-position-box .up {
  color: var(--green);
  font-weight: 900;
}

.shadow-trade-table .down,
.shadow-account-card .down,
.shadow-position-box .down {
  color: var(--red);
  font-weight: 900;
}

.shadow-trade-table small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.factor-review-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.factor-review-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.factor-review-head h3 {
  margin: 0;
  font-size: 18px;
}

.factor-review-head small {
  color: var(--muted);
  line-height: 1.45;
}

.factor-review-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.factor-review-card {
  min-height: 118px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.82);
}

.factor-review-card b,
.factor-review-card strong,
.factor-review-card small {
  display: block;
}

.factor-review-card b {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.factor-review-card strong {
  margin-bottom: 6px;
  font-size: 24px;
  line-height: 1;
}

.factor-review-card small {
  color: var(--muted);
  line-height: 1.45;
}

.factor-review-card.good {
  background: linear-gradient(180deg, rgba(19, 124, 87, 0.12), rgba(255, 253, 247, 0.92));
}

.factor-review-card.bad {
  background: linear-gradient(180deg, rgba(182, 58, 58, 0.12), rgba(255, 253, 247, 0.92));
}

.factor-review-card.neutral {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.12), rgba(255, 253, 247, 0.92));
}

.interval-table-wrap {
  margin-top: 12px;
  overflow-x: auto;
}

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

.interval-table th,
.interval-table td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.interval-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.interval-table .up {
  color: var(--green);
  font-weight: 900;
}

.interval-table .down {
  color: var(--red);
  font-weight: 900;
}

.interval-table .pending {
  color: var(--amber);
  font-weight: 850;
}

.panel {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.9);
  box-shadow: var(--shadow);
}

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

.panel-note {
  max-width: 560px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.interval-tools {
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: 360px;
}

.interval-tools .day-switch,
.interval-tools .date-picker {
  justify-self: end;
}

.day-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.84);
}

.day-switch button {
  min-width: 58px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.day-switch button.active {
  background: #111820;
  color: #fffdf7;
}

.date-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.date-picker select {
  height: 36px;
  min-width: 246px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.98), rgba(245, 241, 230, 0.95));
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 0 36px 0 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.date-picker select:focus {
  border-color: #111820;
  outline: 2px solid rgba(17, 24, 32, 0.12);
  outline-offset: 2px;
}

.date-picker select:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.72;
}

.timeline-panel {
  overflow: hidden;
}

.timeline-wrap {
  position: relative;
  overflow-x: auto;
  padding: 10px 0 4px;
}

.hour-labels {
  position: relative;
  height: 24px;
  min-width: 1440px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.hour-label {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.master-rail {
  position: relative;
  height: 98px;
  min-width: 1440px;
  border: 1px solid var(--strong-line);
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(90deg, rgba(28, 34, 36, 0.26) 0 1px, transparent 1px calc(100% / 1440)),
    repeating-linear-gradient(90deg, transparent 0 calc((100% / 24) - 1px), rgba(28, 34, 36, 0.34) calc((100% / 24) - 1px) calc(100% / 24)),
    linear-gradient(90deg, rgba(19, 124, 87, 0.08), rgba(45, 104, 184, 0.08), rgba(182, 58, 58, 0.08));
}

.event-layer {
  position: absolute;
  inset: 0;
}

.event-dot {
  position: absolute;
  top: 30px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(28, 34, 36, 0.28), 0 5px 12px rgba(28, 34, 36, 0.18);
  transform: translateX(-50%);
}

.event-dot:focus {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.event-dot.funding {
  background: var(--orange);
}

.event-dot.asia {
  background: var(--green);
}

.event-dot.europe {
  background: var(--blue);
}

.event-dot.america {
  background: var(--red);
}

.event-dot.global {
  background: var(--violet);
}

.event-dot.equity {
  background: #111820;
}

.event-popover {
  position: absolute;
  left: 50%;
  top: 22px;
  z-index: 6;
  width: 260px;
  max-width: min(260px, 82vw);
  padding: 10px 11px;
  border: 1px solid var(--strong-line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 14px 30px rgba(28, 34, 36, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.event-dot:hover .event-popover,
.event-dot:focus .event-popover {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.event-popover b,
.event-popover small,
.event-popover span {
  display: block;
}

.event-popover b {
  margin-bottom: 5px;
  font-size: 13px;
}

.event-popover small {
  color: var(--muted);
  line-height: 1.45;
}

.event-popover span {
  margin-top: 7px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.now-marker {
  position: absolute;
  top: -9px;
  bottom: -9px;
  z-index: 5;
  width: 2px;
  background: #111820;
  transform: translateX(-1px);
}

.now-marker::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #111820;
  transform: translateX(-50%);
}

.now-marker span {
  position: absolute;
  top: -32px;
  left: 50%;
  padding: 4px 7px;
  border-radius: 999px;
  background: #111820;
  color: #fffdf7;
  font-size: 11px;
  font-weight: 800;
  transform: translateX(-50%);
  white-space: nowrap;
}

.session-lanes {
  display: grid;
  gap: 10px;
  min-width: 1440px;
  margin-top: 12px;
}

.session-lane {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: center;
}

.lane-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.lane-track {
  position: relative;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(90deg, transparent 0 calc((100% / 24) - 1px), rgba(28, 34, 36, 0.12) calc((100% / 24) - 1px) calc(100% / 24)),
    rgba(28, 34, 36, 0.03);
  overflow: hidden;
}

.session-segment {
  position: absolute;
  top: 5px;
  bottom: 5px;
  display: flex;
  align-items: center;
  min-width: 26px;
  overflow: hidden;
  border-radius: 5px;
  padding: 0 8px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.session-segment.muted {
  color: var(--ink);
}

.selected-event {
  margin-top: 16px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.9);
}

.selected-event .event-time {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
}

.selected-event p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(24, minmax(46px, 1fr));
  gap: 8px;
}

.heat-card {
  min-height: 86px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.heat-card b,
.heat-card span,
.heat-card small {
  display: block;
}

.heat-card b {
  margin-bottom: 8px;
  font-size: 12px;
}

.heat-card span {
  margin-bottom: 6px;
  font-size: 18px;
  font-weight: 900;
}

.heat-card small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.heat-card.up {
  background: linear-gradient(180deg, rgba(19, 124, 87, var(--alpha)), rgba(255, 253, 247, 0.96));
}

.heat-card.down {
  background: linear-gradient(180deg, rgba(182, 58, 58, var(--alpha)), rgba(255, 253, 247, 0.96));
}

.heat-card.flat {
  background: linear-gradient(180deg, rgba(184, 122, 24, 0.12), rgba(255, 253, 247, 0.96));
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: 16px;
}

.factor-stack {
  display: grid;
  gap: 10px;
}

.factor-row {
  display: grid;
  grid-template-columns: 1fr 78px 70px;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.76);
}

.factor-row b,
.factor-row span,
.factor-row small {
  display: block;
}

.factor-row b {
  margin-bottom: 4px;
  font-size: 14px;
}

.factor-row small {
  color: var(--muted);
  line-height: 1.45;
}

.factor-score {
  font-size: 18px;
  font-weight: 900;
  text-align: right;
}

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

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

.factor-weight {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-align: right;
}

.tag-library {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.78);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  max-width: 360px;
  padding: 12px 14px;
  border: 1px solid var(--strong-line);
  border-radius: var(--radius);
  background: #111820;
  color: #fffdf7;
  box-shadow: 0 18px 36px rgba(17, 24, 32, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.disclaimer {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 1120px) {
  .control-grid,
  .signal-grid,
  .live-grid,
  .interval-summary,
  .performance-grid,
  .v5-live-grid,
  .shadow-live-panel,
  .shadow-account-grid,
  .shadow-strategy-lines,
  .shadow-rule-health-grid,
  .two-column {
    grid-template-columns: 1fr 1fr;
  }

  .heatmap-grid {
    grid-template-columns: repeat(12, minmax(58px, 1fr));
  }

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

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 720px);
    padding-top: 16px;
  }

  .topbar,
  .panel-head {
    display: block;
  }

  .clock-card {
    margin-top: 14px;
    text-align: left;
  }

  .control-grid,
  .signal-grid,
  .live-grid,
  .interval-summary,
  .performance-grid,
  .v5-live-grid,
  .shadow-live-panel,
  .shadow-account-grid,
  .shadow-strategy-lines,
  .shadow-rule-health-grid,
  .rhythm-guard,
  .factor-review-grid,
  .two-column {
    grid-template-columns: 1fr;
  }

  .timeline-wrap {
    padding-bottom: 12px;
  }

  .session-lane {
    grid-template-columns: 86px 1fr;
  }

  .heatmap-grid {
    grid-template-columns: repeat(4, minmax(62px, 1fr));
  }

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

  .research-section-head {
    display: block;
  }
}
