/* Sovasta Companion — 시안 v2 (크림 바탕 · 남색 글 · 산호색 강조). */
:root {
  --fs: 16px;
  --bg: #f7f1e8; --surface: #fffdf9; --surface-2: #f1e9dc; --line: #e6dccb;
  --ink: #1f2a44; --muted: #6b6f7d; --accent: #ff6f59; --accent-ink: #fff;
  --navy: #1f2a44; --ok: #2f8f5b; --warn: #b5551d; --bad: #c0392b;
  --str: #ff6f59; --int: #4c7bd9; --emp: #c25bb4; --xp: #f2b33d;
  --radius: 18px; --shadow: 0 6px 22px rgba(31, 42, 68, .08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161f; --surface: #1a2030; --surface-2: #222a3d; --line: #2c3550;
    --ink: #eef0f6; --muted: #a2a8ba; --accent: #ff8a76; --accent-ink: #1a1a1a; --navy: #eef0f6;
    --shadow: 0 6px 22px rgba(0, 0, 0, .35); color-scheme: dark;
  }
}
:root[data-contrast="high"] { --bg: #fff; --surface: #fff; --surface-2: #f2f2f2; --line: #000; --ink: #000; --muted: #222; --accent: #b3261e; --accent-ink: #fff; --navy: #000; }
@media (prefers-color-scheme: dark) { :root[data-contrast="high"] { --bg: #000; --surface: #000; --surface-2: #111; --line: #fff; --ink: #fff; --muted: #eee; --accent: #ffb4a8; --accent-ink: #000; --navy: #fff; } }
/* 색약 배려 팔레트: 빨강/초록 대신 파랑/주황 축 */
:root[data-palette="blue"] { --str: #e69f00; --int: #0072b2; --emp: #cc79a7; --ok: #0072b2; --bad: #d55e00; --accent: #d55e00; }
:root[data-palette="high"] { --str: #000; --int: #000; --emp: #000; --xp: #000; }
:root[data-night="dim"] body { filter: brightness(.86) sepia(.12); }
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; } }

* { box-sizing: border-box; }
html { font-size: var(--fs); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans KR", "Noto Sans JP", "Noto Sans SC", "Noto Sans Arabic", "Noto Sans Devanagari", "Noto Sans Thai", sans-serif; line-height: 1.55; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .7em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; background: var(--surface-2); padding: .05em .35em; border-radius: 6px; overflow-wrap: anywhere; }
.boot { padding: 40px; text-align: center; color: var(--muted); }
.skip { position: absolute; inset-inline-start: 8px; top: 8px; transform: translateY(-200%); background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { transform: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); } .hint { color: var(--muted); font-size: .85rem; }
.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); padding: 8px 12px; border-radius: 10px; }
.pos { color: var(--ok); } .neg { color: var(--bad); }
.eyebrow { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: .3em; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.grow { flex: 1 1 220px; }
.center { text-align: center; }

/* 단추 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: .6em 1.1em; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 44px; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--navy); color: var(--bg); border-color: var(--navy); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.small { padding: .4em .9em; font-size: .9rem; min-height: 38px; }
.btn.tiny { padding: .25em .7em; font-size: .8rem; min-height: 32px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
.chipbtn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: .35em .85em; font: inherit; font-size: .85rem; cursor: pointer; min-height: 34px; }
.chipbtn.on { background: var(--navy); color: var(--bg); border-color: var(--navy); }
.filebtn { position: relative; }

/* 골격 */
.layout { min-height: 100vh; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 10px 16px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-inline-end: auto; }
.brand .logo { width: 38px; height: 38px; border-radius: 12px; background: var(--navy); display: grid; place-items: center; font-size: 1.2rem; }
.brand small { display: block; font-size: .7rem; color: var(--muted); }
.brand b { font-size: 1.05rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 8px; }
.chip { font-size: .8rem; padding: .3em .75em; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; white-space: nowrap; }
.chip.money { background: var(--navy); color: var(--bg); border-color: var(--navy); font-weight: 700; }
.chip.verify { color: var(--ok); }
.xpbar { flex-basis: 100%; height: 3px; background: var(--surface-2); margin: 0 -16px; }
.xpbar span { display: block; height: 100%; background: var(--xp); transition: width .6s; }
.body { flex: 1; display: grid; grid-template-columns: 1fr; gap: 16px; padding: 16px; width: 100%; max-width: 1480px; margin: 0 auto; }
.rail { display: none; }
main { min-width: 0; display: flex; flex-direction: column; gap: 16px; outline: none; padding-bottom: 80px; }
.side-chat { display: none; }
@media (min-width: 900px) {
  .body { grid-template-columns: 220px minmax(0, 1fr); }
  .rail { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 90px; align-self: start; }
  .rail a { display: flex; gap: 10px; align-items: center; padding: .6em .9em; border-radius: 12px; text-decoration: none; color: var(--muted); font-weight: 600; }
  .rail a:hover { background: var(--surface); color: var(--ink); }
  .rail a.on { background: var(--navy); color: var(--bg); }
  .tabs { display: none !important; }
  main { padding-bottom: 16px; }
}
@media (min-width: 1180px) {
  .layout.with-chat .body { grid-template-columns: 220px minmax(0, 1fr) 380px; }
  .side-chat { display: block; position: sticky; top: 90px; align-self: start; height: calc(100vh - 110px); }
}
.one-thing { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.one-thing h3 { font-size: .85rem; color: var(--accent); }
.one-thing p { font-size: .9rem; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex; justify-content: space-around; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tabs a, .tabs summary { display: flex; flex-direction: column; align-items: center; font-size: .68rem; text-decoration: none; color: var(--muted); padding: 4px 6px; border-radius: 10px; cursor: pointer; list-style: none; min-width: 44px; }
.tabs summary::-webkit-details-marker { display: none; }
.tabs a span, .tabs summary span { font-size: 1.2rem; }
.tabs a.on { color: var(--ink); background: var(--surface-2); }
.tabs .more { position: relative; }
.tabs .more div { position: absolute; bottom: 110%; inset-inline-end: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; min-width: 160px; }
.tabs .more div a { flex-direction: row; gap: 8px; font-size: .9rem; color: var(--ink); padding: 10px; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 12px 16px 90px; }
@media (min-width: 900px) { .foot { padding-bottom: 16px; } }

/* 카드 */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.tag { display: inline-block; font-size: .72rem; padding: .2em .65em; border-radius: 999px; background: var(--surface-2); color: var(--ink); font-weight: 600; text-decoration: none; vertical-align: middle; }
.tag.money { background: var(--navy); color: var(--bg); }
.grid2, .grid3 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: repeat(3, 1fr); } }
dl.mini { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 10px 0; }
dl.mini div { min-width: 90px; }
dl.mini dt { font-size: .72rem; color: var(--muted); }
dl.mini dd { margin: 0; font-weight: 700; }
.list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.srow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.srow > span:first-child { flex: 1 1 120px; }
.srow > small { color: var(--muted); font-size: .8rem; }
.trow { display: flex; align-items: center; gap: 12px; text-decoration: none; padding: 10px; border-radius: 12px; border: 1px solid var(--line); }
.trow:hover { border-color: var(--ink); }
.trow > span:nth-child(2) { flex: 1; min-width: 0; }
.trow b, .trow small { display: block; overflow: hidden; text-overflow: ellipsis; }
.trow small { color: var(--muted); font-size: .8rem; }
.status { font-size: .72rem; font-weight: 700; padding: .2em .6em; border-radius: 999px; background: var(--surface-2); white-space: nowrap; }
.s-done, .s-credited, .s-accepted { color: var(--ok); }
.s-failed, .s-cancelled, .s-refunded, .s-disputed, .s-revoked { color: var(--bad); }
.s-running, .s-processing, .s-pending, .s-quoted { color: var(--warn); }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .85rem; }
th, td { text-align: start; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.bar { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--ink); border-radius: inherit; transition: width .6s; }
.bar.str span { background: var(--str); } .bar.intel span { background: var(--int); } .bar.emp span { background: var(--emp); } .bar.xp span, .bar.mem span { background: var(--xp); }
.bar.run span { width: 40%; background: var(--accent); animation: run 1.4s ease-in-out infinite; }
@keyframes run { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

/* 입력 */
.field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; font-size: .9rem; }
.field > span { font-weight: 600; font-size: .85rem; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: .55em .8em; min-height: 42px; width: 100%; }
textarea { resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--navy); }
input[type="range"] { padding: 0; }
fieldset { border: 0; padding: 0; margin: 0 0 14px; }
legend { font-weight: 700; margin-bottom: 6px; }
.check, .radio { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; font-size: .9rem; }
.toggle { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; margin: 10px 0; }
.toggle small { grid-column: 2; color: var(--muted); font-size: .8rem; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { display: flex; gap: 6px; align-items: center; border: 1px solid var(--line); padding: .4em .8em; border-radius: 999px; font-size: .88rem; cursor: pointer; }
.seg label small { color: var(--muted); }
.seg label:has(input:checked) { border-color: var(--navy); background: var(--surface-2); }

/* 히어로 / Living Canvas */
.hero { padding: 30px 6px 10px; }
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero .lead { font-size: 1.05rem; color: var(--muted); max-width: 620px; }
.canvas { display: grid; gap: 20px; grid-template-columns: 1fr; align-items: center; background: radial-gradient(circle at 25% 40%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%), var(--surface); }
@media (min-width: 760px) { .canvas { grid-template-columns: 280px 1fr; } }
.canvas-avatar { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.bubble { background: var(--surface); border: 1px solid var(--line); padding: 10px 14px; border-radius: 16px 16px 16px 4px; box-shadow: var(--shadow); max-width: 260px; font-size: .92rem; }
.tap { font-size: .75rem; color: var(--muted); }
.persona-line { font-weight: 600; }
.emotion small { color: var(--muted); display: block; }
.hatch { background: var(--surface-2); padding: 8px 12px; border-radius: 10px; font-size: .9rem; }

.avatar { position: relative; display: grid; place-items: center; border: 0; background: none; cursor: pointer; padding: 0; border-radius: 50%; }
.avatar.lg { width: 190px; height: 190px; } .avatar.md { width: 110px; height: 110px; }
.avatar .aura { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 35%, transparent), transparent 70%); animation: breathe 4s ease-in-out infinite; }
.avatar .face { position: relative; font-size: 5.2rem; line-height: 1; animation: bob 3.2s ease-in-out infinite; }
.avatar.md .face { font-size: 3rem; }
.avatar .crown { position: absolute; top: 4%; font-size: 1.8rem; }
.avatar.emo-tired .face { filter: saturate(.6); animation-duration: 6s; }
.avatar.emo-happy .aura { background: radial-gradient(circle, color-mix(in srgb, var(--xp) 45%, transparent), transparent 70%); }
.avatar.emo-lonely .aura { background: radial-gradient(circle, color-mix(in srgb, var(--int) 30%, transparent), transparent 70%); }
.avatar.emo-focused .aura, .avatar.working .aura { background: radial-gradient(circle, color-mix(in srgb, var(--int) 45%, transparent), transparent 70%); animation-duration: 1.4s; }
.avatar.stage-egg .face { animation: wobble 2.6s ease-in-out infinite; }
.avatar.petted .face { animation: pet .5s ease; }
.holo { position: absolute; inset: -6%; }
.holo i { position: absolute; inset: 0; border: 2px dashed color-mix(in srgb, var(--int) 60%, transparent); border-radius: 50%; animation: spin 6s linear infinite; }
.holo i:nth-child(2) { inset: 10%; animation-duration: 4s; animation-direction: reverse; }
.holo i:nth-child(3) { inset: 20%; animation-duration: 9s; }
@keyframes breathe { 0%, 100% { transform: scale(.92); opacity: .7; } 50% { transform: scale(1.04); opacity: 1; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
@keyframes pet { 0% { transform: scale(1); } 40% { transform: scale(1.18) rotate(-4deg); } 100% { transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Daily Sync */
.sync-row { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .sync-row { grid-template-columns: repeat(3, 1fr); } }
.sync { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--bg); }
.sync.done { border-color: color-mix(in srgb, var(--ok) 50%, var(--line)); }
.sync header { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.sync header small { color: var(--muted); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .7rem; }
.sync .ok { margin-inline-start: auto; color: var(--ok); font-size: .75rem; font-weight: 700; }
.sync .ic { font-size: 1.3rem; }
.sync p { font-size: .88rem; color: var(--muted); }
.scale { display: flex; gap: 6px; margin-bottom: 8px; }
.dot { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 1.15rem; cursor: pointer; }
.dot.on { border: 2px solid var(--navy); background: var(--surface-2); }

.stat { margin: 10px 0; }
.stat-head { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: 4px; }
.stat.mem { display: flex; justify-content: space-between; font-size: .9rem; }
.eco { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.eco-item { display: flex; flex-direction: column; gap: 2px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; position: relative; }
.eco-item small { color: var(--muted); font-size: .75rem; }
.eco-item .badge { position: absolute; top: 8px; inset-inline-end: 8px; font-size: .7rem; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; }
.badge.linked { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.badge.open { background: var(--surface-2); }

/* 동반자 */
.story { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .story { grid-template-columns: repeat(3, 1fr); } }
.story li { border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.story li.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.story li span { font-size: 1.6rem; } .story li small { color: var(--muted); } .story li em { color: var(--accent); font-style: normal; font-size: .8rem; font-weight: 700; }
.persona-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.persona-opt { display: flex; flex-direction: column; gap: 2px; text-align: start; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 14px; padding: 12px; cursor: pointer; font: inherit; }
.persona-opt input { position: absolute; opacity: 0; pointer-events: none; }
.persona-opt .pe { font-size: 1.6rem; }
.persona-opt small { color: var(--muted); font-size: .78rem; }
.persona-opt.on, .persona-opt:has(input:checked) { border: 2px solid var(--navy); background: var(--surface-2); }
.persona-opt[disabled] { opacity: .45; cursor: not-allowed; }
.persona-opt:focus-within { outline: 3px solid var(--accent); }
.xpline { display: flex; gap: 10px; align-items: center; font-size: .8rem; font-weight: 700; }
.xpline .bar { flex: 1; }
.proofs li { display: flex; flex-direction: column; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.proofs small { color: var(--muted); }

/* 대화 */
.chat { display: flex; flex-direction: column; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.chat-page .chat { height: calc(100vh - 210px); min-height: 420px; }
@media (min-width: 900px) { .chat-page .chat { height: calc(100vh - 140px); } }
.chat-head { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.chat-av { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 1.4rem; }
.chat-head small { display: block; color: var(--muted); font-size: .75rem; }
.chat-tools { margin-inline-start: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: .93rem; }
.msg p { margin: 0; overflow-wrap: anywhere; }
.msg small { display: block; font-size: .68rem; color: var(--muted); margin-top: 4px; }
.msg.bot { background: var(--surface-2); align-self: flex-start; border-end-start-radius: 4px; }
.msg.me { background: var(--navy); color: var(--bg); align-self: flex-end; border-end-end-radius: 4px; }
.msg.me small { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.msg.sys { align-self: stretch; max-width: 100%; background: transparent; border: 1px dashed var(--line); color: var(--muted); font-size: .85rem; text-align: center; }
.msg.sys.crisis { border: 0; padding: 0; }
.msg .btn { margin-top: 8px; }
.memtag { display: inline-block; font-size: .7rem; background: color-mix(in srgb, var(--xp) 25%, transparent); border-radius: 999px; padding: .1em .6em; margin-bottom: 4px; }
.typing p { display: flex; gap: 4px; }
.typing i { width: 7px; height: 7px; background: var(--muted); border-radius: 50%; animation: bob 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
.memsuggest { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 14px; background: color-mix(in srgb, var(--xp) 14%, transparent); font-size: .85rem; }
.memsuggest span { flex: 1 1 200px; }
.chips-row { display: flex; gap: 6px; overflow-x: auto; padding: 8px 14px 0; scrollbar-width: none; }
.chips-row .chipbtn { white-space: nowrap; }
.composer { padding: 8px 14px 12px; display: flex; flex-direction: column; gap: 6px; }
.composer .check { margin: 0; font-size: .8rem; }
.inputrow { display: flex; gap: 8px; align-items: flex-end; }
.inputrow textarea { min-height: 44px; max-height: 160px; }
.send { width: 46px; padding: 0; flex: none; }
.crisis { text-align: start; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 2px solid var(--accent); color: var(--ink); border-radius: 14px; padding: 14px; }

/* 작업 */
.rules { margin: 0; padding-inline-start: 20px; color: var(--muted); font-size: .9rem; }
.task-card header { display: flex; gap: 12px; margin-bottom: 10px; }
.task-card header .ic { font-size: 1.8rem; }
.quote { border: 2px solid var(--navy); }
.running { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.running > div:last-child { flex: 1 1 220px; }
.money-tick b { font-size: 1.3rem; }
.result { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; overflow-wrap: anywhere; }
.result h3, .result h4, .result h5, .result h6 { margin: 1em 0 .4em; }
.result ul, .result ol { padding-inline-start: 22px; }
.wl { color: var(--int); }

/* 지갑 */
.wallet-hero .balance b { font-size: 2.4rem; display: block; }
.wallet-hero .balance b span { font-size: 1rem; color: var(--muted); }
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-bottom: 12px; }
.pack { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; }
.pack input[type="radio"] { position: absolute; opacity: 0; }
.pack:has(input[type="radio"]:checked) { border: 2px solid var(--navy); background: var(--surface-2); }
.pack small { color: var(--muted); }
.pack.custom input[type="number"] { margin-top: 4px; }
.rulebox { margin-top: 14px; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; font-size: .85rem; }
.rulebox ul { margin: 6px 0 0; padding-inline-start: 18px; }

/* 기억 */
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.mem-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.mem { border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.mem small { color: var(--muted); font-size: .78rem; }
.memedit { display: flex; gap: 6px; }
.t-taste { background: color-mix(in srgb, var(--str) 18%, transparent); } .t-family { background: color-mix(in srgb, var(--emp) 18%, transparent); }
.t-date { background: color-mix(in srgb, var(--xp) 25%, transparent); } .t-goal { background: color-mix(in srgb, var(--ok) 18%, transparent); }
.t-skill { background: color-mix(in srgb, var(--int) 18%, transparent); }
.import ul { list-style: none; padding: 0; max-height: 320px; overflow: auto; }
.vault { border-style: dashed; }

/* 보호자 */
.code { font-family: ui-monospace, monospace; font-size: 1.6rem; letter-spacing: .12em; font-weight: 800; background: var(--surface-2); padding: 10px 14px; border-radius: 12px; text-align: center; user-select: all; }
.watch { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }

/* 설정 */
.danger-zone { margin-top: 14px; border: 1px solid color-mix(in srgb, var(--bad) 40%, var(--line)); border-radius: 12px; padding: 10px 14px; }
.danger-zone summary { cursor: pointer; color: var(--bad); font-weight: 700; }

/* 처음 만남 · 모달 · 알림 */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(15, 20, 35, .55); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.sheet { background: var(--surface); color: var(--ink); border-radius: 22px; padding: 24px; width: 100%; max-width: 640px; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: var(--shadow); }
.promise { padding-inline-start: 20px; color: var(--muted); font-size: .9rem; }
.breath { width: 140px; height: 140px; margin: 20px auto; border-radius: 50%; background: radial-gradient(circle, var(--accent), transparent 70%); animation: breathe 8s ease-in-out infinite; }
#toast { position: fixed; bottom: 86px; left: 50%; transform: translateX(-50%); z-index: 70; width: min(92vw, 460px); pointer-events: none; }
@media (min-width: 900px) { #toast { bottom: 24px; } }
.toast { background: var(--navy); color: var(--bg); padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow); font-size: .9rem; text-align: center; }
.toast.ok { background: var(--ok); color: #fff; } .toast.err { background: var(--bad); color: #fff; }
.gate { padding: 36px 20px; } .gate-egg { display: flex; justify-content: center; }
