/* fatefor-v3 — match live fatefor.com
   Accent coral #ff5f4b · ink/black grounds · 山海经 seals
   NO gold Wall-Street theme · NO crypto-exchange chrome */

:root {
  --color-dxi: #ff5f4b;
  --color-dxi-soft: #ff6653;
  --color-dxi-glow: #ff5f4b52;
  --bg: #050505;
  --bg-ink: #07090e;
  --bg-elevated: #0c0c0c;
  --bg-card: #111111;
  --bg-card-hover: #161616;
  --border: #222222;
  --border-soft: #1a1a1a;
  --text: #f1e9e2;
  --text-muted: #a88b86;
  --text-dim: #777777;
  --text-ccc: #cccccc;
  --white: #ffffff;
  --ok: #6bcf7f;
  --down: #ff5f4b;
  --up: #6bcf7f;
  --font-sans: "Geist", "Geist Sans", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans SC", sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "Iowan Old Style",
    Baskerville, "Times New Roman", serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, monospace;
  --max: 1120px;
  --radius: 10px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-dxi);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.mono {
  font-family: var(--font-mono);
}
.muted {
  color: var(--text-muted);
}
.coral {
  color: var(--color-dxi);
}

/* —— Seals (山海经) —— */
.shanhai-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--color-dxi);
  color: var(--color-dxi);
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-dxi) 25%, transparent);
  flex-shrink: 0;
  letter-spacing: 0;
}
.shanhai-seal.inline {
  width: 22px;
  height: 22px;
  font-size: 12px;
  margin-right: 6px;
  vertical-align: -4px;
}
.seal-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--color-dxi);
  color: var(--color-dxi);
  font-family: var(--font-serif);
  font-size: 13px;
  border-radius: 2px;
}
.seal-frame {
  position: relative;
}
.seal-frame::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid color-mix(in srgb, var(--color-dxi) 18%, transparent);
  border-radius: 6px;
  pointer-events: none;
}
.seal-mark {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid color-mix(in srgb, var(--color-dxi) 55%, #333);
  color: color-mix(in srgb, var(--color-dxi) 70%, #888);
  font-family: var(--font-serif);
  font-size: 22px;
  border-radius: 3px;
  transform: rotate(12deg);
  opacity: 0.85;
  pointer-events: none;
}

/* —— Live iframe —— */
.live-frame-wrap {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 640px;
  background: #000;
  border-bottom: 1px solid var(--border);
}
.live-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}
.live-frame-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  pointer-events: none;
}
.badge {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.72);
  color: var(--text-ccc);
  backdrop-filter: blur(8px);
}
.badge-coral {
  border-color: color-mix(in srgb, var(--color-dxi) 55%, #333);
  color: var(--color-dxi);
  text-shadow: 0 0 12px var(--color-dxi-glow);
}
.scroll-hint {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
}
.scroll-hint a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--color-dxi);
  border-radius: 999px;
  padding: 10px 16px;
  text-decoration: none;
  box-shadow: 0 0 20px var(--color-dxi-glow);
}
.scroll-hint a:hover {
  background: #111;
  text-decoration: none;
}

/* Offline hero */
.offline-hero {
  display: none;
  min-height: 100vh;
  padding: 28px 20px 48px;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, #ff5f4b22, transparent),
    radial-gradient(ellipse 40% 30% at 90% 80%, #173f3218, transparent),
    #000;
  border-bottom: 1px solid var(--border);
}
body.show-offline-hero .live-frame-wrap {
  display: none;
}
body.show-offline-hero .offline-hero {
  display: block;
}
.offline-inner {
  max-width: var(--max);
  margin: 0 auto;
}
.brand-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.brand-row h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.brand-row .sub {
  color: var(--text-muted);
  font-size: 13px;
}
.hero-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-dxi);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}
.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 12px;
  max-width: 18ch;
}
.hero-lead {
  color: var(--text-ccc);
  max-width: 54ch;
  margin: 0 0 28px;
}
.dxi-console {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  overflow: hidden;
}
.dxi-console-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.dxi-console-head > div > span {
  color: #f1e9e2;
  text-shadow: 0 0 13px var(--color-dxi-glow);
  font-size: 14px;
  font-family: var(--font-mono);
}
.dxi-console-head small {
  color: var(--text-muted);
  font-size: 11px;
  display: block;
  margin-top: 2px;
}
.index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--border-soft);
}
.index-card {
  background: var(--bg-card);
  padding: 16px;
}
.index-card .sym {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}
.index-card .val {
  font-family: var(--font-mono);
  font-size: 22px;
  margin: 6px 0 2px;
  color: var(--text);
}
.index-card .chg {
  font-family: var(--font-mono);
  font-size: 12px;
}
.index-card .chg.up {
  color: var(--up);
}
.index-card .chg.down {
  color: var(--down);
}
.index-card .n {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 8px;
}
.demo-note {
  font-size: 11px;
  color: var(--text-dim);
  padding: 10px 16px;
  border-top: 1px solid var(--border-soft);
  font-family: var(--font-mono);
}

