:root {
  color-scheme: dark;
  --bg: #12110f;
  --rail: #181612;
  --surface: #1e1c18;
  --surface-2: #29251f;
  --surface-3: #353027;
  --paper: #eee8dc;
  --ink: #f3eee5;
  --muted: #aaa294;
  --line: rgba(238, 232, 220, 0.14);
  --acid: #9db49f;
  --coral: #c45b46;
  --mint: #9db49f;
  --amber: #b99a62;
  --blue: #819ca0;
  --danger: #d06b59;
  --radius: 4px;
  --shadow: 0 24px 70px rgba(4, 3, 2, 0.34);
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--bg); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  letter-spacing: 0;
}

button, input, select, textarea { font: inherit; }
button { border: 0; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

h1, h2, p { margin-top: 0; }
h1, h2 { letter-spacing: 0; font-family: var(--serif); font-weight: 700; }
h1 { margin-bottom: 0; font-size: 48px; line-height: 1.02; }
h2 { margin-bottom: 10px; font-size: 28px; line-height: 1.12; }
p { color: var(--muted); line-height: 1.62; }

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

.rail {
  min-height: 100dvh;
  position: sticky;
  top: 0;
  padding: 24px 18px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--rail);
  border-right: 1px solid var(--line);
  z-index: 10;
}

.brand, .profile-chip { min-height: 44px; background: transparent; display: flex; align-items: center; gap: 11px; text-align: left; }
.brand-seal { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #d7a394; background: var(--coral); color: #fff8ed; font-family: var(--serif); font-size: 22px; box-shadow: inset 0 0 0 3px rgba(255,255,255,.12); }
.brand span, .profile-chip span { min-width: 0; }
.brand strong, .brand small, .profile-chip strong, .profile-chip small { display: block; }
.brand strong { font-size: 16px; }
.brand small, .profile-chip small { margin-top: 3px; color: var(--muted); font-size: 11px; }

.main-nav { padding-top: 70px; display: grid; align-content: start; gap: 6px; }
.nav-button {
  min-height: 46px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 13px;
  background: transparent;
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 650;
  transition: background 180ms ease, color 180ms ease, transform 100ms ease;
}
.nav-button:hover { color: var(--ink); background: rgba(255,255,255,.04); }
.nav-button.active { color: var(--paper); background: rgba(196,91,70,.13); box-shadow: inset 3px 0 0 var(--coral); }
.nav-button:active, .primary:active, .secondary:active, .icon-button:active, .scenario:active { transform: scale(.97); }
.nav-icon { width: 22px; text-align: center; font-size: 17px; }

.profile-chip { padding: 10px; border-radius: var(--radius); }
.profile-chip:hover { background: rgba(255,255,255,.04); }
.avatar, .large-avatar { display: grid; place-items: center; background: var(--paper); color: #171915; font-weight: 800; }
.avatar { width: 34px; height: 34px; border-radius: 50%; font-size: 13px; }
.profile-chip strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }

.stage { min-width: 0; padding: 32px clamp(24px, 4vw, 60px) 72px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; position: relative; }
.title-lockup { display: flex; align-items: center; gap: 14px; }
.chapter-seal { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--coral); color: var(--coral); font-family: var(--serif); font-size: 20px; transform: rotate(-2deg); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.overline { margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; }

.icon-button, .close-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 800;
  transition: transform 100ms ease, background 180ms ease;
}
.icon-button:hover { background: var(--surface-3); }
.icon-button.dark { background: rgba(12,14,12,.72); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(18px); }
.notification-button { position: relative; font-size: 22px; }
.notification-button span { width: 5px; height: 5px; position: absolute; top: 9px; right: 9px; border-radius: 50%; background: var(--coral); }

