/* DearPresence — 잉크 블랙 + 바랜 종이 + 세피아 초상 + 절제된 금속색 (기획 08).
   피드는 종이 위에서 편하게 읽히고, Presence 가 나타나는 곳(첫 댓글 · 답 · 프로필)에만 잉크 바탕으로 분위기를 모은다. */

:root {
  --paper: #efe8db; --paper-2: #f7f2e8; --paper-3: #e6dccb; --line: #d8ccb7; --line-2: #c9bba2;
  --ink: #1c1915; --ink-2: #4a433a; --muted: #6f665a; --faint: #9a8f7f;
  --night: #15120f; --night-2: #1f1b16; --night-3: #2a241d; --night-line: #3a3128;
  --bone: #ece2cf; --bone-2: #c9bca5; --bone-3: #9a8c76;
  --brass: #b8925a; --brass-2: #d6b47c; --brass-dark: #8a6a3c;
  --red: #9b3b2e; --ok: #4f6b43;
  --serif: 'Cormorant Garamond', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --r: 14px; --r-sm: 10px;
  --tab: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
body.night { background: var(--night); color: var(--bone); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.stage { max-width: 600px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; }
.app { padding-bottom: calc(var(--tab) + var(--safe-b) + 24px); }
body.notab .app { padding-bottom: calc(var(--safe-b) + 24px); }
body.composing .app { padding-bottom: calc(var(--safe-b) + 96px); }

/* ── 머리 ── */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 16px 6px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { font: 600 26px/1 var(--serif); letter-spacing: .01em; white-space: nowrap; }
.logo i { font-style: italic; font-weight: 500; }
.soft { font: 600 9.5px/1 var(--sans); letter-spacing: .14em; color: var(--brass-dark); border: 1px solid var(--line-2); border-radius: 99px; padding: 4px 7px 3px; white-space: nowrap; }
body.night .soft { color: var(--brass-2); border-color: var(--night-line); }
.top-acts { display: flex; gap: 6px; align-items: center; }
.ic { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 50%; position: relative; }
.ic:hover { background: rgba(0, 0, 0, .05); }
body.night .ic:hover { background: rgba(255, 255, 255, .06); }
.tagline { padding: 0 16px 6px; margin: 0; color: var(--muted); font: italic 500 16px/1.3 var(--serif); }

.bar { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; padding: 6px 6px; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
body.night .bar { background: color-mix(in srgb, var(--night) 90%, transparent); }
.bar h1 { margin: 0; text-align: center; font: 600 15px/1.2 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── 탭 ── */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(var(--tab) + var(--safe-b)); padding-bottom: var(--safe-b); display: flex; justify-content: center; background: color-mix(in srgb, var(--paper-2) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.tabbar > div { width: 100%; max-width: 600px; display: grid; grid-template-columns: repeat(5, 1fr); }
.tabbar a { display: grid; justify-items: center; align-content: center; gap: 3px; font-size: 10.5px; font-weight: 500; color: var(--muted); position: relative; min-width: 0; }
.tabbar a.on { color: var(--ink); }
.tabbar a svg { width: 23px; height: 23px; }
.tabbar a.new span.plus { width: 44px; height: 34px; border-radius: 12px; background: var(--ink); color: var(--paper); display: grid; place-items: center; }
.tabbar a.new svg { width: 20px; height: 20px; stroke-width: 2.2; }
.tabbar .tab-face { width: 24px; height: 24px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--paper-3); font-size: 12px; font-weight: 600; }
.tabbar .tab-face img { width: 100%; height: 100%; object-fit: cover; }
.tabbar .tab-nick { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.notab .tabbar { display: none; }
body.night .tabbar { background: color-mix(in srgb, var(--night-2) 94%, transparent); border-top-color: var(--night-line); }
body.night .tabbar a { color: var(--bone-3); } body.night .tabbar a.on { color: var(--bone); }
body.night .tabbar a.new span.plus { background: var(--bone); color: var(--night); }
.dot { position: absolute; top: -3px; right: -8px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--red); color: #fff; font: 600 10px/16px var(--sans); text-align: center; }

/* ── 피드 탭 ── */
.seg { display: flex; gap: 22px; padding: 6px 16px 0; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.seg button { padding: 10px 0 11px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.seg button.on { color: var(--ink); border-bottom-color: var(--ink); }
.seg-note { margin: 10px 16px 0; color: var(--muted); font-size: 13px; }

/* ── 카드 ── */
.card { display: block; margin: 12px 12px 0; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; transition: transform .15s ease; }
.card:active { transform: scale(.995); }
.card-body { padding: 14px 16px 12px; }
.who { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; min-width: 0; }
.who b { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .sep { opacity: .6; }
.face { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; display: inline-grid; place-items: center; background: var(--paper-3); color: var(--ink-2); font: 600 13px/1 var(--sans); flex: none; }
.face img { width: 100%; height: 100%; object-fit: cover; }
.face.lg { width: 84px; height: 84px; font-size: 32px; }
.face.house { background: var(--ink); color: var(--paper); font: italic 600 15px/1 var(--serif); }
.kind { margin-left: auto; flex: none; font: 600 10px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; padding: 5px 7px 4px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--ink-2); }
.kind.real { border-color: var(--brass); color: var(--brass-dark); }
.title { font: 600 25px/1.12 var(--serif); margin: 10px 0 6px; letter-spacing: .002em; text-wrap: balance; }
.excerpt { margin: 0; color: var(--ink-2); white-space: pre-line; }
.thumb { margin-top: 12px; border-radius: var(--r-sm); overflow: hidden; position: relative; aspect-ratio: 4 / 3; background: var(--paper-3); }
.thumb img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.75) contrast(.97); }
.label { position: absolute; left: 8px; bottom: 8px; font: 600 10px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: #fff; background: rgba(20, 16, 12, .72); padding: 5px 7px; border-radius: 5px; }
.counts { display: flex; align-items: center; gap: 16px; padding: 10px 16px 12px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.counts span { display: inline-flex; align-items: center; gap: 5px; }
.counts svg { width: 17px; height: 17px; }
.counts .liked { color: var(--red); } .counts .liked svg { fill: currentColor; }
.counts .mem { margin-left: auto; color: var(--brass-dark); font-weight: 500; }

/* 카드 속 Presence 한 줄 (잉크 바탕) */
.pstrip { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start; background: var(--night); color: var(--bone); padding: 13px 16px 14px; }
.portrait { border-radius: 50%; overflow: hidden; background: var(--night-3); display: grid; place-items: center; color: var(--brass-2); font: italic 600 18px/1 var(--serif); aspect-ratio: 1; box-shadow: 0 0 0 1px var(--night-line), 0 0 0 3px rgba(184, 146, 90, .18); }
.portrait img { width: 100%; height: 100%; object-fit: cover; filter: sepia(.35) contrast(1.02); }
.pstrip .portrait { width: 44px; }
.ptag { font: 600 9.5px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--brass-2); }
.pname { font: 600 15px/1.2 var(--serif); font-size: 17px; margin-top: 3px; }
.pname small { font: 400 12px/1 var(--sans); color: var(--bone-3); margin-left: 6px; }
.pquote { font: italic 500 19px/1.3 var(--serif); margin: 6px 0 0; color: var(--bone); }
.arriving { display: flex; align-items: center; gap: 10px; color: var(--bone-2); font: italic 500 16px/1.3 var(--serif); }

/* ── 게시물 ── */
.post { padding: 4px 16px 0; }
.post .title { font-size: 32px; margin-top: 14px; }
.post .text { white-space: pre-line; font-size: 16px; color: var(--ink); margin: 0; }
.post .thumb { aspect-ratio: auto; max-height: 460px; }
.post .thumb img { max-height: 460px; }
.src { margin: 6px 2px 0; color: var(--muted); font-size: 12px; }
.acts { display: flex; gap: 6px; margin: 14px 0 0; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.act { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); color: var(--ink-2); font-size: 13px; font-weight: 500; }
.act.liked { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--line)); } .act.liked svg { fill: currentColor; }
.act svg { width: 17px; height: 17px; }
.act.right { margin-left: auto; }

/* Presence 의 첫 등장 — 분위기는 여기에만 */
.arrival { margin: 18px -16px 0; background: radial-gradient(120% 90% at 50% 0%, #2a2219 0%, var(--night) 60%); color: var(--bone); padding: 26px 20px 22px; position: relative; overflow: hidden; }
.arrival::before { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .9 0 0 0 0 .8 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); pointer-events: none; opacity: .9; }
.arrival > * { position: relative; }
.arr-head { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: center; }
.arr-head .portrait { width: 72px; }
.arr-head .pname { font-size: 22px; }
.arr-head .meta { color: var(--bone-3); font-size: 12.5px; margin-top: 3px; }
.follow { height: 34px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--brass); color: var(--brass-2); font-size: 13px; font-weight: 600; white-space: nowrap; }
.follow.on { background: var(--brass); color: var(--night); }
.first { font: italic 500 28px/1.22 var(--serif); margin: 20px 0 4px; text-wrap: balance; }
.first::before { content: '“'; color: var(--brass); margin-right: 2px; }
.first::after { content: '”'; color: var(--brass); margin-left: 1px; }
.ai-note { color: var(--bone-3); font-size: 11.5px; margin: 14px 0 0; line-height: 1.45; }
.ai-note a { text-decoration: underline; text-underline-offset: 2px; }

.mystery { margin: 16px 0 0; padding: 14px 16px; border: 1px dashed var(--line-2); border-radius: var(--r); background: var(--paper-2); }
.mystery h3 { margin: 0 0 6px; font: 600 10.5px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--brass-dark); }
.mystery ul { margin: 0; padding: 0; list-style: none; }
.mystery li { font: 500 17px/1.35 var(--serif); padding: 3px 0; color: var(--ink-2); }
.mystery li:first-child { font-style: italic; color: var(--ink); }

/* 대화 */
.thread { margin: 20px 0 0; }
.thread h2 { font: 600 12px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.cm { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.cm-head { display: flex; align-items: baseline; gap: 7px; font-size: 13px; color: var(--muted); }
.cm-head b { color: var(--ink); font-weight: 600; }
.cm-tag { font: 600 9px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.cm-text { margin: 2px 0 0; font-size: 15px; overflow-wrap: anywhere; }
.cm-more { margin-left: auto; color: var(--faint); width: 26px; height: 22px; display: grid; place-items: center; border-radius: 6px; }
.cm .state { font-size: 12px; color: var(--faint); font-style: italic; margin-top: 3px; }
.cm.flash { animation: flash 2.2s ease; }
@keyframes flash { 0%, 30% { background: rgba(184, 146, 90, .16); } 100% { background: transparent; } }
.cm.pr { grid-template-columns: 30px 1fr; background: var(--night); color: var(--bone); border-radius: var(--r); padding: 13px 14px 14px; margin: 8px 0; border-top: 0; }
.cm.pr + .cm:not(.pr) { border-top: 0; }
.cm.pr .portrait { width: 30px; font-size: 13px; }
.cm.pr .cm-head { color: var(--bone-3); } .cm.pr .cm-head b { color: var(--bone); font-family: var(--serif); font-size: 15px; }
.cm.pr .cm-tag { color: var(--brass-2); }
.cm.pr .cm-text { font: italic 500 19px/1.32 var(--serif); margin-top: 4px; }
.reply-to { font-size: 12px; color: var(--bone-3); margin-top: 6px; display: block; }
.reply-to q { font-style: italic; }
.surfaced { margin-top: 10px; display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; background: rgba(184, 146, 90, .12); color: var(--brass-2); font-size: 12.5px; line-height: 1.35; }
.surfaced svg { width: 16px; height: 16px; }
.surfaced b { color: var(--bone); font-weight: 600; }
.thinking { display: flex; align-items: center; gap: 10px; padding: 14px 4px; color: var(--muted); font: italic 500 16px/1.3 var(--serif); }
.quietnote { padding: 12px 14px; margin: 8px 0; border-radius: var(--r-sm); background: var(--paper-3); color: var(--ink-2); font: italic 500 16px/1.35 var(--serif); }

/* 질문 입력 (화면 아래 고정) */
.composer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; padding: 10px 12px calc(10px + var(--safe-b)); background: color-mix(in srgb, var(--paper-2) 96%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.composer form { max-width: 576px; margin: 0 auto; display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; overflow: hidden; min-height: 44px; max-height: 120px; padding: 11px 14px; border-radius: 22px; border: 1px solid var(--line-2); background: #fffdf8; outline: none; line-height: 1.4; }
.composer textarea:focus { border-color: var(--brass); }
.composer .send { width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; flex: none; }
.composer .send:disabled { opacity: .35; }
.composer .hint { max-width: 576px; margin: 0 auto 6px; font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; }

/* ── Presence 프로필 (잉크 바탕) ── */
.pr-top { text-align: center; padding: 6px 20px 8px; }
.pr-top .portrait { width: 168px; margin: 8px auto 0; border-radius: 50% / 46%; box-shadow: 0 0 0 1px var(--night-line), 0 0 0 6px rgba(184, 146, 90, .12), 0 20px 50px rgba(0, 0, 0, .5); font-size: 54px; }
.pr-top h1 { font: 600 34px/1.1 var(--serif); margin: 18px 0 2px; }
.pr-top .meta { color: var(--bone-3); font-size: 13.5px; }
.pr-top .epitaph { font: italic 500 19px/1.35 var(--serif); color: var(--bone-2); margin: 12px auto 0; max-width: 420px; }
.pr-stats { display: flex; justify-content: center; gap: 26px; margin: 18px 0 0; }
.pr-stats div { text-align: center; } .pr-stats b { display: block; font: 600 22px/1 var(--serif); }
.pr-stats span { font-size: 11.5px; color: var(--bone-3); letter-spacing: .04em; }
.pr-top .follow { margin-top: 18px; height: 40px; padding: 0 26px; }
.known { margin: 26px 16px 0; padding: 18px 18px 8px; border: 1px solid var(--night-line); border-radius: var(--r); background: var(--night-2); }
.known h2, .night .sec-h { margin: 0 0 8px; font: 600 10.5px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--brass-2); }
.known ul { list-style: none; margin: 0; padding: 0; }
.known li { padding: 9px 0; border-top: 1px solid var(--night-line); display: grid; gap: 2px; }
.known li:first-child { border-top: 0; }
.known li b { font: 500 19px/1.3 var(--serif); }
.known li a, .known li span { font-size: 12px; color: var(--bone-3); }
.known li a:hover { color: var(--brass-2); }
.known .none { color: var(--bone-3); font: italic 500 17px/1.4 var(--serif); padding: 4px 0 12px; margin: 0; }
.night .sec-h { margin: 28px 16px 0; }
.night .card { background: var(--night-2); border-color: var(--night-line); color: var(--bone); }
.night .card .who b, .night .card .title { color: var(--bone); } .night .card .excerpt { color: var(--bone-2); }
.night .card .counts { border-top-color: var(--night-line); color: var(--bone-3); } .night .card .counts .mem { color: var(--brass-2); }
.night .card .kind { color: var(--bone-2); border-color: var(--night-line); }
.night .card .face { background: var(--night-3); color: var(--bone-2); }
.night .foot, .night .muted { color: var(--bone-3); }

/* Presence 목록 (검색 첫 화면) */
.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 10px; padding: 12px 16px 4px; }
.pcell { text-align: center; display: grid; justify-items: center; gap: 2px; }
.pcell .portrait { width: 100%; max-width: 104px; font-size: 30px; }
.pcell b { font: 600 15px/1.15 var(--serif); margin-top: 8px; }
.pcell span { font-size: 11px; color: var(--muted); }
.pcell .seen { color: var(--brass-dark); font-weight: 600; }
.pcell.unseen .portrait img { filter: sepia(.6) grayscale(.4) brightness(.8); }

/* ── 검색 ── */
.search { padding: 8px 16px 0; }
.sbox { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; border-radius: 23px; border: 1px solid var(--line-2); background: #fffdf8; }
.sbox input { flex: 1; border: 0; outline: none; background: none; height: 100%; font-size: 16px; min-width: 0; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); background: var(--paper-2); }
.sec-h2 { display: flex; justify-content: space-between; align-items: baseline; padding: 20px 16px 0; }
.sec-h2 h2 { margin: 0; font: 600 21px/1.1 var(--serif); }
.sec-h2 span { font-size: 12px; color: var(--muted); }
.srow { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.srow .portrait { width: 44px; font-size: 16px; }
.srow b { display: block; font: 600 17px/1.2 var(--serif); }
.srow span { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow .glyph { width: 44px; height: 44px; border-radius: 10px; background: var(--paper-3); display: grid; place-items: center; color: var(--ink-2); }

/* ── 알림 ── */
.nrow { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); align-items: start; }
.nrow.unread { background: color-mix(in srgb, var(--brass) 9%, transparent); }
.nrow .portrait { width: 44px; font-size: 16px; }
.nrow p { margin: 0; } .nrow p b { font-weight: 600; }
.nrow .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; font-family: var(--serif); font-style: italic; font-size: 15px; }
.nrow time { font-size: 11.5px; color: var(--faint); }

/* ── 글쓰기 ── */
.form { padding: 8px 16px 28px; }
.form h1 { font: 600 30px/1.1 var(--serif); margin: 14px 0 4px; }
.form .lead { color: var(--muted); margin: 0 0 18px; }
.flabel { display: flex; justify-content: space-between; font-weight: 600; font-size: 13px; margin: 18px 2px 6px; }
.flabel span { font-weight: 400; color: var(--faint); }
.field { width: 100%; border: 1px solid var(--line-2); background: #fffdf8; border-radius: 12px; padding: 12px 14px; outline: none; font-size: 16px; }
.field:focus { border-color: var(--brass); }
textarea.field { resize: vertical; min-height: 150px; line-height: 1.5; }
input.field.big { font: 600 22px/1.2 var(--serif); padding: 12px 14px; }
.kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kindopt { text-align: left; border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 13px; background: var(--paper-2); }
.kindopt b { display: block; font-size: 14px; } .kindopt span { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.35; }
.kindopt.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: #fffdf8; }
.extras { display: grid; gap: 10px; }
.toggle { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; background: var(--paper-2); text-align: left; width: 100%; }
.toggle i { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-2); flex: none; margin-top: 1px; display: grid; place-items: center; }
.toggle.on i { background: var(--ink); border-color: var(--ink); }
.toggle.on i::after { content: ''; width: 9px; height: 5px; border: 2px solid var(--paper); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.toggle b { display: block; font-size: 14px; } .toggle span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.toggle:disabled { opacity: .5; }
.photo-prev { display: flex; gap: 12px; align-items: center; }
.photo-prev img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; }
.rules { margin: 18px 2px 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--muted); display: grid; gap: 5px; }
.rules li::before { content: '—'; margin-right: 6px; color: var(--faint); }

/* ── 단추 ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 20px; border-radius: 24px; font-weight: 600; width: 100%; margin-top: 12px; }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:disabled { opacity: .45; }
.btn-ghost { border: 1px solid var(--line-2); color: var(--ink-2); }
.btn-brass { background: var(--brass); color: var(--night); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { height: 38px; font-size: 13.5px; width: auto; padding: 0 14px; margin: 0; }
.link { color: var(--brass-dark); text-decoration: underline; text-underline-offset: 3px; font-weight: 500; }
body.night .btn-ghost { border-color: var(--night-line); color: var(--bone-2); }

/* ── 프로필 ── */
.ptop { text-align: center; padding: 10px 16px 0; }
.ptop .face.lg { margin: 0 auto; }
.ptop h1 { font: 600 28px/1.1 var(--serif); margin: 12px 0 2px; }
.stats { display: flex; justify-content: center; gap: 28px; padding: 14px 0 2px; }
.stats div { text-align: center; } .stats b { display: block; font: 600 22px/1 var(--serif); } .stats span { font-size: 11.5px; color: var(--muted); }
.tabs2 { display: flex; gap: 20px; padding: 0 16px; margin-top: 14px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs2 button { padding: 11px 0; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs2 button.on { color: var(--ink); border-bottom-color: var(--ink); }
.draft { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin: 10px 12px 0; padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: 12px; }
.draft b { font: 600 16px/1.2 var(--serif); display: block; } .draft span { font-size: 12px; color: var(--muted); }
.soft-note { margin: 10px 16px 0; padding: 0 2px; font-size: 12px; line-height: 1.5; color: var(--faint); text-align: center; }
.soft-note b { font-weight: 600; color: var(--muted); }

/* ── 기다리는 화면 ── */
.wait { text-align: center; padding: 70px 26px 40px; }
.wait h1 { font: 600 29px/1.15 var(--serif); margin: 26px 0 8px; }
.wait p { color: var(--muted); margin: 0 auto; max-width: 360px; }
.candle { width: 56px; height: 86px; margin: 0 auto; position: relative; }
.candle::before { content: ''; position: absolute; left: 50%; bottom: 0; width: 22px; height: 48px; margin-left: -11px; border-radius: 4px 4px 2px 2px; background: linear-gradient(90deg, #e9dfcb, #fbf6ec 45%, #d9cdb6); box-shadow: 0 2px 0 var(--line-2); }
.candle::after { content: ''; position: absolute; left: 50%; bottom: 50px; width: 14px; height: 26px; margin-left: -7px; border-radius: 50% 50% 45% 45% / 70% 70% 35% 35%; background: radial-gradient(ellipse at 50% 75%, #fff4c7 0%, #f2b54d 45%, rgba(242, 140, 40, 0) 75%); animation: flicker 1.6s infinite ease-in-out; transform-origin: 50% 100%; filter: blur(.3px); }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-1deg); opacity: 1; } 30% { transform: scale(.94, 1.06) rotate(2deg); opacity: .9; } 60% { transform: scale(1.04, .96) rotate(-2deg); } }
.steps { margin: 24px auto 0; display: grid; gap: 8px; max-width: 290px; text-align: left; font-size: 13.5px; color: var(--muted); }
.steps div { display: flex; gap: 8px; align-items: center; } .steps div.on { color: var(--ink); font-weight: 500; }
.steps i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); flex: none; } .steps div.on i { background: var(--brass); box-shadow: 0 0 0 4px rgba(184, 146, 90, .2); }

/* ── 공통 ── */
.empty { text-align: center; padding: 50px 26px; }
.empty h3 { font: 600 23px/1.2 var(--serif); margin: 0 0 6px; }
.empty p { color: var(--muted); margin: 0 auto; max-width: 340px; }
.empty .btn { width: auto; }
.loading { display: grid; place-items: center; min-height: 50vh; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(120, 100, 70, .25); border-top-color: var(--brass); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.more { display: block; margin: 16px auto 0; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 16px 0; line-height: 1.55; }
.foot button { text-decoration: underline; text-underline-offset: 2px; }
.muted { color: var(--muted); } .tiny { font-size: 12px; } .serif { font-family: var(--serif); }
.err { color: var(--red); font-size: 13px; margin: 8px 2px 0; }
.warn { color: #7a4c17; font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tab) + var(--safe-b) + 16px); transform: translate(-50%, 20px); z-index: 60; max-width: min(92vw, 460px); padding: 12px 16px; border-radius: 12px; background: var(--ink); color: var(--paper); font-size: 14px; line-height: 1.4; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body.composing .toast { bottom: calc(var(--safe-b) + 92px); }

.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(20, 16, 12, .5); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; background: var(--paper-2); color: var(--ink); border-radius: 22px 22px 0 0; padding: 26px 20px calc(22px + var(--safe-b)); position: relative; animation: rise .25s ease; }
@keyframes rise { from { transform: translateY(30px); } }
@media (min-width: 640px) { .overlay { align-items: center; } .sheet { border-radius: 22px; } }
.sheet h2 { font: 600 25px/1.15 var(--serif); margin: 0 30px 8px 0; }
.sheet p { margin: 0 0 8px; }
.sheet-x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; font-size: 22px; line-height: 1; color: var(--muted); }
.radio { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; border: 1px solid var(--line); margin-top: 8px; }
.radio i { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-2); flex: none; margin-top: 2px; }
.radio.on { border-color: var(--ink); } .radio.on i { border: 5px solid var(--ink); }
.radio b { display: block; } .radio span span { display: block; font-size: 12.5px; color: var(--muted); }
.nickrow { display: flex; gap: 8px; align-items: center; }
.avgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 10px 0 12px; }
.avgrid button { border-radius: 50%; overflow: hidden; aspect-ratio: 1; box-shadow: 0 0 0 1px var(--line); }
.avgrid button.on { box-shadow: 0 0 0 3px var(--ink); }
.avgrid img { width: 100%; height: 100%; object-fit: cover; }
.fb-stars { display: flex; gap: 4px; margin: 6px 0 10px; }
.fb-stars button { font-size: 30px; color: var(--line-2); } .fb-stars button.on { color: var(--brass); }

/* 입장 암호 · 18세 */
.dw-gate { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: radial-gradient(110% 80% at 50% 20%, #2a2219, var(--night) 70%); color: var(--bone); }
.gate-card { width: 100%; max-width: 380px; text-align: center; }
.gate-card .logo { font-size: 38px; }
.gate-card .soft { display: inline-block; margin-top: 10px; color: var(--brass-2); border-color: var(--night-line); }
.gate-card .slogan { font: italic 500 20px/1.3 var(--serif); color: var(--bone-2); margin: 14px 0 18px; }
.gate-card p { color: var(--bone-2); }
.gate-card input { width: 100%; height: 48px; border-radius: 24px; border: 1px solid var(--night-line); background: var(--night-2); color: var(--bone); text-align: center; font-size: 16px; outline: none; margin-top: 8px; }
.gate-card input:focus { border-color: var(--brass); }
.gate-card .btn-dark { background: var(--bone); color: var(--night); }
.gate-card .btn-ghost { border-color: var(--night-line); color: var(--bone-2); }
.gate-card .err { color: #e69a8a; }

/* 자매품 (시리즈 공통 sister/phase1.md) */
.sister { margin: 34px 0 0; padding: 18px 0 4px; border-top: 1px solid var(--line); }
.sister-title { display: block; padding: 0 16px 10px; font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.sister-home { text-decoration: underline; text-underline-offset: 2px; }
.sister-row { display: flex; gap: 12px; overflow-x: auto; padding: 0 16px 6px; scrollbar-width: none; }
.sister-row::-webkit-scrollbar { display: none; }
.sister-card { flex: none; width: 128px; display: grid; gap: 4px; }
.sister-icon { width: 40px; height: 40px; border-radius: 10px; }
.sister-name { font-weight: 600; font-size: 13px; }
.sister-tag { font-size: 11.5px; color: var(--muted); line-height: 1.35; }

/* PC 가로 줄 넘기기 (시리즈 sister/phase1.md 9절) */
.pcrail { position: relative; }
.pcnav { position: absolute; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; background: var(--paper-2); border: 1px solid var(--line); font-size: 11px; color: var(--ink-2); z-index: 2; }
.pcnav.l { left: 4px; } .pcnav.r { right: 4px; }
.dragging { cursor: grabbing; user-select: none; }

@media (min-width: 600px) {
  .card { margin: 14px 0 0; }
  .app { padding-left: 12px; padding-right: 12px; }
  .arrival { margin-left: -28px; margin-right: -28px; border-radius: var(--r); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* 앱 설치 팝업 (시리즈 공통 install-prompt.md — install.js) */
.dwi { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; justify-content: center; padding: 0 12px calc(var(--tab) + 12px + var(--safe-b)); pointer-events: none; animation: rise .4s ease both; }
.dwi-card { pointer-events: auto; width: min(440px, 100%); background: var(--paper-2); color: var(--ink); border: 1px solid var(--line-2); border-radius: 20px; padding: 16px 16px 14px; box-shadow: 0 18px 50px rgba(40, 30, 15, .2); display: flex; flex-direction: column; gap: 12px; }
.dwi-head { display: flex; gap: 12px; align-items: flex-start; }
.dwi-head img { width: 48px; height: 48px; border-radius: 12px; flex: none; }
.dwi-head b { display: block; font-weight: 600; font-size: 16px; }
.dwi-head p { margin: 3px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.dwi-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.dwi-btn { padding: 9px 14px; border-radius: 999px; font-size: 13px; }
.dwi-main { background: var(--ink); color: var(--paper); font-weight: 500; }
.dwi-ghost { border: 1px solid var(--line-2); color: var(--ink-2); }
.dwi-more { font-size: 13.5px; }
.dwi-steps { margin: 0; padding-left: 20px; line-height: 1.9; }
.dwi-ico { display: inline-flex; vertical-align: -4px; padding: 2px 4px; border-radius: 6px; background: var(--paper-3); }
.dwi-guide { margin: 0 0 8px; line-height: 1.6; }
.portrait img { object-position: 50% 24%; }
.who > span { white-space: nowrap; }
.who > b, .who > a { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
body { font-variant-numeric: lining-nums; }
.title, .pname, .first, .pquote, .cm-text, .known b, .stats b, .pr-stats b, .logo { font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1; }