/* Shanhai nav cards (match live field notes) */
.shanhai-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 28px;
}
@media (max-width: 800px) {
  .shanhai-nav {
    grid-template-columns: 1fr 1fr;
  }
}
.shanhai-nav a {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.shanhai-nav a:hover {
  border-color: color-mix(in srgb, var(--color-dxi) 45%, #333);
  background: var(--bg-card-hover);
  text-decoration: none;
}
.shanhai-nav strong {
  font-size: 14px;
  font-family: var(--font-serif);
}
.shanhai-nav p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}
.center-link {
  margin-top: 20px;
  text-align: center;
}
.center-link a {
  pointer-events: auto;
  text-decoration: none;
}

/* Atlas bar */
.atlas-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg-ink) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.atlas-bar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}
.atlas-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.atlas-brand strong {
  font-family: var(--font-serif);
  font-weight: 600;
}
.atlas-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.atlas-meta {
  font-size: 12px;
  color: var(--text-ccc);
  font-family: var(--font-mono);
}
.atlas-meta b {
  color: var(--color-dxi);
}
.atlas-meta .sep {
  color: var(--text-dim);
  margin: 0 4px;
}
.atlas-nav {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  font-family: var(--font-mono);
}
.atlas-nav a {
  color: var(--text-ccc);
  text-decoration: none;
}
.atlas-nav a:hover {
  color: var(--color-dxi);
}

/* Settlement strip */
.settle-strip {
  border-bottom: 1px solid var(--border-soft);
  background:
    linear-gradient(90deg, #ff5f4b14, transparent 40%, #173f3214),
    var(--bg-elevated);
}
.settle-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  font-size: 13px;
}
.settle-bell {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-dxi);
  color: var(--color-dxi);
  border-radius: 50%;
  font-size: 14px;
  animation: settle-pulse 2.4s ease-in-out infinite;
}
@keyframes settle-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 var(--color-dxi-glow);
  }
  50% {
    box-shadow: 0 0 0 8px transparent;
  }
}
.settle-inner strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 14px;
}
.settle-inner > div > span {
  color: var(--text-muted);
  font-size: 12px;
  font-family: var(--font-mono);
}
.settle-note {
  flex: 1;
  min-width: 200px;
  color: var(--text-dim);
  font-size: 12px;
}
.settle-note em {
  color: var(--color-dxi);
  font-style: normal;
}

/* Sections */
.research-wrap {
  background: var(--bg);
}
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 56px 20px;
  border-bottom: 1px solid var(--border-soft);
}
.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-dxi);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.section h2 {
  margin: 0 0 8px;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 600;
  font-family: var(--font-serif);
}
.section .en-sub {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 0 28px;
}
.disclaimer-inline {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}

/* Ticker tape */
.ticker-tape {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0a0a0a;
  margin-bottom: 14px;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker-track {
  display: flex;
  gap: 28px;
  padding: 10px 0;
  width: max-content;
  animation: tape-scroll 32s linear infinite;
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}
@keyframes tape-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}
.ticker-item .sym {
  color: var(--text-muted);
  margin-right: 8px;
}
.ticker-item .val {
  color: var(--text);
  margin-right: 6px;
}
.ticker-item .chg.up {
  color: var(--up);
}
.ticker-item .chg.down {
  color: var(--down);
}

.quote-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 800px) {
  .quote-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.quote-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.quote-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-dxi), transparent);
}
.quote-card .sym {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.quote-card .val {
  font-family: var(--font-mono);
  font-size: 28px;
  margin: 8px 0 4px;
  letter-spacing: -0.02em;
  transition: color 0.2s;
}
.quote-card.flash-up .val {
  color: var(--up);
}
.quote-card.flash-down .val {
  color: var(--down);
}
.quote-card .chg {
  font-family: var(--font-mono);
  font-size: 13px;
}
.quote-card .chg.up {
  color: var(--up);
}
.quote-card .chg.down {
  color: var(--down);
}
.quote-card .meta {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* Panels / forms */
.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 20px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.panel-head h3 {
  margin: 0;
  font-size: 16px;
  font-family: var(--font-serif);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pill {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--color-dxi) 40%, #333);
  color: var(--color-dxi);
  white-space: nowrap;
}
.pill-muted {
  border-color: var(--border);
  color: var(--text-muted);
}

.tide-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 14px;
}
@media (max-width: 800px) {
  .tide-grid {
    grid-template-columns: 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-muted);
}
.field input,
.field select,
.field textarea {
  appearance: none;
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  font-family: var(--font-sans);
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--color-dxi) 55%, #444);
}

