:root {
  --canvas: #f0f4f6;
  --canvas-deep: #e7edef;
  --card: #fbfcfc;
  --ink: #20313b;
  --muted: #697a83;
  --blue: #58778a;
  --blue-dark: #344f60;
  --blue-soft: #e3ebef;
  --blue-pale: #f3f7f8;
  --line: #d7e0e4;
  --danger-muted: #8b6670;
  --shadow: 0 20px 60px rgba(32, 55, 68, .08);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 4%, rgba(179, 198, 207, .25), transparent 28%),
    linear-gradient(180deg, #f7f9fa 0%, var(--canvas) 55%, #ebf0f2 100%);
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.65;
}
button, textarea, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, textarea:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(88, 119, 138, .24);
  outline-offset: 3px;
}
.topbar {
  width: min(1080px, calc(100% - 36px));
  height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(217, 228, 238, .72);
}
.brand-button, .back-button, .text-action, .close-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}
.brand-button { display: flex; gap: 11px; align-items: center; padding: 10px 0; font-weight: 750; letter-spacing: .02em; }
.brand-mark { width: 18px; height: 18px; border: 2px solid var(--blue); border-radius: 5px; position: relative; }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; background: var(--blue); border-radius: 2px; }
.brand-mark::before { width: 8px; height: 2px; left: 3px; top: 6px; }
.brand-mark::after { width: 2px; height: 8px; left: 6px; top: 3px; }
.back-button { display: flex; gap: 8px; align-items: center; color: var(--muted); padding: 10px 0; }
main { width: min(1040px, calc(100% - 36px)); margin: 0 auto 80px; }
.page { display: none; animation: arrive .28s ease; }
.page.active { display: block; }
@keyframes arrive { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.home-intro { padding: 74px 0 50px; max-width: 760px; }
.eyebrow { color: var(--blue); letter-spacing: .16em; font-size: 11px; font-weight: 800; margin: 0 0 12px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(38px, 6.6vw, 68px); letter-spacing: -.045em; line-height: 1.15; margin-bottom: 24px; font-weight: 680; }
h2 { font-size: clamp(31px, 4.5vw, 48px); letter-spacing: -.035em; line-height: 1.2; margin-bottom: 10px; font-weight: 680; }
h3 { font-size: clamp(22px, 2.8vw, 29px); line-height: 1.35; margin-bottom: 10px; }
.lead { color: #596d78; font-size: clamp(17px, 2.4vw, 21px); max-width: 650px; }
.privacy-note { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; margin-top: 13px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #4f8b78; box-shadow: 0 0 0 4px rgba(79, 139, 120, .1); }
.urgent-entry {
  width: 100%;
  margin: 0 0 34px;
  padding: clamp(24px, 4vw, 34px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 21px;
  color: #f7fafb;
  text-align: left;
  border: 1px solid #2f4a5b;
  border-radius: 24px;
  background: linear-gradient(135deg, #2f4a5b 0%, #405f71 100%);
  box-shadow: 0 22px 55px rgba(29, 50, 63, .18);
  cursor: pointer;
  transition: transform .18s, box-shadow .18s;
}
.urgent-entry:hover { transform: translateY(-2px); box-shadow: 0 26px 64px rgba(29, 50, 63, .23); }
.urgent-indicator {
  width: 46px; height: 46px; border: 1px solid rgba(255,255,255,.38); border-radius: 50%;
  position: relative; background: rgba(255,255,255,.06);
}
.urgent-indicator::before, .urgent-indicator::after {
  content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  border-radius: 2px; background: #e7eff2;
}
.urgent-indicator::before { width: 16px; height: 2px; }
.urgent-indicator::after { width: 2px; height: 16px; }
.urgent-copy { display: flex; flex-direction: column; }
.urgent-copy small { color: #bacbd4; font-size: 12px; letter-spacing: .06em; }
.urgent-copy strong { margin: 3px 0 2px; font-size: clamp(21px, 3vw, 27px); }
.urgent-copy > span { color: #d1dde3; font-size: 14px; }
.urgent-arrow { color: #c4d3db; font-size: 21px; }
.home-evidence {
  margin: 0 0 38px;
  padding: clamp(24px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(251, 252, 252, .9);
  box-shadow: 0 14px 42px rgba(32, 55, 68, .06);
}
.home-evidence-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.home-evidence-heading h2 { font-size: clamp(25px, 3.7vw, 37px); margin-bottom: 8px; }
.home-evidence-heading p:last-child { color: var(--muted); margin-bottom: 0; }
.evidence-tree-mark { width: 88px; height: 94px; flex: 0 0 88px; display: flex; flex-direction: column; align-items: center; justify-content: end; }
.evidence-tree-crown {
  width: 66px; height: 58px; border-radius: 48% 52% 43% 57%;
  background: linear-gradient(145deg, #7895a4, #58778a);
  box-shadow: inset -8px -7px 0 rgba(255,255,255,.08);
}
.evidence-tree-trunk { width: 5px; height: 25px; background: #788b94; border-radius: 3px 3px 0 0; }
.home-evidence-empty { margin-top: 24px; padding: 20px; border-radius: 15px; background: var(--blue-pale); color: #526670; }
.home-evidence-empty p { margin-bottom: 15px; }
.evidence-preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 25px; }
.evidence-preview-card { padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: var(--blue-pale); }
.evidence-preview-card .preview-label { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .09em; }
.evidence-preview-card h3 { margin: 7px 0 10px; font-size: 17px; }
.evidence-preview-card p { color: #526670; margin-bottom: 0; }
.evidence-preview-card .preview-counter { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; }
.home-evidence-actions { display: flex; justify-content: flex-end; align-items: center; gap: 16px; margin-top: 18px; }
.entry-label { margin: 0 0 12px; color: var(--muted); font-size: 12px; font-weight: 750; letter-spacing: .1em; }
.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.entry-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  border-radius: var(--radius);
  padding: 25px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  text-align: left;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 10px 36px rgba(38, 75, 110, .045);
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.entry-card:hover { transform: translateY(-2px); border-color: #b9c9d0; box-shadow: var(--shadow); }
.entry-card.primary-entry { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.entry-card.primary-entry small { color: rgba(255,255,255,.76); }
.entry-card.primary-entry .entry-symbol { color: #fff; border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.1); }
.entry-card.wide-entry { grid-column: 1 / -1; }
.entry-symbol {
  width: 45px; height: 45px; border: 1px solid #c8d4da; border-radius: 13px;
  display: grid; place-items: center; color: var(--blue); background: var(--blue-pale);
  font-size: 11px; font-weight: 800; letter-spacing: .08em;
}
.entry-copy { display: flex; flex-direction: column; gap: 3px; }
.entry-copy strong { font-size: 17px; }
.entry-copy small { color: var(--muted); font-size: 13px; font-weight: 400; }
.entry-arrow { font-size: 18px; opacity: .55; }
.page-heading { padding: 50px 0 28px; }
.page-heading > p, .split-heading p { color: var(--muted); }
.split-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.primary-action, .secondary-action {
  border: 1px solid transparent;
  padding: 13px 21px;
  min-height: 50px;
  border-radius: 13px;
  cursor: pointer;
  font-weight: 700;
}
.primary-action { background: var(--blue); color: #fff; }
.primary-action:hover { background: var(--blue-dark); }
.secondary-action { background: var(--blue-soft); color: var(--blue-dark); border-color: #d1dde2; }
.full-width { width: 100%; }
.flow-card, .hug-card {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(25px, 5vw, 46px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.section-index { display: inline-block; color: var(--blue); background: var(--blue-soft); border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 700; margin-bottom: 20px; }
.state-options { display: grid; gap: 11px; margin-top: 26px; }
.state-options button {
  min-height: 76px; padding: 14px 18px; display: flex; flex-direction: column; gap: 2px;
  text-align: left; border: 1px solid var(--line); border-radius: 15px; background: var(--blue-pale); cursor: pointer;
}
.state-options button:hover { border-color: #adc0c9; background: var(--blue-soft); }
.state-options strong { font-size: 16px; }
.state-options small { color: var(--muted); font-size: 13px; }
.low-state-options { display: grid; gap: 10px; margin-top: 24px; }
.low-state-options button {
  min-height: 74px; padding: 13px 16px; display: grid; grid-template-columns: auto 1fr; gap: 14px;
  align-items: center; text-align: left; border: 1px solid var(--line); border-radius: 15px;
  background: var(--blue-pale); cursor: pointer;
}
.low-state-options button:hover { background: var(--blue-soft); border-color: #adc0c9; }
.low-state-options button > span:last-child { display: flex; flex-direction: column; }
.low-state-options small { color: var(--muted); font-size: 13px; }
.low-state-symbol {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px;
  background: var(--blue-soft); color: var(--blue-dark); font-size: 20px; font-weight: 700;
}
.kit-summary {
  margin-top: 22px; padding: 16px 17px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-top: 1px solid var(--line);
}
.kit-summary p { color: var(--muted); font-size: 13px; margin: 3px 0 0; }
.low-load-step-card { min-height: 400px; display: flex; flex-direction: column; }
.low-load-step-card #lowStepContent { flex: 1; }
.low-step-copy { margin: 20px 0; color: #405762; font-size: clamp(18px, 2.7vw, 22px); line-height: 1.85; }
.low-step-copy p { margin-bottom: 12px; }
.low-step-note { color: var(--muted); font-size: 14px; }
.personal-response {
  margin: 0 0 18px; padding: 18px 20px; border-radius: 15px;
  background: #e8eef1; border: 1px solid #cfdbdf; color: var(--blue-dark);
}
.personal-response span { display: block; margin-bottom: 5px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.personal-response p { margin: 0; font-size: 18px; }
.grounding-year {
  margin: 22px 0; padding: 24px; border-left: 3px solid var(--blue); border-radius: 4px 15px 15px 4px;
  background: var(--blue-pale); color: #405762;
}
.grounding-year strong { display: block; color: var(--blue-dark); font-size: 23px; margin-bottom: 8px; }
.optional-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 22px; }
.optional-actions button {
  min-height: 54px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 13px;
  background: var(--blue-pale); text-align: left; cursor: pointer;
}
.optional-actions button:hover, .optional-actions button.selected { background: var(--blue-soft); border-color: #adc0c9; }
.safety-result { margin-top: 16px; padding: 17px; border-radius: 13px; background: var(--blue-soft); color: #405762; }
.critic-voice { margin: 20px 0; padding: 19px; border-radius: 15px; background: #f5f2f2; border: 1px solid #e3dada; }
.critic-voice span { display: block; color: var(--danger-muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.critic-voice p { margin: 6px 0 0; font-size: 18px; }
.evidence-link {
  width: 100%; margin-top: 18px; padding: 16px; display: flex; justify-content: space-between; gap: 14px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--blue-pale); text-align: left; cursor: pointer;
}
.evidence-link:hover { background: var(--blue-soft); }
.personal-method {
  margin: 22px 0; padding: 22px; border-radius: 15px; background: var(--blue-pale); border: 1px solid var(--line);
}
.personal-method span { display: block; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.personal-method strong { display: block; margin-top: 7px; font-size: 21px; color: var(--blue-dark); }
.support-evidence {
  margin: 24px 0; padding: 22px; background: var(--blue-pale); border-left: 3px solid var(--blue);
  border-radius: 4px 15px 15px 4px;
}
.support-evidence span { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.support-evidence p { margin: 8px 0 0; color: #405762; font-size: 18px; }
.calm-copy { margin: 26px 0; padding: 22px; background: var(--blue-pale); border-left: 3px solid #7795a5; border-radius: 4px 15px 15px 4px; color: #405762; }
.calm-copy p:last-child { margin-bottom: 0; }
.calm-actions { display: grid; gap: 9px; }
.calm-response { color: #405762; background: var(--blue-soft); border-radius: 13px; padding: 16px; margin: 18px 0 0; }
.stepper { display: flex; gap: 7px; max-width: 720px; margin: 0 auto 14px; }
.step-dot { height: 4px; border-radius: 999px; background: #d7e2eb; flex: 1; transition: background .2s; }
.step-dot.done, .step-dot.current { background: var(--blue); }
.rescue-step { display: none; }
.rescue-step.active { display: block; animation: arrive .25s ease; }
.step-label, .helper { color: var(--muted); font-size: 14px; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 22px 0; }
.choice-grid button, .hug-actions button {
  border: 1px solid var(--line); background: var(--blue-pale); border-radius: 13px;
  min-height: 52px; padding: 11px 14px; cursor: pointer;
}
.choice-grid button:hover, .choice-grid button.selected, .hug-actions button:hover {
  background: var(--blue-soft); border-color: #adc0c9;
}
label { display: block; color: #405762; font-size: 14px; font-weight: 700; margin-top: 19px; }
textarea, input, select {
  width: 100%; margin-top: 7px; border: 1px solid var(--line); border-radius: 12px;
  background: #fbfdff; color: var(--ink); padding: 13px 15px;
}
textarea { resize: vertical; line-height: 1.65; }
.flow-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; gap: 14px; }
.text-action { color: var(--muted); padding: 10px 5px; }
.summary { background: var(--blue-pale); border-left: 3px solid var(--blue); border-radius: 4px 15px 15px 4px; padding: 23px; margin: 22px 0; color: #405762; }
.summary p { margin-bottom: 13px; }
.summary .equation { font-size: 21px; color: var(--blue-dark); font-weight: 750; letter-spacing: .04em; }
.hug-card { max-width: 680px; }
.hug-copy { color: #344f5e; font-size: clamp(18px, 2.7vw, 23px); line-height: 1.8; padding: 4px 0 22px; }
.hug-copy p { margin-bottom: 6px; }
.hug-actions { display: grid; gap: 9px; }
.gentle-response { margin-top: 20px; padding: 20px; background: var(--blue-pale); border: 1px solid var(--line); border-radius: 15px; color: #405762; }
.forest-scene {
  min-height: 112px; display: flex; align-items: end; gap: 8px; overflow: hidden; padding: 18px 20px 0;
  border: 1px solid var(--line); background: rgba(255,255,255,.58); border-radius: 18px;
}
.tree { display: flex; flex-direction: column; justify-content: end; align-items: center; flex: 1 0 42px; max-width: 72px; animation: grow .45s ease both; transform-origin: bottom; }
.tree-crown { width: var(--size); height: var(--size); border-radius: 12px 12px 5px 5px; background: var(--tree-color); opacity: .85; }
.tree-trunk { width: 4px; height: 24px; background: #8194a5; border-radius: 3px 3px 0 0; }
@keyframes grow { from { transform: scaleY(.25); opacity: 0; } }
.record-list, .pattern-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; margin-top: 20px; }
.record-card, .pattern-card { background: var(--card); border: 1px solid var(--line); border-radius: 17px; padding: 21px; box-shadow: 0 8px 28px rgba(39,74,107,.045); }
.record-date { color: var(--muted); font-size: 12px; letter-spacing: .06em; }
.record-card h3, .pattern-card h3 { font-size: 18px; margin: 6px 0 13px; }
.record-detail { margin: 10px 0 0; color: #52687c; }
.record-detail strong, .pattern-node small { display: block; color: var(--blue); font-size: 11px; letter-spacing: .08em; }
.delete-button { border: 0; background: none; color: var(--danger-muted); padding: 11px 0 0; cursor: pointer; font-size: 13px; }
.empty-state { color: var(--muted); text-align: center; border: 1px dashed #c4d5e3; border-radius: 16px; padding: 27px; margin-top: 18px; }
.letter-preview { white-space: pre-wrap; color: #52687c; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.pattern-card { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1.25fr; gap: 11px; align-items: center; }
.pattern-node { background: var(--blue-pale); border: 1px solid #e4edf5; border-radius: 12px; padding: 14px; min-height: 88px; }
.pattern-node p { margin: 5px 0 0; }
.pattern-arrow { color: #8da4b8; font-size: 19px; }
dialog {
  width: min(600px, calc(100% - 28px)); max-height: calc(100vh - 28px); border: 0;
  border-radius: 20px; padding: 0; color: var(--ink); background: #fff; box-shadow: 0 32px 100px rgba(18,44,68,.24);
}
dialog::backdrop { background: rgba(20, 39, 57, .48); backdrop-filter: blur(3px); }
.dialog-form { padding: clamp(23px, 5vw, 36px); overflow-y: auto; }
.dialog-heading { display: flex; justify-content: space-between; gap: 20px; }
.dialog-heading h3 { margin-bottom: 0; }
.close-button { width: 42px; height: 42px; border-radius: 50%; color: var(--muted); font-size: 27px; line-height: 1; }
.close-button:hover { background: var(--blue-soft); }
.dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 26px; }
.kit-presets { margin: 22px 0 0; padding: 0; border: 0; }
.kit-presets legend { color: #405762; font-size: 14px; font-weight: 700; margin-bottom: 9px; }
.kit-presets label {
  display: flex; align-items: center; gap: 10px; margin: 0; padding: 11px 3px;
  border-bottom: 1px solid var(--line); font-weight: 500;
}
.kit-presets input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
.inline-input { display: flex; align-items: stretch; gap: 8px; margin-top: 7px; }
.inline-input input { margin: 0; }
.inline-input button { flex: 0 0 auto; min-height: auto; }
.custom-kit-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.kit-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--blue-pale); color: #405762; font-size: 13px;
}
.kit-chip button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 2px; }
.personal-response-editor { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.personal-response-editor h4 { margin: 0 0 4px; font-size: 17px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: #20384e; color: #fff; padding: 10px 17px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: .22s; z-index: 20; font-size: 14px;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.hidden { display: none !important; }

@media (max-width: 700px) {
  .topbar { height: 66px; }
  main { width: min(100% - 24px, 1040px); margin-bottom: 44px; }
  .home-intro { padding: 48px 4px 34px; }
  .urgent-entry { padding: 22px 18px; gap: 14px; border-radius: 19px; }
  .urgent-indicator { width: 42px; height: 42px; }
  .home-evidence { padding: 22px 17px; border-radius: 19px; }
  .evidence-tree-mark { width: 65px; flex-basis: 65px; transform: scale(.82); transform-origin: right center; }
  .evidence-preview-grid { grid-template-columns: 1fr; }
  .home-evidence-actions { align-items: stretch; flex-direction: column-reverse; gap: 5px; }
  .home-evidence-actions button { width: 100%; }
  .entry-grid, .record-list, .pattern-list { grid-template-columns: 1fr; }
  .entry-card.wide-entry { grid-column: auto; }
  .entry-card { padding: 19px 17px; border-radius: 17px; gap: 13px; }
  .entry-symbol { width: 41px; height: 41px; }
  .page-heading { padding: 36px 3px 22px; }
  .split-heading { align-items: flex-start; flex-direction: column; }
  .flow-card, .hug-card { padding: 23px 17px; border-radius: 19px; }
  .choice-grid { grid-template-columns: 1fr; }
  .choice-grid button { text-align: left; padding-left: 17px; }
  .optional-actions { grid-template-columns: 1fr; }
  .low-load-step-card { min-height: 360px; }
  .kit-summary { align-items: flex-start; padding-inline: 2px; }
  .inline-input { flex-direction: column; }
  .pattern-card { grid-column: auto; grid-template-columns: 1fr; }
  .pattern-arrow { transform: rotate(90deg); justify-self: center; line-height: 1; }
  .forest-scene { min-height: 104px; padding-inline: 10px; }
  .dialog-actions { justify-content: stretch; }
  .dialog-actions button { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
