:root {
  --ink: #292724;
  --muted: #706d67;
  --paper: #f1ede5;
  --surface: #fbf8f2;
  --surface-strong: #fffdf9;
  --night: #253348;
  --night-dark: #182436;
  --night-soft: #dfe5ec;
  --moss: #66705d;
  --clay: #a6644b;
  --clay-soft: #ead9cf;
  --gold: #bd9762;
  --line: #d9d2c8;
  --divider: #e7e0d7;
  --danger: #9a3f3f;
  --shadow: 0 22px 60px rgba(48, 42, 35, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-width: 280px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 78% 7%, rgba(189, 151, 98, .12), transparent 24rem),
    var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", sans-serif;
  line-height: 1.65;
}

button, input, textarea, select { font: inherit; }
button, select { color: inherit; }
button { cursor: pointer; }
img, svg { max-width: 100%; }
p, h1, h2, h3, blockquote { overflow-wrap: anywhere; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(37, 51, 72, .22);
  outline-offset: 3px;
}
[hidden] { display: none !important; }
.shell { width: min(1080px, calc(100% - 40px)); margin-inline: auto; }

.site-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 760;
}
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--night);
  color: #faf4e9;
  font-family: Georgia, "Songti SC", serif;
  font-size: 22px;
}
.header-actions { display: flex; align-items: center; gap: 22px; }
.header-actions a, .text-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}
.header-actions a:hover, .text-button:hover { color: var(--ink); }

.hero {
  min-height: 660px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(290px, .72fr);
  gap: 78px;
  align-items: center;
  padding-block: 80px 96px;
}
.eyebrow, .section-heading > span, .privacy-inner span, .science-card > span, .reflection-box > span {
  margin: 0;
  color: var(--clay);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 18px 0 24px;
  font-size: clamp(46px, 7vw, 78px);
  line-height: 1.05;
  letter-spacing: -.055em;
}
.hero h1 em {
  color: var(--night);
  font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
  font-weight: 500;
}
.hero-lead {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 21px);
}
.boundary-note {
  max-width: 670px;
  margin: 20px 0 0;
  padding-left: 16px;
  border-left: 2px solid var(--gold);
  color: var(--muted);
  font-size: 14px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 740;
  transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .5; transform: none; }