.dir-fieldset {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 12px;
  margin: 0 0 14px;
}
.dir-fieldset legend {
  padding: 0 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.dir-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 14px;
  margin-bottom: 4px;
  font-size: 14px;
  cursor: pointer;
}
.ticket-legal {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0 0 14px;
}

.btn {
  appearance: none;
  border: 1px solid var(--color-dxi);
  background: var(--color-dxi);
  color: #111;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-sans);
}
.btn:hover {
  filter: brightness(1.06);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover {
  border-color: var(--text-dim);
}
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}
.btn-block {
  width: 100%;
}

/* Tide weight bars (not order-book chrome) */
.tide-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tide-mid {
  text-align: center;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  margin-bottom: 4px;
  background: #0a0808;
}
.book-last {
  font-family: var(--font-mono);
  font-size: 28px;
  color: var(--text);
  text-shadow: 0 0 16px var(--color-dxi-glow);
}
.book-sub {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-top: 4px;
}
.tide-row {
  display: grid;
  grid-template-columns: 48px 1fr 44px;
  align-items: center;
  gap: 10px;
}
.tide-lab {
  font-family: var(--font-mono);
  font-size: 11px;
}
.tide-lab.up {
  color: var(--up);
}
.tide-lab.down {
  color: var(--down);
}
.tide-lab.range {
  color: var(--text-muted);
}
.tide-track {
  height: 8px;
  background: #1a1a1a;
  border-radius: 99px;
  overflow: hidden;
}
.tide-track > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3d8f52, var(--up));
  border-radius: 99px;
  transition: width 0.4s ease;
}
.tide-track.dim > i {
  background: linear-gradient(90deg, #8a3a32, var(--down));
}
.tide-track.muted > i {
  background: #555;
}
.tide-pct {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-ccc);
  text-align: right;
}

/* Positions table */
.positions-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-ccc);
}
.positions-toolbar b {
  color: var(--color-dxi);
  font-family: var(--font-mono);
}
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
  background: var(--bg-card);
}
.table-wrap.flat {
  border: 0;
  border-radius: 0;
  background: transparent;
}
table.pos-table,
table.leaderboard {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.pos-table th,
table.pos-table td,
table.leaderboard th,
table.leaderboard td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}
table.pos-table th,
table.leaderboard th {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: #0a0a0a;
  font-weight: 500;
}
table.pos-table tr:last-child td,
table.leaderboard tr:last-child td {
  border-bottom: 0;
}
table.pos-table tr:hover td,
table.leaderboard tr:hover td {
  background: var(--bg-card-hover);
}
.empty-row td {
  text-align: center !important;
  color: var(--text-dim);
  padding: 28px 12px !important;
}
.pnl-up {
  color: var(--up);
  font-family: var(--font-mono);
}
.pnl-down {
  color: var(--down);
  font-family: var(--font-mono);
}
.pnl-flat {
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.rank {
  font-family: var(--font-mono);
  color: var(--color-dxi);
}
.pts {
  font-family: var(--font-mono);
  color: var(--white);
  font-variant-numeric: tabular-nums;
}

.boards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 800px) {
  .boards-grid {
    grid-template-columns: 1fr;
  }
}

/* Earn */
.earn-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 900px) {
  .earn-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 520px) {
  .earn-grid {
    grid-template-columns: 1fr;
  }
}
.earn-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 18px;
}
.earn-card .shanhai-seal {
  margin-bottom: 12px;
}
.earn-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-family: var(--font-serif);
}
.earn-card p {
  margin: 0;
  font-size: 13px;
  color: var(--text-ccc);
}
.earn-card .pts-tag {
  display: inline-block;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-dxi);
  border: 1px solid color-mix(in srgb, var(--color-dxi) 40%, #333);
  border-radius: 6px;
  padding: 4px 8px;
}
.callout {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px dashed color-mix(in srgb, var(--color-dxi) 45%, #444);
  background: #0a0808;
  font-size: 13px;
  color: var(--text-ccc);
}
.callout strong {
  color: var(--color-dxi);
}
.invite-box {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}
.invite-box h3 {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 16px;
}
.invite-box > p {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-ccc);
}
.invite-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.invite-row code {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 12px;
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--color-dxi);
}
.invite-cap {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* Radar */
.radar-widget {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: center;
}
@media (max-width: 700px) {
  .radar-widget {
    grid-template-columns: 1fr;
  }
}
.radar-viz {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle, #ff5f4b18 0%, transparent 55%),
    #0a0a0a;
  border: 1px solid var(--border);
  overflow: hidden;
}
.radar-ring {
  position: absolute;
  inset: 0;
  margin: auto;
  border: 1px solid color-mix(in srgb, var(--color-dxi) 22%, #333);
  border-radius: 50%;
}
.radar-ring.r1 {
  width: 70%;
  height: 70%;
}
.radar-ring.r2 {
  width: 45%;
  height: 45%;
}
.radar-ring.r3 {
  width: 22%;
  height: 22%;
}
.radar-sweep {
  position: absolute;
  inset: 0;
  background: conic-gradient(from 0deg, transparent 0deg, #ff5f4b33 40deg, transparent 70deg);
  animation: sweep 4s linear infinite;
}
@keyframes sweep {
  to {
    transform: rotate(360deg);
  }
}
.radar-core {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-dxi);
  color: #111;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  z-index: 2;
}
.radar-blips span {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-dxi);
  box-shadow: 0 0 8px var(--color-dxi-glow);
  transform: translate(-50%, -50%);
}
.radar-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stat-mini {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 12px 14px;
  background: #0a0a0a;
}
.stat-mini .label {
  font-size: 12px;
  color: var(--text-muted);
}
.stat-mini .num {
  font-family: var(--font-mono);
  font-size: 26px;
  color: var(--white);
  text-shadow: 0 0 14px var(--color-dxi-glow);
  margin-top: 4px;
}

/* Life form */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 14px;
}
@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}
.health-fieldset {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 14px;
  margin: 8px 0 16px;
}
.health-fieldset legend {
  padding: 0 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.health-disclaimer {
  font-size: 12px;
  color: var(--text-dim);
  margin: 0 0 10px;
  line-height: 1.5;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-ccc);
  margin-bottom: 8px;
  cursor: pointer;
}
.check.consent {
  margin: 0 0 16px;
}

