:root {
  /* Warm linen, milk and moss. Amber is reserved for time-sensitive guidance. */
  --bg: #f6f3ec;
  --surface: #fffefa;
  --ink: #2d352d;
  --ink-soft: #656d60;
  --ink-faint: #777b70;
  --line: #e6e7dc;
  --track: #eeeee4;
  --green: #365d43;
  --green-deep: #284a32;
  --green-tint: #eaf0e2;
  --red-soft: #fcf0ec;
  --red-ink: #a14b3e;
  --amber-soft: #faf0dc;
  --amber-ink: #805d24;
  --radius: 24px;
  --shadow: 0 3px 4px #60593603, 0 12px 32px -20px #60593635;
  --pad: 16px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  background: #e9e7df;
  color: var(--ink);
  display: flex;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -.025em;
}
button, input, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, summary:focus-visible, [contenteditable]:focus-visible {
  outline: 2px solid var(--green); outline-offset: 4px;
}
button { transition: background .18s, box-shadow .18s, transform .18s; }
button:not(:disabled):active { transform: translateY(1px); }
.frame {
  width: 100%; max-width: 440px; height: 100dvh;
  background: var(--bg); display: flex; flex-direction: column; overflow: hidden;
}
.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.appbar {
  flex: none; display: grid; grid-template-columns: 44px 1fr 44px;
  align-items: center; padding: 12px 16px 8px; background: var(--surface);
}
.appbar h1 { display: flex; gap: 8px; justify-content: center; align-items: center; font-size: 18px; font-weight: 650; letter-spacing: -.04em; }
.family-mark { width: 25px; height: 25px; color: var(--green); }
.appbar .count { color: var(--ink-soft); font-weight: 400; font-size: 12px; margin-left: 0; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-soft); cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: var(--track); }
.preview-bar { flex: none; display: flex; align-items: center; gap: 12px; padding: 4px 24px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.preview-label { font-size: 11px; color: var(--ink-faint); white-space: nowrap; }
.segmented { flex: 1; display: flex; background: #f0f0e7; border-radius: 99px; padding: 3px; }
.segmented button { flex: 1; min-height: 32px; border: 0; border-radius: 99px; padding: 5px 8px; background: transparent; font-size: 12px; font-weight: 500; color: var(--ink-soft); cursor: pointer; white-space: nowrap; }
.segmented button.active { background: var(--surface); color: var(--green); font-weight: 650; box-shadow: 0 2px 6px #52604412; }
.chat { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px 20px 24px; display: flex; flex-direction: column; gap: 20px; scrollbar-width: thin; scrollbar-color: #d5d9ca transparent; }
.day-divider { display: flex; align-items: center; gap: 12px; align-self: center; color: var(--ink-faint); font-size: 11px; padding: 0 0 2px; }
.day-divider::before, .day-divider::after { content: ''; width: 28px; height: 1px; background: #dedfd3; }
.msg { display: flex; gap: 10px; }
.avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; background: #e7e5da; color: #6a6c5f; font-size: 12px; font-weight: 600; display: grid; place-items: center; }
.avatar.ai { background: transparent; color: #667f53; }
.avatar.ai .icon { width: 32px; height: 32px; }
.msg-body { max-width: 87%; min-width: 0; }
.msg-body.wide { max-width: 100%; flex: 1; }
.msg-meta { font-size: 10px; color: var(--ink-faint); margin: 2px 0 8px; display: flex; align-items: center; gap: 7px; }
.msg-meta b { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.bubble { background: var(--surface); border: 1px solid #e9e9df; border-radius: 5px 22px 22px 22px; padding: 14px 16px; font-size: 15px; font-weight: 400; line-height: 1.7; word-break: keep-all; overflow-wrap: anywhere; color: var(--ink); box-shadow: 0 3px 8px #60593603; }
.bubble b { font-weight: 650; }
.msg.me { flex-direction: row-reverse; }
.msg.me .msg-body { display: flex; flex-direction: column; align-items: flex-end; }
.msg.me .bubble { background: #eaf0e2; border: 1px solid #e0e7d7; border-radius: 22px 5px 22px 22px; }
.source-bubble { min-width: 230px; }
.source-heading { font-size: 12px; color: var(--ink-soft); display: flex; gap: 7px; align-items: center; margin-bottom: 7px; }
.source-heading .icon { width: 15px; height: 15px; flex: none; }
.source-title { font-size: 14px; font-weight: 500; }
.source-details { margin-top: 8px; }
.source-details summary { color: var(--ink-soft); font-size: 11px; cursor: pointer; width: fit-content; padding: 4px 0; list-style: none; display: flex; gap: 5px; align-items: center; }
.source-details summary::-webkit-details-marker { display: none; }
.source-details summary::after { content: '⌄'; font-size: 14px; }
.source-details[open] summary::after { content: '⌃'; }
.source-details p { margin-top: 8px; padding-top: 10px; border-top: 1px solid #dce4d4; font-size: 13px; line-height: 1.7; }
.task-card { background: var(--surface); border: 1px solid #e4e6d9; border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--pad); margin-top: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-title { font-size: 12px; font-weight: 600; color: var(--green); }
.card-count { font-size: 11px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.progress { height: 4px; background: var(--track); border-radius: 8px; overflow: hidden; margin-bottom: 18px; }
.progress i { display: block; height: 100%; background: #82966f; border-radius: inherit; transition: width .25s; }
.card-goal { font-size: 12px; color: var(--ink-soft); line-height: 1.6; margin-bottom: 6px; word-break: keep-all; }
.step-action { font-size: 18px; font-weight: 600; line-height: 1.5; letter-spacing: -.035em; margin-bottom: 10px; word-break: keep-all; }
.step-detail { font-size: 14px; line-height: 1.75; color: var(--ink-soft); word-break: keep-all; }
.confirm-q { font-size: 12px; line-height: 1.6; color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; margin-bottom: 12px; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 44px; border-radius: 99px; padding: 10px 16px; font-size: 13px; font-weight: 550; cursor: pointer; }
.chip.primary { border: 1px solid var(--green); background: var(--green); color: #fffefa; box-shadow: 0 3px 6px #3b543c12; }
.chip.primary:hover { background: var(--green-deep); }
.chip.ghost { border: 1px solid #dfe2d5; background: transparent; color: var(--ink-soft); }
.chip.ghost:hover { background: var(--track); }
.chip.block { width: 100%; text-align: center; padding: 12px; border-radius: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.chip[disabled] { background: #edf0e7; color: #8d9684; border-color: #e2e6da; box-shadow: none; cursor: default; }
.done-msg { font-size: 17px; font-weight: 600; color: var(--green); margin-bottom: 12px; }
.step-done-line { align-self: flex-start; margin-left: 42px; font-size: 12px; color: var(--ink-soft); padding: 2px 0; }
body[data-persona="easy"] .ai-text .bubble { font-size: 21px; line-height: 1.6; font-weight: 400; }
body[data-persona="easy"] .chip { font-size: 16px; padding: 12px 16px; }
.easy-lines { display: flex; flex-direction: column; gap: 16px; margin: 24px 0; }
.easy-lines p { font-size: 19px; line-height: 1.7; word-break: keep-all; }
.kv { width: 100%; border-collapse: collapse; }
.kv tr + tr { border-top: 1px solid #eff0e7; }
.kv th { text-align: left; font-size: 12px; font-weight: 400; color: var(--ink-soft); padding: 11px 14px 11px 0; white-space: nowrap; vertical-align: top; width: 1%; }
.kv td { font-size: 14px; font-weight: 400; padding: 9px 0; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere; }
.kv td b { font-weight: 650; font-variant-numeric: tabular-nums; }
.kv-sub { display: block; font-size: 11px; color: var(--ink-faint); margin-top: 2px; }
.kv-sub b { font-weight: 400; }
.alert-badge { background: var(--amber-soft); color: var(--amber-ink); border: 1px solid #eee1c7; border-radius: 16px; padding: 12px; font-size: 13px; font-weight: 400; line-height: 1.7; margin-bottom: 8px; display: flex; gap: 8px; align-items: flex-start; word-break: keep-all; }
.alert-badge > .icon { flex: none; width: 16px; height: 16px; margin-top: 3px; }
.alert-badge b { font-weight: 650; }
.suggest-list { margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.suggest-cap { font-size: 11px; color: var(--ink-soft); margin-bottom: 0; }
.suggest-item { display: flex; gap: 8px; font-size: 12px; line-height: 1.65; color: var(--ink-soft); word-break: keep-all; }
.suggest-item::before { content: '·'; color: #929e84; }
.suggest-action { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid #dfe6d5; border-radius: 16px; background: #f0f4e9; padding: 13px 12px; font-size: 13px; line-height: 1.65; font-weight: 500; color: var(--green-deep); text-align: left; cursor: pointer; word-break: keep-all; }
.suggest-action:hover { background: #e7eeda; }
.suggest-action .chev { color: var(--green); font-size: 20px; flex: none; }
.note-box { margin-top: 16px; background: var(--bg); border-radius: 16px; padding: 12px; font-size: 13px; line-height: 1.7; color: var(--ink-soft); }
.note-box b { display: block; font-size: 11px; font-weight: 600; margin-bottom: 6px; }
.safety-box { margin-bottom: 12px; background: var(--red-soft); color: var(--red-ink); border-radius: 16px; padding: 12px; font-size: 14px; line-height: 1.6; }
.ack-row { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-left: 4px; }
.ack-text { font-size: 11px; color: var(--ink-faint); }
.input-bar { flex: none; display: flex; align-items: center; gap: 2px; margin: 0 12px calc(12px + env(safe-area-inset-bottom)); padding: 5px; background: var(--surface); border: 1px solid #e0e4d5; border-radius: 28px; box-shadow: 0 5px 20px #60593607; }
.input-bar .icon-btn { color: var(--ink-soft); width: 36px; height: 40px; flex: none; }
.input-bar .icon { width: 19px; height: 19px; }
.text-field { flex: 1; min-width: 0; padding: 10px 6px; font-size: 13px; line-height: 1.5; color: var(--ink-faint); max-height: 100px; overflow: auto; }
.text-field.filled { color: var(--ink); }
.send-btn { width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: var(--green); color: #fffefa; cursor: pointer; display: grid; place-items: center; margin-left: 4px; }
.send-btn:hover { background: var(--green-deep); }
.send-btn .icon { width: 18px; height: 18px; }
.preview-footer { flex: none; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-soft); }
.preview-footer button { border: 1px solid #dfe6d5; border-radius: 99px; padding: 10px 20px; background: var(--green-tint); color: var(--green-deep); font-size: 13px; font-weight: 550; cursor: pointer; }
.sheet-backdrop { position: fixed; inset: 0; background: #383e3352; backdrop-filter: blur(4px); z-index: 9; }
.sheet { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 440px; background: var(--surface); border-radius: 32px 32px 0 0; padding: 10px 24px calc(24px + env(safe-area-inset-bottom)); z-index: 10; box-shadow: 0 -12px 60px #373f331a; }
.sheet-grip { width: 32px; height: 4px; border-radius: 9px; background: #dfe3d7; margin: 4px auto 24px; }
.sheet h2 { font-size: 21px; font-weight: 600; letter-spacing: -.04em; }
.sheet-desc { font-size: 13px; line-height: 1.6; color: var(--ink-soft); margin: 8px 0 24px; word-break: keep-all; }
.option-group { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.option { display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 20px; padding: 18px 16px; cursor: pointer; }
.option:has(input:checked) { border-color: #8b9d7f; background: #eef3e6; }
.option input { accent-color: var(--green); width: 18px; height: 18px; flex: none; }
.option-body b { display: block; font-size: 15px; font-weight: 550; }
.option-body small { display: block; font-size: 12px; line-height: 1.5; color: var(--ink-soft); margin-top: 5px; }
@media (min-width: 600px) and (min-height: 700px) {
  body { align-items: center; background: radial-gradient(ellipse at 25% 20%, #f6f2e8, transparent 65%), #e6e9df; }
  .frame { height: min(900px, calc(100dvh - 40px)); border-radius: 32px; border: 1px solid #fffdf5; box-shadow: 0 28px 90px -40px #4c57435c; }
  .sheet { bottom: 20px; border-radius: 32px; }
}
@media (max-width: 360px) {
  .chat { padding-left: 12px; padding-right: 12px; }
  .preview-bar { padding-left: 16px; padding-right: 16px; gap: 8px; }
  .chip { padding-left: 12px; padding-right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