.button.primary { background: var(--night); color: #fffaf2; }
.button.primary:hover:not(:disabled) { background: var(--night-dark); }
.button.quiet { border-color: var(--line); background: var(--surface); color: var(--ink); }
.button.quiet:hover { border-color: #bdb3a6; }
.trust-list { display: flex; flex-wrap: wrap; margin-top: 30px; color: var(--muted); font-size: 13px; }
.trust-list span + span::before { content: "·"; padding-inline: 9px; color: var(--gold); }

.hero-note {
  position: relative;
  overflow: hidden;
  padding: 34px;
  border: 1px solid rgba(37, 51, 72, .18);
  border-radius: 22px;
  background: var(--night);
  color: #f8f2e8;
  box-shadow: 0 28px 70px rgba(24, 36, 54, .18);
}
.hero-note::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  right: -80px;
  bottom: -92px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
}
.orb {
  width: 118px;
  height: 118px;
  display: grid;
  place-items: center;
  margin-bottom: 42px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 50%;
  background: radial-gradient(circle at 65% 36%, #f4d7ad 0 6%, #b99063 7% 18%, #46566a 19% 53%, #1a2638 54%);
}
.orb span { width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 248, 236, .86); box-shadow: 0 0 25px #f1c98f; }
.note-kicker { color: #cdbb9e; font-size: 12px; font-weight: 750; letter-spacing: .08em; }
.hero-note blockquote { margin: 14px 0; font-family: Georgia, "Songti SC", serif; font-size: 23px; line-height: 1.45; }
.hero-note > p:last-child { margin: 0; color: #c8ced6; font-size: 14px; }

.method { padding-block: 90px 110px; }
.section-heading { display: grid; grid-template-columns: 1fr 2fr; gap: 40px; margin-bottom: 40px; }
.section-heading h2, .privacy-inner h2 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.2;
  letter-spacing: -.035em;
}
.topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.topic-grid article {
  min-height: 245px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(251, 248, 242, .75);
}
.topic-grid article > span { color: var(--clay); font-family: Georgia, serif; font-size: 13px; }
.topic-grid h3 { margin: 52px 0 10px; font-size: 21px; }
.topic-grid p { margin: 0; color: var(--muted); font-size: 15px; }
.knowledge-section { padding-block: 100px; border-top: 1px solid var(--line); }
.knowledge-heading > div > p { max-width: 700px; margin: 16px 0 0; color: var(--muted); }
.knowledge-columns { display: grid; grid-template-columns: 1fr; gap: 18px; }
.knowledge-block { padding: clamp(26px, 4vw, 42px); border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.science-block { border-top: 4px solid #637890; }
.knowledge-kicker { margin: 0; color: var(--clay); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.science-block .knowledge-kicker { color: #536b84; }
.knowledge-block > h3 { margin: 12px 0 30px; font-family: Georgia, "Songti SC", serif; font-size: clamp(24px, 3vw, 31px); line-height: 1.4; font-weight: 500; }
.knowledge-points { display: grid; gap: 22px; }
.knowledge-points section { padding-top: 20px; border-top: 1px solid var(--divider); }
.knowledge-points h4 { margin: 0 0 7px; font-size: 16px; }
.knowledge-points p { margin: 0; color: var(--muted); font-size: 14px; }
.science-block .knowledge-points { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 34px; }
.science-block mark { padding: .08em .2em; border-radius: 3px; background: #f1d7a8; color: var(--night); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.research-source { display: block; margin-top: 10px; color: #536b84; font-size: 12px; line-height: 1.6; }
.theory-section { padding-block: 100px; border-top: 1px solid var(--line); }
.theory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.theory-card { min-height: 360px; padding: clamp(24px, 3vw, 34px); border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.theory-card h3 { margin: 14px 0 24px; font-family: Georgia, "Songti SC", serif; font-size: clamp(24px, 3vw, 30px); line-height: 1.25; font-weight: 500; }
.theory-card p { margin: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.75; }
.theory-card p:last-child { margin-bottom: 0; }
.theory-card strong { color: var(--ink); }
.theory-kicker { margin: 0; color: var(--clay) !important; font-size: 11px !important; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.freud-theory { border-top: 4px solid #9d674d; }
.jung-theory { border-top: 4px solid #667a91; }
.adler-theory { border-top: 4px solid #8c6872; }
.theory-source { margin: 22px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.faq-section { padding-block: 90px; border-top: 1px solid var(--line); }
.faq-list { max-width: 880px; margin-left: auto; border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { padding: 22px 4px; cursor: pointer; font-size: 18px; font-weight: 760; }
.faq-list p { max-width: 760px; margin: -4px 0 24px; color: var(--muted); }
.references-section { padding-block: 80px 100px; border-top: 1px solid var(--line); }
.references-heading { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; margin-bottom: 34px; }
.references-heading h2 { margin: 8px 0 0; font-size: clamp(28px, 4vw, 40px); }
.references-heading > p { margin: 8px 0 0; color: var(--muted); }
.reference-list { margin: 0; padding: 0; border-top: 1px solid var(--line); list-style: none; counter-reset: refs; }
.reference-list li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 24px; padding: 18px 8px 18px 42px; border-bottom: 1px solid var(--line); counter-increment: refs; font-size: 14px; }
.reference-list li::before { content: counter(refs, decimal-leading-zero); position: absolute; left: 4px; color: var(--clay); font-family: Georgia, serif; font-size: 12px; }
.reference-list a { color: var(--night); text-underline-offset: 3px; }
.reference-list span { color: var(--muted); font-size: 12px; }
.privacy-band { border-block: 1px solid var(--line); background: #e5e3df; }
.privacy-inner { min-height: 270px; display: grid; grid-template-columns: 1.15fr 1fr; gap: 80px; align-items: center; }
.privacy-inner h2 { margin-top: 10px; }
.privacy-inner > p { color: var(--muted); }

.workspace { max-width: 980px; padding-block: 34px 90px; }
.workspace-topline {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  margin-bottom: 22px;
}
.back-home { min-height: 44px; display: inline-flex; align-items: center; padding: 0; border: 0; background: transparent; color: var(--muted); text-align: left; }
.save-status { color: var(--muted); font-size: 12px; text-align: right; }
.stepper { display: flex; align-items: center; gap: 16px; margin: 0; padding: 0; list-style: none; }
.stepper li { display: flex; align-items: center; gap: 6px; color: #99938b; font-size: 12px; font-weight: 700; }
.stepper li + li::before { content: ""; width: 24px; height: 1px; margin-right: 10px; background: var(--line); }
.stepper span { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; }
.stepper li.active { color: var(--night); }
.stepper li.active span { border-color: var(--night); background: var(--night); color: white; }

.panel {
  padding: clamp(26px, 5vw, 54px);
  border: 1px solid var(--line);
  border-radius: 23px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.panel-heading, .results-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 34px;
  margin-bottom: 36px;
}
.panel-heading h2, .results-heading h2, .safety-panel h2 {
  margin: 8px 0 0;
  font-size: clamp(30px, 4.2vw, 44px);
  line-height: 1.18;
  letter-spacing: -.035em;
}
.panel-heading > p { max-width: 380px; margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { min-width: 0; margin: 0 0 24px; padding: 0; border: 0; }
.form-group.full { grid-column: 1 / -1; }
.form-group > label, .form-group > legend { display: block; margin-bottom: 9px; font-size: 14px; font-weight: 760; }
.form-group > label span, .more-context summary span { color: var(--clay); font-size: 11px; font-weight: 700; }
textarea, select, input[type="number"], input[type="password"], .question-answer {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  color: var(--ink);
}
textarea { min-height: 84px; padding: 15px 16px; resize: vertical; }
select, input[type="number"], input[type="password"] { height: 48px; padding: 0 12px; }
textarea:focus, select:focus, input[type="number"]:focus, input[type="password"]:focus { border-color: #8f9aa8; }
.field-meta { display: flex; justify-content: space-between; margin-top: 6px; color: #969087; font-size: 11px; }
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.choice-grid label { position: relative; }
.choice-grid input { position: absolute; opacity: 0; pointer-events: none; }
.choice-grid span {
  min-height: 48px;
  display: grid;
  place-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
.choice-grid input:checked + span { border-color: var(--night); background: var(--night-soft); color: var(--night); }
.choice-grid input:focus-visible + span { outline: 3px solid rgba(37, 51, 72, .22); outline-offset: 2px; }
.switch-group { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-strong); }
.switch-group label { margin: 0; }
.switch-group p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.switch { display: flex; align-items: center; gap: 8px; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 42px; height: 24px; position: relative; border-radius: 999px; background: #cfc9c0; transition: .16s; }
.switch span::after { content: ""; width: 18px; height: 18px; position: absolute; top: 3px; left: 3px; border-radius: 50%; background: white; transition: .16s; }
.switch input:checked + span { background: var(--night); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch b { color: var(--muted); font-size: 12px; }
.more-context { margin: 6px 0 28px; border-block: 1px solid var(--divider); }
.more-context summary { padding: 18px 2px; cursor: pointer; font-size: 14px; font-weight: 740; }
.details-grid { padding-top: 20px; }
.test-config {
  margin: -10px 0 30px;
  border: 1px solid #cbd3db;
  border-radius: 13px;
  background: #e9edf1;
}
.test-config summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  cursor: pointer;
  color: #3d4f63;
  font-size: 13px;
  font-weight: 760;
}
.test-config summary span { color: #62758b; font-size: 11px; font-weight: 650; }
.api-key-row { display: grid; grid-template-columns: minmax(280px, 1fr) 1fr; gap: 24px; padding: 4px 16px 16px; }
.api-key-row .form-group { margin: 0; }
.api-key-row > p { margin: 26px 0 0; color: #53667d; font-size: 12px; }
.secret-field { position: relative; }
.secret-field input { padding-right: 58px; background: #f8fafb; }
.secret-field button {
  position: absolute;
  right: 2px;
  top: 2px;
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #53667d;
  font-size: 11px;
  font-weight: 700;
}
.consent-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 4px; }
.consent-row > label { min-height: 44px; display: flex; align-items: flex-start; gap: 9px; max-width: 580px; color: var(--muted); font-size: 12px; }
.consent-row input { margin-top: 4px; accent-color: var(--night); }

.response-panel, .results-panel, .safety-panel { max-width: 900px; margin-inline: auto; }
.evidence-pill { flex: none; padding: 6px 10px; border-radius: 999px; font-size: 11px; font-weight: 760; }
.evidence-pill.descriptive { background: #e3e8df; color: #4e6047; }
.acknowledgement { margin-bottom: 26px; padding: 19px 21px; border-left: 3px solid var(--gold); background: #f4eee4; font-family: Georgia, "Songti SC", serif; font-size: 18px; }
.observation-list { display: grid; gap: 10px; margin-bottom: 32px; }
.observation {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 12px;
  padding: 15px 16px;
  border: 1px solid var(--divider);
  border-radius: 12px;
  background: var(--surface-strong);
}
.observation::before { content: "·"; color: var(--clay); font-size: 26px; line-height: .8; }
.observation p { margin: 0; }
.observation small { display: block; margin-top: 4px; color: var(--muted); }
.question-list { display: grid; gap: 18px; }
.question-item label { display: block; margin-bottom: 8px; font-weight: 740; }
.question-item label span { color: var(--clay); font-family: Georgia, serif; margin-right: 7px; }
.question-answer { min-height: 90px; padding: 14px 15px; }
.panel-actions, .result-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 28px; }

.results-heading { align-items: center; }
.results-summary { max-width: 760px; margin: -12px 0 24px; color: var(--muted); font-size: 17px; }
.dream-summary-card {
  margin-bottom: 20px;
  padding: 22px 24px;
  border-left: 3px solid var(--gold);
  background: #f4eee4;
}
.dream-summary-card > span {
  color: var(--clay);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
}
.dream-summary-card p {
  margin: 8px 0 0;
  font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
  font-size: 18px;
  line-height: 1.75;
  white-space: pre-wrap;
}
.markdown-output {
  padding: 10px 2px 4px;
  color: var(--ink);
}
.markdown-output h2,
.markdown-output h3,
.markdown-output h4 {
  color: var(--night);
  letter-spacing: -.025em;
  line-height: 1.35;
}
.markdown-output h2 { margin: 34px 0 13px; font-size: clamp(23px, 3vw, 29px); }
.markdown-output h3 { margin: 28px 0 10px; font-size: 22px; }
.markdown-output h4 { margin: 22px 0 8px; font-size: 18px; }
.markdown-output > :first-child { margin-top: 0; }
.markdown-output p,
.markdown-output li {
  max-width: 780px;
  font-size: 17px;
  line-height: 1.9;
}
.markdown-output p { margin: 0 0 17px; }
.markdown-output strong { color: var(--night); font-weight: 780; }
.markdown-output em { color: var(--clay); }
.markdown-output ul,
.markdown-output ol { margin: 0 0 20px; padding-left: 1.45em; }
.markdown-output li + li { margin-top: 5px; }
.markdown-output blockquote {
  margin: 20px 0;
  padding: 4px 18px;
  border-left: 3px solid var(--gold);
  color: var(--muted);
  background: #f7f3ec;
}
.markdown-output blockquote p { margin: 0; }
.markdown-output hr { margin: 28px 0; border: 0; border-top: 1px solid var(--line); }
.markdown-output code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #f0ebe2;
  font-size: .9em;
}
.markdown-output pre {
  overflow-x: auto;
  margin: 18px 0;
  padding: 15px;
  border-radius: 10px;
  background: #f0ebe2;
  white-space: pre-wrap;
}
.markdown-output pre code { padding: 0; background: transparent; }
.png-export-stage { position: fixed; top: 0; left: -100000px; width: 750px; opacity: 0; pointer-events: none; }
.hypothesis-list { border-top: 1px solid var(--line); }
.theme-card { padding: 30px 2px; border-bottom: 1px solid var(--line); }
.theme-heading { display: grid; grid-template-columns: 42px 1fr; align-items: baseline; gap: 8px; }
.theme-heading span { color: var(--clay); font-family: Georgia, serif; font-size: 12px; }
.theme-heading h3 { margin: 0; font-size: clamp(21px, 3vw, 27px); letter-spacing: -.02em; }
.theme-interpretation {
  max-width: 760px;
  margin: 14px 0 0 50px;
  font-size: 16px;
  line-height: 1.9;
  white-space: pre-line;
}
.theme-details { margin: 13px 0 0 50px; color: var(--muted); font-size: 12px; }
.hypothesis-card { padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-strong); }
.hypothesis-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.hypothesis-top h3 { margin: 0; font-size: 21px; }
.level-badge { flex: none; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.level-descriptive { background: #e3e8df; color: #4e6047; }
.level-continuity { background: #e3e8ef; color: #40556f; }
.level-jungian { background: #efe2d9; color: #8b513b; }
.hypothesis-interpretation { margin: 16px 0; font-size: 16px; }
.evidence-block { padding: 13px 15px; border-radius: 10px; background: #f3efe8; }
.evidence-block strong { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.evidence-block ul { margin: 0; padding-left: 18px; }
.uncertainty { color: var(--muted); font-size: 13px; }
.check-question { margin-bottom: 0; color: var(--night); font-weight: 720; }
.hypothesis-feedback { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.hypothesis-feedback button { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-size: 11px; }
.hypothesis-feedback button[aria-pressed="true"] { border-color: var(--night); background: var(--night-soft); color: var(--night); }
.science-card { margin-top: 20px; padding: 22px; border: 1px solid #cbd3db; border-radius: 15px; background: #e9edf1; }
.science-card > span { color: #53667d; }
.science-card p { margin: 9px 0 0; color: #3d4f63; }
.reflection-box { margin-top: 20px; padding: 28px; border-radius: 17px; background: var(--night); color: #f8f3ea; }
.reflection-box > span { color: #d0b891; }
.reflection-box h3 { max-width: 720px; margin: 12px 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(23px, 3vw, 32px); line-height: 1.4; font-weight: 500; }
.reflection-box p { margin: 0; color: #c7ced7; font-size: 13px; }
.reflection-box hr { margin: 24px 0; border: 0; border-top: 1px solid rgba(255, 255, 255, .2); }
.result-basis { margin-top: 20px; padding: 26px; border: 1px solid var(--line); border-radius: 17px; background: #f4f1eb; }
.result-basis-heading > span, .result-basis-grid article > span { color: var(--clay); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.result-basis-heading h3 { margin: 5px 0 4px; font-size: 23px; }
.result-basis-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.result-basis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.result-basis-grid article { padding: 20px; border: 1px solid var(--divider); border-radius: 13px; background: var(--surface-strong); }
.result-basis-grid article:last-child > span { color: #536b84; }
.result-basis-grid h4 { margin: 7px 0 8px; font-size: 17px; }
.result-basis-grid p { margin: 0; color: var(--muted); font-size: 13px; }
.result-basis-grid small { display: block; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--divider); color: #8b857c; font-size: 10px; }
.basis-link { display: inline-flex; min-height: 44px; align-items: center; margin-top: 12px; color: var(--night); font-size: 12px; font-weight: 740; text-underline-offset: 3px; }
.support-note, .disclaimer { margin-top: 16px; padding: 16px 18px; border-radius: 12px; color: var(--muted); font-size: 13px; }
.support-note { border: 1px solid #dbc6ba; background: #f3e7df; }
.disclaimer { border: 1px dashed var(--line); }

.safety-panel { border-color: #d4b5ae; }
.safety-panel h2 { color: var(--danger); }
.safety-panel .markdown-output p { max-width: 700px; }
.loading-panel { min-height: 480px; display: grid; place-items: center; align-content: center; text-align: center; }
.loading-orb { width: 64px; height: 64px; border: 2px solid var(--line); border-top-color: var(--night); border-radius: 50%; animation: spin 1.1s linear infinite; }
.loading-panel p { margin: 20px 0 2px; font-weight: 760; }
.loading-panel span { color: var(--muted); font-size: 13px; }
@keyframes spin { to { transform: rotate(360deg); } }

.site-footer { min-height: 100px; display: flex; justify-content: space-between; align-items: center; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.site-footer a { min-height: 44px; display: inline-flex; align-items: center; color: var(--muted); text-underline-offset: 3px; }
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 10; transform: translateX(-50%); padding: 10px 16px; border-radius: 999px; background: var(--night-dark); color: white; box-shadow: var(--shadow); font-size: 13px; }

@media (hover: none), (pointer: coarse) {
  .button:hover { transform: none; }
  .button, .text-button, .back-home, .header-actions a { min-height: 44px; }
  .text-button, .back-home { display: inline-flex; align-items: center; }
  summary { min-height: 48px; display: flex; align-items: center; }
}

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 34px; padding-block: 64px 80px; }
  .hero-note { max-width: 520px; }
  .section-heading, .privacy-inner { grid-template-columns: 1fr; gap: 18px; }
  .privacy-inner { padding-block: 64px; }
  .topic-grid { grid-template-columns: 1fr; }
  .knowledge-columns { grid-template-columns: 1fr; }
  .science-block .knowledge-points { grid-template-columns: 1fr; }
  .theory-grid { grid-template-columns: 1fr; }
  .references-heading { grid-template-columns: 1fr; gap: 14px; }
  .topic-grid article { min-height: auto; }
  .topic-grid h3 { margin-top: 26px; }
  .workspace-topline { grid-template-columns: 1fr auto; }
  .stepper { grid-column: 1 / -1; grid-row: 2; justify-content: center; }
  .save-status { grid-column: 2; grid-row: 1; }
  .panel-heading { display: block; }
  .panel-heading > p { margin-top: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .api-key-row { grid-template-columns: 1fr; gap: 4px; }
  .api-key-row > p { margin-top: 0; }
  .form-group.full { grid-column: auto; }
  .results-panel { max-width: 720px; }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 24px, 1080px); }
  .site-header { min-height: calc(68px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
  .brand { min-height: 44px; }
  .brand-mark { width: 32px; height: 32px; font-size: 19px; }
  .header-actions { gap: 8px; }
  .header-actions a { display: none; }
  .hero h1 { margin-block: 14px 20px; font-size: clamp(35px, 11vw, 43px); line-height: 1.1; }
  .hero { min-height: auto; padding-block: 42px 64px; }
  .hero-lead { font-size: 17px; }
  .boundary-note { margin-top: 16px; padding-left: 12px; }
  .hero-actions { display: grid; margin-top: 26px; }
  .hero-actions .button { width: 100%; }
  .trust-list { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 12px; }
  .trust-list span + span::before { display: none; }
  .hero-note { padding: 26px 22px; border-radius: 18px; }
  .orb { width: 92px; height: 92px; margin-bottom: 28px; }
  .hero-note blockquote { font-size: 20px; }
  .method { padding-block: 70px; }
  .knowledge-section { padding-block: 70px; }
  .theory-section { padding-block: 70px; }
  .knowledge-block { padding: 25px 20px; }
  .knowledge-block > h3 { margin-bottom: 24px; font-size: 24px; }
  .faq-section { padding-block: 70px; }
  .faq-list summary { font-size: 16px; }
  .references-section { padding-block: 65px 80px; }
  .reference-list li { grid-template-columns: 1fr; gap: 6px; padding-left: 36px; }
  .section-heading { margin-bottom: 28px; }
  .section-heading h2, .privacy-inner h2 { font-size: 30px; }
  .topic-grid article { padding: 22px; }
  .privacy-inner { padding-block: 52px; }
  .workspace { width: 100%; padding: 18px 10px 70px; }
  .workspace-topline { gap: 8px 12px; padding-inline: 4px; }
  .save-status { display: none; }
  .stepper { gap: 7px; }
  .stepper li + li::before { width: 10px; margin-right: 3px; }
  .panel { padding: 24px 17px; border-radius: 18px; }
  .panel-heading, .results-heading { margin-bottom: 28px; }
  .panel-heading h2, .results-heading h2, .safety-panel h2 { font-size: 31px; }
  textarea, select, input[type="number"], input[type="password"], .question-answer { font-size: 16px; }
  #dream-text { min-height: 230px; }
  .test-config { margin: -4px 0 24px; }
  .test-config summary { flex-wrap: wrap; padding: 12px 14px; }
  .test-config summary span { width: 100%; }
  .api-key-row { padding: 4px 14px 14px; }
  .more-context summary { flex-wrap: wrap; gap: 2px 8px; }
  .more-context summary span { width: 100%; }
  .choice-grid { grid-template-columns: 1fr 1fr; }
  .consent-row { display: grid; }
  .consent-row .button { width: 100%; }
  .results-heading { display: block; }
  .results-heading .text-button { margin-top: 10px; }
  .dream-summary-card { padding: 18px; }
  .dream-summary-card p { font-size: 17px; line-height: 1.7; }
  .markdown-output p,
  .markdown-output li { font-size: 16px; line-height: 1.82; }
  .theme-card { padding-block: 26px; }
  .theme-heading { grid-template-columns: 34px 1fr; }
  .theme-interpretation, .theme-details { margin-left: 0; }
  .theme-interpretation { line-height: 1.82; }
  .reflection-box { padding: 24px 20px; }
  .reflection-box h3 { font-size: 23px; }
  .result-basis { padding: 22px 17px; }
  .result-basis-grid { grid-template-columns: 1fr; }
  .hypothesis-top { align-items: flex-start; }
  .panel-actions, .result-actions { display: grid; justify-content: stretch; }
  .result-actions .button { width: 100%; }
  .loading-panel { min-height: 65svh; padding-inline: 24px; }
  .site-footer { min-height: calc(160px + env(safe-area-inset-bottom)); align-items: flex-start; flex-direction: column; justify-content: center; padding-bottom: env(safe-area-inset-bottom); }
  .site-footer nav { justify-content: flex-start; }
  .toast { width: calc(100% - 32px); bottom: calc(16px + env(safe-area-inset-bottom)); border-radius: 12px; text-align: center; }
}

@media (max-width: 380px) {
  .shell { width: min(100% - 20px, 1080px); }
  .workspace { padding-inline: 6px; }
  .panel { padding: 22px 15px; }
  .trust-list { grid-template-columns: 1fr; }
  .stepper li { font-size: 11px; }
  .stepper span { width: 22px; height: 22px; }
}

@media (orientation: landscape) and (max-height: 520px) {
  .hero { padding-block: 34px 50px; }
  .loading-panel { min-height: 72svh; }
}

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