/* ==========================================================================
   IntelliMind — 케어 서비스 화면
   톤: 종이처럼 따뜻한 바탕, 잉크 같은 글자, 세이지·클레이 두 가지 색만.
   네온·보라 글로우·데이터 장식 없음. 여백과 호흡으로 신뢰를 만든다.
   ========================================================================== */

@font-face {
  font-family: 'Instrument Serif';
  src: url('fonts/InstrumentSerif-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-024F, U+1E00-1EFF, U+2000-206F, U+20A0-20AB, U+2100-214F, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('fonts/InstrumentSerif-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-024F, U+1E00-1EFF, U+2000-206F, U+20A0-20AB, U+2100-214F, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'MaruBuri';
  src: url('fonts/MaruBuri-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'MaruBuri';
  src: url('fonts/MaruBuri-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Pretendard';
  src: url('fonts/PretendardVariable.woff2') format('woff2');
  font-weight: 45 920;
  font-display: swap;
  font-style: normal;
}

:root {
  --ink: #211d18;
  --ink-2: #4c463d;
  --ink-3: #7c756a;
  --paper: #f4f0e8;
  --paper-2: #fbf8f2;
  --card: rgba(251, 248, 242, 0.86);
  --line: rgba(33, 29, 24, 0.11);
  --line-strong: rgba(33, 29, 24, 0.22);
  --sage: #6f8471;
  --sage-deep: #53664f;
  --clay: #b57d5c;
  --amber: #d0a367;
  --danger: #a84f42;
  --radius: 26px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --shadow: 0 34px 90px -46px rgba(38, 32, 25, 0.55), 0 2px 6px rgba(38, 32, 25, 0.04);
  --font: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  --font-display: 'Instrument Serif', 'MaruBuri', 'Apple SD Gothic Neo', 'Nanum Myeongjo', serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body.care {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  overscroll-behavior: none;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 70% at 50% -8%, rgba(255, 255, 255, 0.08), transparent 58%),
    linear-gradient(180deg, rgba(244, 240, 232, 0) 0%, rgba(244, 240, 232, 0.04) 55%, rgba(244, 240, 232, 0.16) 100%);
  transition: opacity 1.2s var(--ease);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}

/* ── 상단 바 ─────────────────────────────────────────────── */
.topbar {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(16px, 3vw, 34px);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand__mark {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--sage);
  display: grid;
  place-items: center;
  position: relative;
}
.brand__mark span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--clay);
  animation: mark-breathe 7s var(--ease) infinite;
}
@keyframes mark-breathe {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  45% { transform: scale(1.35); opacity: 1; }
}

.brand__text { font-size: 15px; }

.topbar__actions { display: flex; gap: 8px; align-items: center; }

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(251, 248, 242, 0.68);
  backdrop-filter: blur(10px);
  color: var(--ink-2);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}
.chip-btn:hover { background: rgba(251, 248, 242, 0.95); border-color: var(--line-strong); }
.chip-btn[aria-pressed='false'] { color: var(--ink-3); }
.chip-btn[aria-pressed='false'] .ico { opacity: 0.35; }
.chip-btn--ghost { background: transparent; }

.lang-btn {
  height: 34px;
  min-width: 44px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s;
}
.lang-btn:hover { background: rgba(255, 255, 255, 0.6); }

.ico { width: 14px; height: 14px; display: inline-block; position: relative; }
.ico--sound::before {
  content: ''; position: absolute; left: 0; top: 4px; width: 4px; height: 6px;
  background: currentColor; border-radius: 1px;
}
.ico--sound::after {
  content: ''; position: absolute; left: 3px; top: 2px;
  border-left: 6px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent;
}
.ico--voice::before {
  content: ''; position: absolute; left: 3px; top: 1px; width: 7px; height: 8px;
  border: 1.4px solid currentColor; border-radius: 4px;
}
.ico--voice::after {
  content: ''; position: absolute; left: 6px; top: 9px; width: 1.4px; height: 4px; background: currentColor;
}

@media (max-width: 560px) {
  .chip-btn__label { display: none; }
  .chip-btn { width: 34px; padding: 0; justify-content: center; }
  .chip-btn--ghost { width: auto; padding: 0 12px; }
}

/* ── 흐름 컨테이너 ───────────────────────────────────────── */
.flow {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: clamp(70px, 9vh, 96px) clamp(14px, 4vw, 40px) clamp(18px, 3vh, 34px);
  pointer-events: none;
}
.flow > * { pointer-events: auto; }

body[data-mode='sim'] .flow { opacity: 0; pointer-events: none; }
body[data-mode='sim'] .flow > * { pointer-events: none; }
body[data-mode='sim'] .veil { opacity: 0.25; }

