/* 소크라테스와의 술자리 · 2026-09-18 리모델링
   재미 앱 표준 «법정 웹툰» 톤(헌법 §7 · 정본 3.오늘운세 §4) + 포도주 빛 강조. */
:root {
    --cream: #FFF6E5;
    --paper: #FFFFFF;
    --ink: #1A1A1A;
    --ink-soft: #4A4A4A;
    --mute: #7A7266;
    --wine: #8E1B3A;
    --wine-soft: #F7E3E8;
    --red: #E8332A;
    --yellow: #FFD13F;
    --yellow-soft: #FFF1B8;
    --navy: #2E4374;
    --olive: #5E7A2E;
    --olive-soft: #EAF0DC;
    --line: 3px solid var(--ink);
    --shadow: 5px 5px 0 var(--ink);
    --shadow-s: 3px 3px 0 var(--ink);
    --display: 'Black Han Sans', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
    --body: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
    --head-h: 56px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--body); color: var(--ink); word-break: keep-all; min-height: 100vh; -webkit-tap-highlight-color: transparent;
       background-color: var(--cream); background-image: repeating-linear-gradient(135deg, rgba(26,26,26,.028) 0 14px, transparent 14px 28px); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.wrap { max-width: 560px; margin: 0 auto; padding: 0 16px; }
.label { font-size: .74rem; font-weight: 900; color: var(--mute); }

