
/* Layout: one phone-sized app column; on wide screens it sits in a device frame beside a short tester guide. */
:root {
  --bg: #F5F4F0;
  --surface: #FFFFFF;
  --surface-2: #EDEBE6;
  --ink: #26232B;
  --ink-2: #5E5B66;
  --ink-3: #6F6C76;
  --line: #E3E1DB;
  --accent: #6553A6;
  --accent-soft: #EEEAF8;
  --lav: #B9AADF;
  --peach: #FAD65C;
  --btn: #26232B;
  --on-btn: #FFFFFF;
  --good: #2F7D5B;
  --good-soft: #E3F2EA;
  --warn: #9A5A12;
  --warn-soft: #FCF1D2;
  --frame: #E8E6E0;
  --shadow: 0 1px 2px rgba(38, 35, 43, .05), 0 6px 20px rgba(38, 35, 43, .06);
  --font: "Plus Jakarta Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17151B; --surface: #211F26; --surface-2: #2B2831; --ink: #F3F1EC; --ink-2: #B7B3BE; --ink-3: #8E8A95;
    --line: #38343F; --accent: #C9BDEB; --accent-soft: #2E2A3E; --lav: #6B5F96; --peach: #8F7A2E;
    --btn: #F3F1EC; --on-btn: #1B1920; --good: #7BCDA6; --good-soft: #1E3329; --warn: #F2C866; --warn-soft: #3A3119;
    --frame: #0F0E12; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17151B; --surface: #211F26; --surface-2: #2B2831; --ink: #F3F1EC; --ink-2: #B7B3BE; --ink-3: #8E8A95;
  --line: #38343F; --accent: #C9BDEB; --accent-soft: #2E2A3E; --lav: #6B5F96; --peach: #8F7A2E;
  --btn: #F3F1EC; --on-btn: #1B1920; --good: #7BCDA6; --good-soft: #1E3329; --warn: #F2C866; --warn-soft: #3A3119;
  --frame: #0F0E12; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  color-scheme: dark;
}
html, body { height: 100%; }
body { margin: 0; }
body { background: var(--frame); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
* { box-sizing: border-box; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; font-size: 16px; color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3 { margin: 0; text-wrap: balance; }

.stage { height: 100%; display: flex; align-items: center; justify-content: center; gap: 48px; }
.guide { width: 300px; color: var(--ink); }
.guide .wm { font-weight: 700; letter-spacing: .32em; font-size: 22px; }
.guide p { color: var(--ink-2); margin: 8px 0 20px; }
.guide ol { margin: 0; padding-left: 20px; display: grid; gap: 10px; color: var(--ink-2); }
.guide ol b { color: var(--ink); font-weight: 600; }
.guide .note { margin-top: 24px; font-size: 13px; color: var(--ink-3); }
.device { position: relative; width: 390px; height: min(844px, calc(100% - 48px)); border-radius: 44px; overflow: hidden; background: var(--bg); box-shadow: 0 0 0 10px var(--surface), 0 30px 80px rgba(30, 16, 50, .25); }
@media (max-width: 860px) { .guide { display: none; } }
@media (max-width: 500px) {
  .stage { display: block; }
  .device { width: 100%; height: 100%; border-radius: 0; box-shadow: none; }
}

#app { position: absolute; inset: 0; display: flex; flex-direction: column; }
.screen { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 16px max(20px, env(safe-area-inset-left, 0px)) 28px max(20px, env(safe-area-inset-right, 0px)); scroll-behavior: smooth; }
.screen.with-input { padding-bottom: 12px; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }

/* top bars */
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .28em; font-size: 14px; }
.iconbtn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); position: relative; }
.iconbtn:hover { background: var(--surface-2); }
.iconbtn .dot { position: absolute; top: 10px; right: 11px; width: 8px; height: 8px; border-radius: 50%; background: #E0785F; border: 2px solid var(--bg); }
.title-lg { font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
.title-md { font-size: 20px; line-height: 1.3; font-weight: 700; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.sec-head h2 { font-size: 16px; font-weight: 700; }
.link { color: var(--accent); font-weight: 600; font-size: 14px; }

/* surfaces */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.pad { padding: 16px; }
.list { display: flex; flex-direction: column; }
.list > * + * { border-top: 1px solid var(--line); }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 64px; text-align: left; width: 100%; }
.li:hover { background: var(--surface-2); }
.li .grow { flex: 1; min-width: 0; }
.li .name { font-weight: 600; }
.chev { color: var(--ink-3); }

.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); }
.avatar.lg { width: 88px; height: 88px; }
.avatar.sm { width: 32px; height: 32px; }
.avatar.xs { width: 24px; height: 24px; border: 2px solid var(--surface); }
.initials { display: grid; place-items: center; font-weight: 700; color: var(--accent); background: var(--accent-soft); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 999px; font-weight: 600; white-space: nowrap; transition: transform .15s ease, opacity .15s ease; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--btn); color: var(--on-btn); }
.btn.soft { background: var(--surface-2); color: var(--ink); }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.block { width: 100%; }
.btn.sm { min-height: 40px; padding: 0 16px; font-size: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; white-space: nowrap; }
.chip.on { background: var(--btn); color: var(--on-btn); box-shadow: none; }
.chip.like { background: var(--accent-soft); box-shadow: none; color: var(--ink); }
.chip.avoid { background: var(--warn-soft); box-shadow: none; color: var(--warn); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); }
.tag.good { background: var(--good-soft); color: var(--good); }
.tag.accent { background: var(--accent-soft); color: var(--accent); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }

.hscroll { display: flex; gap: 12px; overflow-x: auto; margin: 0 -20px; padding: 2px 20px 8px; scroll-snap-type: x mandatory; scroll-padding-inline: 20px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex: none; }

/* gift tile art */
.tile { position: relative; border-radius: var(--r-md); overflow: hidden; display: grid; place-items: center; color: rgba(36, 29, 44, .72); }
.tile svg.i { width: 44%; height: 44%; stroke-width: 1.1; position: relative; }
.tile::before { content: ""; position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%; background: rgba(255,255,255,.45); top: -18%; right: -14%; }
.tile::after { content: ""; position: absolute; width: 46%; aspect-ratio: 1; border-radius: 50%; background: rgba(255,255,255,.28); bottom: -14%; left: -8%; }
.tile.photo::before, .tile.photo::after { display: none; }
.tile.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.t-matcha { background: linear-gradient(140deg, #DCE8C9, #B9D2A6); }
.t-clay { background: linear-gradient(140deg, #F6D9C8, #E8B9A0); }
.t-lav { background: linear-gradient(140deg, #E6DDF8, #C9B7EE); }
.t-sky { background: linear-gradient(140deg, #D6E6F2, #B3CCE3); }
.t-sand { background: linear-gradient(140deg, #F3E8D2, #E2CFA8); }
.t-rose { background: linear-gradient(140deg, #F6DCE2, #E8B6C3); }

.gcard { width: 196px; text-align: left; display: flex; flex-direction: column; gap: 8px; }
.gcard .tile { height: 132px; }
.gcard .gname { font-weight: 600; line-height: 1.3; }
.gcard .meta { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--ink-2); }
.save-fab { position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.85); display: grid; place-items: center; color: #241D2C; z-index: 1; }
.save-fab.on { background: #241D2C; color: #fff; }
.save-fab svg.i { width: 18px; height: 18px; stroke-width: 2; position: static; }

/* home */
.greet { padding-top: 4px; }
.greet .hi { color: var(--ink-2); font-weight: 500; }
.askbox { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 0 8px 0 18px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); color: var(--ink-3); text-align: left; }
.askbox .grow { flex: 1; }
.askbox .go { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--lav), var(--peach)); display: grid; place-items: center; color: #241D2C; }
.hero { position: relative; overflow: hidden; border-radius: 26px; padding: 20px; background: var(--surface); box-shadow: var(--shadow); }
.hero::before { content: ""; position: absolute; width: 280px; height: 280px; right: -100px; top: -130px; filter: blur(18px); border-radius: 46% 54% 60% 40%; background: radial-gradient(circle at 30% 40%, var(--lav), transparent 70%), radial-gradient(circle at 70% 70%, var(--peach), transparent 65%); opacity: .75; }
.hero > * { position: relative; }
.count { display: flex; align-items: baseline; gap: 6px; }
.count b { font-size: 44px; line-height: 1; font-weight: 700; letter-spacing: -.02em; }
.progress { display: flex; gap: 6px; }
.progress span { flex: 1; height: 4px; border-radius: 4px; background: var(--surface-2); }
.progress span.on { background: var(--accent); }
.xmas { border-radius: var(--r-lg); padding: 18px; display: flex; gap: 14px; align-items: center; background: linear-gradient(120deg, var(--accent-soft), var(--surface)); box-shadow: var(--shadow); text-align: left; width: 100%; }
.xmas .ic { width: 48px; height: 48px; border-radius: 14px; background: var(--surface); display: grid; place-items: center; color: var(--accent); flex: none; }

/* bottom nav */
.nav { display: flex; justify-content: space-around; padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--line); }
.nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; min-height: 52px; justify-content: center; font-size: 11px; font-weight: 600; color: var(--ink-3); }
.nav button.on { color: var(--ink); }
.nav button.on svg.i { stroke-width: 2.2; }

/* person */
.phead { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.occ { display: flex; align-items: center; gap: 14px; }
.occ .date { width: 56px; height: 60px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; }
.occ .date b { font-size: 22px; line-height: 1; }
.occ .date span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 4px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow); font-size: 13px; font-weight: 600; }
.quick button.on { background: var(--accent-soft); color: var(--accent); }
.note { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 12px 16px; }
.note .when { font-size: 12px; color: var(--ink-3); padding-top: 2px; }
.note.new { background: var(--good-soft); }

/* gift detail */
.gift-hero { height: 240px; border-radius: 26px; }
.why { display: flex; gap: 12px; padding: 14px 16px; }
.why .q { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.why svg.i { color: var(--accent); margin-top: 2px; }
.shop { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.shop .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stickybar { display: flex; gap: 10px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--line); }
.stickybar .btn { flex: 1; }

/* chat */
.msgs { display: flex; flex-direction: column; gap: 16px; }
.bubble { max-width: 84%; padding: 12px 16px; border-radius: 20px; }
.bubble.me { align-self: flex-end; background: linear-gradient(135deg, var(--lav), var(--peach)); color: #241D2C; border-bottom-right-radius: 6px; }
.ai { display: flex; flex-direction: column; gap: 12px; }
.ai .bubble { background: var(--surface); box-shadow: var(--shadow); border-bottom-left-radius: 6px; }
.ai .who { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--ink-2); letter-spacing: .04em; }
.cites { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.typing { display: inline-flex; gap: 4px; padding: 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.inputbar { display: flex; gap: 8px; align-items: center; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--line); }
.inputbar input { flex: 1; min-height: 46px; border-radius: 999px; border: 0; background: var(--surface-2); padding: 0 18px; }
.inputbar input:focus { outline: 2px solid var(--accent); }
.inputbar .send { width: 46px; height: 46px; border-radius: 50%; background: var(--btn); color: var(--on-btn); display: grid; place-items: center; }
.demo-pill { font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 3px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }

/* moments */
.seg { display: inline-flex; align-self: flex-start; padding: 4px; border-radius: 999px; background: var(--surface-2); }
.seg button { min-height: 36px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.post { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.post .media { height: 180px; }
.post .mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.post .mini .tile { height: 88px; }
.post .mini .cap { font-size: 12px; color: var(--ink-2); margin-top: 4px; line-height: 1.3; }
.post .bar { display: flex; align-items: center; gap: 16px; color: var(--ink-2); font-size: 14px; }
.post .bar button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; }
.post .bar .liked { color: #D4566A; }
.post .bar .liked svg.i { fill: currentColor; }

/* me */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stats div { background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 14px; text-align: center; }
.stats b { display: block; font-size: 22px; }
.toggle { width: 48px; height: 28px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background .2s; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(20px); }

/* splash */
.splash { flex: 1; display: flex; flex-direction: column; justify-content: space-between; padding: 24px 28px 36px; position: relative; overflow: hidden; }
.splash .blob { position: absolute; width: 420px; height: 420px; left: 50%; top: 8%; transform: translateX(-50%); border-radius: 48% 52% 44% 56% / 55% 45% 55% 45%; background: radial-gradient(circle at 35% 35%, var(--lav), transparent 62%), radial-gradient(circle at 70% 65%, var(--peach), transparent 60%); opacity: .9; animation: drift 12s ease-in-out infinite alternate; }
@keyframes drift { to { border-radius: 56% 44% 52% 48% / 45% 58% 42% 55%; transform: translateX(-50%) rotate(12deg); } }
.splash .mark { position: relative; display: grid; place-items: center; height: 300px; color: #fff; }
.splash .mark svg { width: 120px; height: 120px; }
.splash .wm { font-size: 30px; font-weight: 700; letter-spacing: .34em; text-align: center; padding-left: .34em; }
.splash .tagline { text-align: center; color: var(--ink-2); margin-top: 8px; font-size: 16px; }
.choice { display: flex; gap: 14px; align-items: center; padding: 18px; text-align: left; width: 100%; }
.choice .ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }

/* sheet + toast */
.scrim { position: absolute; inset: 0; background: rgba(20, 10, 30, .35); z-index: 20; animation: fade .2s ease; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 88%; overflow-y: auto; background: var(--bg); border-radius: 28px 28px 0 0; padding: 10px 20px calc(24px + env(safe-area-inset-bottom, 0px)); animation: up .25s cubic-bezier(.2,.8,.2,1); }
.sheet .grab { width: 40px; height: 5px; border-radius: 5px; background: var(--line); margin: 0 auto 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field textarea, .field select { min-height: 48px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); padding: 12px 14px; }
.field textarea { min-height: 112px; resize: none; line-height: 1.5; }
.pick { display: flex; align-items: center; gap: 12px; padding: 12px 16px; width: 100%; text-align: left; }
.box { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; color: transparent; }
.box.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.box svg.i { width: 16px; height: 16px; stroke-width: 3; }
.toast { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 30; background: var(--btn); color: var(--on-btn); padding: 12px 18px; border-radius: 14px; font-size: 14px; font-weight: 500; max-width: calc(100% - 40px); width: max-content; box-shadow: 0 10px 30px rgba(0,0,0,.2); animation: up .2s ease; }
@keyframes up { from { transform: translate(var(--tx, 0), 24px); opacity: 0; } }
.toast { --tx: -50%; }
@keyframes fade { from { opacity: 0; } }
.empty { text-align: center; padding: 20px; color: var(--ink-2); }
.search { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-3); }
.search input { flex: 1; border: 0; background: none; min-height: 46px; }
.search input:focus { outline: none; }

.enter-fwd { animation: inR .26s cubic-bezier(.2,.8,.2,1); }
.enter-back { animation: inL .22s cubic-bezier(.2,.8,.2,1); }
@keyframes inR { from { transform: translateX(28px); opacity: 0; } }
@keyframes inL { from { transform: translateX(-28px); opacity: 0; } }
.lock { border-radius: 26px; padding: 22px 14px 14px; background: linear-gradient(160deg, #3B2E57, #7A5A86 55%, #C98C7E); color: #fff; text-align: center; }
.lock-time { font-size: 52px; font-weight: 600; line-height: 1; letter-spacing: -.02em; }
.lock-date { font-size: 14px; opacity: .85; margin: 4px 0 18px; }
.push { display: flex; gap: 10px; text-align: left; padding: 12px; border-radius: 18px; background: rgba(255,255,255,.82); color: #241D2C; backdrop-filter: blur(10px); }
.push .app { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, #C3AEF0, #F5C3AE); display: grid; place-items: center; color: #fff; flex: none; }
.nic { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.meter { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--lav), var(--accent)); }
.xrow { display: flex; align-items: center; }
.xmain { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 8px 12px 16px; text-align: left; min-height: 64px; }
.xmain .grow { flex: 1; min-width: 0; }
.xmain .name { font-weight: 600; }
.xcheck { width: 44px; height: 44px; margin-right: 8px; border-radius: 50%; display: grid; place-items: center; color: transparent; box-shadow: inset 0 0 0 2px var(--line); flex: none; }
.xcheck.on { background: var(--good); color: #fff; box-shadow: none; }
.wgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wcard { padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.wcard .btn { margin-top: 4px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