.panel {
  width: min(580px, 100%);
  max-height: calc(100dvh - 130px);
  overflow: auto;
  background: var(--card);
  backdrop-filter: blur(20px) saturate(1.04);
  -webkit-backdrop-filter: blur(20px) saturate(1.04);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(26px, 4vw, 42px);
  animation: panel-in 0.75s var(--ease) both;
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(14px) scale(0.995); }
  to { opacity: 1; transform: none; }
}

.panel--center { text-align: left; }

.eyebrow {
  margin: 0 0 14px;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage-deep);
  font-weight: 650;
}

.hero-title {
  margin: 0 0 18px;
  font-size: clamp(27px, 4.1vw, 40px);
  line-height: 1.44;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.lede {
  margin: 0 0 26px;
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink-2);
}

.panel__title {
  margin: 0 0 10px;
  font-size: clamp(21px, 2.6vw, 25px);
  line-height: 1.45;
  letter-spacing: -0.025em;
  font-weight: 680;
}

.panel__sub {
  margin: 0 0 24px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--ink-2);
}

.cta-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.btn {
  height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 620;
  letter-spacing: -0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.25s var(--ease), background 0.25s, border-color 0.25s, opacity 0.2s;
}
.btn:active { transform: scale(0.985); }
.btn--primary { background: var(--ink); color: #fbf8f2; }
.btn--primary:hover { background: #322c25; }
.btn--primary:disabled { opacity: 0.4; cursor: default; }
.btn--quiet { background: transparent; border-color: var(--line-strong); color: var(--ink-2); }
.btn--quiet:hover { background: rgba(255, 255, 255, 0.45); }

.fineprint {
  margin: 22px 0 0;
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--ink-3);
}
.fineprint strong { color: var(--ink-2); font-weight: 650; }

/* ── 폼 ─────────────────────────────────────────────────── */
.field { border: 0; padding: 0; margin: 0 0 22px; }
.field legend {
  padding: 0;
  margin-bottom: 10px;
  font-size: 12.5px;
  font-weight: 640;
  color: var(--ink-2);
  letter-spacing: -0.01em;
}
.field__hint { font-weight: 500; color: var(--ink-3); font-size: 11.5px; margin-left: 6px; }

.chips { display: flex; gap: 8px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chips--wrap { flex-wrap: wrap; overflow: visible; }

.chip {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.22s var(--ease);
  white-space: nowrap;
}
.chip:hover { border-color: var(--line-strong); }
.chip.is-on {
  background: rgba(111, 132, 113, 0.14);
  border-color: rgba(111, 132, 113, 0.55);
  color: #33412f;
  font-weight: 620;
}

.panel__actions { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; }

.note-field { display: block; margin-top: 20px; }
.note-field > span { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 8px; font-weight: 600; }
.note-field em { font-style: normal; color: var(--ink-3); font-weight: 500; margin-left: 6px; font-size: 11.5px; }
.note-field textarea {
  width: 100%;
  min-height: 62px;
  resize: vertical;
  padding: 13px 15px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.note-field textarea:focus { border-color: rgba(111, 132, 113, 0.6); background: #fffdf9; }

/* ── 기분 ───────────────────────────────────────────────── */
.moods {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 6px;
}
.mood {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 14px 4px 12px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  font: inherit;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, transform 0.25s var(--ease);
}
.mood:hover { background: rgba(255, 255, 255, 0.5); }
.mood.is-on { background: rgba(255, 255, 255, 0.72); border-color: var(--line-strong); transform: translateY(-2px); }
.mood__orb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow: inset 0 -6px 12px rgba(0, 0, 0, 0.08), 0 6px 14px -8px rgba(40, 32, 24, 0.5);
  filter: saturate(0.9);
}
.mood__orb--heavy { background: radial-gradient(circle at 35% 30%, #9aa39c, #5d6a63); }
.mood__orb--anxious { background: radial-gradient(circle at 35% 30%, #cbb98e, #8a7a54); }
.mood__orb--angry { background: radial-gradient(circle at 35% 30%, #d09a81, #9a5c48); }
.mood__orb--tired { background: radial-gradient(circle at 35% 30%, #b3b6bc, #757b84); }
.mood__orb--empty { background: radial-gradient(circle at 35% 30%, #c9ccd1, #868c95); }
.mood__orb--tangled { background: radial-gradient(circle at 35% 30%, #bda795, #856b5c); }
.mood__orb--shaky { background: radial-gradient(circle at 35% 30%, #c0b995, #847c5c); }
.mood__orb--okay { background: radial-gradient(circle at 35% 30%, #a9bc9e, #6d8464); }

/* ── 호흡 ───────────────────────────────────────────────── */
.panel--breath {
  align-self: start;
  margin-top: 6vh;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  text-align: center;
  width: min(680px, 100%);
  max-height: none;
  overflow: visible;
  animation: none;
}
.breath__stage { padding: 2vh 0 3vh; }
.breath__phase {
  margin: 0;
  font-size: clamp(24px, 3.6vw, 34px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-shadow: 0 1px 12px rgba(255, 255, 255, 0.45);
  transition: opacity 0.35s;
}
.breath__count { margin: 12px 0 0; font-size: 12.5px; letter-spacing: 0.06em; color: var(--ink-3); }
.breath__note { margin: 26px 0 0; font-size: 12px; color: var(--ink-3); }
.breath__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ── 대화 독 ────────────────────────────────────────────── */
.dock {
  width: min(440px, calc(100vw - 28px));
  max-height: min(76dvh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--card);
  backdrop-filter: blur(22px) saturate(1.05);
  -webkit-backdrop-filter: blur(22px) saturate(1.05);
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: panel-in 0.8s var(--ease) both;
  justify-self: end;
  align-self: end;
}
@media (min-width: 900px) {
  .flow { place-items: stretch; }
  .dock { margin-left: auto; margin-top: auto; }
  .panel--center, .panel--form, .panel--report { margin: auto; }
}

.dock__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.dock__who { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); min-width: 0; }
.dock__who #who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 0 rgba(111, 132, 113, 0.5);
  animation: pulse 3.6s var(--ease) infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(111, 132, 113, 0.45); }
  60%, 100% { box-shadow: 0 0 0 9px rgba(111, 132, 113, 0); }
}
.dock__tools { display: flex; gap: 6px; }

.mini {
  height: 30px;
  white-space: nowrap;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink-2);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.mini:hover { background: #fffdf9; border-color: var(--line-strong); }
.mini--accent { background: rgba(111, 132, 113, 0.14); border-color: rgba(111, 132, 113, 0.4); color: #33412f; font-weight: 620; }
.mini--accent:hover { background: rgba(111, 132, 113, 0.2); }

.dock__log {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 18px 6px;
  scroll-behavior: smooth;
  min-height: 120px;
}
.dock__log::-webkit-scrollbar { width: 4px; }
.dock__log::-webkit-scrollbar-thumb { background: rgba(33, 29, 24, 0.14); border-radius: 4px; }

.msg {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.78;
  color: var(--ink);
  max-width: 94%;
  animation: msg-in 0.5s var(--ease) both;
}
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg--user {
  margin-left: auto;
  background: rgba(33, 29, 24, 0.055);
  padding: 10px 14px;
  border-radius: 16px 16px 4px 16px;
  color: var(--ink-2);
  width: fit-content;
}
.msg--ai { padding-left: 2px; }
.msg__meta { display: block; margin-top: 6px; font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.02em; }

.typing { display: inline-flex; gap: 3px; align-items: center; height: 18px; }
.typing i {
  width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3);
  animation: typing 1.2s infinite ease-in-out;
}
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 60%, 100% { opacity: 0.25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

.dock__ask { flex: 0 0 auto; padding: 12px 18px 14px; border-top: 1px solid var(--line); }
.question { margin: 0 0 10px; font-size: 13.5px; font-weight: 620; line-height: 1.6; color: var(--ink); }
.choices { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.choices:empty { display: none; }
.choice {
  height: 32px;
  white-space: nowrap;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  font: inherit;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.choice:hover { background: #fffdf9; border-color: var(--line-strong); transform: translateY(-1px); }

.say { display: flex; gap: 8px; align-items: center; }
.say input {
  flex: 1;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
  padding: 0 16px;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.say input:focus { border-color: rgba(111, 132, 113, 0.55); background: #fffdf9; }
.send {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--ink);
  color: #fbf8f2;
  font-size: 17px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.2s var(--ease), background 0.2s;
}
.send:hover { background: #322c25; }
.send:active { transform: scale(0.94); }
.dock__hint { margin: 10px 0 0; font-size: 10.5px; color: var(--ink-3); line-height: 1.6; }
.linkish {
  border: 0; background: none; padding: 0; font: inherit; color: var(--sage-deep);
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}

/* ── 리포트 ─────────────────────────────────────────────── */
.panel--report { width: min(760px, 100%); }
.report__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.report__card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.42);
}
.report__card--wide { grid-column: 1 / -1; }
.report__card h3 { margin: 0 0 10px; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sage-deep); }
.report__card ul, .report__card ol { margin: 0; padding-left: 17px; }
.report__card li { font-size: 13px; line-height: 1.72; color: var(--ink-2); margin-bottom: 6px; }
.report__card ol li::marker { color: var(--clay); font-weight: 700; }
.report__closing { margin: 20px 0 0; font-size: 14px; line-height: 1.8; color: var(--ink); }
@media (max-width: 620px) { .report__grid { grid-template-columns: 1fr; } }

/* ── 시뮬레이션 바 ───────────────────────────────────────── */
.simbar {
  position: fixed;
  z-index: 24;
  left: 0;
  right: 0;
  margin: 0 auto;
  bottom: clamp(14px, 3vh, 26px);
  width: min(860px, calc(100vw - 24px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 10px;
  border-radius: 20px;
  background: rgba(251, 248, 242, 0.86);
  backdrop-filter: blur(20px) saturate(1.05);
  -webkit-backdrop-filter: blur(20px) saturate(1.05);
  border: 1px solid rgba(255, 255, 255, 0.66);
  box-shadow: var(--shadow);
  animation: fade-in 0.5s var(--ease) both;
}
.simbar__left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.simbar__title { margin: 0; font-size: 13px; font-weight: 650; }
.simbar__hint { margin: 2px 0 0; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.simbar__right { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  font: inherit; font-size: 15px; color: var(--ink-2); cursor: pointer;
  flex: 0 0 auto;
}
.scene-tabs { display: flex; gap: 3px; padding: 3px; border-radius: 999px; background: rgba(33, 29, 24, 0.05); }
.scene-tab {
  height: 28px; padding: 0 11px; border-radius: 999px; border: 0; background: transparent;
  font: inherit; font-size: 11.5px; color: var(--ink-3); cursor: pointer; transition: all 0.22s var(--ease);
}
.scene-tab.is-on { background: #fffdf9; color: var(--ink); box-shadow: 0 1px 3px rgba(30, 24, 18, 0.12); }

@media (max-width: 640px) {
  .simbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .simbar__right { justify-content: space-between; }
}

/* ── 장면 입력 시트 ─────────────────────────────────────── */
.simalt {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(28, 24, 19, 0.32);
  backdrop-filter: blur(6px);
  animation: fade-in 0.3s var(--ease) both;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.simalt__card {
  width: min(430px, 100%);
  background: var(--paper-2);
  border-radius: 22px;
  padding: 26px;
  box-shadow: 0 40px 90px -40px rgba(30, 24, 18, 0.6);
  animation: panel-in 0.45s var(--ease) both;
}
.simalt__card h3 { margin: 0 0 6px; font-size: 18px; letter-spacing: -0.02em; }
.simalt__sub { margin: 0 0 16px; font-size: 12.5px; color: var(--ink-2); line-height: 1.7; }
.simalt__card input {
  width: 100%; height: 46px; border-radius: 13px; border: 1px solid var(--line);
  background: #fff; padding: 0 14px; font: inherit; font-size: 14px; outline: none;
}
.simalt__card input:focus { border-color: rgba(111, 132, 113, 0.6); }
.simalt__actions { display: flex; gap: 8px; margin-top: 14px; }
.simalt__where { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.simalt__where p { margin: 0 0 8px; font-size: 12.5px; color: var(--ink-2); }

/* ── 안전 카드 ──────────────────────────────────────────── */
.safety {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(24, 20, 16, 0.58);
  backdrop-filter: blur(8px);
  animation: fade-in 0.35s var(--ease) both;
}
.safety__card {
  width: min(560px, 100%);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  background: #fdfbf7;
  border-radius: 24px;
  padding: clamp(24px, 4vw, 34px);
  box-shadow: 0 50px 120px -40px rgba(20, 16, 12, 0.7);
  border-top: 3px solid var(--danger);
  animation: panel-in 0.5s var(--ease) both;
}
.safety__eyebrow { margin: 0 0 10px; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--danger); font-weight: 700; }
.safety__card h2 { margin: 0 0 12px; font-size: clamp(20px, 3vw, 24px); letter-spacing: -0.025em; line-height: 1.4; }
.safety__opening { margin: 0 0 20px; font-size: 14px; line-height: 1.85; color: var(--ink-2); }
.safety__numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.safety__num {
  display: block; text-decoration: none; text-align: center;
  padding: 14px 6px 12px; border-radius: 14px;
  background: rgba(168, 79, 66, 0.07); border: 1px solid rgba(168, 79, 66, 0.22);
  transition: background 0.2s, transform 0.2s var(--ease);
}
.safety__num:hover { background: rgba(168, 79, 66, 0.13); transform: translateY(-1px); }
.safety__num b { display: block; font-size: 21px; color: var(--danger); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.safety__num span { display: block; margin-top: 3px; font-size: 10.5px; color: var(--ink-2); line-height: 1.4; }
.safety__steps { margin: 0 0 16px; padding-left: 18px; }
.safety__steps li { font-size: 13px; line-height: 1.8; color: var(--ink-2); margin-bottom: 6px; }
.safety__notice { margin: 0 0 16px; font-size: 11px; line-height: 1.7; color: var(--ink-3); padding-top: 14px; border-top: 1px solid var(--line); }
.safety__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── 도움 시트 ──────────────────────────────────────────── */
.help {
  position: fixed; inset: 0; z-index: 55;
  display: grid; place-items: center; padding: 18px;
  background: rgba(28, 24, 19, 0.4); backdrop-filter: blur(7px);
  animation: fade-in 0.3s var(--ease) both;
}
.help__card {
  width: min(520px, 100%); background: var(--paper-2); border-radius: 22px; padding: 28px;
  box-shadow: 0 40px 100px -40px rgba(20, 16, 12, 0.65);
  animation: panel-in 0.45s var(--ease) both;
}
.help__card h2 { margin: 0 0 10px; font-size: 20px; letter-spacing: -0.02em; }
.help__card > p { margin: 0 0 16px; font-size: 13px; line-height: 1.8; color: var(--ink-2); }
.help__list { display: grid; gap: 7px; margin-bottom: 16px; }
.help__item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: 13px; border: 1px solid var(--line);
  text-decoration: none; color: var(--ink); background: rgba(255, 255, 255, 0.5);
}
.help__item b { font-size: 15px; font-variant-numeric: tabular-nums; }
.help__item span { font-size: 11.5px; color: var(--ink-3); text-align: right; line-height: 1.4; }

/* ── 토스트 ─────────────────────────────────────────────── */
.toast {
  position: fixed;
  z-index: 70;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(8px);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(33, 29, 24, 0.92);
  color: #fbf8f2;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s var(--ease);
  pointer-events: none;
  max-width: calc(100vw - 32px);
  text-align: center;
  line-height: 1.5;
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── 모션 최소화 ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── 모바일 ─────────────────────────────────────────────── */
@media (max-width: 760px) {
  .flow {
    padding: 64px 12px max(12px, env(safe-area-inset-bottom));
    place-items: end center;
  }
  .panel--center { place-self: center; }
  .panel--breath { place-self: center; }
  .panel { border-radius: 22px; padding: 24px 20px; max-height: calc(100dvh - 108px); }
  .dock__tools .mini { padding: 0 9px; font-size: 11px; }
  .dock__who #who { font-size: 11.5px; }
  .dock {
    width: 100%;
    max-height: 72dvh;
    border-radius: 22px 22px 16px 16px;
    justify-self: stretch;
    align-self: end;
  }
  .hero-title { line-height: 1.42; }
  .moods { grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .mood { font-size: 11px; padding: 10px 2px; }
  .mood__orb { width: 34px; height: 34px; }
  .nice-scroll { -webkit-overflow-scrolling: touch; }
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

button:focus-visible, a:focus-visible {
  outline: 2px solid rgba(111, 132, 113, 0.75);
  outline-offset: 2px;
}
input:focus-visible, textarea:focus-visible {
  outline: 1px solid rgba(111, 132, 113, 0.45);
  outline-offset: 0;
}
.safety__num:focus-visible { outline-color: rgba(168, 79, 66, 0.65); }


/* ==========================================================================
   타이포그래피 — 제목: Instrument Serif + MaruBuri / 본문: Pretendard
   Instrument Serif 는 라틴 전용이라 한글은 MaruBuri 로 자동 폴백된다.
   두 서체 모두 로컬 파일이며, 없을 때는 시스템 명조 계열로 내려간다.
   ========================================================================== */
.hero-title, .hero__title, .panel__title, .section-title, .statement__text, .start__title,
.safety__card h2, .help__card h2, .simalt__card h3, .breath__phase,
.report__card h3, .scene-card h3, .step h3, .h1 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
}
.hero-title, .hero__title { line-height: 1.38; }
.hero__title { font-size: clamp(36px, 5.4vw, 68px); }
.hero__lede { max-width: 560px; }
.panel__title { line-height: 1.42; }
.statement__text, .section-title { line-height: 1.42; }
.breath__phase { font-size: clamp(26px, 3.9vw, 38px); letter-spacing: -0.005em; }
.hero-title .hero__em, .statement__text em { font-style: italic; }