/* 머리 (헌법 §5) */
.shin-header { position: sticky; top: 0; z-index: 40; height: var(--head-h); display: flex; align-items: center; background: var(--cream); border-bottom: var(--line); }
.shin-header-inner { width: 100%; max-width: 560px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-mark { width: 32px; height: 32px; flex: none; display: grid; place-items: center; background: var(--navy); color: #fff; border: 2px solid var(--ink); border-radius: 8px; font-family: serif; font-weight: 700; font-size: 18px; }
.brand-name { font-weight: 800; font-size: .95rem; white-space: nowrap; }
.head-tools { display: flex; gap: 6px; flex: none; }
.tool-btn { width: 38px; height: 38px; display: grid; place-items: center; font-size: 18px; line-height: 1; background: var(--paper); border: 2px solid var(--ink); border-radius: 10px; box-shadow: 2px 2px 0 var(--ink); text-decoration: none; transition: transform .1s, box-shadow .1s; }
.tool-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.tool-btn.off { background: #EDE6D8; opacity: .75; }

/* 공통 */
.card { background: var(--paper); border: var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 10px 16px; border: var(--line); border-radius: 14px; background: var(--paper); font-weight: 800; box-shadow: var(--shadow-s); transition: transform .1s, box-shadow .1s; }
.btn:active { transform: translate(3px, 3px); box-shadow: none; }
.btn.primary { background: var(--wine); color: #fff; }
.btn.ghost { box-shadow: none; border-width: 2px; }
.btn.wide { width: 100%; }
.btn:focus-visible, .tool-btn:focus-visible, .mood:focus-visible, .topic:focus-visible, .qchip:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.screen { padding: 16px 0 40px; }
.kicker { display: inline-block; font-size: .76rem; font-weight: 800; background: var(--yellow); border: 2px solid var(--ink); border-radius: 999px; padding: 3px 12px; box-shadow: 2px 2px 0 var(--ink); }

/* ① 입장 */
.title-block { text-align: center; }
.logo { font-family: var(--display); font-weight: 400; font-size: clamp(1.9rem, 8.8vw, 2.5rem); line-height: 1.12; margin-top: 10px; }
.logo span { color: var(--wine); -webkit-text-stroke: 1.2px var(--ink); paint-order: stroke fill; }
.hero { position: relative; margin-top: 12px; height: 214px; overflow: hidden; padding: 0; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 70%; opacity: .55; }
.hero-jo { position: absolute; left: 2%; bottom: -6px; width: 44%; height: auto; filter: drop-shadow(3px 3px 0 rgba(26,26,26,.2)); }
.bubble { position: absolute; right: 12px; top: 18px; width: 52%; background: var(--paper); border: var(--line); border-radius: 16px; padding: 10px 12px; box-shadow: var(--shadow-s); font-weight: 800; font-size: .92rem; line-height: 1.45; }
.bubble::before { content: ''; position: absolute; left: -12px; bottom: 16px; border: 10px solid transparent; border-right-color: var(--ink); border-left: 0; }
.bubble::after { content: ''; position: absolute; left: -7px; bottom: 18px; border: 8px solid transparent; border-right-color: var(--paper); border-left: 0; }
.bubble small { display: block; margin-top: 4px; font-size: .78rem; font-weight: 700; color: var(--mute); }
.resume { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; margin-top: 14px; }
.resume-info { font-weight: 800; margin-top: 2px; font-size: .9rem; }
.resume .btn { min-height: 40px; padding: 6px 12px; font-size: .88rem; }
.step-label { font-family: var(--display); font-size: 1.05rem; margin: 16px 0 8px; }
.step-label span { font-family: var(--body); font-size: .74rem; font-weight: 700; color: var(--mute); margin-left: 4px; }
.moods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mood { border: 2px solid var(--ink); border-radius: 12px; background: var(--paper); padding: 8px 4px; font-weight: 800; font-size: .92rem; box-shadow: 2px 2px 0 var(--ink); transition: transform .1s, box-shadow .1s; }
.mood[aria-checked="true"] { background: var(--wine); color: #fff; transform: translate(2px, 2px); box-shadow: none; }
.mood-desc { font-size: .78rem; font-weight: 700; color: var(--mute); margin-top: 6px; min-height: 1.2em; }
.topics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.topic { border: 2px solid var(--ink); border-radius: 12px; background: var(--paper); padding: 9px 2px 8px; display: flex; flex-direction: column; align-items: center; gap: 3px; box-shadow: 3px 3px 0 var(--ink); transition: transform .1s, box-shadow .1s; }
.topic:active { transform: translate(3px, 3px); box-shadow: none; }
.topic .ti { font-size: 1.5rem; line-height: 1.1; }
.topic .tn { font-size: .78rem; font-weight: 800; line-height: 1.25; text-align: center; }
.home-foot { display: flex; align-items: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.home-foot .btn { min-height: 40px; padding: 6px 12px; font-size: .88rem; }
#maximCount { background: var(--yellow); border: 1.5px solid var(--ink); border-radius: 999px; padding: 0 7px; font-size: .78rem; }
.flow { font-size: .8rem; font-weight: 700; color: var(--ink-soft); flex: 1; min-width: 180px; }
.limit-note { margin-top: 16px; font-size: .8rem; line-height: 1.6; background: rgba(128,128,128,.12); border-radius: 10px; padding: 10px 12px; }
.credit { margin-top: 12px; text-align: center; font-size: .74rem; line-height: 1.6; color: var(--mute); }

/* ② 술자리 */
.screen.table { padding: 10px 0 0; display: flex; flex-direction: column; height: calc(100vh - var(--head-h)); height: calc(100dvh - var(--head-h)); }
.cupbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; box-shadow: var(--shadow-s); border-radius: 14px; }
.cup { width: 58px; height: 40px; flex: none; }
#wine { transition: y .6s ease, height .6s ease; }
.cupinfo { min-width: 0; }
.round { font-family: var(--display); font-size: 1.15rem; line-height: 1.1; }
.round-goal { font-size: .72rem; font-weight: 700; color: var(--mute); }
.sips { display: flex; gap: 4px; margin-top: 4px; }
.sip { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); background: var(--wine); }
.sip.used { background: transparent; }
.cupside { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.tag { font-size: .72rem; font-weight: 800; border: 2px solid var(--ink); border-radius: 999px; padding: 2px 8px; background: var(--olive-soft); white-space: nowrap; }
.mini { font-size: .76rem; font-weight: 800; border: 2px solid var(--ink); border-radius: 9px; background: var(--paper); padding: 3px 10px; }
.chat { flex: 1; overflow-y: auto; padding: 14px 2px 12px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 8px; align-items: flex-end; }
.msg .av { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 2px solid var(--ink); background: var(--olive-soft); overflow: hidden; }
.msg .av img { width: 100%; height: 100%; object-fit: cover; }
.msg .bub { max-width: 82%; background: var(--paper); border: 2px solid var(--ink); border-radius: 16px 16px 16px 4px; padding: 10px 12px; box-shadow: 2px 2px 0 var(--ink); line-height: 1.65; font-size: .96rem; white-space: pre-line; }
.msg .act { display: block; font-size: .74rem; font-weight: 800; color: var(--wine); margin-bottom: 3px; }
.msg.me { justify-content: flex-end; }
.msg.me .bub { background: var(--yellow-soft); border-radius: 16px 16px 4px 16px; }
.msg.new .bub { animation: popIn .35s cubic-bezier(.2,1.4,.4,1); }
@keyframes popIn { from { transform: translateY(10px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.event { align-self: center; font-size: .78rem; font-weight: 800; color: var(--wine); background: var(--wine-soft); border: 2px solid var(--wine); border-radius: 999px; padding: 4px 12px; }
.coaster { align-self: center; width: 210px; aspect-ratio: 1; border-radius: 50%; border: 3px solid var(--ink); background: radial-gradient(circle, #fff 0 58%, var(--wine-soft) 58% 62%, #fff 62%); box-shadow: var(--shadow-s); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 26px; }
.coaster .cn { font-size: .7rem; font-weight: 900; color: var(--wine); }
.coaster .cm { font-family: var(--display); font-size: 1.02rem; line-height: 1.35; margin-top: 4px; }
.coaster.in { animation: coasterIn .5s cubic-bezier(.2,1.5,.4,1); }
@keyframes coasterIn { from { transform: rotate(-30deg) scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.thinking { display: flex; align-items: center; gap: 8px; font-size: .84rem; font-weight: 700; color: var(--mute); }
.thinking img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--ink); object-fit: cover; object-position: 50% 8%; background: var(--olive-soft); }
.thinking span i { font-style: normal; animation: blink 1.2s infinite; }
.thinking span i:nth-child(2) { animation-delay: .2s; } .thinking span i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .2; } }
.dock { padding: 8px 0 max(8px, env(safe-area-inset-bottom)); border-top: var(--line); background: var(--cream); }
.next-cup { width: 100%; margin-bottom: 8px; background: var(--wine); color: #fff; }
.quick { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.qchip { flex: none; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); padding: 7px 12px; font-size: .86rem; font-weight: 800; box-shadow: 2px 2px 0 var(--ink); white-space: nowrap; }
.qchip:active { transform: translate(2px, 2px); box-shadow: none; }
.qchip:disabled { opacity: .4; }
.say { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.say textarea { resize: none; min-width: 0; max-height: 120px; font-size: 16px; line-height: 1.45; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 14px; background: var(--paper); }
.say textarea:focus { outline: none; box-shadow: 0 0 0 3px var(--yellow); }
.send { width: 48px; min-height: 46px; padding: 0; background: var(--wine); color: #fff; font-size: 1.1rem; }
.quota { font-size: .7rem; color: var(--mute); text-align: right; margin-top: 4px; min-height: 1em; }

/* ③ 기록 */
.rec { position: relative; padding: 18px 16px 16px; overflow: hidden; }
.rec-title { font-family: var(--display); font-weight: 400; font-size: 1.7rem; line-height: 1.25; margin: 10px 0 4px; padding-right: 40%; }
.rec-meta { font-size: .8rem; font-weight: 700; color: var(--mute); padding-right: 40%; }
.rec-jo { position: absolute; right: -4px; top: 14px; width: 36%; height: auto; }
.rec-sec { margin-top: 14px; border-top: 2px dashed #D8CDB6; padding-top: 10px; }
.rec-sec p:not(.label), .rec-sec li { font-size: .95rem; line-height: 1.65; }
.rec-sec ul, .rec-sec ol { padding-left: 20px; margin-top: 4px; display: grid; gap: 4px; }
.rec-sec:first-of-type { margin-top: 26px; }
.coasters { display: flex; gap: 8px; margin-top: 16px; }
.coasters .coaster { width: auto; flex: 1; padding: 10px; }
.coasters .coaster .cm { font-size: .78rem; }
.rec-maxim { margin-top: 16px; text-align: center; font-family: var(--display); font-size: 1.3rem; line-height: 1.4; color: var(--wine); }
.rec-help { margin-top: 14px; border: 2px solid var(--navy); border-radius: 12px; padding: 10px 12px; background: #E4E9F4; display: grid; gap: 8px; }
.rec-help p { font-size: .88rem; line-height: 1.6; }
.rec-help .btn { justify-content: flex-start; min-height: 44px; font-size: .9rem; }
a.btn { color: var(--ink); text-decoration: none; }
a.btn.primary { color: #fff; }
.crisis { display: grid; gap: 8px; margin-top: 12px; }
.crisis .btn { justify-content: flex-start; }
.sheet-card p.small { font-size: .82rem; margin-top: 8px; }
.linkish { background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 2px; font-weight: 800; color: inherit; }
.rec-sign { margin-top: 12px; text-align: right; font-size: .74rem; font-weight: 700; color: var(--mute); }
.rec-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.rec-actions .wide { grid-column: 1 / -1; }

/* 시트·알림 */
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(26,26,26,.55); }
.sheet-card { width: 100%; max-width: 440px; max-height: 80vh; overflow-y: auto; padding: 18px 16px 16px; }
.sheet-card h3 { font-family: var(--display); font-weight: 400; font-size: 1.35rem; margin: 2px 0 8px; }
.sheet-card p { line-height: 1.65; color: var(--ink-soft); }
.sheet-btns { display: flex; gap: 8px; margin-top: 14px; }
.sheet-btns .btn { flex: 1; }
.maxims { list-style: none; display: grid; gap: 8px; margin-top: 8px; }
.maxims li { border: 2px solid var(--ink); border-radius: 12px; padding: 8px 10px; background: var(--cream); }
.maxims b { display: block; font-family: var(--display); font-weight: 400; font-size: 1rem; line-height: 1.4; }
.maxims small { font-size: .72rem; font-weight: 700; color: var(--mute); }
.toast { position: fixed; left: 50%; bottom: 150px; z-index: 80; transform: translate(-50%, 10px); opacity: 0; pointer-events: none; background: var(--ink); color: #fff; font-size: .86rem; font-weight: 800; padding: 9px 16px; border-radius: 12px; max-width: calc(100vw - 32px); text-align: center; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.warn { background: var(--red); }

@media (min-width: 600px) { .msg .bub { font-size: 1rem; } }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
