/* Let's Hello — app styles. Colours and type come from the brand kit. */
:root {
  --surface: #ffffff;
  --surface-2: #f5f2ff;
  --line: #e6e1f2;
  --ink: #221540;
  --ink-muted: #6b6480;
  --grape: #221540;
  --lilac: #e9e2ff;
  --lilac-line: #b9a5ff;
  --lime: #d5f56b;
  --link: #5a3fd1;
  --yes: #5a3fd1;
  --maybe: #ffb86b;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --warn-soft: #fff4e2;
  --radius-sm: 10px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --font: Figtree, -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --script: Sacramento, cursive;
  --tabbar: 68px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #150d2b;
    --surface-2: #1c1236;
    --line: #2e2448;
    --ink: #f4f1fa;
    --ink-muted: #ada5c4;
    --lilac: #2a1d52;
    --lilac-line: #c4b3ff;
    --link: #c4b3ff;
    --yes: #c4b3ff;
    --danger: #ff8a80;
    --danger-soft: #3a1618;
    --warn-soft: #3a2a12;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--link); text-decoration: none; font-weight: 600; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; border-radius: 6px; }

#app { max-width: 520px; margin: 0 auto; min-height: 100dvh; padding: 0 16px calc(var(--tabbar) + 32px + env(safe-area-inset-bottom)); }
#app.bare { padding-bottom: 32px; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; padding: calc(14px + env(safe-area-inset-top)) 0 10px; min-height: 68px; gap: 12px; }
.top .wordmark { height: 46px; width: auto; }
.wordmark.on-dark { display: none; }
@media (prefers-color-scheme: dark) { .wordmark.on-light { display: none; } .wordmark.on-dark { display: block; } }
.top h1 { font-size: 22px; line-height: 28px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); flex: none; }
.icon-btn svg, .tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.back { background: transparent; margin-left: -10px; }

/* ---------- type ---------- */
.large-title { font-size: 34px; line-height: 40px; font-weight: 800; letter-spacing: -0.01em; }
.title { font-size: 22px; line-height: 28px; font-weight: 700; }
.headline { font-size: 17px; line-height: 22px; font-weight: 700; }
.subhead { font-size: 15px; line-height: 20px; font-weight: 500; color: var(--ink-muted); }
.caption { font-size: 13px; line-height: 16px; font-weight: 500; color: var(--ink-muted); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 4px 12px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; font-size: 16px; line-height: 20px; font-weight: 700; text-align: center; }
.btn.block { display: flex; width: 100%; }
.btn-lime { background: var(--lime); color: var(--grape); }
.btn-grape { background: var(--grape); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-grape { background: var(--lime); color: var(--grape); } }
.btn-soft { background: var(--surface-2); color: var(--ink); }
.btn-line { border: 1.5px solid var(--line); color: var(--ink); }
.btn-danger { color: var(--danger); background: var(--danger-soft); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; }

/* ---------- cards ---------- */
.card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 18px 20px; color: var(--ink); font-weight: 400; }
.card + .card { margin-top: 12px; }
a.card:active { background: var(--surface-2); }

.hero { position: relative; background: var(--grape); color: #fff; border-radius: var(--radius-lg); padding: 24px 20px 20px; overflow: hidden; }
@media (prefers-color-scheme: dark) { .hero { border: 1px solid var(--line); } }
.hero .sub { color: var(--lilac-line); font-size: 15px; line-height: 20px; font-weight: 500; margin: 6px 0 20px; }
.hero .mark { position: absolute; right: 18px; top: 18px; width: 72px; height: 72px; }
.hero .large-title { max-width: 240px; }
.hero .star { position: absolute; width: 4px; height: 4px; border-radius: 9px; background: #b9a5ff; opacity: .6; }

.banner { display: flex; gap: 12px; align-items: flex-start; border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 12px; font-size: 15px; line-height: 20px; background: var(--lilac); color: var(--ink); font-weight: 500; }
.banner.warn { background: var(--warn-soft); }
.banner.bad { background: var(--danger-soft); color: var(--danger); }
.banner b { font-weight: 700; }
.banner a { text-decoration: underline; color: inherit; }

/* ---------- hangout cards ---------- */
.h-meta { margin-top: 2px; }
.h-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.stack { display: flex; }
.stack .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--surface); }
.stack .avatar:first-child { margin-left: 0; }
.counts { font-size: 14px; line-height: 20px; font-weight: 600; }
.bar { display: flex; gap: 3px; height: 6px; border-radius: 3px; overflow: hidden; background: var(--line); margin-top: 12px; }
.bar i { display: block; height: 100%; border-radius: 3px; }
.bar .yes { background: var(--yes); }
.bar .maybe { background: var(--maybe); }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 12px; line-height: 16px; font-weight: 700; background: var(--surface-2); color: var(--ink-muted); white-space: nowrap; }
.pill.lime { background: var(--lime); color: var(--grape); }
.pill.warn { background: var(--warn-soft); color: var(--ink); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }

