/* Cycled demo — light by default, dark follows the phone */
:root {
  --bg: #FAF8F3; --text: #1A1917; --muted: #6B665D; --body2: #3D3A34;
  --line: #E4DFD4; --line2: #D3CDC0; --card: #F0ECE3; --media: #E7E3D8;
  --accent: #1F5F4A; --on-accent: #FAF8F3; --clay: #B4532A; --blue: #2F4FB0;
  --ok-bg: #E3EEE8; --ok-text: #14402F; --flag-bg: #F7EBE3; --flag-text: #8A3A1A;
  --ink: #1A1917; --on-ink: #FAF8F3; --empty: #C9C3B6; --sel-bg: #E3EEE8;
  --frame: #E9E5DC; --ava-l: 88%;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211; --text: #EDEBE5; --muted: #A19D94; --body2: #CFCBC2;
    --line: #2A2926; --line2: #3A3934; --card: #1E1E1C; --media: #23251F;
    --accent: #6FCF9F; --on-accent: #121211; --clay: #E08A63; --blue: #8FA8FF;
    --ok-bg: #1C2E25; --ok-text: #9FE3BF; --flag-bg: #2E211B; --flag-text: #F0A783;
    --ink: #EDEBE5; --on-ink: #121211; --empty: #4A4843; --sel-bg: #1C2E25;
    --frame: #0B0B0A; --ava-l: 26%;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--frame); color: var(--text); font-family: Inter, system-ui, -apple-system, sans-serif; font-size: 15px; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button { font-family: inherit; cursor: pointer; color: inherit; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; }

.app { position: relative; max-width: 480px; height: 100dvh; margin: 0 auto; background: var(--bg); display: flex; flex-direction: column; overflow: hidden; }
@media (min-width: 520px) { .app { height: min(100dvh, 900px); margin-top: max(0px, calc((100dvh - 900px) / 2)); border-radius: 28px; box-shadow: 0 12px 40px rgba(0,0,0,.15); } }

.screen { display: none; flex: 1; min-height: 0; flex-direction: column; }
.screen.active { display: flex; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pad { padding: 20px; padding-top: max(20px, env(safe-area-inset-top)); display: flex; flex-direction: column; }
.pad-x { padding-left: 20px; padding-right: 20px; }
.top-pad { padding-top: max(20px, env(safe-area-inset-top)); }

/* text */
.logo { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 30px; letter-spacing: -1px; }
.display { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 56px; line-height: .95; letter-spacing: -2px; }
.title { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 40px; letter-spacing: -1.5px; }
.title.tight { line-height: 1; }
.title-md { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 34px; line-height: 1.05; letter-spacing: -1.2px; }
.title-sm { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 28px; letter-spacing: -1px; }
.big-num { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 64px; letter-spacing: -2px; min-width: 130px; text-align: center; }
.num-24, .num-26, .stat-num { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; }
.num-24 { font-size: 24px; } .num-26 { font-size: 26px; } .stat-num { font-size: 28px; }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 1px; }
.lead { font-size: 17px; line-height: 1.5; color: var(--body2); }
.body { font-size: 15px; line-height: 1.45; }
.body2 { font-size: 15px; line-height: 1.45; color: var(--body2); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 600; }
.big { font-size: 17px; }
.center { text-align: center; }
.accent { color: var(--accent); }
.dim { opacity: .88; }

/* layout helpers */
.row { display: flex; align-items: center; }
.wrap { flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.row-between.baseline { align-items: baseline; }
.gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-14 { gap: 14px; }
.stack, .stack-2, .stack-4, .stack-6, .stack-8, .stack-10, .stack-12, .stack-14, .stack-16 { display: flex; flex-direction: column; }
.stack { gap: 12px; } .stack-2 { gap: 2px; } .stack-4 { gap: 4px; } .stack-6 { gap: 6px; } .stack-8 { gap: 8px; } .stack-10 { gap: 10px; } .stack-12 { gap: 12px; } .stack-14 { gap: 14px; } .stack-16 { gap: 16px; }
.bottom { margin-top: auto; padding-top: 8px; }
.grow { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* buttons */
.btn { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 52px; padding: 0 18px; border-radius: 999px; font-weight: 600; font-size: 16px; text-decoration: none; border: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-ghost { background: transparent; border: 1px solid var(--line2); color: var(--text); }
.btn-ink { background: var(--ink); color: var(--on-ink); }
.btn-lg { min-height: 56px; font-size: 17px; }
.btn-sm { min-height: 48px; font-size: 15px; }
.link-blue { display: flex; align-items: center; justify-content: center; min-height: 44px; color: var(--blue); font-weight: 600; font-size: 15px; }
.text-btn { min-height: 44px; border: none; background: transparent; color: var(--accent); font-weight: 600; font-size: 14px; }
.round { width: 52px; height: 52px; border-radius: 50%; font-size: 26px; line-height: 1; flex-shrink: 0; }
.round-ghost { border: 1px solid var(--line2); background: transparent; }
.round-fill { border: none; background: var(--accent); color: var(--on-accent); }
.back { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: -10px; }
.backrow { display: flex; align-items: center; gap: 8px; }
.chip { font-size: 12px; font-weight: 600; padding: 6px 10px; border: 1px solid var(--line2); border-radius: 999px; }
.tag { font-size: 13px; font-weight: 600; padding: 7px 11px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line2); }

/* cards */
.card { background: var(--card); border-radius: 16px; padding: 18px; }
.stat { background: var(--card); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.ink-box { display: flex; align-items: center; justify-content: space-between; background: var(--ink); color: var(--on-ink); border-radius: 14px; padding: 14px 16px; }
.blue-card { background: var(--blue); color: var(--on-accent); border-radius: 16px; padding: 18px; }
.mini-check { width: 32px; height: 32px; border-radius: 50%; background: var(--on-accent); color: var(--blue); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.list-box { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; }
.list-box li { display: flex; justify-content: space-between; padding: 11px 14px; font-size: 14px; border-bottom: 1px solid var(--line); }
.list-box li:last-child { border-bottom: none; }
.plain { list-style: none; margin: 0; padding: 0; line-height: 1.4; }
.alert { padding: 10px 12px; border: 1px solid var(--line2); border-radius: 12px; font-size: 13px; line-height: 1.4; display: flex; gap: 10px; align-items: flex-start; }

/* avatars */
.ava { border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0; background: hsl(var(--h) 30% var(--ava-l)); color: var(--text); }
.ava-40 { width: 40px; height: 40px; font-size: 14px; }
.ava-44 { width: 44px; height: 44px; font-size: 13px; }
.ava-64 { width: 64px; height: 64px; font-size: 20px; }

/* feed */
.feed-head { padding: 20px 20px 12px; padding-top: max(16px, env(safe-area-inset-top)); display: flex; flex-direction: column; gap: 14px; border-bottom: 1px solid var(--line); }
.progress-wrap { display: flex; flex-direction: column; gap: 6px; }
.bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.bar-fill { height: 4px; width: 29%; background: var(--accent); transition: width .3s ease; }
.feed { padding: 16px; display: flex; flex-direction: column; gap: 28px; }
.post { display: flex; flex-direction: column; gap: 12px; }
.post-head { display: flex; align-items: center; gap: 10px; }
.post-who { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.post-name { font-weight: 600; font-size: 15px; }
.badge { font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 4px; color: var(--on-accent); }
.badge.creator { background: var(--accent); } .badge.company { background: var(--clay); } .badge.wildcard { background: var(--blue); }
.media { position: relative; width: 100%; border-radius: 14px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.media.tall { aspect-ratio: 4 / 5; } .media.square { aspect-ratio: 1 / 1; } .media.wide { aspect-ratio: 4 / 3; }
.media .play { width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.85); display: flex; align-items: center; justify-content: center; color: #1A1917; }
.media .corner { position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 600; background: rgba(250,248,243,.92); color: #1A1917; padding: 4px 8px; border-radius: 4px; }
.media .partner { position: absolute; left: 12px; bottom: 12px; font-size: 11px; font-weight: 600; background: rgba(26,25,23,.8); color: #FAF8F3; padding: 5px 9px; border-radius: 4px; }
.media .overlay-text { position: absolute; left: 0; right: 0; top: 18%; text-align: center; font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 30px; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.35); padding: 0 16px; }
.post-foot { display: flex; align-items: center; justify-content: space-between; }
.like { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line2); background: transparent; font-size: 14px; font-weight: 600; }
.like svg { transition: transform .15s ease; }
.like.on svg { fill: var(--accent); stroke: var(--accent); }
.like:active svg { transform: scale(1.25); }
.end-card { background: var(--card); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 12px; text-align: center; margin-bottom: 8px; }

/* done */
.done { gap: 26px; padding-top: max(56px, env(safe-area-inset-top)); }
.check-circle { flex-shrink: 0; width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; }

/* board */
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--card); border-radius: 999px; padding: 4px; }
.tabs button { min-height: 40px; border: none; border-radius: 999px; font-size: 13px; font-weight: 600; background: transparent; }
.price-box { border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; color: var(--on-accent); }
.price-num { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 40px; letter-spacing: -1.5px; line-height: 1; }
.price-num small { font-size: 18px; letter-spacing: 0; }
.price-btn { white-space: nowrap; flex-shrink: 0; display: flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; background: var(--bg); font-weight: 600; font-size: 14px; text-decoration: none; }
.people { list-style: none; margin: 0; padding-top: 4px; padding-bottom: 20px; }
.people li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.people .label { font-size: 12px; font-weight: 600; letter-spacing: 1px; color: var(--muted); padding: 10px 0 2px; border: none; }
.more-dot { width: 34px; height: 34px; border-radius: 50%; border: 1px dashed var(--empty); flex-shrink: 0; }
.people .ava { width: 34px; height: 34px; font-size: 12px; }

/* bid */
.stepper-wrap { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.stepper { display: flex; align-items: center; gap: 22px; }
.rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.4; }
.rules li { display: flex; gap: 10px; }
.rules li > span:first-child { color: var(--accent); font-weight: 600; }

/* week */
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.days button { min-height: 64px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 0; font-size: 12px; font-weight: 600; }
.days button.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.days i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.legend { display: flex; gap: 14px; font-size: 11px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.slot-media { height: 170px; border-radius: 14px; background: var(--media); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.ok-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--ok-bg); color: var(--ok-text); font-size: 14px; line-height: 1.4; }
.flag-note { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--clay); background: var(--flag-bg); font-size: 14px; line-height: 1.4; }
.flag-note b { color: var(--flag-text); }
.add-box { height: 170px; border-radius: 14px; border: 2px dashed var(--empty); background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--body2); }

/* boost */
.tiers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tiers button { width: 100%; min-height: 58px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); display: flex; align-items: center; gap: 12px; padding: 8px 14px; text-align: left; }
.tiers button.on { border-color: var(--accent); background: var(--sel-bg); }
.tier-range { width: 64px; font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 18px; }

/* me */
.menu { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.menu a { display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 0 16px; text-decoration: none; font-weight: 600; border-bottom: 1px solid var(--line); }
.menu a:last-child { border-bottom: none; }

/* bottom menu */
.nav { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); background: var(--bg); padding: 6px 8px; padding-bottom: max(10px, env(safe-area-inset-bottom)); flex-shrink: 0; }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 48px; justify-content: center; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 500; }
.nav a.on { color: var(--accent); font-weight: 600; }

/* toast */
.toast { position: absolute; left: 50%; bottom: 90px; transform: translate(-50%, 20px); background: var(--ink); color: var(--on-ink); padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; max-width: calc(100% - 40px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* install tip */
.install { display: flex; align-items: center; gap: 12px; margin: 12px 16px 0; padding: 12px; border-radius: 14px; background: var(--card); font-size: 14px; }
.install[hidden] { display: none; }
.install img { border-radius: 10px; flex-shrink: 0; }
.install-btn { border: none; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 14px; padding: 9px 14px; flex-shrink: 0; }
.install-btn[hidden] { display: none; }
.install-x { border: none; background: transparent; color: var(--muted); font-size: 24px; line-height: 1; width: 32px; height: 32px; flex-shrink: 0; }
