:root {
  --ground: #F7F5F0;
  --surface: #FFFFFF;
  --ink: #1C2433;
  --ink-2: #2E3747;
  --muted: #4A5465;
  --line: #E4E6EA;
  --line-2: #D5D9DF;
  --field: #9AA3AF;
  --teal: #0B6A6A;
  --teal-dark: #084F4F;
  --teal-soft: #E3F1EF;
  --teal-ink: #0B4A4A;
  --warm-soft: #FFF4E5;
  --warm-line: #F2C98A;
  --warm-ink: #5C3300;
  --alert: #C2410C;
  --radius: 20px;
  --font: 'Atkinson Hyperlegible', system-ui, -apple-system, sans-serif;
  --display: 'Fraunces', Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #DCD8CF;
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }

/* The phone frame: full screen on a phone, centred column on a computer */
#app {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100dvh;
  margin: 0 auto;
  background: var(--ground);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
@media (min-width: 560px) {
  body { display: flex; align-items: center; justify-content: center; }
  #app { height: min(900px, 100dvh); border-radius: 36px; box-shadow: 0 20px 60px rgba(0,0,0,0.25); }
}

#stage { position: relative; flex: 1 1 auto; min-height: 0; }
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: var(--ground);
}
.screen.enter-fwd { animation: inFwd 0.28s ease both; }
.screen.enter-back { animation: inBack 0.28s ease both; }
.screen.enter-fade { animation: inFade 0.25s ease both; }
@keyframes inFwd { from { transform: translateX(40%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes inBack { from { transform: translateX(-40%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes inFade { from { opacity: 0; } to { opacity: 1; } }

.top { display: flex; align-items: center; gap: 12px; padding: max(18px, env(safe-area-inset-top)) 20px 10px; }
.top h1 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 26px; line-height: 1.15; flex: 1 1 auto; }
.brand { font-family: var(--display); font-weight: 600; font-size: 28px; color: var(--teal); }
.sub { font-size: 16px; color: var(--muted); }
.body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 6px 20px 24px; display: flex; flex-direction: column; gap: 20px; -webkit-overflow-scrolling: touch; }
.foot { padding: 14px 20px max(18px, env(safe-area-inset-bottom)); background: var(--surface); border-top: 2px solid var(--line); display: flex; flex-direction: column; gap: 8px; }

.round {
  width: 52px; height: 52px; border-radius: 26px; flex: none;
  border: 2px solid var(--line-2); background: var(--surface);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.badge {
  position: absolute; top: -4px; right: -4px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px;
  background: var(--alert); color: #fff; font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.btn {
  height: 64px; border-radius: 32px; border: none; padding: 0 22px;
  background: var(--teal); color: #fff; font-size: 19px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
}
.btn:active { background: var(--teal-dark); }
.btn.ghost { background: var(--surface); color: var(--ink); border: 2px solid var(--ink); }
.btn.outline { background: var(--surface); color: var(--teal); border: 2px solid var(--teal); }
.btn.small { height: 52px; font-size: 17px; }
.linkbtn { background: none; border: none; color: var(--teal); font-weight: 700; font-size: 17px; padding: 12px 4px; text-decoration: underline; }

.note { margin: 0; padding: 14px 16px; border-radius: 14px; background: var(--teal-soft); color: var(--teal-ink); font-size: 17px; line-height: 1.4; }
.warn { padding: 18px; border-radius: 18px; background: var(--warm-soft); border: 2px solid var(--warm-line); color: #3B2A14; }
.warn h2 { margin: 0 0 8px; font-size: 20px; color: #7A3E00; }
.warn ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; line-height: 1.4; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .legend { font-size: 18px; font-weight: 700; }
.hint { font-size: 16px; color: var(--muted); line-height: 1.35; }
.input, select.input, textarea.input {
  min-height: 56px; padding: 0 16px; border-radius: 12px; border: 2px solid var(--field);
  background: var(--surface); font-size: 18px; width: 100%; min-width: 0;
}
textarea.input { padding: 12px 16px; line-height: 1.4; resize: none; }
.input:focus { outline: 3px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 48px; padding: 0 18px; border-radius: 24px; border: 2px solid var(--field);
  background: var(--surface); font-size: 17px;
}
.chip[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; font-weight: 700; }

.ticks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ticks.one { grid-template-columns: 1fr; }
.tick {
  display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 6px 12px; border-radius: 12px;
  background: var(--surface); border: 2px solid var(--line-2); font-size: 17px; line-height: 1.2;
}
.tick input { width: 26px; height: 26px; margin: 0; accent-color: var(--teal); flex: none; }
.tick:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }

.topic {
  display: inline-flex; align-items: center; gap: 2px; min-height: 46px; padding: 0 4px 0 16px; border-radius: 23px;
  background: var(--warm-soft); border: 2px solid var(--warm-line); color: var(--warm-ink); font-size: 17px; font-weight: 700;
}
.topic button { width: 40px; height: 40px; border: none; background: none; display: flex; align-items: center; justify-content: center; }
.addrow { display: flex; gap: 8px; }
.addrow .btn { width: auto; height: 56px; border-radius: 12px; }

/* Welcome */
.welcome { justify-content: space-between; padding: max(40px, env(safe-area-inset-top)) 28px max(28px, env(safe-area-inset-bottom)); text-align: center; }
.welcome .logo { width: 96px; height: 96px; margin: 0 auto 18px; }
.welcome h1 { font-family: var(--display); font-weight: 600; font-size: 44px; margin: 0; color: var(--teal); }
.welcome p.lead { font-size: 22px; line-height: 1.4; margin: 14px 0 0; color: var(--ink-2); }
.examples { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; text-align: left; }
.examples div { background: var(--surface); border-radius: 16px; padding: 14px 16px; font-size: 18px; display: flex; gap: 12px; align-items: center; }

/* Plans */
.plan {
  width: 100%; text-align: left; padding: 16px 18px; border-radius: 18px; border: 2px solid var(--field);
  background: var(--surface); display: flex; flex-direction: column; gap: 4px;
}
.plan[aria-pressed="true"] { border: 3px solid var(--teal); background: var(--teal-soft); }
.plan .name { font-size: 21px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.plan .price { font-size: 26px; font-weight: 700; color: var(--teal); }
.save { padding: 4px 10px; border-radius: 12px; background: var(--alert); color: #fff; font-size: 14px; font-weight: 700; }
.checks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.35; }
.checks svg, .examples svg { flex: none; }

/* Browse */
.filters { display: flex; gap: 8px; padding: 2px 20px 10px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter { flex: none; min-height: 44px; padding: 0 16px; border-radius: 22px; border: 2px solid var(--line-2); background: var(--surface); font-size: 16px; }
.filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 700; }
.swipehint { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 16px; color: var(--ink-2); padding: 0 20px 8px; }
.deck { position: relative; flex: 1 1 auto; min-height: 0; margin: 0 20px; }
.card {
  position: absolute; inset: 0; background: var(--surface); border-radius: 24px;
  box-shadow: 0 4px 18px rgba(28,36,51,0.10); padding: 22px; display: flex; flex-direction: column; gap: 14px;
  overflow-y: auto; touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.card.under { transform: scale(0.95) translateY(10px); opacity: 0.7; pointer-events: none; }
.card.front { cursor: grab; z-index: 2; }
.card.flying { transition: transform 0.3s ease-in, opacity 0.3s ease-in; }
.card.settle { transition: transform 0.25s ease; }
.stamp {
  position: absolute; top: 20px; padding: 6px 14px; border-radius: 12px; font-size: 24px; font-weight: 800;
  background: #fff; opacity: 0; pointer-events: none; z-index: 3;
}
.stamp.yes { left: 18px; border: 4px solid var(--teal); color: var(--teal); transform: rotate(-8deg); }
.stamp.no { right: 18px; border: 4px solid var(--muted); color: var(--muted); transform: rotate(8deg); }
.cardhead { display: flex; justify-content: flex-start; align-items: center; gap: 8px; }
.cardhead .pill { align-self: flex-start; }
.pill { padding: 6px 14px; border-radius: 16px; background: var(--teal-soft); color: #0B5555; font-size: 16px; font-weight: 700; }
.eyebrow { font-size: 15px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.card h2 { margin: 2px 0 0; font-size: 27px; line-height: 1.2; }
.facts { display: flex; flex-direction: column; gap: 10px; font-size: 19px; }
.facts div { display: flex; gap: 12px; align-items: flex-start; line-height: 1.3; }
.facts svg { flex: none; margin-top: 1px; }
.who { border-top: 2px solid #EEF0F2; padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.who .name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 20px; font-weight: 700; }
.verified { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 14px; background: var(--teal-soft); color: #0B5555; font-size: 15px; font-weight: 700; }
.who p { margin: 0; font-size: 19px; line-height: 1.45; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tags .label { font-size: 15px; font-weight: 700; color: var(--muted); }
.tag { padding: 4px 12px; border-radius: 14px; background: var(--warm-soft); border: 1.5px solid var(--warm-line); color: var(--warm-ink); font-size: 15px; font-weight: 700; }
.actions { display: flex; gap: 12px; padding: 14px 20px; }
.actions .btn { padding: 0 10px; gap: 6px; white-space: nowrap; font-size: 18px; }
.actions .btn.ghost { flex: 1 1 0; }
.actions .btn:not(.ghost) { flex: 1.25 1 0; }
#app.on-browse #toast { bottom: 178px; }
.empty { margin: auto 0; text-align: center; padding: 24px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.empty h2 { margin: 0; font-size: 24px; }

/* Lists */
.item {
  width: 100%; text-align: left; background: var(--surface); border: 2px solid var(--line); border-radius: 18px;
  padding: 16px; display: flex; gap: 14px; align-items: center;
}
.avatar { width: 52px; height: 52px; border-radius: 26px; background: var(--teal-soft); color: var(--teal); font-weight: 700; font-size: 20px; display: flex; align-items: center; justify-content: center; flex: none; }
.item .t { font-size: 19px; font-weight: 700; }
.item .s { font-size: 16px; color: var(--muted); margin-top: 2px; }
.status { font-size: 15px; font-weight: 700; padding: 4px 10px; border-radius: 12px; display: inline-block; margin-top: 6px; }
.status.yes { background: var(--teal-soft); color: #0B5555; }
.status.wait { background: #EEF0F2; color: var(--muted); }
.section-title { margin: 4px 0 0; font-size: 20px; }

/* Chat */
.chat { gap: 12px; }
.bubble { max-width: 86%; padding: 14px 16px; font-size: 18px; line-height: 1.4; white-space: pre-line; }
.bubble.bot { align-self: flex-start; background: var(--surface); border: 2px solid var(--line); border-radius: 20px 20px 20px 6px; }
.bubble.me { align-self: flex-end; background: var(--teal); color: #fff; border-radius: 20px 20px 6px 20px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.quick button { min-height: 46px; padding: 0 14px; border-radius: 23px; border: 2px solid var(--teal); background: var(--surface); color: var(--teal); font-size: 16px; font-weight: 700; }
.composer { display: flex; gap: 10px; align-items: center; }
.composer .input { border-radius: 28px; }
.mic { width: 60px; height: 60px; border-radius: 30px; border: none; background: var(--teal); display: flex; align-items: center; justify-content: center; flex: none; }
.mic.on { background: var(--alert); animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.mini { background: var(--ground); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; font-size: 17px; line-height: 1.35; }

/* SMS */
.sms { background: #fff; }
.sms .head { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: max(18px, env(safe-area-inset-top)) 20px 12px; background: var(--ground); border-bottom: 2px solid var(--line); position: relative; }
.sms .head .round { position: absolute; left: 16px; top: max(18px, env(safe-area-inset-top)); }
.sms .av { width: 54px; height: 54px; border-radius: 27px; background: var(--teal); color: #fff; font-weight: 700; font-size: 21px; display: flex; align-items: center; justify-content: center; }
.sms .time { align-self: center; font-size: 15px; color: var(--muted); }
.sms .in { align-self: flex-start; max-width: 84%; padding: 14px 16px; border-radius: 20px 20px 20px 6px; background: #EEF0F2; font-size: 19px; line-height: 1.4; }
.sms .out { align-self: flex-end; max-width: 84%; padding: 14px 16px; border-radius: 20px 20px 6px 20px; background: var(--teal); color: #fff; font-size: 19px; line-height: 1.4; }

/* Tab bar */
#tabs {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface); border-top: 2px solid var(--line);
  padding: 6px 4px max(10px, env(safe-area-inset-bottom));
}
#tabs[hidden] { display: none; }
.tab { position: relative; border: none; background: none; min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 15px; }
.tab[aria-current="page"] { color: var(--teal); font-weight: 700; }
.tab .badge { top: 2px; right: calc(50% - 26px); }

/* Toast and banner */
#toast {
  position: absolute; left: 16px; right: 16px; bottom: 96px; z-index: 20;
  background: var(--ink); color: #fff; border-radius: 16px; padding: 12px 12px 12px 18px;
  display: flex; align-items: center; gap: 12px; font-size: 18px; line-height: 1.35;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  transform: translateY(20px); opacity: 0; pointer-events: none; transition: all 0.25s ease;
}
#toast.show { transform: none; opacity: 1; pointer-events: auto; }
#toast span { flex: 1 1 auto; }
#toast button { flex: none; height: 48px; padding: 0 16px; border-radius: 24px; border: 2px solid #fff; background: none; color: #fff; font-weight: 700; font-size: 17px; }
#banner {
  position: absolute; left: 12px; right: 12px; top: max(12px, env(safe-area-inset-top)); z-index: 30;
  background: var(--surface); border: 3px solid var(--teal); border-radius: 18px; padding: 14px 16px;
  display: flex; align-items: center; gap: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  transform: translateY(-140%); transition: transform 0.35s ease; text-align: left; width: auto;
}
#banner.show { transform: none; }
#banner .t { font-size: 19px; font-weight: 700; }
#banner .s { font-size: 16px; color: var(--muted); }

/* Modal */
#modal { position: absolute; inset: 0; z-index: 40; background: rgba(28,36,51,0.45); display: flex; align-items: flex-end; }
#modal[hidden] { display: none; }
#modal .sheet { background: var(--surface); width: 100%; border-radius: 24px 24px 0 0; padding: 24px 20px max(24px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; animation: up 0.25s ease; }
#modal .sheet p { margin: 0; font-size: 19px; line-height: 1.45; }
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* v2 */