/* ---------- avatars + rows ---------- */
.avatar { width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #221540; flex: none; }
.avatar.lg { width: 44px; height: 44px; font-size: 18px; }
.avatar.ring { box-shadow: 0 0 0 2px var(--surface), 0 0 0 5px var(--lime) !important; }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 4px; color: var(--ink); font-weight: 400; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .name, .row .sub { display: block; }
.fake { margin-top: 8px; } .fake .btn-row { margin-top: 6px; }
.row .name { font-weight: 700; font-size: 17px; line-height: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { font-size: 14px; line-height: 20px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .quote { font-size: 15px; line-height: 20px; color: var(--ink); white-space: normal; }
.row .chev { color: var(--ink-muted); }
.list { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 4px 14px; }
.group-title { display: flex; align-items: center; gap: 8px; margin: 24px 4px 10px; font-size: 15px; font-weight: 700; }
.dot { width: 10px; height: 10px; border-radius: 99px; background: var(--line); flex: none; }
.dot.yes { background: var(--yes); } .dot.maybe { background: var(--maybe); }
.dot.lime { background: var(--lime); box-shadow: 0 0 0 1.5px var(--grape); }

/* ---------- forms ---------- */
label.field { display: block; margin-bottom: 16px; }
label.field > span { display: block; font-size: 14px; line-height: 20px; font-weight: 700; margin: 0 4px 6px; }
label.field > small { display: block; font-size: 13px; line-height: 18px; color: var(--ink-muted); margin: 6px 4px 0; }
.input, textarea.input { width: 100%; background: var(--surface-2); border: 1.5px solid transparent; border-radius: var(--radius-sm); padding: 12px 14px; font-size: 17px; line-height: 24px; color: var(--ink); -webkit-appearance: none; appearance: none; }
.input:focus { outline: none; border-color: var(--link); background: var(--surface); }
.input::placeholder { color: var(--ink-muted); opacity: .8; }
textarea.input { resize: vertical; min-height: 96px; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-md); background: var(--surface-2); font-size: 15px; line-height: 21px; margin-bottom: 16px; cursor: pointer; }
.check input, .pick input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: #5a3fd1; }
.preview { background: var(--lilac); border-radius: 20px 20px 20px 6px; padding: 12px 16px; font-size: 15px; line-height: 21px; margin: 0 0 16px; max-width: 88%; }
.preview-label { font-size: 13px; font-weight: 700; color: var(--ink-muted); margin: 0 4px 6px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { border-radius: 999px; padding: 8px 14px; font-size: 14px; line-height: 18px; font-weight: 700; background: var(--surface-2); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--grape); color: #fff; }
@media (prefers-color-scheme: dark) { .chip[aria-pressed="true"] { background: var(--lime); color: var(--grape); } }
.pick { display: flex; align-items: center; gap: 14px; padding: 10px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pick:last-child { border-bottom: 0; }
.pick.off { opacity: .5; cursor: default; }
.sticky { position: sticky; bottom: calc(var(--tabbar) + 12px + env(safe-area-inset-bottom)); padding-top: 16px; background: linear-gradient(to top, var(--surface) 70%, transparent); margin-top: 8px; }
#app.bare .sticky { bottom: 12px; }
.error { color: var(--danger); font-size: 15px; font-weight: 600; margin: 0 4px 12px; }

/* ---------- empty + centered ---------- */
.empty { text-align: center; padding: 28px 16px; }
.empty img { width: 140px; height: 140px; margin: 0 auto 16px; }
.empty p { color: var(--ink-muted); font-size: 15px; line-height: 21px; margin-top: 6px; }
.center-screen { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 32px 8px; }
.center-screen .wordmark { height: 84px; width: auto; margin: 0 auto 4px; }
.center-screen .bub { width: 150px; height: 150px; margin: 0 auto 20px; }
.center-screen .tag { text-align: center; color: var(--ink-muted); font-size: 15px; font-weight: 500; margin-bottom: 28px; }

/* ---------- tab bar ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.tabbar-in { max-width: 520px; margin: 0 auto; height: var(--tabbar); display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink-muted); font-size: 12px; line-height: 16px; font-weight: 600; position: relative; }
.tab[aria-current="page"] { color: var(--ink); }
.tab .badge { position: absolute; top: -2px; left: calc(50% + 6px); min-width: 18px; height: 18px; border-radius: 99px; background: var(--lime); color: var(--grape); font-size: 11px; font-weight: 800; display: grid; place-items: center; padding: 0 5px; box-shadow: 0 0 0 2px var(--surface); }
.tab-plus { justify-self: center; width: 56px; height: 56px; border-radius: 999px; background: var(--grape); display: grid; place-items: center; box-shadow: 0 8px 24px rgba(34, 21, 64, .25); margin-top: -18px; }
@media (prefers-color-scheme: dark) { .tab-plus { border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0,0,0,.5); } }
.tab-plus svg { width: 26px; height: 26px; stroke: var(--lime); stroke-width: 3; fill: none; stroke-linecap: round; }

/* ---------- status (free / busy) ---------- */
.status { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px 16px 12px; margin-bottom: 12px; }
.status-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 8px; }
.seg button { min-height: 46px; border-radius: 999px; border: 1.5px solid var(--line); font-size: 16px; font-weight: 700; color: var(--ink); background: var(--surface); }
.seg button.s-free[aria-pressed="true"] { background: var(--lime); border-color: var(--lime); color: var(--grape); }
.seg button.s-busy[aria-pressed="true"] { background: var(--grape); border-color: var(--grape); color: #fff; }
@media (prefers-color-scheme: dark) { .seg button.s-busy[aria-pressed="true"] { background: var(--lilac); border-color: var(--lilac-line); color: var(--ink); } }
.status .caption a, .linkish { color: var(--link); font-weight: 700; font-size: inherit; text-decoration: underline; }
.chip.free { box-shadow: inset 0 0 0 2px var(--lime); }
.chip.free[aria-pressed="true"] { background: var(--lime); color: var(--grape); }
.pick .pill, .row .pill { flex: none; }

/* ---------- toast + busy ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + 24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--grape); color: #fff; border-radius: 999px; padding: 12px 20px; font-size: 15px; font-weight: 600; z-index: 20; max-width: calc(100vw - 32px); box-shadow: 0 8px 24px rgba(34, 21, 64, .3); border: 1px solid #3a2c63; }
.busy { position: fixed; inset: 0; background: rgba(21, 13, 43, .72); z-index: 30; display: grid; place-items: center; color: #fff; text-align: center; padding: 24px; }
.busy img { width: 120px; height: 120px; margin: 0 auto 16px; animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .busy img { animation: none; } .btn:active:not(:disabled) { transform: none; } }

.msg { max-width: 86%; padding: 10px 14px; border-radius: 18px; font-size: 15px; line-height: 21px; margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.out { background: var(--lilac); margin-left: auto; border-bottom-right-radius: 6px; }
.msg.in { background: var(--surface-2); border-bottom-left-radius: 6px; }
.msg small { display: block; font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.copybox { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; line-height: 18px; overflow-wrap: anywhere; font-family: ui-monospace, Menlo, monospace; }
.copybox span { flex: 1; min-width: 0; }
.steps { padding-left: 22px; margin: 8px 0 0; font-size: 15px; line-height: 22px; }
.steps li { margin-bottom: 6px; }
details.card summary { font-weight: 700; cursor: pointer; }
.pick .grow { flex: 1; min-width: 0; }

/* ---------- when (plan day + time) ---------- */
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 12px; padding: 2px 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chips.scroll .chip { flex: none; }
.datechip { position: relative; cursor: pointer; }
.datechip input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.datechip[data-on="true"] { background: var(--grape); color: #fff; }
@media (prefers-color-scheme: dark) { .datechip[data-on="true"] { background: var(--lime); color: var(--grape); } }
.datechip:focus-within { outline: 3px solid var(--link); outline-offset: 2px; }
label.field.inline { display: flex; align-items: center; gap: 12px; }
label.field.inline > span { margin: 0 4px; flex: none; }
label.field.inline .input { width: auto; flex: 1; min-height: 48px; }
p.banner { margin: 0 0 16px; }

/* ---------- accounts, invites, members ---------- */
.linkish { color: var(--link); font-weight: 700; font-size: inherit; text-decoration: underline; }
.input.code { font-size: 28px; line-height: 36px; letter-spacing: .3em; text-align: center; font-weight: 700; }
.card.invite { background: var(--lilac); border-color: transparent; }
.banner.added { align-items: center; }
.banner .grow { flex: 1; min-width: 0; }
.avatar.member { position: relative; }
.avatar.member::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border-radius: 99px; background: var(--lime); border: 2px solid var(--surface); box-shadow: 0 0 0 1.5px var(--grape); }
.pick .btn.small { flex: none; }
.chip[data-share] { box-shadow: inset 0 0 0 1.5px var(--line); background: var(--surface); }
