:root {
  color-scheme: dark;
  --bg: #080a0f;
  --panel: #111722;
  --panel-2: #151f2e;
  --line: rgba(255, 255, 255, 0.11);
  --text: #f6f7fb;
  --muted: #9ba8ba;
  --soft: #d9e2ef;
  --green: #35d07f;
  --red: #ff5b66;
  --amber: #f5bb3d;
  --cyan: #36c6d3;
  --blue: #4b8dff;
  --pink: #f763a8;
  --orange: #ff8a3d;
  --radius: 8px;
  --mono: "JetBrains Mono", "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-family: "Inter", "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 18% 0%, rgba(75, 141, 255, 0.18), transparent 34rem),
    linear-gradient(145deg, #080a0f 0%, #10141e 44%, #07090d 100%);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--cyan), var(--orange));
  color: #071016;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.nav {
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.nav a {
  padding: 8px 10px;
  border-radius: 999px;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.top-actions,
.hero-actions,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn,
.member-btn,
.ghost-btn,
.primary-link {
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}

.icon-btn {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.copy-icon {
  position: relative;
  display: block;
  width: 16px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.copy-icon::before {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 14px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 3px;
  content: "";
  opacity: 0.45;
}

.member-btn,
.primary-link {
  padding: 10px 14px;
  background: #f8f2df;
  color: #15130d;
  font-weight: 800;
}

.member-btn.active {
  background: rgba(53, 208, 127, 0.18);
  color: var(--green);
  border: 1px solid rgba(53, 208, 127, 0.4);
}

.ghost-btn {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--line);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: stretch;
  min-height: 430px;
  padding: 72px 0 32px;
}

.hero-copy {
  display: flex;
  min-height: 360px;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 820px;
  margin-bottom: 18px;
  font-size: clamp(56px, 9vw, 108px);
  line-height: 0.92;
}

.lead {
  max-width: 680px;
  color: var(--soft);
  font-size: 18px;
  line-height: 1.75;
}

.update-pill {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
}

.market-card,
.notes,
.options-card,
.map-stage,
.allocation {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 23, 34, 0.84);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.26);
}

.market-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
}

.pulse-row,
.risk-grid {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.pulse-row strong {
  color: var(--green);
  font-size: 26px;
}

.dial,
.signal-visual {
  display: grid;
  min-height: 170px;
  place-items: center;
}

.dial svg,
.signal-visual svg {
  width: 100%;
  max-width: 240px;
}

.signal-visual svg {
  max-width: 300px;
}

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

.risk-grid span {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
}

.risk-grid b {
  display: block;
  color: var(--text);
  font-size: 18px;
}

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

.market-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 18px;
}

.market-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 23, 34, 0.72);
  overflow-x: auto;
}

.market-panel h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

.market-panel h2 small {
  margin-left: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
}

.index-row,
.note-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 88px 72px 72px;
  gap: 14px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  color: var(--soft);
  font-size: 14px;
}

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

.index-row strong em {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.index-row:first-of-type,
.note-row:first-of-type {
  border-top: 0;
}

.index-row span {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

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

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

.fear-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(180px, 0.72fr) minmax(260px, 1.3fr) minmax(140px, 0.45fr);
  gap: 18px;
  align-items: center;
  overflow: visible;
}

.fear-copy h2 {
  margin-bottom: 6px;
}

.fear-copy p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.fear-meter {
  min-width: 0;
}

.fear-track {
  position: relative;
  height: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 107, 107, 0.72), rgba(231, 188, 88, 0.68), rgba(53, 208, 127, 0.72));
}

.fear-track i {
  position: absolute;
  top: 50%;
  left: var(--fear);
  width: 16px;
  height: 16px;
  border: 3px solid var(--panel);
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.24);
  transform: translate(-50%, -50%);
}

.fear-scale {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 7px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
}

.fear-scale span:nth-child(2) {
  text-align: center;
}

.fear-scale span:last-child {
  text-align: right;
}

.fear-score {
  text-align: right;
}

.fear-score strong,
.fear-score span,
.fear-score small {
  display: block;
}

.fear-score strong {
  color: var(--text);
  font-size: 38px;
  line-height: 1;
}

.fear-score span {
  margin-top: 4px;
  font-weight: 900;
}

.fear-score small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.fear-score a {
  color: inherit;
}

.stat-card {
  overflow: hidden;
  min-height: 136px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.075), rgba(255,255,255,0.035));
}

