/* Layout: one phone-width column, image-led cards, a fixed bottom bar; wider screens centre the same column. */
:root {
  --bg: #F5F4EF;
  --surface: #FFFFFF;
  --sunk: #ECEAE2;
  --ink: #1C2926;
  --muted: #5B6863;
  --line: #E0DDD3;
  --gift: #1F5C4A;
  --gift-soft: #DCEBE4;
  --receive: #8E3A5C;
  --receive-soft: #F1DFE6;
  --sun: #C98A1B;
  --sun-soft: #F6E9CC;
  --on-strong: #FFFFFF;
  --warn: #9A5B00;
  --warn-soft: #FBEBD0;
  --shadow: 0 1px 2px rgba(28, 41, 38, .06), 0 6px 20px rgba(28, 41, 38, .07);
  --display: 'Bricolage Grotesque', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --body: 'Figtree', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --r: 18px;
  --col: 520px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121816; --surface: #1A2320; --sunk: #222D29; --ink: #ECEFEA; --muted: #A2AEA8; --line: #2E3A36;
    --gift: #6CC0A1; --gift-soft: #1D3A31; --receive: #E58DB0; --receive-soft: #3C2230; --sun: #E6B252; --sun-soft: #3A2F18;
    --on-strong: #0E1613; --warn: #F0B860; --warn-soft: #3A2C14; --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: #121816; --surface: #1A2320; --sunk: #222D29; --ink: #ECEFEA; --muted: #A2AEA8; --line: #2E3A36;
  --gift: #6CC0A1; --gift-soft: #1D3A31; --receive: #E58DB0; --receive-soft: #3C2230; --sun: #E6B252; --sun-soft: #3A2F18;
  --on-strong: #0E1613; --warn: #F0B860; --warn-soft: #3A2C14; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 8px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -.015em; text-wrap: balance; margin: 0; }
h1 { font-size: 2rem; line-height: 1.05; }
h2 { font-size: 1.3rem; line-height: 1.15; }
h3 { font-size: 1.05rem; line-height: 1.2; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.tiny { font-size: .78rem; }
.num { font-variant-numeric: tabular-nums; }
svg { display: block; width: 100%; height: 100%; }

#app { max-width: var(--col); margin: 0 auto; min-height: 100%; padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
.wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-lg { display: flex; flex-direction: column; gap: 28px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

/* Demo strip */
.demo-strip { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-block: 6px; background: var(--sun-soft); color: var(--ink); font-size: .78rem; letter-spacing: .02em; }
.demo-strip button { border: 0; background: none; text-decoration: underline; font-size: .78rem; padding: 4px; color: inherit; }

/* Top bar */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); display: flex; align-items: center; gap: 10px; padding-block: 12px; }
.wordmark { font-family: var(--display); font-weight: 800; font-size: 1.45rem; letter-spacing: -.03em; line-height: 1; }
.wordmark i { font-style: normal; color: var(--gift); }
.wordmark b { color: var(--receive); font-weight: 800; }
.top .comm { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.iconbtn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; font-size: 1.1rem; }
.back { border: 0; background: none; padding: 10px 0; font-weight: 700; color: var(--gift); display: inline-flex; gap: 6px; align-items: center; min-height: 44px; }

/* Avatars */
.av { --h: 200; width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: .95rem;
  background: radial-gradient(circle at 30% 25%, hsl(var(--h) 55% 82%), hsl(var(--h) 38% 62%)); color: hsl(var(--h) 45% 18%); }
.av.lg { width: 76px; height: 76px; font-size: 1.6rem; }
.av.sm { width: 30px; height: 30px; font-size: .72rem; }
.av-stack { display: flex; }
.av-stack .av { border: 2px solid var(--surface); margin-left: -8px; }
.av-stack .av:first-child { margin-left: 0; }

/* The two central actions */
.twin { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.big { border: 0; border-radius: var(--r); padding: 18px 14px; min-height: 96px; text-align: left; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; color: var(--on-strong); }
.big .label { font-family: var(--display); font-size: 1.35rem; font-weight: 800; letter-spacing: .02em; }
.big .hint { font-size: .85rem; opacity: .9; }
.big.gift { background: var(--gift); }
.big.receive { background: var(--receive); }

/* Buttons */
.btn { border: 0; border-radius: 14px; min-height: 50px; padding: 12px 18px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.btn.primary { background: var(--gift); color: var(--on-strong); }
.btn.rose { background: var(--receive); color: var(--on-strong); }
.btn.soft { background: var(--gift-soft); color: var(--ink); }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.btn.quiet { background: transparent; color: var(--muted); min-height: 44px; padding: 8px 10px; }
.btn.block { width: 100%; }
.btn.sm { min-height: 40px; padding: 8px 14px; font-size: .9rem; border-radius: 12px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.linkish { border: 0; background: none; padding: 0; color: var(--gift); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* Cards */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.card-pad { padding: 16px; }
.art { aspect-ratio: 16 / 10; max-width: 100%; background: var(--sunk); overflow: hidden; }
.art.tall { aspect-ratio: 4 / 3; }
.art.wide { aspect-ratio: 2 / 1; }
.tile { border: 0; padding: 0; text-align: left; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; color: inherit; width: 100%; }
.tile .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.tile h3 { font-size: .98rem; }
.tile .who { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); margin-top: auto; padding-top: 4px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 74%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); padding-inline: max(16px, env(safe-area-inset-left, 0px)); scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
.rail.narrow { grid-auto-columns: 46%; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head button { border: 0; background: none; color: var(--gift); font-weight: 700; padding: 6px 0; }

.wishcard { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.wishcard .q { font-family: var(--display); font-size: 1.08rem; font-weight: 600; line-height: 1.22; }
.eyebrow { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.eyebrow.rose { color: var(--receive); }
.eyebrow.green { color: var(--gift); }

/* Pills and chips */
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 10px; font-size: .78rem; font-weight: 700; background: var(--sunk); color: var(--ink); }
.pill.green { background: var(--gift-soft); }
.pill.rose { background: var(--receive-soft); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.sun { background: var(--sun-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 10px 16px; min-height: 44px; font-size: .95rem; transition: background .15s, border-color .15s, transform .15s; }
.chip[aria-pressed="true"] { background: var(--gift); border-color: var(--gift); color: var(--on-strong); }
.chip.rose[aria-pressed="true"] { background: var(--receive); border-color: var(--receive); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--sunk); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; border-radius: 10px; min-height: 42px; font-weight: 700; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.cats { display: grid; grid-auto-flow: column; grid-auto-columns: max-content; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); padding-inline: max(16px, env(safe-area-inset-left, 0px)); }
.cats::-webkit-scrollbar { display: none; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .legend { font-weight: 700; font-size: .95rem; }
.input, textarea, select { width: 100%; border: 1.5px solid var(--line); background: var(--surface); border-radius: 14px; padding: 13px 14px; min-height: 50px; }
textarea { min-height: 96px; resize: vertical; }
.search { position: relative; }
.search .input { padding-left: 44px; }
.search span { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.option { display: flex; gap: 12px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; background: var(--surface); text-align: left; width: 100%; }
.option[aria-pressed="true"] { border-color: var(--gift); background: var(--gift-soft); }
.option .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: 0 0 auto; margin-top: 2px; }
.option[aria-pressed="true"] .dot { border: 7px solid var(--gift); }

/* Notes */
.note { border-radius: 14px; padding: 12px 14px; background: var(--sunk); font-size: .9rem; display: flex; gap: 10px; align-items: flex-start; }
.note.warn { background: var(--warn-soft); }
.note.green { background: var(--gift-soft); }
.note.rose { background: var(--receive-soft); }
.note .ic { flex: 0 0 auto; }

/* Progress */
.meter { height: 10px; border-radius: 99px; background: var(--sunk); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 99px; background: var(--receive); transition: width .6s ease; }
.meter.green > span { background: var(--gift); }

/* Bottom nav */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
.nav .in { max-width: var(--col); margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); }
.nav button { border: 0; background: none; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: .74rem; font-weight: 700; color: var(--muted); position: relative; }
.nav button svg { width: 24px; height: 24px; }
.nav button[aria-current="page"] { color: var(--gift); }
.badge { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 18px; height: 18px; border-radius: 9px; background: var(--receive); color: var(--on-strong); font-size: .7rem; display: grid; place-items: center; padding: 0 5px; }

.footbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--bg); border-top: 1px solid var(--line); padding-block: 12px calc(12px + env(safe-area-inset-bottom, 0px)); }
.footbar .in { max-width: var(--col); margin: 0 auto; }

/* Sheets */
.scrim { position: fixed; inset: 0; background: rgba(10, 16, 14, .45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; animation: fade .18s ease; }
.sheet { background: var(--bg); width: 100%; max-width: var(--col); max-height: 92%; overflow: auto; border-radius: 24px 24px 0 0; padding-block: 10px calc(24px + env(safe-area-inset-bottom, 0px)); animation: up .24s cubic-bezier(.2, .8, .2, 1); }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet-item { display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; border: 0; background: var(--surface); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); color: inherit; }
.sheet-item .thumb { width: 64px; height: 64px; border-radius: 12px; overflow: hidden; flex: 0 0 auto; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 30; background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 14px; font-size: .92rem; max-width: min(92vw, 480px); box-shadow: var(--shadow); animation: up .25s ease; }

/* Hero */
.hero { position: relative; border-radius: 24px; overflow: hidden; }
.hero .art { aspect-ratio: 5 / 4; }
.hero .over { position: absolute; inset: auto 0 0 0; padding: 18px; background: linear-gradient(transparent, rgba(12, 20, 17, .72)); color: #fff; }
.hero .over h1 { color: #fff; }

/* Discovery flow */
.step-dots { display: flex; gap: 6px; }
.step-dots span { height: 6px; flex: 1; border-radius: 3px; background: var(--line); transition: background .3s; }
.step-dots span.on { background: var(--gift); }
.big-q { font-size: 1.9rem; line-height: 1.08; }
.sugg { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; transition: opacity .25s; }
.sugg .thumb { min-height: 100%; }
.sugg .body { padding: 12px 12px 12px 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sugg.rejected { opacity: .45; }
.sugg.accepted { outline: 2px solid var(--gift); }
.because { font-size: .8rem; color: var(--muted); }
.demand { font-size: .82rem; color: var(--receive); font-weight: 700; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--surface); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); }
.stat b { display: block; font-family: var(--display); font-size: 1.45rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: .76rem; color: var(--muted); }

.list { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.list > * + * { border-top: 1px solid var(--line); }
.li { display: flex; gap: 12px; align-items: center; padding: 14px; width: 100%; text-align: left; border: 0; background: none; color: inherit; }
.li .grow p { font-size: .86rem; color: var(--muted); }

.msgs { display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 82%; padding: 10px 13px; border-radius: 16px; font-size: .95rem; background: var(--surface); box-shadow: var(--shadow); }
.msg.me { align-self: flex-end; background: var(--gift); color: var(--on-strong); }
.msg.sys { align-self: center; background: none; box-shadow: none; color: var(--muted); font-size: .82rem; text-align: center; }

.timeline { display: flex; flex-direction: column; gap: 0; }
.tl { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding-bottom: 14px; position: relative; }
.tl::before { content: ""; position: absolute; left: 13px; top: 26px; bottom: 0; width: 2px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl .mk { width: 28px; height: 28px; border-radius: 50%; background: var(--sunk); display: grid; place-items: center; font-size: .8rem; font-weight: 700; }
.tl.done .mk { background: var(--gift); color: var(--on-strong); }
.tl.now .mk { background: var(--receive); color: var(--on-strong); }

.coord-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: max-content; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.coord-tabs button { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-weight: 700; min-height: 42px; }
.coord-tabs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.check { display: flex; gap: 10px; align-items: center; min-height: 40px; }
.check input { width: 20px; height: 20px; accent-color: var(--gift); }

.welcome { min-height: 100%; display: flex; flex-direction: column; gap: 22px; padding-block: 18px 32px; }
.welcome .tag { font-family: var(--display); font-size: 2.6rem; font-weight: 800; line-height: .98; letter-spacing: -.03em; }
.mosaic { display: grid; grid-template-columns: 1.2fr 1fr; grid-template-rows: 120px 120px; gap: 8px; }
.mosaic > div { border-radius: 18px; overflow: hidden; }
.mosaic > div:first-child { grid-row: span 2; }
.three-lines { display: flex; flex-direction: column; gap: 10px; }
.three-lines div { display: flex; gap: 12px; align-items: center; font-family: var(--display); font-size: 1.15rem; font-weight: 600; }
.three-lines span { width: 34px; height: 34px; border-radius: 50%; background: var(--gift-soft); display: grid; place-items: center; flex: 0 0 auto; font-size: 1rem; }

@media (min-width: 700px) {
  #app { padding-top: 12px; }
  h1 { font-size: 2.3rem; }
  .rail { grid-auto-columns: 58%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
