:root {
  --bg: #f7f4ee;
  --panel: #fffdf8;
  --panel-2: #ebe5da;
  --ink: #202321;
  --muted: #74776f;
  --line: #ded8cc;
  --gold: #a97838;
  --green: #31483e;
  --soft-green: #e4ece5;
  --blue: #dfe9ef;
  --red: #efe3dd;
  --radius: 8px;
  --serif: Georgia, "Times New Roman", "Songti TC", serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang HK", "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell { position: relative; isolation: isolate; min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.ambient-canvas, .ambient-grid { position: fixed; inset: 0; pointer-events: none; }
.ambient-canvas { z-index: -2; opacity: .72; }
.ambient-grid { z-index: -3; opacity: .48; background-image: linear-gradient(rgba(169,120,56,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(169,120,56,.035) 1px, transparent 1px); background-size: 72px 72px; mask-image: linear-gradient(to bottom, black, transparent 92%); }
.motion-off .ambient-canvas { display: none; }
.motion-off .ambient-grid { opacity: .22; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 22px; border-right: 1px solid var(--line); background: rgba(255,253,248,.72); backdrop-filter: blur(12px); display: flex; flex-direction: column; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-family: var(--serif); font-size: 20px; }
.brand strong { display: block; font-family: var(--serif); font-size: 21px; line-height: 1; font-weight: 400; }
.brand small { display: block; margin-top: 3px; color: var(--muted); letter-spacing: .18em; font-size: 9px; }
.sidebar nav { display: grid; gap: 8px; }
.sidebar nav a { padding: 10px 12px; border-radius: var(--radius); color: var(--muted); font-size: 14px; }
.sidebar nav a:hover { background: var(--panel-2); color: var(--ink); }
.sidebar-note { margin-top: auto; color: var(--muted); font-size: 12px; }
.sidebar-tools { display: grid; gap: 8px; }
.language-toggle { border: 1px solid var(--line); background: var(--ink); color: var(--bg); border-radius: var(--radius); padding: 9px 10px; font-size: 11px; text-align: left; }
.language-toggle:hover { background: var(--green); }
.motion-toggle { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: var(--radius); padding: 9px 10px; font-size: 11px; text-align: left; }
.motion-toggle:hover { border-color: var(--gold); color: var(--ink); }
.main { min-width: 0; padding: 42px; }

.home-grid { min-height: calc(100vh - 84px); display: grid; grid-template-columns: minmax(420px, 1.14fr) minmax(320px, .86fr); gap: 64px; align-items: center; max-width: 1180px; margin: 0 auto; }
.home-operating .system-copy { order: 2; }
.system-copy h1 { max-width: 550px; }
.eyebrow { margin: 0 0 14px; color: var(--gold); letter-spacing: .15em; text-transform: uppercase; font-size: 11px; }
.hero-copy h1, .topbar h1, .empty h1, .account-page h1 { margin: 0 0 22px; font-family: var(--serif); font-size: clamp(48px, 7vw, 88px); font-weight: 400; line-height: 1.02; letter-spacing: 0; }
.hero-copy p { max-width: 520px; color: var(--muted); font-size: 17px; }
.product-principles { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px; }
.product-principles span { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); font-size: 12px; background: rgba(255,253,248,.5); }

.entry-card, .panel, .chat-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 18px 50px rgba(36, 31, 21, .06); }
.entry-card { padding: 28px; display: grid; gap: 18px; }
.entry-head { display: flex; align-items: end; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.entry-head span { color: var(--gold); font-size: 12px; }
.entry-head h2 { margin: 0; font-family: var(--serif); font-size: 30px; font-weight: 400; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; }
input, select { width: 100%; border: 1px solid var(--line); background: var(--bg); color: var(--ink); padding: 12px; min-height: 45px; outline: none; border-radius: 4px; }
input:focus, select:focus { border-color: var(--gold); background: var(--panel); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.time-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.check-row { display: flex; align-items: start; gap: 10px; }
.check-row input { width: 17px; min-height: 17px; margin-top: 2px; accent-color: var(--green); }
.check-row span, .hint { color: var(--muted); font-size: 12px; }
.preset-button { border: 1px dashed var(--gold); background: transparent; color: var(--gold); padding: 10px 12px; border-radius: var(--radius); font-size: 12px; text-align: left; }
.preset-button:hover { background: #f2eadc; }
.pillar-input-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mode-tabs button { border: 0; background: transparent; padding: 12px; color: var(--muted); }
.mode-tabs button.active { background: var(--ink); color: var(--bg); }
.primary, .secondary { border: 0; border-radius: var(--radius); padding: 13px 16px; display: inline-flex; justify-content: center; align-items: center; line-height: 1; }
.primary { background: var(--ink); color: var(--bg); }
.secondary { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.link-button { width: fit-content; }
.error { color: #9a4d34; font-size: 12px; min-height: 18px; margin: 0; }
.hidden { display: none !important; }

.topbar { display: flex; justify-content: space-between; align-items: end; gap: 24px; max-width: 1200px; margin: 0 auto 28px; }
.topbar h1 { font-size: clamp(42px, 5vw, 66px); }
.topbar-subtitle { margin: -8px 0 0; color: var(--muted); max-width: 620px; }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dashboard-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr); gap: 24px; align-items: start; }
.space-hero { max-width: 1200px; margin: 0 auto 30px; display: flex; gap: 16px; align-items: center; }
.avatar { width: 54px; height: 54px; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-family: var(--serif); font-size: 27px; border-radius: 50%; }
.space-hero h1 { margin: 0; font-family: var(--serif); font-size: 38px; font-weight: 400; }
.identity-line { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.identity-line span { border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; color: var(--muted); font-size: 11px; }
.panel { padding: 22px; margin-bottom: 18px; }
.panel-title { display: flex; justify-content: space-between; gap: 20px; align-items: baseline; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.panel-title span { font-family: var(--serif); font-size: 24px; }
.panel-title small { color: var(--muted); font-size: 11px; text-align: right; }
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 22px 0; }
.pillars b { min-height: 82px; display: grid; place-items: center; background: var(--bg); border-radius: var(--radius); font-family: var(--serif); font-size: 34px; font-weight: 400; }
.day-master { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.day-master span { color: var(--muted); }
.day-master strong { font-family: var(--serif); font-size: 24px; font-weight: 400; }
.chart-table { margin-top: 10px; border-top: 1px solid var(--line); }
.chart-head, .chart-row { display: grid; grid-template-columns: 52px 48px 1fr 48px 1.4fr; gap: 8px; align-items: center; }
.chart-head { color: var(--muted); font-size: 10px; padding: 12px 0 8px; }
.chart-row { border-top: 1px solid var(--line); padding: 12px 0; font-size: 12px; }
.chart-row b { font-family: var(--serif); font-size: 20px; font-weight: 400; }
.elements { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 12px; }
.elements i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); margin-right: 6px; }
.el-木 { background: #6f956c !important; } .el-火 { background: #c27762 !important; } .el-土 { background: #b09262 !important; } .el-金 { background: #9a9a93 !important; } .el-水 { background: #617f97 !important; }
.subtle { background: var(--panel-2); box-shadow: none; }
.luck-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.luck-list span { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 7px 10px; color: var(--muted); font-size: 12px; }
.luck-list span.current { background: var(--green); color: var(--bg); border-color: var(--green); }

.daily-panel { background: linear-gradient(180deg, #fffdf8 0%, #f2eee6 100%); }
.daily-summary { font-family: var(--serif); font-size: 25px; line-height: 1.5; }
.advice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.advice-grid article { background: rgba(255,255,255,.55); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px; }
.advice-grid span { color: var(--gold); font-size: 12px; }
.advice-grid p { margin: 7px 0 0; font-size: 14px; }
.do-dont { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.do-dont div { background: var(--soft-green); border-radius: var(--radius); padding: 14px; }
.do-dont div:last-child { background: var(--red); }
.do-dont b { display: block; margin-bottom: 8px; }
.do-dont em { display: block; font-style: normal; color: var(--muted); font-size: 13px; margin-top: 5px; }
.personal-reminder { border-left: 3px solid var(--gold); padding: 12px 14px; margin: 18px 0; background: rgba(255,255,255,.55); }
.personal-reminder span { display: block; color: var(--gold); font-size: 11px; margin-bottom: 4px; }
.personal-reminder b { font-family: var(--serif); font-size: 20px; font-weight: 400; }
.flow-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 6px; }
.flow-strip span, .keywords span { padding: 6px 9px; border: 1px solid var(--line); color: var(--muted); font-size: 11px; border-radius: 999px; }
.daily-overview { padding: 16px 0 4px; }
.section-kicker { margin: 0 0 8px; color: var(--gold); letter-spacing: .1em; font-size: 11px; }
.daily-overview h2 { margin: 0 0 8px; font-family: var(--serif); font-size: 25px; font-weight: 400; line-height: 1.3; }
.keywords { display: flex; flex-wrap: wrap; gap: 7px; }
.daily-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.score-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.score-item { min-width: 0; padding: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.45); border-radius: var(--radius); }
.score-item > div { display: flex; justify-content: space-between; gap: 7px; align-items: baseline; }
.score-item span { color: var(--muted); font-size: 11px; }
.score-item strong { font-family: var(--serif); font-size: 25px; font-weight: 400; color: var(--green); }
.score-item p, .score-item small { display: block; margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.score-item small { color: var(--ink); }
.split-section { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.reason-item { padding: 12px; margin-top: 8px; border-left: 3px solid var(--green); background: rgba(228,236,229,.68); }
.reason-item.bad { border-color: #a9674d; background: rgba(239,227,221,.72); }
.reason-item b { font-size: 13px; }
.reason-item p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.outfit-grid, .rhythm-grid, .reminder-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.outfit-grid > div, .rhythm-grid > div, .reminder-grid > div { padding: 12px; background: rgba(255,255,255,.5); border: 1px solid var(--line); border-radius: var(--radius); }
.outfit-grid span, .rhythm-grid span, .reminder-grid span { color: var(--gold); font-size: 11px; }
.outfit-grid b { display: block; margin-top: 7px; font-family: var(--serif); font-size: 19px; font-weight: 400; }
.rhythm-grid p, .reminder-grid p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.reminder-grid { grid-template-columns: repeat(2, 1fr); }
.personal-sentence { margin-top: 22px; padding: 18px; background: var(--green); color: var(--bg); border-radius: var(--radius); }
.personal-sentence span { display: block; color: #dfc28f; font-size: 11px; margin-bottom: 5px; }
.personal-sentence b { font-family: var(--serif); font-size: 22px; font-weight: 400; }
.daily-note { margin-top: 16px; }
.archive-panel { background: rgba(255,253,248,.8); }
.archive-lead { font-family: var(--serif); font-size: 19px; line-height: 1.55; }
.archive-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 18px; }
.archive-grid > div { padding: 13px 0; border-top: 1px solid var(--line); }
.archive-grid span, .archive-profile span { color: var(--gold); font-size: 11px; }
.archive-grid p, .archive-profile p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.archive-profile { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.today-layout { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); gap: 24px; align-items: start; }
.today-layout aside { min-width: 0; }
.destiny-page, .simulate-page { max-width: 1200px; margin: 0 auto; }
.timeline-page { max-width: 1200px; margin: 0 auto; }
.timeline-current h2 { margin: 20px 0 4px; font-family: var(--serif); font-size: 34px; font-weight: 400; }
.timeline-current > p { margin: 0; color: var(--muted); }
.timeline-current-grid { display: grid; grid-template-columns: .7fr 1.3fr 1.3fr; gap: 12px; margin-top: 22px; }
.timeline-current-grid > div { padding: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }
.timeline-current-grid span { display: block; color: var(--gold); font-size: 11px; }
.timeline-current-grid b { display: block; margin-top: 7px; font-family: var(--serif); font-size: 24px; font-weight: 400; }
.timeline-current-grid p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.life-timeline { position: relative; margin-top: 10px; padding: 10px 0; }
.life-timeline::before { content: ""; position: absolute; top: 22px; bottom: 22px; left: 38px; width: 1px; background: var(--line); }
.life-stage { position: relative; display: grid; grid-template-columns: 78px 1fr; gap: 18px; padding: 14px 0; }
.life-marker { position: relative; z-index: 1; width: 78px; height: 50px; display: flex; align-items: center; justify-content: center; gap: 3px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.life-marker b { font-family: var(--serif); font-size: 21px; font-weight: 400; color: var(--ink); }
.life-marker span { font-size: 10px; }
.life-stage.current .life-marker { background: var(--green); border-color: var(--green); color: var(--bg); }
.life-stage.current .life-marker b { color: var(--bg); }
.life-stage-body { padding: 4px 0 14px; border-bottom: 1px solid var(--line); }
.life-stage-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.life-stage-head h3 { margin: 0; font-family: var(--serif); font-size: 23px; font-weight: 400; }
.life-stage-head span { color: var(--gold); font-size: 11px; }
.life-stage-body p { margin: 5px 0 10px; color: var(--muted); }
.life-stage-body small { display: block; color: var(--muted); font-size: 12px; line-height: 1.6; }
.month-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.month-grid article { padding: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.5); border-radius: var(--radius); }
.month-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.month-head b { font-family: var(--serif); font-size: 22px; font-weight: 400; }
.month-head span { color: var(--gold); font-size: 11px; }
.month-grid p { margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.month-grid strong { color: var(--ink); font-weight: 500; }
.destiny-head { max-width: 720px; margin-bottom: 24px; }
.destiny-head h1 { margin: 0 0 12px; font-family: var(--serif); font-size: clamp(44px, 6vw, 72px); font-weight: 400; line-height: 1.05; }
.destiny-head p { color: var(--muted); max-width: 650px; }
.destiny-map { position: relative; min-height: 620px; margin: 30px 0 20px; border: 1px solid var(--line); background: rgba(255,253,248,.52); overflow: hidden; }
.destiny-map::before { content: ""; position: absolute; inset: 10%; border: 1px solid rgba(169,120,56,.15); border-radius: 50%; box-shadow: 0 0 0 40px rgba(169,120,56,.025), 0 0 0 80px rgba(169,120,56,.02); }
.destiny-lines { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.destiny-lines path { fill: none; stroke: rgba(169,120,56,.42); stroke-width: .35; stroke-dasharray: 1.5 1.5; }
.destiny-core, .destiny-node { position: absolute; z-index: 1; }
.destiny-core { left: 50%; top: 50%; width: 230px; height: 150px; transform: translate(-50%, -50%); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; background: var(--green); color: var(--bg); border-radius: 50%; padding: 22px; box-shadow: 0 12px 50px rgba(49,72,62,.18); }
.destiny-core span { color: #dfc28f; font-size: 11px; }
.destiny-core b { margin: 5px 0; font-family: var(--serif); font-size: 24px; font-weight: 400; }
.destiny-core small { color: #d8dfd6; font-size: 10px; }
.destiny-node { width: 190px; min-height: 90px; padding: 14px; border: 1px solid var(--line); background: rgba(255,253,248,.92); color: var(--ink); text-align: left; border-radius: var(--radius); box-shadow: 0 10px 28px rgba(36,31,21,.05); }
.destiny-node:hover, .destiny-node:focus { border-color: var(--gold); transform: translateY(-3px); }
.destiny-node span { color: var(--gold); font-family: var(--serif); font-size: 19px; }
.destiny-node p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.node-0 { left: 50%; top: 7%; transform: translateX(-50%); }
.node-1 { right: 17%; top: 13%; }
.node-2 { right: 3%; top: 50%; transform: translateY(-50%); }
.node-3 { right: 17%; bottom: 13%; }
.node-4 { left: 50%; bottom: 4%; transform: translateX(-50%); }
.node-5 { left: 17%; bottom: 13%; }
.node-6 { left: 3%; top: 50%; transform: translateY(-50%); }
.node-7 { left: 17%; top: 13%; }
.route-detail { max-width: 760px; }
.route-detail p { color: var(--muted); }
.simulation-form { max-width: 760px; display: grid; gap: 14px; }
.simulation-result { margin-top: 22px; }
.guide-result { margin-top: 22px; }
.guide-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.guide-section h2 { margin: 0 0 8px; font-family: var(--serif); font-size: 28px; font-weight: 400; }
.guide-section > p { color: var(--muted); }
.guide-section > small { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; }
.decision-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.decision-grid article { padding: 15px; border: 1px solid var(--line); background: rgba(255,255,255,.5); border-radius: var(--radius); }
.decision-grid b, .decision-plan b { display: block; color: var(--gold); font-size: 12px; margin-bottom: 8px; }
.decision-grid span, .decision-plan span { display: block; color: var(--muted); font-size: 12px; line-height: 1.55; margin-top: 6px; }
.decision-plan { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.decision-plan > div { padding: 14px; background: var(--soft-green); border-radius: var(--radius); }
.decision-plan > div:nth-child(2) { background: var(--panel-2); }
.decision-plan > div:nth-child(3) { background: var(--blue); }
.kb-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kb-list article { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.kb-list span { color: var(--gold); font-size: 11px; }
.kb-list b { display: block; margin-top: 4px; font-family: var(--serif); font-size: 19px; font-weight: 400; }
.kb-list p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.simulation-summary { font-family: var(--serif); font-size: 22px; line-height: 1.5; }
.simulation-paths { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.simulation-paths article { padding: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.5); border-radius: var(--radius); }
.path-head { display: flex; align-items: baseline; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.path-head span { color: var(--gold); font-size: 11px; }
.path-head strong { font-family: var(--serif); font-size: 22px; font-weight: 400; }
.path-head em { margin-left: auto; color: var(--green); font-style: normal; font-size: 12px; }
.simulation-paths article > p { color: var(--muted); font-size: 13px; }
.path-section { border-top: 1px solid var(--line); padding-top: 11px; }
.path-section b, .path-columns b { color: var(--gold); font-size: 11px; }
.path-section p { color: var(--muted); font-size: 12px; }
.path-columns { display: grid; gap: 10px; margin-top: 13px; }
.path-columns > div { display: grid; gap: 3px; }
.path-columns small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.guidance-panel { background: var(--green); color: var(--bg); box-shadow: none; }
.guidance-panel .panel-title { border-color: rgba(255,255,255,.2); }
.guidance-panel .panel-title small, .guidance-panel .confidence-note, .guidance-panel .symbolic-note { color: #c9d1c8; }
.guidance-panel h2 { margin: 18px 0 10px; font-family: var(--serif); font-size: 28px; font-weight: 400; line-height: 1.25; }
.guidance-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.guidance-columns div { display: grid; gap: 8px; }
.guidance-columns b { color: #dfc28f; font-size: 12px; }
.guidance-columns span { color: #e1e6df; font-size: 12px; }
.symbolic-note { border-top: 1px solid rgba(255,255,255,.2); padding-top: 12px; margin: 18px 0 0; font-size: 10px; }

.chat-layout { max-width: 1220px; margin: 0 auto; display: grid; grid-template-columns: 410px minmax(0, 1fr); gap: 22px; align-items: start; }
.chat-context { position: sticky; top: 24px; }
.chat-panel { min-height: calc(100vh - 84px); display: grid; grid-template-rows: auto 1fr auto; padding: 22px; }
.messages { padding: 18px 0; display: flex; flex-direction: column; gap: 14px; overflow: auto; }
.msg { max-width: 78%; padding: 13px 15px; border-radius: 14px; background: var(--bg); }
.msg span { display: block; color: var(--gold); font-size: 11px; margin-bottom: 4px; }
.msg p { margin: 0; }
.msg.user { margin-left: auto; background: var(--green); color: var(--bg); }
.msg.user span { color: #d8c39f; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.chat-form input { background: var(--bg); }
.empty, .account-page { max-width: 760px; margin: 16vh auto 0; }
.empty p, .account-page p { color: var(--muted); }
.account-intro { max-width: 620px; margin-bottom: 22px; }
.profile-form { display: grid; gap: 16px; }
.profile-meta { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.profile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
textarea { width: 100%; resize: vertical; border: 1px solid var(--line); background: var(--bg); color: var(--ink); padding: 12px; border-radius: 4px; font: inherit; outline: none; }
textarea:focus { border-color: var(--gold); background: var(--panel); }
fieldset { border: 0; padding: 0; margin: 0; }
legend { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.focus-options { display: flex; flex-wrap: wrap; gap: 8px; }
.focus-options label { display: inline-flex; grid-template-columns: auto auto; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
.focus-options input { width: 15px; min-height: 15px; padding: 0; accent-color: var(--green); }

@media (max-width: 940px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 18px 20px; border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; align-items: center; }
  .sidebar nav { display: flex; margin-left: auto; }
  .sidebar-note { display: none; }
  .sidebar-tools { display: flex; margin-left: auto; }
  .main { padding: 28px 20px; }
  .home-grid, .dashboard-grid, .chat-layout, .today-layout { grid-template-columns: 1fr; gap: 22px; }
  .home-operating .system-copy { order: -1; }
  .destiny-map { min-height: 650px; }
  .destiny-node { width: 155px; }
  .simulation-paths { grid-template-columns: 1fr; }
  .decision-plan, .kb-list { grid-template-columns: 1fr; }
  .timeline-current-grid, .month-grid { grid-template-columns: 1fr; }
  .hero-copy h1 { font-size: 54px; }
  .chat-context { position: static; }
}

@media (max-width: 560px) {
  .sidebar { flex-direction: column; align-items: flex-start; }
  .sidebar nav, .motion-toggle, .language-toggle { width: 100%; }
  .sidebar nav { margin-left: 0; }
  .sidebar-tools { width: 100%; margin-left: 0; }
  .sidebar nav { width: 100%; justify-content: space-between; }
  .brand strong { font-size: 19px; }
  .main { padding: 22px 16px; }
  .hero-copy h1 { font-size: 46px; }
  .form-grid, .advice-grid, .do-dont, .split-section, .profile-grid { grid-template-columns: 1fr; }
  .decision-grid { grid-template-columns: 1fr; }
  .life-stage { grid-template-columns: 58px 1fr; gap: 12px; }
  .life-timeline::before { left: 29px; }
  .life-marker { width: 58px; }
  .life-stage-head { display: block; }
  .life-stage-head span { display: block; margin-top: 3px; }
  .destiny-map { min-height: 720px; }
  .destiny-node { width: 132px; min-height: 76px; padding: 10px; }
  .destiny-node span { font-size: 16px; }
  .destiny-node p { font-size: 10px; }
  .node-1, .node-7 { top: 12%; }
  .node-2, .node-6 { top: 43%; }
  .node-3, .node-5 { bottom: 12%; }
  .node-4 { bottom: 4%; }
  .pillar-input-grid { grid-template-columns: repeat(2, 1fr); }
  .score-grid { grid-template-columns: repeat(2, 1fr); }
  .outfit-grid, .rhythm-grid, .reminder-grid { grid-template-columns: 1fr; }
  .topbar, .profile-meta { align-items: flex-start; flex-direction: column; }
  .topbar-actions { width: 100%; }
  .topbar-actions a { flex: 1; }
  .pillars { grid-template-columns: repeat(2, 1fr); }
  .chart-head, .chart-row { grid-template-columns: 38px 34px 1fr 34px 1.2fr; gap: 5px; font-size: 10px; }
  .chart-row b { font-size: 17px; }
  .msg { max-width: 92%; }
  .chat-form { grid-template-columns: 1fr; }
  .guidance-columns { grid-template-columns: 1fr; }
  .space-hero { align-items: flex-start; }
  .space-hero h1 { font-size: 31px; }
  .destiny-map { min-height: 590px; }
  .destiny-core { width: 170px; height: 125px; }
  .destiny-core b { font-size: 18px; }
  .destiny-node { width: 142px; min-height: 82px; padding: 10px; }
  .destiny-node span { font-size: 16px; }
  .destiny-node p { font-size: 10px; }
  .node-0 { top: 5%; }
  .node-1 { right: 3%; top: 45%; }
  .node-2 { left: 3%; top: 45%; }
  .node-3 { right: 5%; bottom: 6%; }
  .node-4 { left: 5%; bottom: 6%; }
}