/* Aggregates */
.agg-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 720px) {
  .agg-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.agg-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 16px;
}
.agg-card .label {
  font-size: 12px;
  color: var(--text-muted);
}
.agg-card .val {
  margin-top: 8px;
  font-size: 20px;
  color: var(--white);
}
.bazi-pre {
  margin: 0;
  padding: 14px;
  background: #0a0a0a;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-ccc);
  white-space: pre-wrap;
  line-height: 1.6;
}

.reward-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 720px) {
  .reward-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.reward-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 18px;
  text-align: center;
}
.reward-card .reward-ico {
  margin: 0 auto 12px;
  width: 40px;
  height: 40px;
  font-size: 18px;
}
.reward-card h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-family: var(--font-serif);
}
.reward-card p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(6px);
}
.modal-overlay[hidden] {
  display: none !important;
}
/* Founding Reading must sit above Resident Desk (z-index 1200) */
#founding-reading-modal.modal-overlay {
  z-index: 1300;
}
.modal-card {
  width: min(440px, 100%);
  background: var(--bg-card);
  border: 1px solid color-mix(in srgb, var(--color-dxi) 35%, #333);
  border-radius: 12px;
  padding: 28px 24px 22px;
  box-shadow: 0 0 40px var(--color-dxi-glow);
}
.modal-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--color-dxi);
  margin-bottom: 10px;
}
.modal-card h2 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.3;
}
.modal-lead {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text-ccc);
}
.modal-bullets {
  margin: 0 0 18px;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-muted);
}
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.modal-fine {
  margin: 0;
  font-size: 11px;
  color: var(--text-dim);
}

/* Toasts */
.toast-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
}
.toast {
  padding: 12px 14px;
  background: #1a1210;
  border: 1px solid color-mix(in srgb, var(--color-dxi) 40%, #333);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-ccc);
  box-shadow: 0 8px 24px #000a;
  animation: toast-in 0.25s ease;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Footer */
.site-footer {
  padding: 48px 20px 64px;
  background: #000;
  border-top: 1px solid var(--border);
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
}
.footer-inner h2 {
  font-size: 16px;
  margin: 0 0 12px;
  font-family: var(--font-serif);
  color: var(--text);
}
.footer-inner p {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-ccc);
  max-width: 72ch;
}
.footer-inner .en {
  color: var(--text-dim);
  font-size: 12px;
}
.footer-meta {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
}

/* Privacy page extras */
.privacy-page .section {
  padding-top: 40px;
}
.privacy-page h1 {
  font-family: var(--font-serif);
  font-size: clamp(24px, 4vw, 32px);
  margin: 0 0 8px;
}
.privacy-page .prose p,
.privacy-page .prose li {
  color: var(--text-ccc);
  font-size: 14px;
  line-height: 1.65;
}
.privacy-page .prose h3 {
  font-family: var(--font-serif);
  font-size: 17px;
  margin: 28px 0 8px;
  color: var(--text);
}
.privacy-page .prose ul {
  padding-left: 18px;
}

/* Compact screenshots */
body.compact-shot .offline-hero {
  min-height: 0;
  padding-top: 24px;
  padding-bottom: 32px;
}
body.compact-shot .live-frame-wrap {
  height: 70vh;
  min-height: 480px;
}

/* —— Title row + help popover —— */
.title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.title-row h2 {
  margin: 0;
}
.help-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid color-mix(in srgb, var(--color-dxi) 45%, #444);
  background: transparent;
  color: var(--color-dxi);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1.2;
}
.help-btn:hover {
  background: #ff5f4b18;
}
.help-btn-text {
  letter-spacing: 0.04em;
}
.help-popover {
  position: fixed;
  z-index: 110;
  width: min(360px, calc(100vw - 32px));
  background: #121010;
  border: 1px solid color-mix(in srgb, var(--color-dxi) 40%, #333);
  border-radius: 10px;
  padding: 16px 18px 14px;
  box-shadow: 0 12px 40px #000c, 0 0 24px var(--color-dxi-glow);
}
.help-popover[hidden] {
  display: none !important;
}
.help-popover h3 {
  margin: 0 28px 8px 0;
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--text);
}
.help-body {
  font-size: 13px;
  color: var(--text-ccc);
  line-height: 1.6;
}
.help-body p {
  margin: 0 0 8px;
}
.help-body p:last-child {
  margin-bottom: 0;
}
.help-close {
  position: absolute;
  top: 8px;
  right: 10px;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}
.modal-one-line {
  margin: 0 0 16px;
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  padding: 8px 10px;
  border-left: 2px solid var(--color-dxi);
  background: #0a0808;
}
.footer-legal p {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-ccc);
  max-width: 76ch;
  line-height: 1.65;
}
.footer-legal strong {
  color: var(--text);
}