.stat-card .k {
  color: var(--muted);
  font-size: 13px;
}

.stat-card .v {
  margin: 14px 0 8px;
  font-size: 34px;
  font-weight: 900;
}

.meter {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.meter i {
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: inherit;
  background: var(--c);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 10px;
  align-items: center;
  margin: 18px 0 34px;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
}

.search-wrap span {
  width: 14px;
  height: 14px;
  border: 2px solid var(--muted);
  border-radius: 50%;
}

.search-wrap span::after {
  display: block;
  width: 6px;
  height: 2px;
  margin: 9px 0 0 9px;
  background: var(--muted);
  content: "";
  transform: rotate(45deg);
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

select {
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #111722;
}

.segmented {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.segmented button {
  white-space: nowrap;
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.segmented button.active {
  background: rgba(255, 255, 255, 0.11);
  color: var(--text);
}

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

.section-head h2 {
  margin: 0;
  font-size: 28px;
}

.section-head p:last-child {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  text-align: right;
}

.compact {
  margin-top: 0;
}

.map-stage {
  padding: 10px;
}

#treemap {
  display: block;
  width: 100%;
  height: auto;
  min-height: 420px;
}

.tile rect {
  transition: filter 0.18s ease, transform 0.18s ease;
}

.tile:hover rect {
  filter: brightness(1.14);
}

.tile-badge {
  stroke: rgba(20, 18, 14, 0.16);
  stroke-width: 1.5px;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.18));
}

.tile-logo-image {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.18));
}

.tile-badge-text {
  fill: #172027;
  letter-spacing: 0;
}

.allocation {
  margin-top: 18px;
  padding: 18px;
}

.alloc-bar {
  display: flex;
  overflow: hidden;
  height: 34px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07);
}

.alloc-seg {
  display: grid;
  min-width: 6px;
  place-items: center;
  color: #061014;
  font-size: 12px;
  font-weight: 900;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--soft);
  font-size: 13px;
}

.chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
}

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

.sector-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 23, 34, 0.78);
}

.sector-hd {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-top: 4px solid var(--c);
  border-bottom: 1px solid var(--line);
}

.sector-hd h3 {
  margin-bottom: 4px;
  font-size: 20px;
}

.sector-hd p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.sector-weight {
  color: var(--c);
  font-size: 26px;
  font-weight: 900;
}

.holding-list {
  display: grid;
}

.holding-row {
  display: grid;
  grid-template-columns: 86px 1fr auto;
  gap: 14px;
  align-items: center;
  min-height: 76px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.holding-row.rich {
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 12px;
}

.holding-row:last-child {
  border-bottom: 0;
}

.holding-main {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 14px;
  align-items: center;
}

.ticker-block {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.logo-mark {
  position: relative;
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--c), var(--line) 48%);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0)),
    color-mix(in srgb, var(--c), var(--panel) 62%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 5px 14px rgba(74, 64, 48, 0.1);
}

.logo-mark img {
  position: absolute;
  inset: 4px;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  object-fit: contain;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.94);
  padding: 3px;
}

