:root {
  --canvas: #ffffff;
  --surface: #f6f7f7;
  --ink: #111b21;
  --ink-subtle: #59676f;
  --accent: #087f46;
  --accent-bright: #25d366;
  --accent-soft: #d9fdd3;
  --hairline: #e9edef;
  --chat-canvas: #f5f1eb;
  --mine: #d9fdd3;
  --peer: #ffffff;
  --type: #087f46;
  --type-bg: #eefaf2;
  --radius: 12px;
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: #e7e2da; }
body { min-height: 100dvh; word-break: keep-all; overflow-wrap: anywhere; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input { font: inherit; }
.app {
  max-width: 480px; margin: 0 auto; min-height: 100dvh; background: var(--canvas);
  display: flex; flex-direction: column; position: relative;
  box-shadow: 0 0 0 1px rgba(0,0,0,.04), 0 8px 40px rgba(0,0,0,.06);
}
.hidden { display: none !important; }

/* ---------- Intro ---------- */
.intro { flex: 1; display: flex; flex-direction: column; padding: 28px 22px 24px; background: linear-gradient(180deg, #f5f1eb 0%, #ffffff 58%); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--ink-subtle); }
.brand img { width: 26px; height: 26px; border-radius: 7px; }
.intro-hero { margin-top: 38px; }
.intro-kicker { display: inline-block; font-size: 13px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 6px 11px; border-radius: 999px; }
.intro h1 { font-size: 34px; line-height: 1.22; letter-spacing: -0.03em; margin: 16px 0 12px; font-weight: 800; }
.intro h1 em { font-style: normal; color: var(--accent); }
.intro p.lead { font-size: 16px; line-height: 1.55; color: var(--ink-subtle); margin: 0; }
.preview { margin: 30px 0 26px; display: flex; flex-direction: column; gap: 8px; }
.preview .bubble { max-width: 82%; animation: pop .45s ease both; }
.preview .bubble:nth-child(2) { animation-delay: .25s; }
.preview .bubble:nth-child(3) { animation-delay: .5s; }
.drinks { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; margin-bottom: 18px; }
.drinks span { font-size: 12.5px; padding: 6px 10px; border-radius: 999px; background: var(--surface); color: var(--ink-subtle); }
.shared-card { margin: 26px 0 8px; border-radius: 18px; padding: 18px; background: var(--type-bg); border: 1px solid rgba(0,0,0,.04); }
.shared-card .who { font-size: 14px; color: var(--ink-subtle); }
.shared-card .what { font-size: 22px; font-weight: 800; margin-top: 6px; color: var(--type); letter-spacing: -0.02em; }
.shared-card .sum { font-size: 14.5px; line-height: 1.5; margin-top: 8px; color: var(--ink); }

.btn-primary { width: 100%; height: 56px; border-radius: 14px; background: var(--accent); color: #fff; font-weight: 700; font-size: 17px; transition: transform .1s ease, filter .2s; }
.btn-primary:active { transform: scale(.98); filter: brightness(.95); }
.btn-ghost { width: 100%; height: 50px; border-radius: 14px; background: var(--surface); font-weight: 600; font-size: 15px; }
.fine { font-size: 12px; color: var(--ink-subtle); text-align: center; margin-top: 12px; line-height: 1.5; }

/* ---------- Chat ---------- */
.chat { flex: 1; display: flex; flex-direction: column; background: var(--chat-canvas); min-height: 100dvh; }
.chat-head { position: sticky; top: 0; z-index: 5; background: var(--surface); display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--hairline); }
.chat-head img { width: 38px; height: 38px; border-radius: 50%; }
.chat-head .name { font-weight: 700; font-size: 16px; }
.chat-head .status { font-size: 12px; color: var(--accent); }
.chat-head .prog { margin-left: auto; font-size: 13px; color: var(--ink-subtle); font-variant-numeric: tabular-nums; }
.progress { height: 3px; background: var(--hairline); }
.progress > i { display: block; height: 100%; width: 0; background: var(--accent-bright); transition: width .35s ease; }
.msgs { flex: 1; padding: 14px 12px 8px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.day { align-self: center; font-size: 12px; color: var(--ink-subtle); background: rgba(255,255,255,.8); padding: 4px 10px; border-radius: 8px; margin-bottom: 6px; }
.bubble { max-width: 78%; padding: 8px 11px; font-size: 15px; line-height: 1.38; border-radius: var(--radius); box-shadow: 0 1px .5px rgba(11,20,26,.13); word-break: keep-all; overflow-wrap: anywhere; }
.bubble.peer { align-self: flex-start; background: var(--peer); border-top-left-radius: 4px; }
.bubble.mine { align-self: flex-end; background: var(--mine); border-top-right-radius: 4px; }
.bubble.peer + .bubble.peer, .bubble.mine + .bubble.mine { border-radius: var(--radius); }
.bubble.new { animation: pop .28s ease both; }
.typing { display: inline-flex; gap: 4px; align-items: center; height: 20px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa5ab; animation: blink 1.1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
.replies { position: sticky; bottom: 0; padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); background: var(--chat-canvas); display: flex; flex-direction: column; gap: 8px; }
.reply { text-align: left; padding: 13px 15px; border-radius: 14px; background: var(--peer); font-size: 15px; line-height: 1.35; border: 1.5px solid transparent; box-shadow: 0 1px .5px rgba(11,20,26,.13); animation: pop .25s ease both; }
.reply:hover { border-color: var(--accent-bright); }
.reply:active { background: var(--mine); }
.composer { display: flex; gap: 8px; align-items: center; background: var(--peer); border-radius: 24px; padding: 4px 4px 4px 16px; box-shadow: 0 1px .5px rgba(11,20,26,.13); }
.composer input { flex: 1; border: 0; outline: none; background: transparent; font-size: 16px; height: 42px; }
.composer button { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #9aa5ab; }
.composer button.on { color: var(--accent); }
.skip { align-self: center; font-size: 13px; color: var(--ink-subtle); padding: 4px 10px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Result ---------- */
.result { flex: 1; background: var(--canvas); }
.r-hero { padding: 26px 22px 24px; background: var(--type-bg); position: relative; overflow: hidden; }
.r-hero .top { display: flex; justify-content: space-between; align-items: center; }
.r-hero .who { font-size: 15px; color: var(--ink-subtle); margin-top: 22px; }
.r-hero .temp { font-size: 64px; font-weight: 800; color: var(--type); letter-spacing: -0.04em; line-height: 1; margin-top: 8px; font-variant-numeric: tabular-nums; }
.r-hero .temp small { font-size: 30px; font-weight: 700; }
.r-hero h2 { font-size: 27px; margin: 10px 0 0; letter-spacing: -0.03em; }
.r-hero .sum { font-size: 15.5px; line-height: 1.55; margin: 12px 0 0; }
.thermo { margin-top: 18px; height: 10px; border-radius: 99px; background: linear-gradient(90deg, #7fb3ff, #9be3b5 45%, #ffd27a 70%, #ff7a59); position: relative; }
.thermo i { position: absolute; top: -5px; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 4px solid var(--type); transform: translateX(-50%); box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.thermo-label { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-subtle); margin-top: 7px; }
.r-sec { padding: 22px; border-bottom: 8px solid var(--surface); }
.r-sec h3 { font-size: 15px; margin: 0 0 12px; color: var(--ink-subtle); font-weight: 700; }
.r-sec ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.r-sec li { background: var(--chat-canvas); border-radius: 12px; border-top-left-radius: 4px; padding: 10px 13px; font-size: 15px; line-height: 1.4; align-self: flex-start; box-shadow: 0 1px .5px rgba(11,20,26,.1); }
.quote { font-size: 17px; font-weight: 700; line-height: 1.45; }
.tip { font-size: 15px; line-height: 1.55; }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.match a { display: block; text-decoration: none; color: inherit; border-radius: 14px; padding: 14px; background: var(--surface); }
.match .lbl { font-size: 12px; color: var(--ink-subtle); }
.match .nm { font-size: 16px; font-weight: 800; margin-top: 4px; letter-spacing: -0.02em; }
.match .tp { font-size: 13px; color: var(--ink-subtle); margin-top: 2px; }
.chem { border-radius: 16px; padding: 18px; background: linear-gradient(135deg, #e9fbe9, #fff6e8); }
.chem .score { font-size: 40px; font-weight: 800; color: var(--accent); letter-spacing: -0.03em; }
.chem .line { font-size: 15px; line-height: 1.5; margin-top: 6px; }
.share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.share-row button, .share-row a { height: 48px; border-radius: 12px; background: var(--surface); font-weight: 600; font-size: 14.5px; display: grid; place-items: center; text-decoration: none; color: inherit; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: rgba(17,27,33,.92); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 50; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

.app-cta { padding: 24px 22px 30px; background: #0b141a; color: #e9edef; }
.app-cta .row { display: flex; gap: 12px; align-items: center; }
.app-cta img { width: 52px; height: 52px; border-radius: 13px; }
.app-cta h3 { margin: 0; font-size: 18px; letter-spacing: -0.02em; }
.app-cta .sub { font-size: 13px; color: #adb8bf; margin-top: 3px; }
.app-cta p { font-size: 14.5px; line-height: 1.6; color: #d1d7db; margin: 16px 0; }
.app-cta ul { margin: 0 0 18px; padding: 0; list-style: none; font-size: 14px; color: #d1d7db; display: flex; flex-direction: column; gap: 7px; }
.app-cta li::before { content: '✓'; color: var(--accent-bright); font-weight: 800; margin-right: 8px; }
.stores { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stores a { height: 52px; border-radius: 12px; background: #25d366; color: #002d19; font-weight: 800; font-size: 15px; display: grid; place-items: center; text-decoration: none; }
.stores a.alt { background: #202c33; color: #e9edef; }
.stores.single { grid-template-columns: 1fr; }
.app-cta .fine { color: #8696a0; text-align: left; }
.foot { padding: 18px 22px 30px; font-size: 12px; color: var(--ink-subtle); line-height: 1.6; background: #0b141a; border-top: 1px solid #202c33; }
.foot a { color: #adb8bf; }

@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