.tape-empty {
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}

/* —— Genesis announcement banner —— */
.genesis-banner {
  position: sticky;
  top: 0;
  z-index: 90;
  background:
    linear-gradient(90deg, #1a0806 0%, #0c0c0c 40%, #120a08 100%);
  border-bottom: 1px solid color-mix(in srgb, var(--color-dxi) 55%, #333);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 0 40px var(--color-dxi-glow);
}
.genesis-banner-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.genesis-seal {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1.5px solid var(--color-dxi);
  color: var(--color-dxi);
  font-family: var(--font-serif);
  font-size: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 12px var(--color-dxi-glow);
  text-shadow: 0 0 10px var(--color-dxi-glow);
}
.genesis-copy { flex: 1; min-width: 0; }
.genesis-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.25rem;
}
.genesis-pill {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  border: 1px solid var(--color-dxi);
  background: color-mix(in srgb, var(--color-dxi) 18%, transparent);
  color: var(--color-dxi);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}
.genesis-dates {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-ccc);
}
.genesis-title {
  margin: 0 0 0.2rem;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--white);
  letter-spacing: 0.04em;
}
.genesis-body {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.genesis-body strong { color: var(--color-dxi-soft); font-weight: 600; }
.genesis-cta {
  flex: 0 0 auto;
  padding: 0.55rem 1rem;
  border: 1px solid var(--color-dxi);
  background: var(--color-dxi);
  color: #050505 !important;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-decoration: none !important;
  white-space: nowrap;
}
.genesis-cta:hover {
  background: transparent;
  color: var(--color-dxi) !important;
}
@media (max-width: 720px) {
  .genesis-banner-inner { flex-wrap: wrap; }
  .genesis-cta { width: 100%; text-align: center; }
}


/* Registration modal */
.modal-card-wide {
  width: min(640px, 100%);
  max-height: min(90vh, 900px);
  overflow-y: auto;
}
.modal-card .form-grid {
  margin-bottom: 12px;
}
.modal-card .field .req {
  font-style: normal;
  font-size: 11px;
  color: var(--color-dxi);
  margin-left: 4px;
}
button.genesis-cta {
  appearance: none;
  font: inherit;
  cursor: pointer;
  border: none;
}


/* —— How to play · onboarding tour —— */
.atlas-how,
.genesis-how {
  appearance: none;
  font: inherit;
  cursor: pointer;
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--color-dxi) 55%, #444);
  color: var(--color-dxi);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  line-height: 1.4;
}
.atlas-how:hover,
.genesis-how:hover {
  background: color-mix(in srgb, var(--color-dxi) 14%, transparent);
  text-decoration: none;
}
.atlas-nav .atlas-how {
  margin-right: 2px;
}
.genesis-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  flex: 0 0 auto;
}
.genesis-actions .genesis-cta {
  width: 100%;
  text-align: center;
}
.genesis-how {
  text-align: center;
  padding: 0.4rem 0.75rem;
}
@media (max-width: 720px) {
  .genesis-actions { width: 100%; }
}