.logo-mark span {
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

.ticker {
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.05;
}

.ticker small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.holding-meta {
  min-width: 0;
}

.holding-meta strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.holding-meta p {
  display: -webkit-box;
  overflow: hidden;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.holding-side {
  min-width: 116px;
  text-align: right;
}

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

.metric {
  min-height: 92px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
}

.metric span {
  font-size: 12px;
  font-weight: 900;
}

.metric strong {
  display: block;
  margin: 6px 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.metric small {
  min-height: 30px;
  font-size: 12px;
  line-height: 1.35;
}

.metric b,
.batch-row strong {
  display: inline-block;
  margin-top: 5px;
  font-size: 13px;
}

.metric.muted {
  opacity: 0.62;
}

.pct {
  color: var(--c);
  font-size: 19px;
  font-weight: 900;
}

.private {
  display: none;
  margin-top: 6px;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.55;
}

.unlocked .private {
  display: block;
}

.unlocked .holding-metrics.private {
  display: grid;
  margin-top: 0;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.vip-only {
  display: none;
}

.unlocked .vip-only {
  display: block;
}

.batch-table {
  margin-top: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.16);
  text-align: left;
}

.batch-title {
  margin-bottom: 8px;
  color: var(--soft);
  font-weight: 900;
}

.trade-history {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.28);
}

.trade-head,
.trade-row {
  display: grid;
  grid-template-columns: 70px 58px 64px 1fr 58px 72px 62px;
  gap: 8px;
  align-items: center;
}

.trade-head {
  padding: 8px 10px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.24);
}

.trade-head small {
  grid-column: 2 / -1;
  color: var(--muted);
  font-weight: 700;
}

.trade-row {
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.trade-row strong {
  color: var(--ink);
}

.trade-row.trade-buy strong,
.trade-row.trade-buy span:nth-child(5) {
  color: var(--green);
}

.trade-row.trade-sell strong,
.trade-row.trade-sell span:nth-child(5) {
  color: var(--amber);
}

.batch-row {
  display: grid;
  grid-template-columns: 58px 58px 1fr 1fr 62px;
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.batch-row.open span:nth-child(2) {
  color: var(--green);
  font-weight: 900;
}

.batch-row.sold span:nth-child(2) {
  color: var(--amber);
  font-weight: 900;
}

.delta {
  font-weight: 800;
}

.delta.pos {
  color: var(--green);
}

.delta.neg {
  color: var(--red);
}

.pnl {
  display: inline-block;
  margin-top: 4px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-weight: 900;
}

.pnl.good {
  color: var(--green);
}

.pnl.bad {
  color: var(--red);
}

.options-card {
  overflow: hidden;
}

.option-row,
.option-head {
  display: grid;
  grid-template-columns: 1fr 1fr 100px 130px 90px;
  gap: 12px;
  align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

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

.option-row:last-child {
  border-bottom: 0;
}

.badge {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(245, 187, 61, 0.12);
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
}

.notes {
  margin: 18px 0 42px;
  padding: 18px;
}

.history-section {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 23, 34, 0.84);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.26);
}

.history-locked {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.history-locked strong {
  color: var(--text);
  font-size: 18px;
}

.history-locked span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.history-unlocked {
  display: none;
}

.unlocked .history-locked {
  display: none;
}

.unlocked .history-unlocked {
  display: block;
}

.history-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.history-stat {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.history-stat span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.history-stat strong {
  color: var(--ink);
  font-size: 20px;
}

.history-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.history-row {
  display: grid;
  grid-template-columns: 82px 96px 112px 88px 86px 76px 72px 86px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  color: var(--soft);
  font-size: 13px;
}

.history-row:first-child {
  border-top: 0;
}

.history-head {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 900;
}

.history-row strong {
  color: var(--ink);
}

.history-row strong small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.notes h2 {
  font-size: 20px;
}

.notes ol {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.8;
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(12px);
}

.modal-mask.show {
  display: grid;
}

.modal {
  position: relative;
  width: min(420px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #101722;
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.5);
}

.modal h2 {
  margin-bottom: 8px;
}

.modal p {
  color: var(--muted);
  line-height: 1.6;
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  font-size: 22px;
}

.password-row {
  display: grid;
  gap: 8px;
  color: var(--soft);
  font-weight: 800;
}

.password-row input {
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.modal-error {
  min-height: 24px;
  margin: 8px 0;
  color: var(--red) !important;
  font-weight: 800;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(340px, calc(100% - 36px));
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8f2df;
  color: #15130d;
  font-weight: 900;
  opacity: 0;
  transform: translateY(12px);
  transition: 0.18s ease;
  pointer-events: none;
}

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

@media (max-width: 940px) {
  .hero,
  .sector-grid,
  .stats,
  .market-strip,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 34px;
  }

  .hero-copy {
    min-height: 260px;
  }

  .market-card {
    min-height: 300px;
  }

  .fear-panel {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .fear-score {
    text-align: left;
  }

  .toolbar {
    align-items: stretch;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 22px, 1180px);
  }

  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }

  h1 {
    font-size: 56px;
  }

  .hero-actions,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-head p:last-child {
    text-align: left;
  }

  .holding-row {
    grid-template-columns: 76px 1fr;
  }

  .holding-main,
  .holding-metrics {
    grid-template-columns: 1fr;
  }

  .holding-side {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    text-align: left;
  }

  .batch-row {
    grid-template-columns: 1fr 1fr;
  }

  .trade-head,
  .trade-row {
    grid-template-columns: 1fr 1fr;
  }

  .trade-head small {
    grid-column: 1 / -1;
  }

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

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

  .history-head {
    display: none;
  }

  .index-row,
  .note-row {
    grid-template-columns: minmax(112px, 1fr) 74px 64px 64px;
    gap: 8px;
    font-size: 12px;
  }

  .option-row,
  .option-head {
    grid-template-columns: 1fr 1fr;
  }

  .option-head span:nth-child(n+3),
  .option-row span:nth-child(n+3) {
    color: var(--muted);
  }
}

/* Workbench Theme --------------------------------------------------------- */
:root {
  color-scheme: light;
  --bg: #f1ece2;
  --panel: #fbf7ef;
  --panel-2: #f5efe5;
  --line: #e1d8c9;
  --text: #151515;
  --muted: #81796d;
  --soft: #4e4942;
  --green: #138a55;
  --red: #a94735;
  --amber: #c48a22;
  --cyan: #1f6f9f;
  --blue: #2776a8;
  --pink: #9f526a;
  --orange: #b96f25;
  --radius: 6px;
}

body {
  background:
    linear-gradient(90deg, rgba(16, 16, 15, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(16, 16, 15, 0.04) 1px, transparent 1px),
    #151515;
  background-size: 28px 28px;
  color: var(--text);
}

.shell {
  width: min(1240px, calc(100% - 34px));
  margin: 18px auto 28px;
  padding: 14px;
  border: 1px solid #2b2a27;
  border-radius: 2px;
  background: var(--bg);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.36), inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.topbar {
  top: 10px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(251, 247, 239, 0.92);
  box-shadow: 0 4px 18px rgba(85, 72, 52, 0.08);
}

.brand {
  min-width: 260px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border: 1px solid #1f1f1c;
  border-radius: 50%;
  background: #fffaf0;
  color: #171717;
  font-size: 13px;
}

.brand strong {
  color: #111;
  font-size: 25px;
  line-height: 1;
  letter-spacing: -0.01em;
}

.brand small,
.eyebrow,
.stat-card .k,
.metric span,
.index-head,
.ticker small {
  font-family: "JetBrains Mono", "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav {
  gap: 4px;
  font-size: 12px;
}

.nav a {
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 4px;
}

.nav a:hover {
  border-color: var(--line);
  background: #f6efe4;
}

.icon-btn,
.ghost-btn,
.member-btn,
.primary-link,
.update-pill {
  border-radius: 4px;
  box-shadow: none;
}

.icon-btn,
.ghost-btn {
  border: 1px solid var(--line);
  background: #f8f2e8;
  color: var(--text);
}

.member-btn,
.primary-link {
  background: #2478b8;
  color: #fff;
}

.member-btn.active {
  background: #e8f4ed;
  color: var(--green);
  border-color: #afd7c1;
}

.hero {
  min-height: auto;
  padding: 10px 0 12px;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 10px;
}

.hero-copy,
.market-card {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(251, 247, 239, 0.88);
}

.hero-copy {
  justify-content: center;
  padding: 18px 18px 16px;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(42px, 5vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.lead {
  max-width: 780px;
  margin-bottom: 12px;
  color: var(--soft);
  font-size: 14px;
  line-height: 1.65;
}

.market-card,
.notes,
.map-stage,
.allocation,
.market-panel,
.stat-card,
.sector-card,
.modal {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(251, 247, 239, 0.9);
  box-shadow: 0 8px 22px rgba(92, 78, 55, 0.08);
}

.market-card {
  padding: 14px;
}

.pulse-row strong {
  color: #111;
  font-size: 34px;
  letter-spacing: -0.02em;
}

.dial,
.signal-visual {
  min-height: 120px;
}

.risk-grid span,
.metric,
.search-wrap,
select,
.segmented,
.batch-table {
  border: 1px solid var(--line);
  background: #f8f2e8;
}

.risk-grid b {
  color: #111;
}

.stats {
  gap: 8px;
}

.stat-card {
  min-height: 104px;
  padding: 13px;
}

.stat-card .v {
  margin: 8px 0 8px;
  color: #111 !important;
  font-size: 32px;
  letter-spacing: -0.03em;
}

.meter {
  height: 4px;
  background: #e7ded0;
}

.market-strip {
  gap: 8px;
  margin: 8px 0 12px;
}

.market-panel {
  padding: 13px;
}

.market-panel h2,
.section-head h2,
.notes h2 {
  color: #171717;
  letter-spacing: -0.01em;
}

.index-row,
.note-row {
  border-top: 1px solid #e9dfd2;
  color: var(--soft);
}

.toolbar {
  margin: 10px 0 18px;
}

input,
select {
  color: var(--text);
}

select {
  background: #f8f2e8;
}

.segmented button {
  color: var(--muted);
}

.segmented button.active {
  background: #fffaf2;
  color: #111;
  box-shadow: inset 0 0 0 1px var(--line);
}

.section-head {
  margin: 24px 0 10px;
  padding-top: 8px;
  border-top: 1px solid #d8cebe;
}

.section-head p:last-child {
  color: var(--muted);
}

.map-stage {
  padding: 8px;
}

#treemap {
  min-height: 360px;
}

.allocation {
  margin-top: 8px;
  padding: 13px;
}

.alloc-bar {
  height: 26px;
  background: #eee4d7;
}

.chip {
  border-color: var(--line);
  background: #f8f2e8;
  color: var(--soft);
}

.sector-grid {
  gap: 10px;
}

.sector-hd {
  padding: 13px;
  border-bottom-color: var(--line);
  background: #f8f2e8;
}

.sector-hd h3 {
  color: #111;
  font-size: 22px;
}

.sector-weight {
  font-size: 26px;
  letter-spacing: -0.03em;
}

.holding-row {
  padding: 12px 13px;
  border-bottom-color: #e9dfd2;
}

.ticker {
  color: #111;
  font-size: 23px;
  letter-spacing: -0.02em;
}

.holding-meta strong {
  color: #111;
}

.holding-meta p {
  color: var(--muted);
}

.holding-metrics {
  gap: 6px;
}

.metric {
  min-height: 86px;
  padding: 9px;
}

.metric strong {
  color: #111;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.batch-table {
  background: #f5efe5;
}

.batch-row {
  border-top-color: #e5dbcd;
}

.good,
.market-up,
.pnl.good {
  color: var(--green);
}

.bad,
.market-down,
.pnl.bad {
  color: var(--red);
}

.modal-mask {
  background: rgba(16, 15, 13, 0.45);
}

.modal {
  background: var(--panel);
}

.password-row input {
  border-color: var(--line);
  background: #fffaf2;
  color: #111;
}

.toast {
  border-color: #ccb98b;
  background: #fff2bd;
  color: #171717;
}

@media (max-width: 940px) {
  .shell {
    width: min(100% - 18px, 1240px);
    padding: 10px;
  }

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

@media (max-width: 720px) {
  .brand {
    min-width: 0;
  }

  .brand strong {
    font-size: 21px;
  }

  h1 {
    font-size: 42px;
  }
}

/* Professional Desk Refinement ------------------------------------------- */
:root {
  --bg: #efeae1;
  --panel: #fbf8f1;
  --panel-2: #f4eee4;
  --line: #ddd4c6;
  --text: #171717;
  --muted: #756f66;
  --soft: #45423d;
  --green: #2f7d5c;
  --red: #9d4a3b;
  --amber: #a0793d;
  --cyan: #2f6f8f;
  --blue: #2f6f8f;
  --pink: #7d6d83;
  --orange: #9b7a45;
}

body {
  background:
    linear-gradient(90deg, rgba(36, 35, 31, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(36, 35, 31, 0.03) 1px, transparent 1px),
    #111;
  background-size: 34px 34px;
}

.shell {
  background: #f3eee5;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.34), inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.topbar,
.hero-copy,
.market-card,
.market-panel,
.stat-card,
.map-stage,
.allocation,
.sector-card,
.notes {
  background: rgba(251, 248, 241, 0.94);
  box-shadow: 0 5px 18px rgba(75, 65, 49, 0.06);
}

.history-section {
  background: rgba(251, 248, 241, 0.94);
  border-color: #dfd6c8;
  box-shadow: 0 5px 18px rgba(75, 65, 49, 0.06);
}

.history-stat,
.history-table {
  border-color: #dfd6c8;
  background: #f7f1e8;
}

.history-head {
  background: #efe7da;
}

.history-row {
  border-top-color: #e5dbcd;
}

.brand-mark {
  background: #fbf8f1;
  color: #111;
}

.member-btn,
.primary-link {
  background: #2f6f8f;
}

h1 {
  font-size: clamp(36px, 4.4vw, 52px);
}

.lead {
  color: #5f5a52;
}

.stat-card .v,
.pulse-row strong,
.metric strong,
.sector-hd h3,
.ticker {
  color: #121212 !important;
}

.stat-card {
  min-height: 96px;
  background: #fbf8f1;
}

.market-panel,
.stat-card,
.sector-card,
.map-stage,
.allocation {
  border-color: #dfd6c8;
}

.map-stage {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.52), rgba(246,240,230,0.76)),
    #fbf8f1;
}

#treemap .tile rect {
  opacity: 0.78;
  stroke: rgba(251, 248, 241, 0.92);
  stroke-width: 2px;
}

#treemap .tile text {
  fill: #172027;
}

.tile:hover rect {
  filter: brightness(1.04) saturate(0.92);
}

.sector-hd {
  border-top-width: 3px;
  background: #f7f1e8;
}

.sector-weight,
.pct {
  color: color-mix(in srgb, var(--c) 74%, #111 26%);
}

.metric {
  background: #f7f1e8;
}

.metric b,
.batch-row strong {
  font-weight: 900;
}

.good,
.market-up,
.pnl.good {
  color: #2f7d5c;
}

.bad,
.market-down,
.pnl.bad {
  color: #9d4a3b;
}

.market-flat {
  color: var(--muted);
  font-weight: 800;
}

.alloc-seg {
  color: #101010;
  filter: saturate(0.72);
}

.chip i {
  filter: saturate(0.72);
}

.chip,
.segmented,
.search-wrap,
select,
.risk-grid span,
.batch-table {
  background: #f7f1e8;
}

.section-head {
  border-top-color: #dcd2c3;
}

/* Login Welcome ----------------------------------------------------------- */
.login-gate {
  display: none;
  min-height: 100vh;
  padding: 18px;
}

.login-locked .login-gate {
  display: grid;
  place-items: center;
}

.login-locked .shell {
  display: none;
}

.login-frame {
  width: min(1120px, 100%);
  padding: 14px;
  border: 1px solid #2b2a27;
  border-radius: 2px;
  background: #f3eee5;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.34), inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.login-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(251, 248, 241, 0.94);
  box-shadow: 0 5px 18px rgba(75, 65, 49, 0.06);
}

.login-brand {
  min-width: 0;
}

.login-brand strong {
  font-size: 24px;
}

.login-date {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f7f1e8;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.login-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 10px;
}

.login-copy,
.login-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(251, 248, 241, 0.94);
  box-shadow: 0 5px 18px rgba(75, 65, 49, 0.06);
}

.login-copy {
  display: flex;
  min-height: 440px;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(24px, 5vw, 46px);
  background:
    linear-gradient(180deg, rgba(251, 248, 241, 0.7), rgba(251, 248, 241, 0.96)),
    linear-gradient(90deg, rgba(47, 111, 143, 0.12) 1px, transparent 1px),
    linear-gradient(0deg, rgba(47, 111, 143, 0.08) 1px, transparent 1px),
    #fbf8f1;
  background-size: auto, 28px 28px, 28px 28px, auto;
}

.login-copy h1 {
  margin: 0 0 10px;
  color: #111;
  font-size: clamp(44px, 7vw, 82px);
  line-height: 0.95;
}

.login-copy .lead {
  max-width: 620px;
  margin-bottom: 22px;
}

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

.login-signal-grid div {
  min-height: 82px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f7f1e8;
}

.login-signal-grid span,
.login-note {
  color: var(--muted);
  font-size: 12px;
}

.login-signal-grid span {
  display: block;
  margin-bottom: 14px;
  font-family: var(--mono);
  text-transform: uppercase;
}

.login-signal-grid strong {
  display: block;
  color: #121212;
  font-size: 22px;
  line-height: 1;
}

.login-panel {
  align-self: stretch;
  padding: 26px;
}

.login-panel h2 {
  margin: 6px 0 28px;
  color: #111;
  font-size: 32px;
}

.login-password {
  margin-bottom: 10px;
}

.login-submit {
  width: 100%;
  margin-top: 10px;
  padding: 12px 14px;
}

.login-note {
  margin: 18px 0 0;
  line-height: 1.6;
}

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

  .login-copy {
    min-height: 360px;
  }
}

@media (max-width: 620px) {
  .login-gate {
    padding: 9px;
  }

  .login-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-date {
    width: 100%;
  }

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

  .login-copy,
  .login-panel {
    padding: 20px;
  }
}
