:root {
  color-scheme: dark;
  --canvas: #111015;
  --rail: #17151d;
  --surface: #1c1a23;
  --surface-raised: #23202c;
  --surface-input: #131119;
  --stroke: #34303e;
  --stroke-soft: #2a2732;
  --text: #f4f1f8;
  --text-secondary: #c2bdce;
  --muted: #918a9f;
  --violet: #7650f8;
  --violet-bright: #9b7cff;
  --violet-wash: #29213f;
  --green: #51d4a2;
  --rose: #ef8cab;
  --gold: #e4bd7b;
  --font-ui: "Segoe UI Variable", "Segoe UI", Inter, system-ui, sans-serif;
  --font-data: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--canvas); color: var(--text); font-family: var(--font-ui); font-size: 13px; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--violet-bright); outline-offset: 3px; }

.app-shell { display: grid; grid-template-columns: 58px minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; display: flex; height: 100vh; min-height: 480px; flex-direction: column; align-items: center; gap: 25px; padding: 14px 0 16px; border-right: 1px solid var(--stroke-soft); background: var(--rail); }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px 10px 10px 3px; background: var(--violet); color: #fff; font-family: Georgia, serif; font-size: 25px; line-height: 1; box-shadow: 0 5px 18px #7650f833; }
.rail-nav { display: flex; flex-direction: column; gap: 9px; }
.rail-link, .icon-button { display: grid; place-items: center; color: var(--muted); transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease; }
.rail-link { width: 38px; height: 38px; border: 1px solid transparent; border-radius: 10px; }
.rail-link:hover, .rail-link.is-active { color: #fff; background: var(--violet-wash); }
.rail-link.is-active { border-color: #7650f84a; box-shadow: inset 2px 0 var(--violet-bright); }
.rail-link svg, .icon-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.rail-bottom { display: flex; flex: 1; align-items: flex-end; }
.connection-dot, .live-indicator i, .app-footer i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px #51d4a266; }

.main-panel { min-width: 0; }
.topbar { position: sticky; z-index: 2; top: 0; display: flex; height: 58px; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--stroke-soft); background: #17151df2; backdrop-filter: blur(14px); }
.brand-lockup, .topbar-meta, .live-indicator { display: flex; align-items: center; }
.brand-lockup { gap: 10px; }
.brand-name { font-size: 11px; font-weight: 750; letter-spacing: .14em; }
.brand-divider { width: 1px; height: 16px; background: var(--stroke); }
.brand-product { color: var(--text-secondary); font-size: 13px; }
.topbar-meta { gap: 15px; }
.language-switch { display: flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--stroke); border-radius: 7px; background: #11101580; }
.language-option { min-width: 27px; height: 22px; padding: 0 5px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-family: var(--font-data); font-size: 9px; cursor: pointer; }
.language-option:hover { color: var(--text); }
.language-option.is-active { background: var(--violet-wash); color: #e4dbff; box-shadow: inset 0 0 0 1px #7650f83d; }
.live-indicator { gap: 7px; color: var(--muted); font-size: 11px; }
.live-indicator i { width: 6px; height: 6px; }
.icon-button { width: 30px; height: 30px; border: 1px solid transparent; border-radius: 8px; background: transparent; cursor: pointer; }
.icon-button:hover { border-color: var(--stroke); background: var(--surface-raised); color: var(--text); }
.icon-button svg { width: 17px; height: 17px; }

.content-scroll { min-height: calc(100vh - 58px); overflow-y: auto; scrollbar-color: #403a4b transparent; scrollbar-width: thin; }
.content-wrap { width: min(100%, 520px); margin: 0 auto; padding: 22px 20px 26px; }
.page-view[hidden] { display: none !important; }
.page-view { min-height: 420px; }
.page-kicker { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; color: var(--muted); font-family: var(--font-data); font-size: 9px; letter-spacing: .1em; }
.kicker-line { width: 18px; height: 1px; background: #51495f; }

.solar-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 104px; min-height: 142px; align-items: center; overflow: hidden; padding: 20px 19px 34px; border: 1px solid #3a3448; border-radius: 13px; background: radial-gradient(ellipse at 92% 15%, #6544b422 0, transparent 42%), linear-gradient(125deg, #211d2a 0%, #1d1a24 58%, #211c2b 100%); }
.solar-card::after { position: absolute; right: -66px; bottom: -116px; width: 255px; height: 255px; border: 1px solid #8d73c51a; border-radius: 50%; content: ""; pointer-events: none; }
.solar-copy { position: relative; z-index: 1; }
.eyebrow { display: block; color: var(--muted); font-family: var(--font-data); font-size: 9px; font-weight: 500; letter-spacing: .105em; line-height: 1.4; }
.solar-copy h1 { display: flex; align-items: baseline; gap: 8px; margin: 7px 0 4px; color: #fff; font-size: clamp(31px, 9vw, 42px); font-weight: 570; letter-spacing: -.055em; line-height: 1; }
.solar-copy h1 small { color: var(--violet-bright); font-family: var(--font-data); font-size: 10px; font-weight: 500; letter-spacing: .08em; }
.solar-copy p { max-width: 210px; margin: 8px 0 0; color: var(--text-secondary); font-size: 11px; line-height: 1.45; }
.solar-dial { position: relative; width: 91px; height: 91px; justify-self: end; border: 1px solid #9580ba44; border-radius: 50%; background: radial-gradient(circle, #30273f 0 34%, #211d2a 35% 69%, #b49be50d 70%); }
.dial-orbit { position: absolute; inset: 8px; border: 1px dashed #a994d550; border-radius: 50%; }
.dial-crosshair { position: absolute; top: 50%; left: 7px; width: 75px; height: 1px; background: #b4a4cf32; }
.dial-sun { position: absolute; top: 50%; left: 50%; width: 7px; height: 7px; transform: rotate(var(--phase-angle, 0deg)) translateY(-34px); border: 1px solid #fff4d3; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px #f1cd8bba; }
.dial-center { position: absolute; inset: 0; display: grid; place-items: center; color: #d9c8ff; font-family: Georgia, serif; font-size: 24px; }
.dial-label { position: absolute; left: 50%; color: #9f97ac; font-family: var(--font-data); font-size: 7px; transform: translateX(-50%); }
.dial-label-top { top: -14px; }
.dial-label-bottom { bottom: -14px; }
.solar-foot { position: absolute; right: 18px; bottom: 12px; left: 19px; display: flex; align-items: center; justify-content: space-between; padding-top: 9px; border-top: 1px solid #ffffff12; }
.solar-foot span { color: var(--muted); font-family: var(--font-data); font-size: 8px; letter-spacing: .08em; }
.solar-foot strong { color: #ded4f6; font-family: var(--font-data); font-size: 10px; font-weight: 500; }

.section-block { margin-top: 24px; scroll-margin-top: 74px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 12px; }
.section-heading h2 { margin: 4px 0 0; color: var(--text); font-size: 15px; font-weight: 570; letter-spacing: -.015em; }
.section-index { padding-bottom: 2px; color: #6f687b; font-family: var(--font-data); font-size: 9px; }
.profile-form { padding: 13px; border: 1px solid var(--stroke); border-radius: 12px; background: var(--surface); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 11px; }
.field { min-width: 0; }
.field label { display: flex; justify-content: space-between; margin: 0 0 6px 1px; color: var(--text-secondary); font-size: 10px; }
.field label .unit-label { color: #777083; font-family: var(--font-data); font-size: 9px; }
.field input, .field select { width: 100%; height: 36px; padding: 0 10px; border: 1px solid #3a3543; border-radius: 7px; outline: none; background: var(--surface-input); color: var(--text); font-family: var(--font-data); font-size: 11px; color-scheme: dark; transition: border-color 150ms ease, box-shadow 150ms ease; }
.field input:hover, .field select:hover { border-color: #575064; }
.field input:focus, .field select:focus { border-color: var(--violet-bright); box-shadow: 0 0 0 3px #7650f826; }
.field select { font-family: var(--font-ui); cursor: pointer; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 39px; }
.input-suffix span { position: absolute; top: 11px; right: 10px; color: var(--muted); font-family: var(--font-data); font-size: 9px; pointer-events: none; }
.field-row-bottom { margin-bottom: 0; }
.name-lens-inputs { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--stroke-soft); }
.name-lens-heading { display: grid; gap: 8px; margin-bottom: 12px; }
.name-lens-heading h3 { margin: 0; color: var(--text); font-size: 12px; font-weight: 580; }
.name-lens-toggle { display: flex; align-items: center; gap: 7px; color: var(--text-secondary); font-size: 10px; cursor: pointer; }
.name-lens-toggle input { width: 14px; height: 14px; margin: 0; accent-color: var(--violet-bright); }
.name-method-field { max-width: 100%; }
.name-method-note { margin: -1px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.name-feedback { margin: 8px 0 0; color: #ff9cba; font-size: 10px; line-height: 1.4; }
.compute-button { display: flex; width: 100%; min-height: 39px; align-items: center; justify-content: center; gap: 10px; margin-top: 13px; border: 1px solid #9276fa; border-radius: 8px; background: var(--violet); color: #fff; font-size: 11px; font-weight: 650; cursor: pointer; box-shadow: 0 5px 14px #6841e32e; transition: background 150ms ease, border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease; }
.compute-button:hover { border-color: #b49cff; background: #8664ff; box-shadow: 0 7px 19px #6841e344; }
.compute-button:active { transform: translateY(1px); }
.compute-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.results-block { margin-top: 23px; }
.readings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.profile-lens-results { margin-top: 22px; }
.lens-results-heading { margin-bottom: 10px; }
.reading { position: relative; min-width: 0; min-height: 79px; padding: 12px 12px 11px; overflow: hidden; border: 1px solid var(--stroke); border-radius: 10px; background: var(--surface); }
.reading::after { position: absolute; top: 12px; right: 12px; width: 5px; height: 5px; border-radius: 50%; background: var(--reading-accent, var(--violet-bright)); box-shadow: 0 0 8px color-mix(in srgb, var(--reading-accent, var(--violet-bright)) 55%, transparent); content: ""; }
.reading-label { display: block; padding-right: 9px; color: var(--muted); font-size: 10px; }
.reading-value { display: block; overflow: hidden; margin-top: 8px; color: var(--reading-accent, var(--text)); font-family: var(--font-data); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.reading-note { display: block; overflow: hidden; margin-top: 4px; color: #7e778b; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.accent-violet { --reading-accent: var(--violet-bright); }
.accent-green { --reading-accent: var(--green); }
.accent-rose { --reading-accent: var(--rose); }
.accent-gold { --reading-accent: var(--gold); }
.reading-wide { grid-column: 1 / -1; min-height: 68px; }
.reading-wide .reading-value { font-family: var(--font-ui); font-size: 11px; }

.interpretations-block { margin-top: 27px; }
.profile-synthesis-card { margin: 0 0 12px; padding: 13px; border: 1px solid #8a72be55; border-radius: 11px; background: linear-gradient(145deg, #201b2a, #19171e 72%); }
.profile-synthesis-card h3 { margin: 0; color: var(--text); font-size: 12px; font-weight: 600; }
.profile-synthesis-card h4 { margin: 12px 0 6px; color: #c2afff; font-size: 9px; font-weight: 600; }
.synthesis-intro { margin: 6px 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.synthesis-list { display: grid; gap: 5px; margin: 0; padding-left: 16px; color: var(--text-secondary); font-size: 9px; line-height: 1.45; }
.synthesis-list code { color: #d4c5ff; font-family: var(--font-data); font-size: 8px; overflow-wrap: anywhere; }
.synthesis-list p { margin: 3px 0 0; color: var(--muted); }
.synthesis-caveat { margin: 10px 0 0; padding: 8px 9px; border-left: 2px solid #b18b55; background: #b18b550d; color: #b7a992; font-size: 9px; line-height: 1.55; }
.ai-analysis-panel { margin: 0 0 14px; padding: 13px; border: 1px solid #7650f84d; border-radius: 11px; background: linear-gradient(135deg, #211b31, #1b1921 66%); }
.ai-analysis-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.ai-analysis-heading h3 { margin: 4px 0 0; color: var(--text); font-size: 12px; font-weight: 600; }
.ai-provider-tag { color: #a99ac6; font-family: var(--font-data); font-size: 8px; }
.ai-analysis-description { margin: 9px 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.ai-evidence-preview { margin: 8px 0; color: var(--text-secondary); font-size: 9px; }
.ai-evidence-preview summary { cursor: pointer; }
.ai-evidence-preview ul { display: grid; gap: 4px; max-height: 130px; margin: 8px 0; padding-left: 17px; overflow: auto; color: var(--muted); font-family: var(--font-data); font-size: 8px; }
.ai-consent { display: flex; align-items: flex-start; gap: 7px; margin: 10px 0; color: var(--text-secondary); font-size: 9px; line-height: 1.5; cursor: pointer; }
.ai-consent input { flex: 0 0 auto; width: 13px; height: 13px; margin: 1px 0 0; accent-color: var(--violet-bright); }
.ai-generate-button { min-height: 34px; margin-top: 8px; font-size: 10px; }
.ai-generate-button:disabled { border-color: var(--stroke); background: #383341; color: #827b8b; box-shadow: none; cursor: not-allowed; }
.ai-analysis-status { min-height: 14px; margin: 7px 0 0; color: var(--muted); font-size: 9px; }
.ai-analysis-result { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--stroke); }
.ai-result-summary { color: var(--text); font-size: 10px; font-weight: 600; line-height: 1.55; }
.ai-result-section { margin-top: 9px; }
.ai-result-section h4 { margin: 0 0 4px; color: #c8b8ff; font-size: 10px; }
.ai-result-section p { margin: 4px 0; color: var(--text-secondary); font-size: 9px; line-height: 1.55; }
.ai-result-meta { color: #80798c !important; font-family: var(--font-data); font-size: 8px !important; overflow-wrap: anywhere; }
.section-description { max-width: 54ch; margin: -3px 0 12px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.interpretation-list { display: grid; gap: 10px; }
.interpretation-card { min-width: 0; padding: 14px; border: 1px solid var(--stroke); border-radius: 11px; background: var(--surface); }
.interpretation-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.lens-domain { flex: 0 0 auto; padding: 4px 6px; border: 1px solid #7650f833; border-radius: 5px; background: #29213f80; color: #c2afff; font-family: var(--font-data); font-size: 8px; letter-spacing: .055em; }
.interpretation-head h3 { flex: 1; margin: 1px 0 0; color: var(--text); font-size: 12px; font-weight: 600; line-height: 1.4; text-align: right; }
.interpretation-summary { margin: 10px 0 12px; color: var(--text-secondary); font-size: 11px; line-height: 1.6; }
.evidence-title { margin-bottom: 5px; font-size: 8px; }
.evidence-list { margin: 0; padding: 0; }
.evidence-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--stroke-soft); }
.evidence-row dt { min-width: 0; color: var(--muted); font-size: 9px; line-height: 1.4; }
.evidence-row dd { max-width: 58%; margin: 0; color: #e5def2; font-family: var(--font-data); font-size: 9px; line-height: 1.4; text-align: right; overflow-wrap: anywhere; }
.interpretation-caveat { margin: 10px 0 0; padding: 8px 9px; border-left: 2px solid #b18b55; background: #b18b550d; color: #b7a992; font-size: 9px; line-height: 1.55; }
.interpretation-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 11px; padding-top: 9px; border-top: 1px solid var(--stroke-soft); color: #777181; font-family: var(--font-data); font-size: 8px; letter-spacing: .04em; }
.interpretation-meta code { max-width: 72%; color: #aaa1b8; font-size: 8px; overflow-wrap: anywhere; text-align: right; }
.future-lenses { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--stroke-soft); }
.future-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.future-count { color: #625b6e; font-family: var(--font-data); font-size: 9px; }
.future-lens-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.planned-lens { min-width: 0; padding: 11px; border: 1px solid var(--stroke-soft); border-radius: 9px; background: #17151d; }
.planned-lens-heading { display: flex; min-height: 28px; flex-direction: column; align-items: flex-start; gap: 5px; }
.planned-lens h3 { margin: 0; color: var(--text-secondary); font-size: 10px; font-weight: 580; line-height: 1.4; }
.lens-status { display: inline-flex; align-items: center; gap: 5px; color: #b49b70; font-size: 8px; line-height: 1.35; }
.lens-status::before { width: 5px; height: 5px; border-radius: 50%; background: #b18b55; content: ""; }
.planned-lens p { margin: 7px 0 0; color: #837c8e; font-size: 9px; line-height: 1.5; }

.data-details { margin-top: 13px; overflow: hidden; border: 1px solid var(--stroke); border-radius: 10px; background: var(--surface); scroll-margin-top: 74px; }
.data-details summary { display: flex; min-height: 54px; align-items: center; justify-content: space-between; padding: 10px 13px; cursor: pointer; list-style: none; }
.data-details summary::-webkit-details-marker { display: none; }
.data-details summary strong { display: block; margin-top: 3px; color: var(--text-secondary); font-size: 11px; font-weight: 550; }
.details-toggle { display: grid; width: 23px; height: 23px; place-items: center; border: 1px solid var(--stroke); border-radius: 7px; color: var(--muted); font-size: 16px; transition: transform 150ms ease; }
.data-details[open] .details-toggle { transform: rotate(45deg); }
.data-details pre { max-height: 230px; margin: 0; padding: 12px 14px 14px; overflow: auto; border-top: 1px solid var(--stroke-soft); color: #b5adc4; font-family: var(--font-data); font-size: 9px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.app-footer { display: flex; justify-content: space-between; gap: 12px; padding: 19px 2px 0; color: #777181; font-family: var(--font-data); font-size: 8px; letter-spacing: .065em; }
.app-footer span:first-child { display: flex; align-items: center; gap: 7px; }
.app-footer i { width: 5px; height: 5px; }

@media (max-width: 370px) {
  .app-shell { grid-template-columns: 48px minmax(0, 1fr); }
  .rail-link { width: 34px; height: 34px; }
  .topbar { padding-right: 13px; padding-left: 13px; }
  .topbar-meta { gap: 8px; }
  .live-indicator { gap: 0; font-size: 0; }
  .content-wrap { padding-right: 13px; padding-left: 13px; }
  .solar-card { grid-template-columns: minmax(0, 1fr) 84px; padding-right: 14px; padding-left: 14px; }
  .solar-dial { width: 76px; height: 76px; }
  .dial-crosshair { left: 6px; width: 62px; }
  .dial-sun { transform: rotate(var(--phase-angle, 0deg)) translateY(-28px); }
  .field-row { gap: 7px; }
  .profile-form { padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
.ai-limitations { margin-top: 6px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.ai-limitations summary { cursor: pointer; }
.ai-limitations ul { display: grid; gap: 4px; margin: 6px 0 0; padding-left: 16px; }