.tour-overlay {
  z-index: 110;
}
.tour-card {
  width: min(460px, 100%);
  position: relative;
  animation: tour-in 0.32s ease;
}
@keyframes tour-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.tour-close {
  position: absolute;
  top: 12px;
  right: 14px;
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}
.tour-close:hover {
  color: var(--color-dxi);
}
.tour-dots {
  display: flex;
  gap: 6px;
  margin: 0 0 14px;
}
.tour-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.tour-dot.is-done {
  background: color-mix(in srgb, var(--color-dxi) 45%, #222);
  border-color: var(--color-dxi);
}
.tour-dot.is-active {
  background: var(--color-dxi);
  border-color: var(--color-dxi);
  transform: scale(1.2);
  box-shadow: 0 0 10px var(--color-dxi-glow);
}
.tour-copy {
  min-height: 4.5em;
}
.tour-actions {
  margin-top: 4px;
}
.tour-spotlight {
  outline: 2px solid var(--color-dxi) !important;
  outline-offset: 6px;
  box-shadow: 0 0 0 8px var(--color-dxi-glow), 0 0 28px var(--color-dxi-glow);
  border-radius: 10px;
  transition: box-shadow 0.35s ease, outline-color 0.35s ease;
}


/* Loud but on-brand guide entry */
.btn-how-to-play,
#btn-how-to-play,
#btn-how-to-play-banner {
  border: 1px solid var(--color-dxi, #ff5f4b) !important;
  color: var(--color-dxi, #ff5f4b) !important;
  background: color-mix(in srgb, #ff5f4b 14%, transparent) !important;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 0 18px color-mix(in srgb, #ff5f4b 25%, transparent);
}
.field-hint {
  margin: -0.35rem 0 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted, #a88b86);
  line-height: 1.45;
}

/* —— Live presence strip —— */
.presence-strip {
  position: sticky;
  top: 52px;
  z-index: 40;
  background: color-mix(in srgb, #050505 92%, #ff5f4b 8%);
  border-bottom: 1px solid color-mix(in srgb, var(--color-dxi) 35%, #222);
  backdrop-filter: blur(8px);
}
.presence-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 13px;
  color: var(--text-muted);
}
.presence-inner b {
  color: var(--text);
  font-weight: 600;
}
.presence-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-dxi);
  box-shadow: 0 0 10px var(--color-dxi-glow);
  animation: presence-blink 1.8s ease-in-out infinite;
}
@keyframes presence-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}
.presence-note {
  color: var(--text-dim);
  font-size: 12px;
}
.atlas-bar .sep,
.presence-inner .sep,
.desk-header-meta .sep {
  opacity: 0.45;
}

.atlas-desk {
  appearance: none;
  border: 1px solid var(--color-dxi);
  background: color-mix(in srgb, #ff5f4b 18%, transparent);
  color: var(--color-dxi);
  font: inherit;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 0 14px color-mix(in srgb, #ff5f4b 22%, transparent);
}
.atlas-desk:hover {
  background: color-mix(in srgb, #ff5f4b 28%, transparent);
  text-decoration: none;
}
.atlas-reading {
  background: color-mix(in srgb, #c9a227 16%, transparent);
  border-color: color-mix(in srgb, #c9a227 70%, #888);
  color: #e8d48b;
  box-shadow: 0 0 12px color-mix(in srgb, #c9a227 18%, transparent);
}
.atlas-reading:hover {
  background: color-mix(in srgb, #c9a227 28%, transparent);
}
.atlas-reading[hidden],
#btn-ov-view-reading[hidden],
.ov-reading-card[hidden] {
  display: none !important;
}

/* —— Resident Desk —— */
body.desk-open {
  overflow: hidden;
}
.desk-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 16px;
  overflow: auto;
}
.desk-overlay[hidden] {
  display: none !important;
}
.desk-shell {
  width: min(1080px, 100%);
  max-height: calc(100vh - 32px);
  margin: auto;
  background: linear-gradient(165deg, #0e0e0e 0%, #090909 55%, #0c0808 100%);
  border: 1px solid color-mix(in srgb, var(--color-dxi) 40%, #333);
  border-radius: 14px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-dxi) 15%, transparent),
    0 24px 80px rgba(0, 0, 0, 0.65),
    0 0 60px color-mix(in srgb, #ff5f4b 12%, transparent);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: tour-in 0.28s ease;
}
.desk-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.desk-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.desk-brand h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}
.desk-header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.desk-close {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 8px;
  margin-left: 4px;
}
.desk-close:hover {
  color: var(--color-dxi);
}
.desk-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px 16px 0;
  border-bottom: 1px solid var(--border-soft);
  background: #0a0a0a;
}
.desk-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 10px 14px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
}
.desk-tab:hover {
  color: var(--text);
}
.desk-tab.is-active {
  color: var(--color-dxi);
  border-color: var(--border);
  border-bottom-color: #0a0a0a;
  background: color-mix(in srgb, #ff5f4b 8%, #111);
}
.desk-body {
  flex: 1;
  overflow: auto;
  padding: 18px 20px 24px;
}
.desk-pane[hidden] {
  display: none !important;
}
.desk-lead {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 12px;
}
.desk-fine {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 12px;
}
.desk-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.desk-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
}
.desk-stat .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.desk-stat .val {
  font-size: 1.25rem;
  font-weight: 650;
}
.pnl-up { color: var(--up) !important; }
.pnl-down { color: var(--down) !important; }
.pnl-flat { color: var(--text-dim); }

.chronicle-progress {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0d0d0d;
  font-size: 13px;
  color: var(--text-muted);
}
.chr-bar {
  margin-top: 10px;
  height: 6px;
  border-radius: 999px;
  background: #1a1a1a;
  overflow: hidden;
}
.chr-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--color-dxi), #ff8a7a);
  border-radius: 999px;
  transition: width 0.35s ease;
}
.chronicle-form .chr-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
  margin: 0 0 14px;
  background: #0c0c0c;
}
.chronicle-form .chr-section legend {
  padding: 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}
.chronicle-form .chr-section .hint {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 12px;
}
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px 10px;
}
.field-span {
  grid-column: 1 / -1;
}
.chronicle-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 72px;
  background: #0a0a0a;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
}
.chronicle-form textarea:focus {
  outline: none;
  border-color: var(--color-dxi);
  box-shadow: 0 0 0 2px var(--color-dxi-glow);
}