.primary, .secondary, .text-button, .text-camera-button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius);
  font-weight: 750;
  transition: transform 100ms ease, filter 180ms ease, background 180ms ease;
}
.primary { background: var(--coral); color: #fff8ed; }
.primary:hover { filter: brightness(1.05); }
.primary.compact { min-height: 44px; }
.primary.full { width: 100%; margin-top: 22px; }
.secondary { background: var(--surface-3); color: var(--ink); }
.secondary:hover { background: #333a30; }
.text-button { padding: 0; min-height: 44px; color: var(--acid); background: transparent; }

.view { display: none; animation: view-in 350ms cubic-bezier(.16,1,.3,1); }
.view.active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.today-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .72fr); gap: 16px; }
.weather-panel, .window-panel, .trend-panel, .action-panel, .checkin-panel, .event-panel, .market-panel,
.drivers-panel, .scenario-panel, .palm-map-panel, .palm-insights, .conversation, .source-panel,
.identity-panel, .settings-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.weather-panel {
  min-height: 306px;
  padding: clamp(26px, 4vw, 46px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  align-items: center;
  overflow: hidden;
  position: relative;
  background-color: #1c2119;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 26px 26px;
}
.weather-copy { max-width: 620px; position: relative; z-index: 2; }
.weather-copy h2 { font-size: 74px; line-height: .96; }
.weather-copy > p { max-width: 580px; margin-bottom: 22px; }
.weather-meta { display: flex; flex-wrap: wrap; gap: 16px; color: #d9ded5; font-size: 12px; }
.weather-meta span { display: flex; align-items: center; gap: 7px; }
.signal { width: 7px; height: 7px; border-radius: 50%; }
.signal.career { background: var(--acid); }.signal.relation { background: var(--coral); }.signal.energy { background: var(--amber); }

.orbit-visual { width: 220px; aspect-ratio: 1; position: relative; display: grid; place-items: center; }
.orbit-ring { position: absolute; border: 1px solid rgba(217,246,111,.38); border-radius: 50%; }
.ring-a { inset: 18px; }.ring-b { inset: 45px; border-color: rgba(239,128,111,.32); }
.orbit-core { width: 88px; height: 88px; display: grid; place-content: center; text-align: center; border-radius: 50%; background: var(--acid); color: #12140f; box-shadow: 0 0 36px rgba(217,246,111,.18); }
.orbit-core strong { font-size: 30px; line-height: 1; }.orbit-core small { margin-top: 4px; font-size: 10px; }
.orbit-dot { width: 9px; height: 9px; position: absolute; border-radius: 50%; background: var(--coral); }
.dot-a { top: 40px; right: 52px; }.dot-b { bottom: 28px; left: 76px; background: var(--acid); }

.window-panel { padding: 28px; display: flex; flex-direction: column; justify-content: space-between; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.section-heading h2 { margin-bottom: 0; }
.trend-up { color: var(--acid); font-weight: 800; font-size: 13px; }
.timeline { height: 42px; display: flex; align-items: center; justify-content: space-between; position: relative; }
.timeline span { height: 1px; position: absolute; left: 0; right: 0; background: var(--line); }
.timeline i { width: 8px; height: 8px; border-radius: 50%; background: var(--surface-3); position: relative; }
.timeline i.active { width: 13px; height: 13px; background: var(--acid); box-shadow: 0 0 0 5px rgba(217,246,111,.09); }

.dashboard-grid { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr); gap: 16px; }
.trend-panel { min-height: 360px; padding: 28px; }
.trend-panel canvas { width: 100%; height: 236px; display: block; margin-top: 16px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 18px; color: var(--muted); font-size: 11px; }
.chart-legend span { display: flex; align-items: center; gap: 7px; }
.chart-legend i { display: inline-block; width: 20px; height: 3px; }
.legend-candle { background: var(--acid); }.legend-cycle { background: var(--amber); border-top: 1px dashed var(--amber); }.legend-future { background: rgba(123,183,215,.38); }

.action-panel { padding: 28px; background: var(--paper); color: #161814; }
.action-panel .overline, .action-panel p { color: #64695e; }
.action-panel h2 { margin-top: 30px; font-size: 32px; }
.action-panel .primary { margin-top: 18px; background: #171915; color: var(--paper); }

.checkin-panel { padding: 28px; }
.checkin-panel .section-heading > span { color: var(--acid); font-size: 34px; font-weight: 800; }
.checkin-panel label { margin-top: 20px; display: grid; grid-template-columns: 44px 1fr 32px; align-items: center; gap: 12px; color: #d6dad2; font-size: 12px; }
.checkin-panel output { color: var(--muted); text-align: right; }
input[type="range"] { width: 100%; accent-color: var(--acid); }
.checkin-panel .secondary { width: 100%; margin-top: 24px; }

.event-panel { min-height: 248px; padding: 28px; grid-column: 1 / -1; }
.event-panel .section-heading { align-items: center; }
.event-panel .event-count { color: var(--coral); font-family: var(--serif); font-size: 14px; white-space: nowrap; }
.event-intro { max-width: 620px; margin: 8px 0 18px; font-size: 11px; }
.event-journal { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.event-entry { min-height: 96px; padding: 16px 18px 16px 0; position: relative; border-bottom: 1px solid var(--line); }
.event-entry + .event-entry { padding-left: 18px; border-left: 1px solid var(--line); }
.event-entry small, .event-entry strong, .event-entry span { display: block; }
.event-entry small { color: var(--muted); font-size: 10px; }
.event-entry strong { margin-top: 8px; color: var(--paper); font-size: 13px; }
.event-entry span { margin-top: 5px; color: var(--muted); font-size: 10px; }
.event-entry::after { content: ""; width: 7px; height: 7px; position: absolute; top: 17px; right: 18px; background: var(--coral); transform: rotate(45deg); }
.event-remove { width: 28px; height: 28px; position: absolute; right: 7px; bottom: 8px; border-radius: 50%; background: transparent; color: var(--muted); font-size: 17px; }
.event-remove:hover { background: var(--surface-2); color: var(--paper); }
.event-empty { min-height: 86px; grid-column: 1 / -1; display: flex; align-items: center; color: var(--muted); font-size: 12px; }
.event-panel > .secondary { margin-top: 18px; }
.legend-event { background: var(--coral); transform: rotate(45deg) scale(.38); }
.form-grid textarea { width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: var(--radius); resize: vertical; background: var(--surface-2); color: var(--ink); font: inherit; line-height: 1.5; }
.event-impact-label > span { color: var(--paper); font-size: 12px; }
.event-impact-label input { height: auto; padding: 0; border: 0; background: transparent; }

.palm-entry { min-height: 248px; padding: 0; position: relative; display: grid; grid-template-columns: 45% 55%; overflow: hidden; text-align: left; background: #242820; border: 1px solid var(--line); border-radius: var(--radius); }
.palm-entry img { width: 100%; height: 248px; object-fit: contain; object-position: center bottom; opacity: .9; transform: translateY(30px); }
.palm-entry > span { padding: 38px 26px 28px 0; align-self: center; }
.palm-entry small, .palm-entry strong, .palm-entry em { display: block; }
.palm-entry small { margin-bottom: 10px; color: var(--acid); font-weight: 800; text-transform: uppercase; }
.palm-entry strong { max-width: 260px; font-size: 24px; line-height: 1.12; }
.palm-entry em { margin-top: 24px; color: var(--muted); font-size: 12px; font-style: normal; }

.trend-toolbar { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.segmented { padding: 4px; display: flex; gap: 3px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.segmented button { min-width: 52px; min-height: 44px; padding: 0 14px; border-radius: 3px; background: transparent; color: var(--muted); font-weight: 700; }
.segmented button.active { background: var(--surface-3); color: var(--ink); }
.market-panel { padding: clamp(24px, 3vw, 36px); }
.market-summary { display: grid; grid-template-columns: minmax(220px,.6fr) minmax(0,1fr); gap: 40px; align-items: end; }
.market-summary > div strong { margin-right: 12px; font-size: 48px; }.market-summary > div span { color: var(--acid); font-size: 12px; }
.market-summary > p { max-width: 600px; margin: 0; }.market-summary > p strong, .market-summary > p > span { display: block; }.market-summary > p strong { color: var(--ink); }
.market-summary > p > span { margin-top: 5px; }
.market-summary > p .ai-command { display: block; }
.market-panel canvas { width: 100%; height: 430px; display: block; margin-top: 20px; }
.expanded { padding-top: 18px; border-top: 1px solid var(--line); }
.evidence-layout { margin-top: 16px; display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; }
.drivers-panel, .scenario-panel { padding: 28px; }
.driver-row { margin-top: 20px; display: grid; grid-template-columns: 126px 1fr 82px; gap: 16px; align-items: center; font-size: 12px; }
.driver-row > div { height: 5px; background: var(--surface-3); }
.driver-row i { width: var(--value); height: 100%; display: block; background: var(--acid); }
.driver-row strong { color: var(--muted); font-size: 11px; text-align: right; }
.ai-command { min-height: 44px; margin-top: 18px; padding: 0 14px; border: 1px solid rgba(196,91,70,.58); border-radius: var(--radius); background: rgba(196,91,70,.1); color: #d88776; font-size: 11px; font-weight: 750; }
.ai-command:hover { background: rgba(196,91,70,.18); }
.ai-command.full-command { width: 100%; }
.ai-command:disabled { opacity: .38; cursor: not-allowed; }
.is-loading { opacity: .62; cursor: progress; }
.legend-cycle.disabled { opacity: .34; }
.scenario { width: 100%; min-height: 52px; margin-top: 8px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 3px; background: var(--surface-2); color: var(--muted); text-align: left; }
.scenario.selected { background: var(--paper); color: #171915; }.scenario strong { font-size: 11px; }

.palm-workspace { min-height: 690px; display: grid; grid-template-columns: minmax(0,1.38fr) minmax(320px,.62fr); gap: 16px; }
.palm-map-panel { min-height: 690px; padding: 24px; display: flex; flex-direction: column; background-color: #121510; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 24px 24px; }
.palm-map-stage { min-height: 0; flex: 1; position: relative; display: grid; place-items: center; overflow: hidden; }
.palm-map-stage > img { width: min(92%, 520px); height: 570px; object-fit: contain; }
.scan-line { width: min(78%, 440px); height: 1px; position: absolute; top: 18%; background: var(--acid); box-shadow: 0 0 16px var(--acid); opacity: .7; animation: scan 4s ease-in-out infinite; }
@keyframes scan { 0%,100% { transform: translateY(0); opacity: .15; } 50% { transform: translateY(420px); opacity: .85; } }
.line-hotspot { width: 44px; height: 44px; position: absolute; border: 10px solid transparent; border-radius: 50%; background: var(--paper) padding-box; box-shadow: 0 0 0 6px rgba(242,240,232,.12); }
.line-hotspot.heart { top: 41%; left: 61%; }.line-hotspot.head { top: 56%; left: 62%; }.line-hotspot.life { top: 67%; left: 41%; }.line-hotspot.fate { top: 72%; left: 53%; }
.palm-controls { display: flex; justify-content: center; gap: 10px; }
.palm-insights { padding: 32px; }
.palm-insights > h2 { margin-top: 30px; font-size: 34px; }
.line-list { margin-top: 30px; display: grid; }
.line-list button { min-height: 64px; padding: 0; display: flex; align-items: center; gap: 12px; background: transparent; border-top: 1px solid var(--line); text-align: left; }
.line-list button:last-child { border-bottom: 1px solid var(--line); }
.line-list button:not(.active) { opacity: .58; }.line-list button:hover { opacity: 1; }
.line-swatch { width: 22px; height: 3px; }.line-swatch.coral { background: var(--coral); }.line-swatch.mint { background: var(--mint); }.line-swatch.amber { background: var(--amber); }.line-swatch.blue { background: var(--blue); }
.line-list strong, .line-list small { display: block; }.line-list strong { font-size: 13px; }.line-list small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.source-note { margin-top: 28px; padding-left: 14px; border-left: 2px solid var(--coral); }.source-note strong { font-size: 12px; }.source-note p { margin: 5px 0 0; font-size: 11px; }

.ask-layout { min-height: 680px; display: grid; grid-template-columns: minmax(0,1.35fr) minmax(280px,.65fr); gap: 16px; }
.conversation { padding: clamp(24px, 4vw, 42px); display: flex; flex-direction: column; }
.guide-intro { display: flex; gap: 18px; align-items: flex-start; }.guide-mark { width: 46px; height: 46px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--acid); color: #171915; font-size: 20px; }
.guide-intro h2 { font-size: 32px; }.guide-intro p { max-width: 590px; margin-bottom: 0; }
.quick-prompts { margin: 28px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.quick-prompts button { min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: transparent; color: var(--muted); font-size: 11px; }
.quick-prompts button:hover { color: var(--ink); background: var(--surface-2); }
.messages { flex: 1; min-height: 210px; display: grid; align-content: end; gap: 12px; }
.message { max-width: 82%; padding: 15px 17px; border-radius: var(--radius); background: var(--surface-2); color: #dfe3dc; font-size: 13px; line-height: 1.6; }
.message-copy { white-space: pre-line; }
.message.user { justify-self: end; background: var(--paper); color: #171915; }
.message .evidence { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.1); color: var(--muted); font-size: 10px; }
.ask-form { margin-top: 22px; padding: 8px 8px 8px 16px; display: flex; align-items: flex-end; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.ask-form textarea { min-height: 44px; max-height: 110px; flex: 1; resize: none; border: 0; outline: 0; background: transparent; color: var(--ink); line-height: 1.5; }
.send-button { width: 44px; height: 44px; border-radius: 50%; background: var(--acid); color: #171915; font-weight: 900; }
.source-panel { padding: 28px; }.source-row { min-height: 50px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); font-size: 12px; }.source-row strong { color: var(--acid); font-size: 11px; }.source-caption { margin-top: 24px; font-size: 11px; }

.profile-layout { display: grid; grid-template-columns: .72fr 1.28fr; gap: 16px; }
.identity-panel, .settings-panel { padding: clamp(24px, 4vw, 42px); }
.identity-header { display: flex; align-items: center; gap: 20px; }.large-avatar { width: 84px; height: 84px; border-radius: 50%; font-size: 28px; }.identity-header h2 { font-size: 34px; }
.completeness { margin: 44px 0 28px; display: grid; grid-template-columns: 1fr auto; gap: 12px; color: var(--muted); font-size: 12px; }.completeness strong { color: var(--ink); }.completeness div { height: 5px; grid-column: 1/-1; background: var(--surface-3); }.completeness i { width: 64%; height: 100%; display: block; background: var(--acid); }
.settings-panel h2 { margin-bottom: 24px; }.settings-panel > button { width: 100%; min-height: 72px; padding: 0; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); background: transparent; text-align: left; }.settings-panel strong, .settings-panel small { display: block; }.settings-panel small { margin-top: 5px; color: var(--muted); }.settings-panel em { color: var(--muted); font-size: 26px; font-style: normal; }.settings-panel .danger-row strong { color: var(--danger); }
.account-row { min-height: 94px; padding: 16px 0; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 18px; border-top: 1px solid var(--line); }
.account-row strong, .account-row small { display: block; }
.account-row small { max-width: 380px; margin-top: 5px; color: var(--muted); }
.account-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.account-actions .secondary { min-height: 44px; padding-inline: 13px; }
.legal-links { margin-top: 28px; border-bottom: 1px solid var(--line); }
.legal-links::before { content: "法律与支持"; display: block; margin-bottom: 8px; color: var(--muted); font-size: 9px; font-weight: 750; }
html[lang="en"] .legal-links::before { content: "LEGAL & SUPPORT"; }
.legal-links a { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.legal-links a:hover strong { color: var(--acid); }
.legal-links a:active { transform: scale(.995); }
.legal-links em { color: var(--muted); font-size: 26px; font-style: normal; }

dialog { padding: 0; border: 0; color: var(--ink); background: transparent; overflow: hidden; }
dialog::backdrop { background: rgba(0,0,0,.66); backdrop-filter: blur(8px); }
body:has(dialog[open]) { overflow: hidden; }
.sheet-dialog { width: min(620px, calc(100% - 24px)); max-height: calc(100dvh - 24px); margin: auto; }
.sheet-content { padding: 28px; border: 1px solid var(--line); border-radius: 10px; background: #1a1e18; box-shadow: var(--shadow); transform-origin: 86% 0; animation: materialize 340ms cubic-bezier(.16,1,.3,1); }
.assessment-dialog { width: min(760px, calc(100% - 24px)); }
.assessment-sheet { width: 100%; max-height: calc(100dvh - 24px); overflow: auto; }
.sheet-header > div { min-width: 0; }
.assessment-question { margin: 0; padding: 18px 0; border: 0; border-bottom: 1px solid var(--line); }
.assessment-question legend { width: 100%; display: flex; gap: 10px; align-items: baseline; color: var(--ink); font-weight: 700; line-height: 1.45; }
.assessment-question legend span { flex: 0 0 auto; color: var(--coral); font-size: 12px; font-variant-numeric: tabular-nums; }
.assessment-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.assessment-choices label { position: relative; min-width: 0; }
.assessment-choices input { position: absolute; opacity: 0; pointer-events: none; }
.assessment-choices label span { display: block; min-height: 44px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); cursor: pointer; transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 100ms ease; }
.assessment-choices label span:hover { color: var(--ink); background: rgba(255,255,255,.04); }
.assessment-choices input:checked + span { color: var(--paper); border-color: var(--coral); background: rgba(196,91,70,.16); box-shadow: inset 0 0 0 1px rgba(196,91,70,.35); }
.assessment-choices input:focus-visible + span { outline: 2px solid var(--acid); outline-offset: 3px; }
@keyframes materialize { from { opacity: 0; transform: scale(.975) translateY(10px); } to { opacity: 1; transform: none; } }
.sheet-handle { width: 46px; height: 4px; margin: -12px auto 22px; border-radius: 4px; background: var(--surface-3); }
.sheet-header { display: flex; justify-content: space-between; gap: 18px; }.close-button { border: 1px solid var(--line); }
.form-grid { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }.form-grid label { display: grid; gap: 8px; color: var(--muted); font-size: 11px; }.form-grid label.wide { grid-column: 1/-1; }
.form-grid input, .form-grid select { width: 100%; height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); color: var(--ink); }
.form-grid .birth-consent-row { display: flex; grid-template-columns: none; align-items: flex-start; gap: 10px; line-height: 1.55; }
.form-grid .birth-consent-row input { flex: 0 0 auto; width: 18px; height: 18px; margin: 1px 0 0; padding: 0; accent-color: var(--coral); }
.palm-observation-note { margin-top: 18px; }
#palmObservationForm .primary { margin-top: 22px; }
.form-note { margin: 18px 0 0; font-size: 10px; }

.scanner-dialog, .ar-dialog { width: min(430px, 100%); height: min(860px, 100dvh); max-height: 100dvh; margin: auto; }
.scanner-shell, .ar-shell { width: 100%; height: 100%; position: relative; overflow: hidden; background: #090a09; }
.scanner-shell video, .ar-shell video { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; }
.camera-fallback, .ar-backdrop { position: absolute; inset: 0; display: grid; place-items: center; background: #121510; }.camera-fallback img { width: 78%; height: 78%; object-fit: contain; opacity: .54; }
.hand-guide { position: absolute; inset: 9% 10% 20%; display: grid; place-items: end center; border: 1px dashed rgba(217,246,111,.58); border-radius: 48% 48% 38% 38%; }.hand-guide span { width: 70%; height: 1px; position: absolute; top: 12%; background: var(--acid); box-shadow: 0 0 18px var(--acid); animation: camera-scan 3s ease-in-out infinite; }
@keyframes camera-scan { 0%,100% { transform: translateY(0); } 50% { transform: translateY(480px); } }
.hand-guide p { padding: 8px 12px; border-radius: 4px; background: rgba(0,0,0,.58); color: white; font-size: 12px; }
.scan-status { position: absolute; top: 22px; left: 22px; right: 22px; display: flex; align-items: center; gap: 8px; font-size: 11px; }.scan-status i { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.scan-status[data-phase="ready"] i, .tracking-dot[data-phase="ready"] { background: var(--acid); box-shadow: 0 0 0 6px rgba(217,246,111,.1); }
.scan-status[data-phase="poorLighting"] i, .scan-status[data-phase="overexposed"] i { background: var(--coral); }
.scanner-actions { position: absolute; left: 20px; right: 20px; bottom: 24px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }.capture-button { width: 70px; height: 70px; padding: 6px; border-radius: 50%; background: rgba(255,255,255,.24); }.capture-button span { width: 100%; height: 100%; display: block; border-radius: 50%; background: var(--paper); }.text-camera-button { justify-self: end; padding: 0; color: white; background: transparent; font-size: 11px; }
.capture-button:disabled { opacity: .36; }

.ar-palm { width: 96%; height: 74%; position: absolute; left: 2%; top: 11%; object-fit: contain; filter: drop-shadow(0 0 18px rgba(217,246,111,.18)); opacity: .34; transition: opacity .24s ease, transform .24s ease; }
.ar-palm.is-tracking { opacity: 1; animation: ar-lock 2.4s ease-in-out infinite alternate; }
@keyframes ar-lock { from { transform: scale(.985); opacity: .78; } to { transform: scale(1); opacity: 1; } }
.ar-topbar { position: absolute; top: 18px; left: 18px; right: 18px; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }.ar-topbar small, .ar-topbar strong { display: block; }.ar-topbar small { color: var(--acid); font-size: 9px; }.ar-topbar strong { margin-top: 3px; font-size: 12px; }.tracking-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 6px rgba(217,246,111,.1); }
.ar-copy { position: absolute; left: 24px; right: 24px; bottom: 138px; padding: 18px; background: rgba(12,14,12,.72); backdrop-filter: blur(18px); border: 1px solid rgba(255,255,255,.13); border-radius: var(--radius); }.ar-copy h2 { font-size: 21px; }.ar-copy p:last-child { margin-bottom: 0; font-size: 11px; }
.ar-tabs { position: absolute; left: 24px; right: 24px; bottom: 82px; padding: 4px; display: grid; grid-template-columns: repeat(4,1fr); background: rgba(12,14,12,.72); backdrop-filter: blur(18px); border-radius: var(--radius); }.ar-tabs button { min-height: 44px; border-radius: 3px; background: transparent; color: var(--muted); font-size: 11px; }.ar-tabs button.active { background: var(--acid); color: #171915; font-weight: 800; }
.ar-disclaimer { position: absolute; left: 0; right: 0; bottom: 24px; margin: 0; color: rgba(255,255,255,.54); text-align: center; font-size: 9px; }

.toast { max-width: min(420px, calc(100% - 32px)); min-height: 44px; padding: 12px 16px; position: fixed; left: 50%; bottom: 24px; z-index: 100; transform: translate(-50%, 20px); display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: #171915; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity 180ms ease, transform 260ms cubic-bezier(.16,1,.3,1); font-size: 12px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.insight-dialog { width: min(760px, calc(100% - 24px)); }
.insight-sheet { max-height: calc(100dvh - 32px); overflow-y: auto; padding: 30px; }
.insight-sheet-header { align-items: flex-start; }
.insight-sheet-header h2 { max-width: 610px; margin-bottom: 0; font-size: 38px; }
.insight-status-line { margin: 18px 0 0; padding: 11px 0; display: flex; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.insight-trust-band { margin-top: 20px; padding: 15px 0; display: grid; grid-template-columns: minmax(130px,.42fr) 1fr; gap: 18px; align-items: center; border-bottom: 1px solid var(--line); }
.insight-trust-band > div { display: grid; gap: 4px; }
.insight-trust-band small { color: var(--muted); font-size: 9px; }
.insight-trust-band strong { color: var(--amber); font-family: var(--serif); font-size: 18px; }
.insight-trust-band[data-level="broad"] strong { color: var(--acid); }
.insight-trust-band[data-level="limited"] strong { color: var(--blue); }
.insight-trust-band p { margin: 0; color: var(--ink); font-size: 11px; line-height: 1.55; }
.insight-trust-boundary { margin: 9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.insight-summary { margin: 24px 0 4px; color: var(--ink); font-family: var(--serif); font-size: 18px; line-height: 1.62; }
.insight-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.insight-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.insight-section h3, .insight-action-block h3 { margin: 0; font-family: var(--serif); font-size: 17px; }
.insight-section-heading small { color: var(--muted); font-size: 10px; }
.insight-evidence-list { margin-top: 8px; }
.insight-evidence-row { min-height: 60px; padding: 12px 0; display: grid; grid-template-columns: 88px 1fr; align-items: start; gap: 14px; border-bottom: 1px solid rgba(238,232,220,.08); }
.insight-evidence-row:last-child { border-bottom: 0; }
.insight-evidence-row p { margin: 0; color: var(--ink); font-size: 12px; line-height: 1.6; }
.insight-evidence-content { min-width: 0; }
.classical-citation { margin-top: 10px; border-top: 1px solid rgba(185,154,98,.22); }
.classical-citation summary { min-height: 44px; display: flex; align-items: center; gap: 8px; color: var(--amber); cursor: pointer; font-size: 11px; font-weight: 700; list-style: none; user-select: none; }
.classical-citation summary::-webkit-details-marker { display: none; }
.classical-citation summary::before { content: "+"; width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid rgba(185,154,98,.48); color: var(--amber); font: 700 12px/1 ui-monospace, monospace; }
.classical-citation[open] summary::before { content: "−"; }
.classical-citation summary:active { opacity: .68; }
.classical-citation summary:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.classical-citation-body { padding: 2px 0 14px 26px; }
.classical-citation-body .classical-interpretation { color: var(--paper); }
.classical-passage { margin-top: 12px; padding-left: 12px; border-left: 2px solid rgba(185,154,98,.52); }
.classical-passage strong, .classical-passage small { display: block; }
.classical-passage strong { color: var(--paper); font-size: 11px; }
.classical-passage small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.classical-passage blockquote { margin: 9px 0; color: var(--ink); font-family: var(--serif); font-size: 13px; line-height: 1.75; }
.classical-passage a { color: var(--blue); font-size: 10px; text-underline-offset: 3px; }
.classical-citation-body .classical-relationship { margin-top: 10px; padding: 8px 10px; border-left: 2px solid var(--amber); color: var(--paper); background: rgba(185,154,98,.07); font-size: 10px; }
.classical-citation-body .classical-relationship.conflicts_with { border-left-color: var(--coral); }
.classical-citation-body .classical-status, .classical-citation-body .classical-boundary { margin-top: 10px; color: var(--muted); font-size: 9px; }
.evidence-kind { min-height: 24px; padding: 4px 7px; display: inline-grid; place-items: center; justify-self: start; border: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.evidence-kind.observed { border-color: rgba(157,180,159,.5); color: var(--mint); }
.evidence-kind.calculated { border-color: rgba(129,156,160,.58); color: var(--blue); }
.evidence-kind.symbolic { border-color: rgba(185,154,98,.58); color: var(--amber); }
.evidence-kind.scenario { border-color: rgba(196,91,70,.58); color: #d88776; }
.insight-counterpoint { padding-left: 16px; border-left: 2px solid var(--coral); border-top-color: transparent; }
.insight-counterpoint p:last-child { margin-bottom: 0; color: var(--ink); font-size: 12px; }
.insight-uncertainties { margin: 12px 0 0; padding: 0; list-style: none; }
.insight-uncertainties li { padding: 8px 0 8px 18px; position: relative; color: var(--muted); font-size: 12px; line-height: 1.55; }
.insight-uncertainties li::before { content: "未"; position: absolute; left: 0; top: 8px; color: var(--amber); font-family: var(--serif); font-size: 10px; }
html[lang="en"] .insight-uncertainties li::before { content: "?"; }
.insight-action-block { margin-top: 24px; padding: 20px; display: grid; grid-template-columns: 1fr auto; gap: 18px; background: var(--paper); color: #211e19; }
.insight-action-block .overline, .insight-action-block p { color: #665f55; }
.insight-action-block p:last-child { margin: 8px 0 0; font-size: 12px; }
.insight-action-block > span { align-self: start; padding: 6px 8px; border: 1px solid rgba(33,30,25,.18); color: #514b42; font-size: 10px; white-space: nowrap; }
.insight-followup { width: 100%; min-height: 64px; margin-top: 14px; padding: 12px 0; display: grid; grid-template-columns: 100px 1fr; align-items: center; gap: 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.insight-followup span { color: var(--coral); font-size: 10px; font-weight: 750; }
.insight-followup strong { font-family: var(--serif); font-size: 14px; line-height: 1.45; }
.insight-actions { margin-top: 22px; display: flex; justify-content: flex-end; gap: 8px; }
.insight-actions button:disabled { opacity: .45; cursor: wait; }
.insight-unavailable { margin: 24px 0 4px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.insight-unavailable strong { font-family: var(--serif); font-size: 20px; }
.insight-unavailable p { margin: 8px 0 0; }
.insight-history-dialog { width: min(700px, calc(100% - 24px)); }
.insight-history-sheet { max-height: calc(100dvh - 32px); overflow-y: auto; }
.history-intro { max-width: 550px; margin: 20px 0; font-size: 11px; }
.insight-history-list { border-top: 1px solid var(--line); }
.insight-history-item { width: 100%; min-height: 100px; padding: 16px 0; display: grid; gap: 6px; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.insight-history-item:hover { background: rgba(238,232,220,.035); }
.insight-history-item span { color: var(--coral); font-size: 9px; }
.insight-history-item strong { font-family: var(--serif); font-size: 17px; }
.insight-history-item small { max-width: 580px; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.history-empty { padding: 36px 0; text-align: center; }

/* FateOS cultural system: ink, rice paper, cinnabar seals, and calibrated data. */
.skip-link { position: fixed; left: 16px; top: 12px; z-index: 120; padding: 10px 14px; background: var(--paper); color: #211e19; transform: translateY(-160%); transition: transform 160ms ease; }
.skip-link:focus { transform: translateY(0); }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1; opacity: .18; background-image: repeating-linear-gradient(0deg, transparent 0 3px, rgba(238,232,220,.018) 3px 4px); }
.stage { width: 100%; max-width: 1580px; margin: 0 auto; }
.brand strong { font-family: Georgia, var(--serif); font-weight: 700; }
.brand small { color: #c9bdae; }
.overline { text-transform: none; font-weight: 650; }
.language-switch { min-width: 86px; height: 44px; padding: 4px 9px; display: grid; grid-template-columns: 1fr 1px 1fr; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 700; }
.language-switch i { width: 1px; height: 16px; background: var(--line); }
.language-switch span:first-child { color: var(--paper); }
html[lang="en"] .language-switch span:first-child { color: var(--muted); }
html[lang="en"] .language-switch span:last-child { color: var(--paper); }

.evidence-path { margin-bottom: 18px; padding: 20px 0 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.evidence-path-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.evidence-path-heading h2 { margin: 0; font-size: 22px; }
.seal-status, .demo-stamp { display: inline-grid; place-items: center; border: 1px solid var(--coral); color: var(--coral); font-family: var(--serif); font-style: normal; transform: rotate(-2deg); }
.seal-status { min-width: 58px; min-height: 32px; padding: 4px 8px; font-size: 12px; }
.evidence-steps { margin-top: 18px; display: grid; grid-template-columns: repeat(4, 1fr); }
.evidence-steps button { min-height: 58px; padding: 0 18px; display: grid; grid-template-columns: 28px 1fr; grid-template-rows: 1fr 1fr; align-items: center; border-left: 1px solid var(--line); background: transparent; text-align: left; }
.evidence-steps button:last-child { border-right: 1px solid var(--line); }
.evidence-steps button:hover { background: rgba(238,232,220,.035); }
.evidence-steps button > span { grid-row: 1 / 3; color: var(--coral); font-family: var(--serif); font-size: 18px; }
.evidence-steps small { align-self: end; color: var(--muted); }
.evidence-steps strong { align-self: start; color: var(--paper); font-size: 12px; }
.evidence-path-note { max-width: 760px; margin: 16px 0 0; font-size: 11px; }

.weather-panel { border: 0; background-color: #e7dfd1; background-image: linear-gradient(rgba(54,48,39,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(54,48,39,.055) 1px, transparent 1px); color: #211e19; box-shadow: inset 0 0 0 1px rgba(255,255,255,.38); }
.weather-panel::after { content: ""; width: 108px; height: 108px; position: absolute; right: -32px; top: -36px; border: 1px solid rgba(196,91,70,.34); transform: rotate(12deg); }
.vertical-chapter { position: absolute; left: 14px; top: 18px; color: rgba(196,91,70,.78); font-family: var(--serif); font-size: 11px; writing-mode: vertical-rl; }
.weather-copy .overline, .weather-copy > p { color: #6d655a; }
.weather-copy h2 { color: #211e19; }
.weather-meta { color: #514b42; }
.orbit-ring { border-color: rgba(69,87,72,.48); }
.ring-b { border-color: rgba(196,91,70,.38); }
.orbit-core { background: var(--coral); color: #fff8ed; box-shadow: none; }
.dot-b { background: #667d69; }
.window-panel { border-top: 3px solid var(--coral); }
.trend-up, .text-button, .checkin-panel .section-heading > span, .source-row strong { color: var(--mint); }
.timeline i.active { background: var(--coral); box-shadow: 0 0 0 5px rgba(196,91,70,.12); }
.legend-candle, .driver-row i, .completeness i { background: var(--mint); }
.action-panel { position: relative; }
.action-panel::after { content: "行"; width: 42px; height: 42px; position: absolute; right: 20px; bottom: 18px; display: grid; place-items: center; border: 1px solid rgba(196,91,70,.7); color: rgba(196,91,70,.86); font-family: var(--serif); font-size: 22px; transform: rotate(-4deg); }
html[lang="en"] .action-panel::after { content: "ACT"; }
.action-panel .primary { background: #211e19; color: var(--paper); }
.palm-entry small { color: #c98a77; }
.palm-entry { background: #29251f; }
.market-panel { position: relative; overflow: hidden; }
.market-panel::before { content: "节气刻度"; position: absolute; right: 20px; top: 18px; color: rgba(238,232,220,.18); font-family: var(--serif); font-size: 11px; writing-mode: vertical-rl; }
html[lang="en"] .market-panel::before { content: "SOLAR SCALE"; }
.market-summary > div { position: relative; }
.demo-stamp { margin-left: 12px; min-height: 26px; padding: 3px 7px; font-size: 10px; vertical-align: middle; }
.chart-legend b { font-weight: 500; }
.scenario.selected { background: var(--paper); box-shadow: inset 3px 0 0 var(--coral); }
.scenario-detail { margin: 14px 0 0; padding-top: 13px; border-top: 1px solid var(--line); font-size: 11px; line-height: 1.55; }
.notification-popover { width: min(340px, calc(100vw - 32px)); padding: 18px; position: absolute; z-index: 20; top: 64px; right: 0; border: 1px solid var(--line); border-radius: 6px; background: rgba(31,34,29,.98); box-shadow: var(--shadow); }
.notification-popover[hidden] { display: none; }
.notification-popover strong { font-family: var(--serif); font-size: 18px; }
.notification-popover p:not(.overline) { margin: 12px 0 16px; font-size: 11px; line-height: 1.6; }
.notification-button.enabled { color: var(--coral); box-shadow: inset 0 0 0 1px rgba(196,91,70,.5); }
.action-review { margin-top: 18px; padding-top: 15px; border-top: 1px solid rgba(33,30,25,.18); position: relative; z-index: 1; }
.action-review p { margin: 0 0 10px; color: #4e493f; font-size: 11px; }
.action-review > div { display: flex; gap: 6px; }
.action-review button { min-height: 44px; padding: 0 10px; border: 1px solid rgba(33,30,25,.18); border-radius: 3px; background: transparent; color: #4e493f; font-size: 10px; }
.action-review button.selected { border-color: #211e19; background: #211e19; color: var(--paper); }
.confirm-dialog { width: min(520px, calc(100% - 24px)); margin: auto; }
.delete-confirm-label { margin-top: 18px; display: grid; gap: 8px; color: var(--muted); font-size: 11px; }
.delete-confirm-label input { height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-2); color: var(--ink); }
.confirm-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 8px; }
.danger-button { min-height: 44px; padding: 0 16px; border-radius: 4px; background: var(--danger); color: white; }
.danger-button:disabled { opacity: .35; cursor: not-allowed; }
.palm-map-panel { border: 0; background-color: #171613; background-image: linear-gradient(rgba(238,232,220,.032) 1px, transparent 1px), linear-gradient(90deg, rgba(238,232,220,.032) 1px, transparent 1px); }
.palm-insights { border-top: 3px solid var(--coral); }
.guide-mark { border-radius: 2px; background: var(--coral); color: #fff8ed; }
.send-button { border-radius: 3px; background: var(--coral); color: #fff8ed; }
.avatar, .large-avatar { border-radius: 3px; background: var(--coral); color: #fff8ed; font-family: var(--serif); }
.profile-chip .avatar { border-radius: 2px; }
html[lang="en"] h1, html[lang="en"] h2 { font-family: Georgia, "Times New Roman", serif; }
html[lang="en"] .weather-panel { grid-template-columns: minmax(0, 1.25fr) 210px; }
html[lang="en"] .weather-copy h2 { max-width: 520px; font-size: 45px; line-height: .99; }
.privacy-badges { margin: -10px 0 28px; display: flex; flex-wrap: wrap; gap: 7px; }
.privacy-badges span { min-height: 28px; padding: 6px 8px; border: 1px solid var(--line); color: var(--muted); font-size: 9px; }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 84px minmax(0,1fr); }
  .rail { padding: 20px 14px; }
  .brand > span:not(.brand-seal), .profile-chip > span, .nav-button span:last-child { display: none; }
  .brand, .profile-chip, .nav-button { justify-content: center; }
  .main-nav { padding-top: 58px; }
  .today-layout, .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .trend-panel { grid-column: 1/-1; }
  .palm-workspace { grid-template-columns: minmax(0,1.15fr) minmax(280px,.85fr); }
}

@media (max-width: 760px) {
  .app-shell { display: block; padding-bottom: 76px; }
  .rail { min-height: 0; height: 70px; padding: 6px 10px calc(6px + env(safe-area-inset-bottom)); position: fixed; left: 0; right: 0; top: auto; bottom: 0; display: block; border-right: 0; border-top: 1px solid var(--line); background: rgba(17,19,16,.92); backdrop-filter: blur(24px); }
  .brand, .profile-chip { display: none; }
  .main-nav { height: 100%; padding: 0; display: grid; grid-template-columns: repeat(5,1fr); align-items: center; gap: 2px; }
  .nav-button { min-height: 54px; padding: 5px 0; display: grid; place-content: center; gap: 3px; border-radius: 4px; font-size: 9px; }
  .nav-button span:last-child { display: block; }.nav-icon { width: auto; font-size: 16px; }
  .stage { padding: 20px 16px 42px; }
  .chapter-seal { width: 30px; height: 30px; font-size: 17px; }
  .evidence-path { padding-top: 14px; }
  .evidence-path-heading h2 { font-size: 20px; }
  .evidence-steps { grid-template-columns: 1fr 1fr; }
  .evidence-steps button:nth-child(3) { border-top: 1px solid var(--line); }
  .evidence-steps button:nth-child(4) { border-top: 1px solid var(--line); border-right: 1px solid var(--line); }
  .evidence-steps button { padding: 0 12px; }
  .topbar { margin-bottom: 24px; align-items: center; }.topbar .overline { display: none; }.topbar h1 { font-size: 30px; }
  .top-actions .notification-button { display: none; }.primary.compact { display: none; }
  .notification-popover { position: fixed; top: 74px; right: 16px; }
  .today-layout, .dashboard-grid, .evidence-layout, .palm-workspace, .ask-layout, .profile-layout { grid-template-columns: 1fr; }
  .weather-panel { min-height: 420px; padding: 28px 24px; grid-template-columns: 1fr; align-items: start; }.weather-copy h2 { font-size: 40px; line-height: 1.02; }.orbit-visual { width: 180px; position: absolute; right: -12px; bottom: -8px; opacity: .72; }
  html[lang="en"] .weather-panel { min-height: 420px; grid-template-columns: 1fr; }
  html[lang="en"] .weather-copy { max-width: 100%; }
  html[lang="en"] .weather-copy h2 { max-width: 100%; font-size: 36px; line-height: 1.02; }
  html[lang="en"] .weather-copy > p { max-width: 285px; }
  .window-panel { min-height: 210px; }.dashboard-grid { display: grid; }.trend-panel { grid-column: auto; padding: 22px; }.action-panel h2 { margin-top: 20px; }
  .palm-entry { min-height: 210px; }.palm-entry img { height: 210px; }.palm-entry > span { padding: 24px 18px 20px 0; }.palm-entry strong { font-size: 19px; }
  .trend-toolbar { display: grid; grid-template-columns: 1fr; overflow: visible; gap: 8px; }
  .trend-toolbar .segmented { width: 100%; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .trend-toolbar .segmented button { min-width: 0; padding-inline: 6px; }
  .domain-switch { flex: none; }
  .market-panel { overflow: hidden; }.market-summary { grid-template-columns: 1fr; gap: 14px; }.market-summary > p { max-width: 100%; }.market-summary > p .ai-command { width: 100%; margin-top: 16px; }.market-panel canvas { height: 330px; }.driver-row { grid-template-columns: 96px 1fr 70px; gap: 10px; }
  .palm-map-panel { min-height: 580px; }.palm-map-stage > img { height: 480px; }.palm-insights > h2 { margin-top: 18px; }.line-hotspot.heart { left: 65%; }.line-hotspot.head { left: 65%; }
  .palm-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .palm-controls button { min-width: 0; min-height: 52px; padding-inline: 12px; line-height: 1.15; }
  .source-panel { order: initial; padding: 24px; }.source-panel .source-row { display: flex; }.source-panel .source-caption { margin: 18px 0 0; }.conversation { min-height: 620px; }.guide-intro h2 { font-size: 26px; }
  .identity-header { gap: 16px; }.large-avatar { width: 64px; height: 72px; flex: 0 0 auto; }.identity-header h2 { font-size: 30px; line-height: 1.06; }
  .form-grid { grid-template-columns: 1fr; }.form-grid label.wide { grid-column: auto; }
  .event-journal { grid-template-columns: 1fr; }.event-entry + .event-entry { padding-left: 0; border-left: 0; }
  .sheet-dialog { width: calc(100vw - 16px); max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); inset: auto auto 0 8px; margin: 0; }
  .sheet-content { padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); border-radius: 12px 12px 0 0; transform-origin: 50% 100%; animation-name: sheet-rise; }
  .assessment-choices { grid-template-columns: 1fr; }
  @keyframes sheet-rise { from { opacity: .72; transform: translateY(24px); } to { opacity: 1; transform: none; } }
  .scanner-dialog, .ar-dialog { width: 100vw; max-width: none; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .insight-dialog, .insight-history-dialog { width: calc(100vw - 16px); max-width: calc(100vw - 16px); }
  .insight-sheet, .insight-history-sheet { max-height: calc(100dvh - 16px); padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); }
  .insight-sheet-header h2 { font-size: 30px; }
  .insight-trust-band { grid-template-columns: 1fr; gap: 9px; }
  .insight-evidence-row { grid-template-columns: 78px 1fr; gap: 10px; }
  .classical-citation-body { padding-left: 0; }
  .insight-action-block { grid-template-columns: 1fr; }
  .insight-action-block > span { justify-self: start; }
  .insight-followup { grid-template-columns: 82px 1fr; }
}
/* Final cascade guard: legacy visual-direction rules above intentionally stay for compatibility,
   while these tokens win for the v2 light/dark surfaces. */
.app-shell { display: block; }
.rail { width: 100%; height: 96px; min-height: 0; padding: 0 clamp(24px, 4vw, 64px); position: sticky; inset: 0 0 auto; display: flex; align-items: center; gap: clamp(28px, 5vw, 80px); background: var(--rail); border: 0; border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.35) blur(22px); -webkit-backdrop-filter: saturate(1.35) blur(22px); }
.brand-seal { width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--acid); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.26), inset 0 0 0 5px rgba(255,255,255,.08); }
.brand strong { color: var(--ink); font-size: 21px; }
.brand small { color: var(--muted); }
.main-nav { max-width: 730px; height: 100%; margin: 0 auto; padding: 0; flex: 1 1 auto; display: grid; grid-template-columns: repeat(5, minmax(74px, 1fr)); align-content: stretch; gap: clamp(2px, 1vw, 14px); }
.nav-button { min-height: 0; height: 100%; padding: 0 10px; justify-content: center; gap: 8px; border: 0; border-bottom: 2px solid transparent; border-left: 0; border-radius: 0; background: transparent; color: var(--muted); box-shadow: none; }
.nav-button:hover { color: var(--ink); background: var(--panel-glow); }
.nav-button.active { color: var(--acid); border-color: var(--acid); background: transparent; box-shadow: none; }
.nav-icon { width: auto; color: inherit; font-size: 14px; }
.profile-chip { max-width: 160px; padding: 10px 0 10px 16px; border: 0; border-left: 1px solid var(--line); border-top: 0; }
.profile-chip strong { color: var(--ink); }
.profile-chip .avatar { border-radius: 50%; background: var(--coral); color: #fff; }
.stage { max-width: 1480px; padding: 34px clamp(24px, 4.4vw, 72px) 88px; }
.topbar { align-items: center; margin-bottom: 32px; padding: 0 0 24px; border-bottom: 1px solid var(--line); }
.top-actions { padding-top: 0; }
.appearance-switch, .language-switch { border-color: var(--line); background: var(--surface); color: var(--muted); }
.weather-panel { min-height: 390px; border-color: var(--line); background-color: var(--surface); background-image: radial-gradient(circle at 65% 55%, var(--panel-glow), transparent 34%), linear-gradient(var(--hairline) 1px, transparent 1px), linear-gradient(90deg, var(--hairline) 1px, transparent 1px); background-size: auto, 28px 28px, 28px 28px; box-shadow: none; }
.weather-panel::after { border-color: color-mix(in srgb, var(--amber) 48%, transparent); }
.weather-copy .overline, .weather-copy > p { color: var(--muted); }
.weather-copy h2 { color: var(--ink); }
.weather-meta { color: var(--muted); }
.orbit-ring { border-color: color-mix(in srgb, var(--acid) 48%, transparent); }
.ring-b { border-color: color-mix(in srgb, var(--amber) 52%, transparent); }
.orbit-core { background: var(--acid); color: #fff; }
.dot-b { background: var(--amber); }
.window-panel { background: var(--surface); }
.trend-panel, .checkin-panel, .event-panel, .market-panel, .drivers-panel, .scenario-panel, .palm-insights, .conversation, .source-panel, .identity-panel, .settings-panel { border-color: var(--line); background: var(--surface); }
.action-panel { background: var(--paper); }
.action-panel h2 { color: #17201c; }
.action-panel .overline, .action-panel p, .action-review p { color: #646b66; }
.palm-entry { border-color: var(--line); background: linear-gradient(135deg, var(--surface), var(--surface-2)); }
.segmented { background: var(--surface); }
.segmented button.active { background: var(--surface-2); color: var(--ink); }
.market-panel::before { color: color-mix(in srgb, var(--muted) 36%, transparent); }
.driver-row > div { background: var(--surface-3); }
.scenario { background: var(--surface-2); }
.scenario.selected { background: var(--ink); color: var(--bg); }
.ai-command { border-color: color-mix(in srgb, var(--coral) 58%, transparent); background: color-mix(in srgb, var(--coral) 9%, transparent); color: var(--coral); }
.palm-map-panel { border-color: var(--line); background-color: var(--surface); background-image: radial-gradient(circle at center, var(--panel-glow), transparent 48%), linear-gradient(var(--hairline) 1px, transparent 1px), linear-gradient(90deg, var(--hairline) 1px, transparent 1px); }
.palm-insights { background: var(--surface); }
.line-hotspot { background: var(--acid) padding-box; box-shadow: 0 0 0 6px color-mix(in srgb, var(--acid) 16%, transparent); }
.conversation, .source-panel { background: var(--surface); }
.message { background: var(--surface-2); color: var(--ink); }
.message.user { background: var(--acid); color: #fff; }
.ask-form { background: var(--surface-2); }
.identity-panel, .settings-panel { background: var(--surface); }
.avatar, .large-avatar { background: var(--coral); color: #fff; }
.notification-popover, .sheet-content { background: var(--surface); color: var(--ink); }
.form-grid input, .form-grid select, .form-grid textarea, .delete-confirm-label input { background: var(--surface-2); color: var(--ink); }
.toast { background: var(--ink); color: var(--bg); }

@media (max-width: 1050px) and (min-width: 761px) {
  .app-shell { display: block; }
  .rail { height: 88px; padding-inline: 24px; }
  .brand > span:not(.brand-seal), .profile-chip > span { display: none; }
  .brand, .profile-chip, .nav-button { justify-content: center; }
  .main-nav { padding: 0; }
  .profile-chip { width: 46px; padding-left: 10px; }
  .stage { padding-inline: 32px; }
}

@media (max-width: 760px) {
  .app-shell { display: block; padding-bottom: 78px; }
  .rail { height: 72px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); position: fixed; inset: auto 0 0; display: block; border: 0; border-top: 1px solid var(--line); background: var(--glass); backdrop-filter: saturate(1.35) blur(24px); }
  .brand, .profile-chip { display: none; }
  .main-nav { max-width: none; height: 100%; margin: 0; padding: 0; grid-template-columns: repeat(5, 1fr); gap: 2px; }
  .nav-button { min-height: 54px; height: 54px; padding: 5px 0; display: grid; place-content: center; gap: 3px; border: 0; border-top: 2px solid transparent; font-size: 9px; }
  .nav-button.active { border-top-color: var(--acid); border-bottom-color: transparent; }
  .stage { padding: 20px 16px 44px; }
  .topbar { align-items: center; margin-bottom: 22px; padding-bottom: 18px; }
  .topbar h1 { font-size: 34px; }
  .appearance-switch { min-width: 44px; width: 44px; padding: 0; display: grid; grid-template-columns: 1fr; }
  .appearance-switch small { display: none; }
  .today-layout, .dashboard-grid, .evidence-layout, .palm-workspace, .ask-layout, .profile-layout { grid-template-columns: 1fr; }
  .weather-panel { min-height: 430px; padding: 30px 24px; }
  .weather-copy h2 { max-width: 320px; font-size: 43px; }
  .window-panel { min-height: 220px; }
  .palm-map-panel { min-height: 560px; }
  .palm-map-stage > img { height: 460px; }
  .conversation { min-height: 620px; }
}


/* FateOS visual system v2: translated from the generated observatory references. */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6f2;
  --rail: rgba(255, 255, 255, .9);
  --surface: #ffffff;
  --surface-2: #edf2ee;
  --surface-3: #e2eae5;
  --paper: #f5f0e7;
  --ink: #17201c;
  --muted: #68736d;
  --line: rgba(23, 32, 28, .12);
  --acid: #247d68;
  --mint: #247d68;
  --coral: #d45645;
  --amber: #b59a68;
  --blue: #557f79;
  --danger: #bd4438;
  --shadow: 0 24px 70px rgba(35, 49, 42, .10);
  --hairline: rgba(23, 32, 28, .08);
  --glass: rgba(255, 255, 255, .84);
  --panel-glow: rgba(36, 125, 104, .07);
  --reverse-ink: #f2f1ea;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111714;
  --rail: rgba(17, 23, 20, .91);
  --surface: #1b2420;
  --surface-2: #222e28;
  --surface-3: #2b3932;
  --paper: #f2f1ea;
  --ink: #f2f1ea;
  --muted: #a6b0aa;
  --line: rgba(242, 241, 234, .14);
  --acid: #4eb49a;
  --mint: #4eb49a;
  --coral: #e26d58;
  --amber: #c4a66a;
  --blue: #83aaa2;
  --danger: #ef7565;
  --shadow: 0 28px 90px rgba(0, 0, 0, .38);
  --hairline: rgba(242, 241, 234, .08);
  --glass: rgba(17, 23, 20, .84);
  --panel-glow: rgba(78, 180, 154, .07);
  --reverse-ink: #17201c;
}

html, body { background: var(--bg); }
body { color: var(--ink); transition: background-color 240ms ease, color 240ms ease; }
body::before {
  opacity: .48;
  background-image: radial-gradient(circle at 1px 1px, var(--hairline) .7px, transparent .8px);
  background-size: 18px 18px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.38), transparent 70%);
}
h1, h2 { color: var(--ink); }
button { -webkit-tap-highlight-color: transparent; }
.app-shell { min-height: 100dvh; display: block; }

.rail {
  width: 100%;
  min-height: 0;
  height: 96px;
  padding: 0 clamp(24px, 4vw, 64px);
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  gap: clamp(28px, 5vw, 80px);
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--rail);
  backdrop-filter: saturate(1.35) blur(22px);
  -webkit-backdrop-filter: saturate(1.35) blur(22px);
  z-index: 40;
}
.brand { flex: 0 0 auto; gap: 13px; }
.brand-seal {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--acid);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.26), inset 0 0 0 5px rgba(255,255,255,.08);
}
.brand strong { color: var(--ink); font-size: 21px; }
.brand small { color: var(--muted); font-size: 10px; letter-spacing: .16em; }
.main-nav {
  max-width: 730px;
  height: 100%;
  margin: 0 auto;
  padding: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(74px, 1fr));
  align-content: stretch;
  gap: clamp(2px, 1vw, 14px);
}
.nav-button {
  min-height: 0;
  height: 100%;
  padding: 0 10px;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  font-weight: 600;
}
.nav-button:hover { color: var(--ink); background: var(--panel-glow); }
.nav-button.active { color: var(--acid); border-color: var(--acid); background: transparent; box-shadow: none; }
.nav-icon { width: auto; color: inherit; font-size: 14px; }
.profile-chip {
  max-width: 160px;
  padding: 10px 0 10px 16px;
  flex: 0 1 auto;
  border: 0;
  border-left: 1px solid var(--line);
}
.profile-chip:hover { background: transparent; opacity: .72; }
.profile-chip .avatar { border-radius: 50%; background: var(--coral); color: white; }
.profile-chip strong { color: var(--ink); }

.stage { max-width: 1480px; padding: 34px clamp(24px, 4.4vw, 72px) 88px; }
.topbar { align-items: center; margin-bottom: 32px; padding: 0 0 24px; border-bottom: 1px solid var(--line); }
.title-lockup { gap: 14px; }
.chapter-seal { width: 34px; height: 34px; border-color: var(--coral); color: var(--coral); font-size: 18px; }
h1 { font-size: clamp(40px, 4vw, 58px); }
h2 { font-size: 27px; }
.top-actions { padding: 0; }
.appearance-switch, .language-switch {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
}
.appearance-switch {
  min-width: 72px;
  padding: 4px 10px;
  display: grid;
  grid-template-columns: 20px auto;
  place-items: center;
  gap: 5px;
}
.appearance-switch span { color: var(--ink); font-size: 18px; line-height: 1; }
.appearance-switch small { font-size: 10px; white-space: nowrap; }
.language-switch span:first-child { color: var(--ink); }
html[lang="en"] .language-switch span:first-child { color: var(--muted); }
html[lang="en"] .language-switch span:last-child { color: var(--ink); }
.icon-button, .close-button { background: var(--surface-2); color: var(--ink); }
.icon-button:hover { background: var(--surface-3); }
.primary { background: var(--coral); color: #fff; }
.secondary { background: var(--surface-2); color: var(--ink); }
.secondary:hover { background: var(--surface-3); }
.text-button, .trend-up, .checkin-panel .section-heading > span, .source-row strong { color: var(--acid); }

.weather-panel, .window-panel, .trend-panel, .action-panel, .checkin-panel, .event-panel, .market-panel,
.drivers-panel, .scenario-panel, .palm-map-panel, .palm-insights, .conversation, .source-panel,
.identity-panel, .settings-panel {
  border-color: var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: none;
}
.evidence-path { margin-bottom: 20px; padding: 22px 0; }
.evidence-path-heading h2 { font-size: 24px; }
.seal-status { color: var(--coral); }
.evidence-steps { border-color: var(--line); background: var(--surface); }
.evidence-steps button { border-color: var(--line); background: transparent; }
.evidence-steps button:hover { background: var(--surface-2); }
.evidence-steps strong { color: var(--ink); }

.today-layout { grid-template-columns: minmax(0, 1.65fr) minmax(280px, .72fr); gap: 12px; }
.weather-panel {
  min-height: 390px;
  border: 1px solid var(--line);
  color: var(--ink);
  background-color: var(--surface);
  background-image: radial-gradient(circle at 65% 55%, var(--panel-glow), transparent 34%), linear-gradient(var(--hairline) 1px, transparent 1px), linear-gradient(90deg, var(--hairline) 1px, transparent 1px);
  background-size: auto, 28px 28px, 28px 28px;
  box-shadow: none;
}
.weather-panel::after { width: 100px; height: 100px; border-color: color-mix(in srgb, var(--amber) 48%, transparent); }
.weather-copy .overline, .weather-copy > p { color: var(--muted); }
.weather-copy h2 { max-width: 620px; margin-top: 18px; color: var(--ink); font-size: clamp(46px, 5vw, 70px); }
.weather-meta { color: var(--muted); }
.orbit-ring { border-color: color-mix(in srgb, var(--acid) 48%, transparent); }
.ring-b { border-color: color-mix(in srgb, var(--amber) 52%, transparent); }
.orbit-core { background: var(--acid); color: #fff; }
.dot-b { background: var(--amber); }
.window-panel { min-height: 390px; padding: 30px; border-top: 2px solid var(--coral); background: var(--surface); }
.window-panel h2 { color: var(--ink); }
.dashboard-grid { gap: 12px; }
.trend-panel, .checkin-panel, .event-panel { background: var(--surface); }
.action-panel { background: var(--paper); color: #17201c; }
.action-panel h2 { color: #17201c; }
.action-panel .overline, .action-panel p, .action-review p { color: #646b66; }
.action-panel .primary { background: #17201c; color: #f2f1ea; }
.action-review { border-color: rgba(23,32,28,.16); }
.action-review button { border-color: rgba(23,32,28,.18); color: #4f5953; }
.action-review button.selected { border-color: #17201c; background: #17201c; color: #f2f1ea; }
.checkin-panel label { color: var(--ink); }
.event-entry strong { color: var(--ink); }
.event-remove:hover { color: var(--ink); }
.palm-entry { border-color: var(--line); background: linear-gradient(135deg, var(--surface), var(--surface-2)); }
.palm-entry img { filter: saturate(.78); }
.palm-entry small { color: var(--coral); }

.segmented { background: var(--surface); }
.segmented button.active { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hairline); }
.market-panel { background: var(--surface); }
.market-panel::before { color: color-mix(in srgb, var(--muted) 36%, transparent); }
.driver-row > div { background: var(--surface-3); }
.scenario { background: var(--surface-2); color: var(--muted); }
.scenario.selected { background: var(--ink); color: var(--bg); box-shadow: inset 3px 0 0 var(--coral); }
.ai-command { border-color: color-mix(in srgb, var(--coral) 58%, transparent); background: color-mix(in srgb, var(--coral) 9%, transparent); color: var(--coral); }

.palm-workspace { gap: 12px; }
.palm-map-panel {
  border: 1px solid var(--line);
  background-color: var(--surface);
  background-image: radial-gradient(circle at center, var(--panel-glow), transparent 48%), linear-gradient(var(--hairline) 1px, transparent 1px), linear-gradient(90deg, var(--hairline) 1px, transparent 1px);
}
.palm-map-stage > img { filter: saturate(.72) contrast(.96); }
.line-hotspot { background: var(--acid) padding-box; box-shadow: 0 0 0 6px color-mix(in srgb, var(--acid) 16%, transparent); }
.palm-insights { border-top-color: var(--coral); background: var(--surface); }
.line-list button { color: var(--ink); }
.guide-mark, .send-button { background: var(--coral); color: #fff; }
.conversation, .source-panel { background: var(--surface); }
.message { background: var(--surface-2); color: var(--ink); }
.message.user { background: var(--acid); color: #fff; }
.message .evidence { border-color: var(--line); }
.ask-form { background: var(--surface-2); }
.identity-panel, .settings-panel { background: var(--surface); }
.avatar, .large-avatar { background: var(--coral); color: #fff; }
.privacy-badges span { background: var(--surface-2); }

.notification-popover { background: var(--glass); color: var(--ink); backdrop-filter: blur(22px); }
.sheet-content { background: var(--surface); color: var(--ink); }
.form-grid input, .form-grid select, .form-grid textarea, .delete-confirm-label input { background: var(--surface-2); color: var(--ink); }
.assessment-choices label span:hover, .insight-history-item:hover { background: var(--surface-2); }
.assessment-choices input:checked + span { color: var(--ink); border-color: var(--coral); background: color-mix(in srgb, var(--coral) 13%, var(--surface)); }
.insight-evidence-row { border-color: var(--hairline); }
.classical-citation-body .classical-interpretation, .classical-passage strong, .classical-citation-body .classical-relationship { color: var(--ink); }
.toast { background: var(--ink); color: var(--bg); }

@media (max-width: 1050px) and (min-width: 761px) {
  .app-shell { display: block; }
  .rail { height: 88px; padding-inline: 24px; }
  .brand > span:not(.brand-seal), .profile-chip > span { display: none; }
  .brand, .profile-chip, .nav-button { justify-content: center; }
  .brand-seal { width: 42px; height: 42px; }
  .main-nav { padding: 0; }
  .nav-button span:last-child { display: block; }
  .profile-chip { width: 46px; padding-left: 10px; }
  .stage { padding-inline: 32px; }
}

@media (max-width: 760px) {
  .app-shell { display: block; padding-bottom: 78px; }
  .rail {
    min-height: 0;
    height: 72px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    position: fixed;
    inset: auto 0 0;
    display: block;
    border: 0;
    border-top: 1px solid var(--line);
    background: var(--glass);
    backdrop-filter: saturate(1.35) blur(24px);
  }
  .brand, .profile-chip { display: none; }
  .main-nav { max-width: none; height: 100%; margin: 0; padding: 0; grid-template-columns: repeat(5, 1fr); gap: 2px; }
  .nav-button { min-height: 54px; height: 54px; padding: 5px 0; display: grid; place-content: center; gap: 3px; border: 0; border-top: 2px solid transparent; font-size: 9px; }
  .nav-button.active { border-top-color: var(--acid); border-bottom-color: transparent; }
  .stage { padding: 20px 16px 44px; }
  .topbar { align-items: center; margin-bottom: 22px; padding-bottom: 18px; }
  .topbar h1 { font-size: 34px; }
  .appearance-switch { min-width: 44px; width: 44px; padding: 0; display: grid; grid-template-columns: 1fr; }
  .appearance-switch small { display: none; }
  .language-switch { min-width: 78px; }
  .today-layout, .dashboard-grid, .evidence-layout, .palm-workspace, .ask-layout, .profile-layout { grid-template-columns: 1fr; }
  .weather-panel { min-height: 430px; padding: 30px 24px; }
  .weather-copy h2 { max-width: 320px; font-size: 43px; }
  .window-panel { min-height: 220px; }
  .palm-map-panel { min-height: 560px; }
  .palm-map-stage > img { height: 460px; }
  .conversation { min-height: 620px; }
  .sheet-content { background: var(--surface); }
}

@media (prefers-reduced-transparency: reduce) {
  .rail, .notification-popover { background: var(--surface); backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  html[data-theme="light"] { --line: rgba(23, 32, 28, .32); --muted: #445049; }
  html[data-theme="dark"] { --line: rgba(242, 241, 234, .34); --muted: #c5cec9; }
}

@media (max-width: 420px) {
  .weather-copy h2 { font-size: 38px; }
  html[lang="en"] .weather-copy h2 { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .scan-line, .hand-guide span { display: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .rail, .notification-popover, .ar-copy, .ar-tabs { background: #181a17; backdrop-filter: none; }
  dialog::backdrop { backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  :root { --line: rgba(255,255,255,.34); --muted: #c3c8be; }
  .rail, .ar-copy, .ar-tabs { backdrop-filter: none; }
}

/* FateOS visual direction v1: observatory log, rice paper, and one cinnabar accent. */
:root {
  --bg: #11110f;
  --rail: #151613;
  --surface: #191a17;
  --surface-2: #22231f;
  --surface-3: #2d2e29;
  --paper: #efe7d8;
  --ink: #f2ede4;
  --muted: #aaa69d;
  --line: rgba(239, 231, 216, .15);
  --acid: #9aaa8f;
  --mint: #9aaa8f;
  --coral: #b95b49;
  --amber: #bd9d67;
  --blue: #9aa8a1;
  --shadow: 0 28px 90px rgba(0, 0, 0, .38);
}

body { background: var(--bg); }
body::before { opacity: .28; background-image: repeating-linear-gradient(0deg, transparent 0 4px, rgba(239,231,216,.022) 4px 5px), repeating-linear-gradient(90deg, transparent 0 8px, rgba(239,231,216,.012) 8px 9px); }
.app-shell { grid-template-columns: 228px minmax(0, 1fr); }
.rail { padding: 30px 22px 24px; background: #151613; border-right-color: rgba(239,231,216,.12); }
.brand { gap: 13px; }
.brand-seal { width: 42px; height: 42px; border-radius: 50%; border-color: rgba(239,231,216,.6); background: transparent; color: var(--paper); box-shadow: inset 0 0 0 2px rgba(185,91,73,.35); }
.brand strong { font-size: 17px; letter-spacing: 0; }
.brand small { color: #c6bfb3; letter-spacing: 0; }
.main-nav { padding-top: 84px; gap: 8px; }
.nav-button { min-height: 52px; padding: 0 14px; border-left: 2px solid transparent; border-radius: 0; gap: 14px; }
.nav-button.active { border-left-color: var(--coral); background: rgba(185,91,73,.11); box-shadow: none; }
.nav-icon { font-size: 16px; color: #bfb9ae; }
.nav-button.active .nav-icon { color: var(--coral); }
.profile-chip { padding: 12px 8px; border-top: 1px solid var(--line); border-radius: 0; }
.profile-chip .avatar { width: 36px; height: 36px; }
.stage { max-width: 1540px; padding: 38px clamp(28px, 5vw, 78px) 84px; }
.topbar { align-items: flex-start; margin-bottom: 34px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.title-lockup { gap: 16px; }
.chapter-seal { width: 38px; height: 38px; border-color: rgba(185,91,73,.85); color: var(--coral); }
h1 { font-size: 60px; line-height: .96; }
h2 { font-size: 29px; }
.top-actions { padding-top: 2px; }
.language-switch { background: var(--surface-2); border-color: rgba(239,231,216,.2); }
.primary { background: var(--coral); }
.primary:hover { filter: brightness(1.11); }
.secondary { background: var(--surface-3); }
.evidence-path { margin-bottom: 22px; padding: 22px 0 24px; }
.evidence-path-heading h2 { font-size: 25px; }
.evidence-steps button { min-height: 66px; }
.evidence-steps button > span { font-size: 17px; }
.evidence-path-note { max-width: 820px; }
.today-layout { gap: 18px; }
.weather-panel { min-height: 404px; padding: clamp(34px, 4.6vw, 60px); background-color: var(--paper); background-image: linear-gradient(rgba(64,58,48,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(64,58,48,.06) 1px, transparent 1px); background-size: 30px 30px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.4), 0 18px 50px rgba(0,0,0,.16); }
.weather-copy { max-width: 650px; }
.weather-copy h2 { max-width: 560px; margin-top: 28px; font-size: 68px; letter-spacing: 0; }
.weather-copy > p { max-width: 520px; font-size: 14px; }
.orbit-visual { width: 250px; }
.orbit-core { width: 104px; height: 104px; background: var(--coral); }
.orbit-core strong { font-size: 34px; }
.window-panel { min-height: 404px; padding: 32px; border-top-width: 2px; background: #191a17; }
.window-panel h2 { margin-top: 24px; font-size: 35px; }
.window-panel > p { max-width: 260px; font-size: 13px; }
.timeline { margin-top: 30px; }
.dashboard-grid { margin-top: 18px; gap: 18px; }
.trend-panel, .action-panel, .checkin-panel, .event-panel, .market-panel, .drivers-panel, .scenario-panel, .palm-map-panel, .palm-insights, .conversation, .source-panel, .identity-panel, .settings-panel { border-color: rgba(239,231,216,.13); }
.trend-panel { padding: 30px; min-height: 386px; background: #181916; }
.trend-panel canvas { height: 246px; }
.action-panel { padding: 30px; background: var(--paper); }
.action-panel h2 { font-size: 34px; }
.checkin-panel { padding: 30px; background: #191a17; }
.event-panel { padding: 30px; }
.palm-entry { border-color: rgba(239,231,216,.15); background: #1c1d19; }
.palm-entry strong { font-size: 26px; }
.market-panel { background: #181916; }
.market-panel canvas { height: 440px; }
.segmented { background: #191a17; }
.segmented button.active { background: #30312c; box-shadow: inset 0 0 0 1px rgba(239,231,216,.08); }
.ai-command { border-color: rgba(185,91,73,.66); color: #d88a78; background: rgba(185,91,73,.10); }
.palm-map-panel { background-color: #151613; }
.palm-insights { background: #191a17; }
.guide-mark, .send-button { background: var(--coral); }
.settings-panel > button { min-height: 80px; }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 84px minmax(0,1fr); }
  .rail { padding: 22px 14px; }
  .main-nav { padding-top: 58px; }
  .stage { padding-inline: 32px; }
  h1 { font-size: 48px; }
  .weather-copy h2 { font-size: 58px; }
}

@media (max-width: 760px) {
  .rail { height: 72px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: rgba(21,22,19,.95); }
  .main-nav { height: 100%; padding: 0; }
  .nav-button { min-height: 54px; padding: 5px 0; border-left: 0; border-bottom: 2px solid transparent; }
  .nav-button.active { border-bottom-color: var(--coral); }
  .stage { padding: 22px 16px 44px; }
  .topbar { padding-bottom: 20px; margin-bottom: 22px; }
  .topbar h1 { font-size: 34px; }
  .weather-panel { min-height: 440px; padding: 30px 24px; }
  .weather-copy h2 { margin-top: 18px; font-size: 44px; }
  .weather-copy > p { font-size: 13px; }
  .orbit-visual { width: 188px; right: -8px; bottom: -10px; }
  .orbit-core { width: 88px; height: 88px; }
  .orbit-core strong { font-size: 29px; }
  .window-panel { min-height: 230px; padding: 24px; }
  .window-panel h2 { margin-top: 16px; font-size: 30px; }
  .trend-panel, .action-panel, .checkin-panel, .event-panel { padding: 24px; }
.palm-entry strong { font-size: 21px; }
}
/* v2 final cascade */
.app-shell { display: block; }
.rail { width: 100%; height: 96px; min-height: 0; padding: 0 clamp(24px, 4vw, 64px); position: sticky; inset: 0 0 auto; display: flex; align-items: center; gap: clamp(28px, 5vw, 80px); background: var(--rail); border: 0; border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.35) blur(22px); -webkit-backdrop-filter: saturate(1.35) blur(22px); }
.brand-seal { width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--acid); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.26), inset 0 0 0 5px rgba(255,255,255,.08); }
.brand strong { color: var(--ink); font-size: 21px; }
.brand small { color: var(--muted); }
.main-nav { max-width: 730px; height: 100%; margin: 0 auto; padding: 0; flex: 1 1 auto; display: grid; grid-template-columns: repeat(5, minmax(74px, 1fr)); align-content: stretch; gap: clamp(2px, 1vw, 14px); }
.nav-button { min-height: 0; height: 100%; padding: 0 10px; justify-content: center; gap: 8px; border: 0; border-bottom: 2px solid transparent; border-left: 0; border-radius: 0; background: transparent; color: var(--muted); box-shadow: none; }
.nav-button:hover { color: var(--ink); background: var(--panel-glow); }
.nav-button.active { color: var(--acid); border-color: var(--acid); background: transparent; box-shadow: none; }
.nav-icon { width: auto; color: inherit; font-size: 14px; }
.profile-chip { max-width: 160px; padding: 10px 0 10px 16px; border: 0; border-left: 1px solid var(--line); border-top: 0; }
.profile-chip strong { color: var(--ink); }
.profile-chip .avatar { border-radius: 50%; background: var(--coral); color: #fff; }
.stage { max-width: 1480px; padding: 34px clamp(24px, 4.4vw, 72px) 88px; }
.topbar { align-items: center; margin-bottom: 32px; padding: 0 0 24px; border-bottom: 1px solid var(--line); }
.top-actions { padding-top: 0; }
.appearance-switch, .language-switch { border-color: var(--line); background: var(--surface); color: var(--muted); }
.weather-panel { min-height: 390px; border-color: var(--line); background-color: var(--surface); background-image: radial-gradient(circle at 65% 55%, var(--panel-glow), transparent 34%), linear-gradient(var(--hairline) 1px, transparent 1px), linear-gradient(90deg, var(--hairline) 1px, transparent 1px); background-size: auto, 28px 28px, 28px 28px; box-shadow: none; }
.weather-copy h2 { color: var(--ink); }
.weather-copy .overline, .weather-copy > p, .weather-meta { color: var(--muted); }
.orbit-ring { border-color: color-mix(in srgb, var(--acid) 48%, transparent); }
.ring-b { border-color: color-mix(in srgb, var(--amber) 52%, transparent); }
.orbit-core { background: var(--acid); color: #fff; }
.dot-b { background: var(--amber); }
.window-panel, .trend-panel, .checkin-panel, .event-panel, .market-panel, .drivers-panel, .scenario-panel, .palm-insights, .conversation, .source-panel, .identity-panel, .settings-panel { border-color: var(--line); background: var(--surface); }
.action-panel { background: var(--paper); }
.action-panel h2 { color: #17201c; }
.action-panel .overline, .action-panel p, .action-review p { color: #646b66; }
.palm-entry { border-color: var(--line); background: linear-gradient(135deg, var(--surface), var(--surface-2)); }
.segmented { background: var(--surface); }
.segmented button.active { background: var(--surface-2); color: var(--ink); }
.market-panel::before { color: color-mix(in srgb, var(--muted) 36%, transparent); }
.driver-row > div { background: var(--surface-3); }
.scenario { background: var(--surface-2); }
.scenario.selected { background: var(--ink); color: var(--bg); }
.ai-command { border-color: color-mix(in srgb, var(--coral) 58%, transparent); background: color-mix(in srgb, var(--coral) 9%, transparent); color: var(--coral); }
.palm-map-panel { border-color: var(--line); background-color: var(--surface); background-image: radial-gradient(circle at center, var(--panel-glow), transparent 48%), linear-gradient(var(--hairline) 1px, transparent 1px), linear-gradient(90deg, var(--hairline) 1px, transparent 1px); }
.palm-insights { background: var(--surface); }
.line-hotspot { background: var(--acid) padding-box; box-shadow: 0 0 0 6px color-mix(in srgb, var(--acid) 16%, transparent); }
.conversation, .source-panel { background: var(--surface); }
.message { background: var(--surface-2); color: var(--ink); }
.message.user { background: var(--acid); color: #fff; }
.ask-form { background: var(--surface-2); }
.avatar, .large-avatar { background: var(--coral); color: #fff; }
.notification-popover, .sheet-content { background: var(--surface); color: var(--ink); }
.form-grid input, .form-grid select, .form-grid textarea, .delete-confirm-label input { background: var(--surface-2); color: var(--ink); }
.toast { background: var(--ink); color: var(--bg); }
@media (max-width: 1050px) and (min-width: 761px) {
  .app-shell { display: block; }
  .rail { height: 88px; padding-inline: 24px; }
  .brand > span:not(.brand-seal), .profile-chip > span { display: none; }
  .brand, .profile-chip, .nav-button { justify-content: center; }
  .main-nav { padding: 0; }
  .profile-chip { width: 46px; padding-left: 10px; }
  .stage { padding-inline: 32px; }
}
@media (max-width: 760px) {
  .app-shell { display: block; padding-bottom: 78px; }
  .rail { height: 72px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); position: fixed; inset: auto 0 0; display: block; border: 0; border-top: 1px solid var(--line); background: var(--glass); backdrop-filter: saturate(1.35) blur(24px); }
  .brand, .profile-chip { display: none; }
  .main-nav { max-width: none; height: 100%; margin: 0; padding: 0; grid-template-columns: repeat(5, 1fr); gap: 2px; }
  .nav-button { min-height: 54px; height: 54px; padding: 5px 0; display: grid; place-content: center; gap: 3px; border: 0; border-top: 2px solid transparent; font-size: 9px; }
  .nav-button.active { border-top-color: var(--acid); border-bottom-color: transparent; }
  .stage { padding: 20px 16px 44px; }
  .topbar { align-items: center; margin-bottom: 22px; padding-bottom: 18px; }
  .topbar h1 { font-size: 34px; }
  .appearance-switch { min-width: 44px; width: 44px; padding: 0; display: grid; grid-template-columns: 1fr; }
  .appearance-switch small { display: none; }
  .today-layout, .dashboard-grid, .evidence-layout, .palm-workspace, .ask-layout, .profile-layout { grid-template-columns: 1fr; }
  .weather-panel { min-height: 430px; padding: 30px 24px; }
  .weather-copy h2 { max-width: 320px; font-size: 43px; }
  .window-panel { min-height: 220px; }
  .palm-map-panel { min-height: 560px; }
  .palm-map-stage > img { height: 460px; }
  .conversation { min-height: 620px; }
}