.desk-invite-panel {
  max-width: 640px;
}
#desk-invite-link {
  width: 100%;
  font-size: 12px;
}

.pulse-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.pulse-chip {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0d0d0d;
  font-size: 12px;
}
.pulse-chip .sym {
  font-weight: 700;
  color: var(--color-dxi);
  letter-spacing: 0.04em;
}
.desk-pos-grid {
  align-items: start;
}

@media (max-width: 720px) {
  .desk-overlay { padding: 8px; }
  .desk-shell { max-height: calc(100vh - 16px); border-radius: 10px; }
  .desk-header { padding: 12px 14px 8px; }
  .desk-body { padding: 12px 14px 18px; }
  .desk-tab { padding: 8px 10px; font-size: 12px; }
  .presence-strip { top: 0; }
}


/* Bottom Join Genesis — mirror top banner */
.genesis-bottom {
  padding: 1.25rem 1.35rem;
  background: linear-gradient(180deg, rgba(255,95,75,0.08), rgba(0,0,0,0.35));
  border: 1px solid rgba(255,95,75,0.35);
}
.genesis-bottom-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  align-items: flex-start;
}
.genesis-bottom .genesis-seal {
  flex: 0 0 auto;
}
.genesis-bottom .genesis-copy {
  flex: 1 1 280px;
}
.genesis-bottom .genesis-title {
  margin: 0.35rem 0 0.5rem;
  font-size: 1.35rem;
}
.genesis-bottom .genesis-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-left: auto;
}
@media (max-width: 720px) {
  .genesis-bottom .genesis-actions {
    width: 100%;
    margin-left: 0;
  }
}


/* Production: no self-embedding iframe */
.live-frame-wrap { display: none !important; }
#offline-hero.offline-hero, .offline-hero {
  display: block !important;
}

/* —— Overview invest CTA + founding reading —— */
.ov-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 18px;
}
.ov-reading-card,
.ov-pos-summary {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0c0c0c;
}
.ov-reading-card .desk-fine {
  margin: 8px 0 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.ov-reg-card {
  margin: 12px 0 16px;
}
.ov-reg-dl {
  display: grid;
  grid-template-columns: minmax(120px, 160px) 1fr;
  gap: 6px 12px;
  margin: 0;
  font-size: 13px;
}
.ov-reg-dl dt {
  color: var(--text-dim);
  margin: 0;
}
.ov-reg-dl dd {
  margin: 0;
  color: var(--text);
  word-break: break-word;
}
.ov-reg-card .desk-fine {
  margin-top: 10px;
  margin-bottom: 0;
}

.zh-hint {
  font-size: 0.85em;
  color: var(--text-dim);
  font-weight: 500;
  margin-left: 0.35em;
}
.btn-block { width: 100%; }

/* Founding Reading modal — BaZi outline */
.founding-reading-card {
  max-height: min(94vh, 1100px);
  overflow-y: auto;
}
.modal-card-wide.founding-reading-card-v3 {
  width: min(820px, 100%);
  max-height: min(94vh, 1200px);
}
.reading-lang-row {
  margin: 0 0 14px;
}
.reading-lang-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: #0c0c0c;
}
.reading-lang-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 6px 14px;
  cursor: pointer;
  min-width: 52px;
}
.reading-lang-btn.is-active {
  background: color-mix(in srgb, #ff5f4b 22%, transparent);
  color: var(--color-dxi);
}
.reading-lang-btn:focus-visible {
  outline: 2px solid var(--color-dxi);
  outline-offset: -2px;
}
.reading-lang-note {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-dim);
}
.founding-method {
  margin: -4px 0 12px;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}
.founding-sec-title {
  margin: 18px 0 8px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}
.founding-pillars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 12px;
}
.founding-pillar {
  text-align: center;
  padding: 12px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0a0a0a;
}
.founding-pillar .lab {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.founding-pillar .glyphs {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
}
.founding-pillar .sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
}
.founding-pillar .nayin {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text);
  opacity: 0.9;
}
.founding-pillar .canggan {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.35;
  color: var(--text-dim);
}
.founding-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-muted);
}
.founding-meta-item {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0d0d0d;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.founding-meta-item strong {
  color: var(--text);
  font-weight: 650;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.founding-meta-item span {
  color: var(--text-muted);
  line-height: 1.45;
}
.founding-meta-item .meta-note {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-dim);
}
.founding-analysis {
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
}
.founding-analysis p { margin: 0 0 8px; }
.founding-reason-list {
  margin: 0 0 10px;
  padding-left: 1.15rem;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-dim);
}
.founding-elements { margin-bottom: 12px; }
.founding-elem-bars { display: grid; gap: 8px; }
.elem-row {
  display: grid;
  grid-template-columns: 88px 1fr 36px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.elem-lab { color: var(--text-muted); }
.elem-bar {
  height: 8px;
  border-radius: 4px;
  background: #1a1a1a;
  border: 1px solid var(--border);
  overflow: hidden;
}
.elem-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #8b7355, #c4a574);
  border-radius: 3px;
}
.elem-n {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.founding-tengods { margin-bottom: 12px; }
.founding-tengods-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.founding-tengods-list li {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0a0a0a;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}
.founding-tengods-list .tg-src { color: var(--text-dim); }
.founding-tengods-list .tg-stem {
  color: var(--text);
  font-weight: 650;
  margin: 0 2px;
}
.founding-tengods-list .tg-en {
  color: var(--text-dim);
  font-size: 11px;
}
.founding-empty {
  font-size: 12px;
  color: var(--text-dim);
}
.founding-mountains {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}
.founding-mtn {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0d0d0d;
}
.founding-mtn h4 {
  margin: 0 0 6px;
  font-size: 14px;
  letter-spacing: 0.04em;
}
.founding-mtn p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
}
@media (max-width: 640px) {
  .founding-pillars {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .founding-meta {
    grid-template-columns: 1fr;
  }
}


/* Founding Reading v3 — narrative-first */
.founding-narrative {
  margin: 8px 0 16px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-muted);
}
.founding-narr-sec {
  margin-bottom: 14px;
  padding-bottom: 6px;
}
.founding-narrative p { margin: 0 0 10px; }
.founding-narrative strong { color: var(--text); font-weight: 650; }
.founding-humility {
  font-size: 12px;
  color: var(--text-dim);
  border-left: 2px solid var(--border);
  padding-left: 10px;
}
.founding-dual-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0 12px;
}
.dual-pane {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0a0a0a;
}
.dual-pane h4 {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.dual-pillars {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: var(--text);
}
.founding-dayun-list,
.founding-liunian-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 6px;
}
.founding-dayun-list li,
.founding-liunian-list li {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0a0a0a;
  font-size: 12.5px;
  color: var(--text-muted);
}
.founding-dayun-list li.is-current,
.founding-liunian-list li.is-current {
  border-color: color-mix(in srgb, var(--color-dxi) 55%, var(--border));
  background: color-mix(in srgb, var(--color-dxi) 10%, #0a0a0a);
}
.founding-dayun-list em,
.founding-liunian-list em {
  font-style: normal;
  color: var(--color-dxi);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.founding-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 8px;
}
.founding-appendix {
  margin: 16px 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px 14px;
  background: #0b0b0b;
}
.founding-appendix > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.03em;
  color: var(--text);
  padding: 6px 0;
  list-style-position: outside;
}
.founding-appendix[open] > summary {
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}
@media (max-width: 640px) {
  .founding-dual-charts { grid-template-columns: 1fr; }
  .founding-reading-card-v3 { width: min(100%, 100%); }
}


/* —— V4 global city picker —— */
.field-city-picker {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.field-city-picker .city-select {
  width: 100%;
}
.field-city-picker .city-lon-input {
  width: 100%;
  margin-top: 0.15rem;
}
.field-city-picker .field-hint {
  font-size: 0.75rem;
  opacity: 0.7;
  line-height: 1.35;
}
.founding-narr-lead .plain-suggest {
  margin: 0.35rem 0 0.75rem;
  padding-left: 1.1rem;
  line-height: 1.5;
}
.founding-narr-lead .plain-suggest li {
  margin: 0.25rem 0;
}
.founding-narr-lead .lead-evidence,
.mbti-evidence {
  font-size: 0.84rem;
  opacity: 0.78;
  line-height: 1.4;
}
.mbti-caveat {
  font-size: 0.82rem;
  opacity: 0.75;
  font-style: italic;
}
.founding-narr-sec#narr-h {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.75rem;
  margin-top: 0.5rem;
}
