/* =====================================================================
   Lux Circle, design system
   Mobile first. Ivory, navy and one quiet gold. Serif for voice,
   Manrope for everything you tap.
   ===================================================================== */

:root {
  --white: #ffffff;
  --ivory: #faf8f4;
  --sand: #f2ede4;
  --line: #e6e0d5;
  --line-2: #d9d1c3;
  --navy: #13213c;
  --navy-2: #22345a;
  --ink: #1b2336;
  --ink-2: #596175;
  --ink-3: #8a90a0;
  --gold: #a38350;
  --gold-deep: #7a6030;
  --gold-soft: #c9ae7c;
  --gold-wash: #f5efe3;
  --hot: #a9472f;
  --good: #3e7a58;
  --good-wash: #eef5f0;
  --cool: #4d6c8e;

  --shadow: 0 1px 2px rgba(19, 33, 60, 0.05), 0 12px 32px -12px rgba(19, 33, 60, 0.16);
  --shadow-lg: 0 30px 80px -30px rgba(19, 33, 60, 0.4);

  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --caps: 'Marcellus', 'Trajan Pro', Georgia, serif;
  --sans: 'Manrope', 'Helvetica Neue', Arial, system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --app-h: 100dvh;
  --tabbar: 62px;
  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; margin: 0; letter-spacing: -0.01em; color: var(--navy); text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.serif { font-family: var(--serif); }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.stack { display: grid; gap: 14px; }
.stack-sm { display: grid; gap: 8px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Brand ---------- */
.wordmark { display: inline-flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--navy); line-height: 1; gap: 6px; }
.wordmark b { font-family: var(--caps); font-weight: 400; font-size: 18px; letter-spacing: 0.32em; padding-left: 0.32em; white-space: nowrap; }
.wordmark i { font-style: normal; font-size: 8.5px; font-weight: 700; letter-spacing: 0.42em; padding-left: 0.42em; color: var(--gold-deep); display: flex; align-items: center; gap: 9px; }
.wordmark i::before, .wordmark i::after { content: ''; width: 16px; height: 1px; background: var(--gold); }
.wordmark.lg b { font-size: 28px; }
.wordmark.lg i { font-size: 10px; }
.wordmark.light { color: var(--white); }
.wordmark.light i { color: var(--gold-soft); }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-deep); }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }
.gold-rule { width: 36px; height: 1px; background: var(--gold); border: 0; margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; border: 1px solid transparent; border-radius: 999px; padding: 10px 20px;
  font-weight: 650; font-size: 14.5px; letter-spacing: 0.01em;
  background: var(--navy); color: var(--white); text-decoration: none; white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s var(--ease), opacity 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn:hover { background: var(--navy-2); }
.btn.ghost { background: transparent; color: var(--navy); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--navy); }
.btn.gold { background: var(--gold); }
.btn.gold:hover { background: var(--gold-deep); }
.btn.soft { background: var(--sand); color: var(--navy); }
.btn.soft:hover { background: #ebe4d7; }
.btn.danger { background: transparent; color: var(--hot); border-color: rgba(169, 71, 47, 0.3); }
.btn.sm { min-height: 34px; padding: 6px 14px; font-size: 13px; }
.btn.block { width: 100%; }
.btn[disabled], .btn.busy { opacity: 0.55; pointer-events: none; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 0; background: transparent; color: var(--navy);
  display: inline-grid; place-items: center; flex: none; position: relative; transition: background 0.2s;
}
.icon-btn:hover, .icon-btn:active { background: var(--sand); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.sm svg { width: 16px; height: 16px; }
svg.chev { width: 18px; height: 18px; color: var(--ink-3); flex: none; }
a:has(> .av), .person-row, .rail-card a, .meet-card { text-decoration: none; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.sm { width: 34px; height: 34px; }
.icon-btn.sm svg { width: 18px; height: 18px; }
.link { background: none; border: 0; padding: 0; color: var(--navy); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.link:hover { text-decoration-color: var(--navy); }
.dot-badge { position: absolute; top: 7px; right: 7px; min-width: 17px; height: 17px; border-radius: 9px; padding: 0 5px; background: var(--gold); color: var(--white); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--white); }
.dot-badge.plain { min-width: 10px; width: 10px; height: 10px; padding: 0; }

/* ---------- Chips, pills & tags ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--white); font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.chip.on { background: var(--navy); color: var(--white); border-color: var(--navy); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: var(--gold-wash); color: var(--gold-deep); font-size: 12.5px; font-weight: 600; }
.tag.navy { background: var(--sand); color: var(--navy); }
.tag button { border: 0; background: none; padding: 0; color: inherit; font-size: 15px; line-height: 1; opacity: 0.6; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.label { font-size: 10.5px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; border: 1px solid var(--line-2); color: var(--ink-2); background: var(--white); white-space: nowrap; }
.pill.gold { color: var(--gold-deep); border-color: rgba(163, 131, 80, 0.35); background: var(--gold-wash); }
.pill.good { color: var(--good); border-color: rgba(62, 122, 88, 0.3); background: var(--good-wash); }
.pill.hot { color: var(--hot); border-color: rgba(169, 71, 47, 0.3); background: rgba(169, 71, 47, 0.05); }
.pill.navy { color: var(--white); background: var(--navy); border-color: var(--navy); }
.pill.lux { color: var(--gold-soft); background: var(--navy); border-color: var(--navy); font-family: var(--caps); font-weight: 400; letter-spacing: 0.16em; text-transform: uppercase; padding: 4px 12px; }
.pill.lux::before { content: ''; width: 5px; height: 5px; transform: rotate(45deg); background: var(--gold-soft); }

/* ---------- Avatars & tier rings ---------- */
.av { --s: 40px; width: var(--s); height: var(--s); border-radius: 50%; flex: none; position: relative; display: grid; place-items: center; background: var(--gold-wash); color: var(--gold-deep); font-family: var(--caps); font-size: calc(var(--s) * 0.36); letter-spacing: 0.04em; overflow: visible; }
.av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.av.bot { background: var(--navy); color: var(--gold-soft); }
.av.xs { --s: 24px; }
.av.sm { --s: 32px; }
.av.md { --s: 48px; }
.av.lg { --s: 72px; }
.av.xl { --s: 104px; }
/* Rings: Trusted = hairline gold, Top Giver = solid gold, Connector = double gold. */
.av.t-trusted::after, .av.t-giver::after, .av.t-connector::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; pointer-events: none; }
.av.t-trusted::after { box-shadow: 0 0 0 1.5px var(--gold-soft); }
.av.t-giver::after { box-shadow: 0 0 0 2px var(--gold); }
.av.t-connector::after { box-shadow: 0 0 0 2px var(--gold), 0 0 0 3.5px var(--white), 0 0 0 5px var(--gold); }
.av .online { position: absolute; right: 0; bottom: 0; width: 28%; height: 28%; min-width: 9px; min-height: 9px; border-radius: 50%; background: var(--good); border: 2px solid var(--white); }
.tier { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold-deep); white-space: nowrap; }
.tier::before { content: ''; width: 6px; height: 6px; transform: rotate(45deg); background: var(--gold); }
.tier.t-member { color: var(--ink-3); }
.tier.t-member::before { background: var(--line-2); }
.founder { font-family: var(--caps); font-size: 11px; letter-spacing: 0.12em; color: var(--gold-deep); white-space: nowrap; }
.av-stack { display: flex; }
.av-stack .av { box-shadow: 0 0 0 2px var(--white); }
.av-stack .av + .av { margin-left: -8px; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; }
.field > span, .field > label { font-size: 12.5px; font-weight: 650; color: var(--ink-2); letter-spacing: 0.02em; }
.field small { font-size: 12px; color: var(--ink-3); }
/* 16px stops iOS zooming into inputs. */
.input, .select, .textarea { width: 100%; background: var(--white); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; font-size: 16px; transition: border-color 0.2s, box-shadow 0.2s; appearance: none; -webkit-appearance: none; }
.select { background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 15px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(19, 33, 60, 0.07); }
.textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.form-error { color: var(--hot); font-size: 13.5px; }
.form-error:empty { display: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--navy); margin-top: 1px; flex: none; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--line-2); transition: background 0.2s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.2s var(--ease); }
.switch input:checked + i { background: var(--navy); }
.switch input:checked + i::after { transform: translateX(18px); }
.seg { display: flex; background: var(--sand); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 999px; padding: 8px 12px; font-weight: 650; font-size: 13.5px; color: var(--ink-2); min-height: 36px; }
.seg button.on { background: var(--white); color: var(--navy); box-shadow: 0 1px 3px rgba(19, 33, 60, 0.12); }

/* ---------- Cards & lists ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.card.pad-lg { padding: 22px; }
.card.ivory { background: var(--ivory); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { font-size: 1.2rem; }
.list { background: var(--white); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; text-decoration: none; background: none; border: 0; width: 100%; text-align: left; min-height: 60px; }
.list-item + .list-item { border-top: 1px solid var(--line); }
.list-item:active, .list-item:hover { background: var(--ivory); }
.list-item b { display: block; color: var(--navy); font-weight: 650; font-size: 15px; }
.list-item .sub { font-size: 13px; color: var(--ink-2); }
.list-item svg.chev { width: 18px; height: 18px; color: var(--ink-3); flex: none; }
.list-item .li-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--sand); color: var(--navy); display: grid; place-items: center; flex: none; }
.list-item .li-icon svg { width: 19px; height: 19px; }
.section-label { font-size: 11px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); margin: 22px 4px 10px; }
.empty { border: 1px dashed var(--line-2); border-radius: 18px; padding: 36px 22px; text-align: center; display: grid; gap: 10px; justify-items: center; color: var(--ink-2); }
.empty h3 { font-size: 1.3rem; }
.progress { height: 5px; background: var(--sand); border-radius: 5px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-soft), var(--gold)); border-radius: 5px; transition: width 0.6s var(--ease); }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: grid; gap: 2px; }
.kpi span { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.kpi b { font-family: var(--serif); font-weight: 500; font-size: 1.7rem; color: var(--navy); line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi small { font-size: 12px; color: var(--ink-3); }

/* ---------- Skeletons & spinners ---------- */
.skel { background: linear-gradient(90deg, var(--sand) 0%, #f7f3ec 50%, var(--sand) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--gold); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block { display: grid; place-items: center; padding: 40px 0; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; top: calc(12px + var(--safe-t)); transform: translateX(-50%); z-index: 400; background: var(--navy); color: var(--white); border-radius: 999px; padding: 12px 20px; font-size: 14px; font-weight: 550; box-shadow: var(--shadow-lg); animation: rise 0.3s var(--ease); max-width: calc(100vw - 32px); text-align: center; }
.toast.err { background: var(--hot); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Sheets (bottom on mobile, centred dialog on desktop) ---------- */
.scrim { position: fixed; inset: 0; z-index: 150; background: rgba(19, 33, 60, 0.42); display: flex; align-items: flex-end; justify-content: center; animation: fade 0.2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet { background: var(--white); width: 100%; max-height: calc(var(--app-h) - 40px); border-radius: 22px 22px 0 0; overflow: auto; overscroll-behavior: contain; padding: 10px 20px calc(20px + var(--safe-b)); display: grid; gap: 16px; box-shadow: var(--shadow-lg); animation: sheet-up 0.32s var(--ease); }
.sheet::before { content: ''; justify-self: center; width: 38px; height: 4px; border-radius: 4px; background: var(--line-2); margin-bottom: 2px; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sheet-head h3 { font-size: 1.45rem; line-height: 1.2; }
.sheet-actions { display: grid; gap: 8px; }
.menu { display: grid; }
.menu button { display: flex; align-items: center; gap: 14px; background: none; border: 0; padding: 14px 4px; text-align: left; font-size: 15.5px; font-weight: 550; color: var(--navy); width: 100%; }
.menu button + button { border-top: 1px solid var(--line); }
.menu button svg { width: 20px; height: 20px; color: var(--ink-2); flex: none; }
.menu button.danger { color: var(--hot); }
.menu button.danger svg { color: var(--hot); }
.react-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 2px 0 6px; }
.react-row button { display: grid; justify-items: center; gap: 6px; border: 0; background: none; padding: 4px 0; color: var(--navy); }
.react-row button svg { width: 46px; height: 46px; padding: 12px; border-radius: 50%; border: 1px solid var(--line); background: var(--ivory); stroke-width: 1.5; transition: transform 0.2s var(--ease-out, ease), background 0.2s, border-color 0.2s, color 0.2s; }
.react-row button span { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.react-row button:active svg { transform: scale(1.12); }
.react-row button.on svg { color: var(--gold-deep); border-color: var(--gold); background: var(--gold-wash); }
.react-row button.on span { color: var(--gold-deep); }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 180; background: rgba(11, 18, 34, 0.96); display: grid; place-items: center; padding: 16px; animation: fade 0.2s; }
.lightbox img { max-height: calc(var(--app-h) - 80px); max-width: 100%; object-fit: contain; border-radius: 8px; }
.lightbox .icon-btn { position: absolute; top: calc(12px + var(--safe-t)); right: 12px; color: var(--white); background: rgba(255, 255, 255, 0.1); }

/* =====================================================================
   App shell
   ===================================================================== */

.app { height: var(--app-h); display: flex; flex-direction: column; overflow: hidden; background: var(--ivory); }
.app-main { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.page { padding: 16px 16px 32px; max-width: 760px; width: 100%; margin: 0 auto; }
.page.wide { max-width: 1120px; }

.topbar { flex: none; display: flex; align-items: center; gap: 6px; padding: calc(8px + var(--safe-t)) 8px 8px 12px; background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); min-height: 58px; position: relative; z-index: 5; }
.topbar h1 { font-size: 1.28rem; line-height: 1.15; }
.topbar .sub { font-size: 12px; color: var(--ink-3); line-height: 1.3; }
.topbar .title { flex: 1; min-width: 0; padding: 0 4px; }
.topbar .title > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .back { margin-left: -6px; }

.tabbar { flex: none; display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(255, 255, 255, 0.97); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); z-index: 20; }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--tabbar); text-decoration: none; color: var(--ink-3); font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; position: relative; }
.tabbar a svg { width: 23px; height: 23px; }
.tabbar a.on { color: var(--navy); }
.tabbar a.on::before { content: ''; position: absolute; top: 0; width: 22px; height: 2px; border-radius: 2px; background: var(--gold); }
.tabbar .dot-badge { top: 6px; right: calc(50% - 22px); }
.app.kb-open .tabbar, .app.in-thread .tabbar { display: none; }

.sidebar { display: none; }

/* =====================================================================
   Chat
   ===================================================================== */

.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--ivory); position: relative; }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 8px 0 10px; }
.chat-list { display: flex; flex-direction: column; max-width: 860px; margin: 0 auto; }
.chat-sentinel { height: 1px; }
.chat-edge { padding: 26px 20px 14px; text-align: center; display: grid; gap: 8px; justify-items: center; }
.chat-edge h3 { font-size: 1.35rem; }
.chat-edge p { color: var(--ink-2); max-width: 44ch; font-size: 14px; }

.day { display: flex; align-items: center; gap: 12px; margin: 18px 16px 8px; font-size: 11px; font-weight: 750; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.day::before, .day::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.new-divider { display: flex; align-items: center; gap: 10px; margin: 10px 16px; color: var(--gold-deep); font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.new-divider::after { content: ''; flex: 1; height: 1px; background: var(--gold-soft); }

.msg { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 0 10px; padding: 3px 14px 3px 12px; position: relative; }
.msg.first { padding-top: 12px; }
.msg .av { grid-row: span 2; --s: 38px; cursor: pointer; }
.msg.cont .av { visibility: hidden; height: 0; }
.msg-head { display: flex; align-items: baseline; gap: 7px; min-width: 0; line-height: 1.25; margin-bottom: 2px; }
.msg-head b { color: var(--navy); font-weight: 700; font-size: 14.5px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-head .tier { font-size: 9.5px; }
.msg-head time { font-size: 11.5px; color: var(--ink-3); flex: none; margin-left: auto; padding-left: 6px; }
.msg.cont .msg-head { display: none; }
.msg-body { grid-column: 2; min-width: 0; font-size: 15px; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; white-space: pre-wrap; }
.msg-body a { color: var(--navy); text-decoration-color: var(--gold-soft); text-underline-offset: 2px; }
.msg-body .mention { color: var(--gold-deep); font-weight: 700; text-decoration: none; }
.msg-body .mention.me { background: var(--gold-wash); border-radius: 4px; padding: 0 3px; }
.msg-body .edited { font-size: 11px; color: var(--ink-3); margin-left: 4px; }
.msg-body.deleted { color: var(--ink-3); font-style: italic; font-size: 14px; }
.msg.mentions-me { background: linear-gradient(90deg, rgba(163, 131, 80, 0.09), rgba(163, 131, 80, 0) 70%); box-shadow: inset 2px 0 0 var(--gold); }
.msg.pending { opacity: 0.55; }
.msg.failed .msg-body { color: var(--hot); }
.msg.flash { animation: flash 1.8s ease; }
@keyframes flash { 0%, 40% { background: var(--gold-wash); } 100% { background: transparent; } }
.msg-extras { grid-column: 2; display: grid; gap: 6px; min-width: 0; }
.msg-extras:empty { display: none; }
.msg .quote { grid-column: 2; display: flex; gap: 8px; align-items: baseline; font-size: 13px; color: var(--ink-2); border-left: 2px solid var(--gold-soft); padding: 2px 0 2px 10px; margin: 2px 0 4px; cursor: pointer; min-width: 0; }
.msg .quote b { color: var(--navy); font-weight: 700; flex: none; }
.msg .quote span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-actions-btn { position: absolute; top: 4px; right: 10px; opacity: 0; transition: opacity 0.15s; background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow); }
@media (hover: hover) {
  .msg:hover { background: rgba(255, 255, 255, 0.7); }
  .msg:hover .msg-actions-btn { opacity: 1; }
  .msg:hover .msg-head time { visibility: hidden; }
}
.reacts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.reacts button { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--white); border-radius: 999px; padding: 2px 10px 2px 8px; min-height: 28px; color: var(--navy); transition: border-color 0.2s, background 0.2s, transform 0.15s; }
.reacts button svg { width: 14px; height: 14px; stroke-width: 1.8; }
.reacts button b { font-size: 12px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.reacts button.on { border-color: var(--gold-soft); background: var(--gold-wash); color: var(--gold-deep); }
.reacts button.on b { color: var(--gold-deep); }
.reacts button:active { transform: scale(0.95); }
.att-grid { display: grid; gap: 4px; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 380px; margin-top: 4px; }
.att-grid.one { grid-template-columns: 1fr; max-width: 320px; }
.att-grid button { border: 0; padding: 0; border-radius: 12px; overflow: hidden; background: var(--sand); aspect-ratio: 1; }
.att-grid.one button { aspect-ratio: auto; max-height: 360px; }
.att-grid img { width: 100%; height: 100%; object-fit: cover; }

/* Special messages */
.msg.system { display: block; padding: 14px 24px; text-align: center; }
.msg.system .sys { display: inline-block; max-width: 520px; font-family: var(--serif); font-size: 15.5px; line-height: 1.55; color: var(--navy); }
.msg.system .sys::before { content: ''; display: block; width: 28px; height: 1px; background: var(--gold); margin: 0 auto 10px; }
.msg.system .sys small { display: block; margin-top: 6px; font-family: var(--sans); font-size: 10.5px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-deep); }
.msg.host .msg-body { font-family: var(--serif); font-size: 16px; line-height: 1.5; color: var(--navy); }
.msg.host .msg-head b { color: var(--gold-deep); }

.ask-card { grid-column: 2; margin-top: 2px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 14px 15px 12px; position: relative; overflow: hidden; display: grid; gap: 8px; box-shadow: 0 1px 2px rgba(19, 33, 60, 0.04); }
.ask-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--gold); }
.ask-card.offer::before { background: var(--navy); }
.ask-card.solved::before { background: var(--good); }
.ask-card.closed::before { background: var(--line-2); }
.ask-card .ask-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ask-card .ask-top .label { color: var(--gold-deep); }
.ask-card.offer .ask-top .label { color: var(--navy); }
.ask-card .ask-text { font-size: 15.5px; line-height: 1.5; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.ask-card .ask-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; padding-top: 4px; }
.ask-card .ask-foot .who { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); min-width: 0; }
.ask-card .ask-btns { display: flex; gap: 6px; margin-left: auto; }
.ask-card.solved .ask-text, .ask-card.closed .ask-text { color: var(--ink-2); }
.ask-card .solved-by { font-size: 13px; color: var(--good); font-weight: 650; }

.intro-card { grid-column: 2; margin-top: 2px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 14px 15px; display: grid; gap: 10px; }
.intro-card .label { color: var(--gold-deep); }
.intro-card .who-line { font-size: 13px; color: var(--ink-2); }
.help-card { grid-column: 2; margin: 2px 0 2px; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: var(--gold-wash); font-size: 13.5px; display: grid; gap: 4px; color: var(--ink-2); }
.help-card b { color: var(--navy); }

.room-layout { flex: 1; min-height: 0; display: flex; }
.chat-host { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }

/* Open asks strip */
.asks-strip { flex: none; background: var(--white); border-bottom: 1px solid var(--line); }
.asks-strip-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px 0; }
.asks-strip-head .label { color: var(--gold-deep); display: flex; gap: 8px; align-items: center; white-space: nowrap; min-width: 0; overflow: hidden; }
.asks-strip-head .label b { color: var(--navy); }
.asks-strip-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 8px 14px 10px; scroll-snap-type: x proximity; }
.asks-strip-row::-webkit-scrollbar { display: none; }
.ask-chip { flex: none; width: 236px; scroll-snap-align: start; text-align: left; border: 1px solid var(--line); background: var(--ivory); border-radius: 14px; padding: 9px 11px; display: grid; gap: 4px; position: relative; overflow: hidden; }
.ask-chip::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--gold); }
.ask-chip.offer::before { background: var(--navy); }
.ask-chip .t { font-size: 13.5px; line-height: 1.35; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ask-chip .m { font-size: 11.5px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; }
.ask-chip .m b { color: var(--gold-deep); font-weight: 700; }
.ask-chip.empty-chip { width: auto; min-width: 236px; background: var(--white); border-style: dashed; }
.ask-chip.empty-chip::before { display: none; }
.asks-strip.collapsed .asks-strip-row { display: none; }
.asks-strip.collapsed .asks-strip-head { padding-bottom: 8px; }

.room-banner { flex: none; display: flex; gap: 10px; align-items: center; padding: 9px 14px; background: var(--navy); color: var(--white); font-size: 13px; }
.room-banner p { flex: 1; min-width: 0; }
.room-banner .icon-btn { color: var(--white); width: 30px; height: 30px; }
.room-banner .icon-btn:hover { background: rgba(255, 255, 255, 0.1); }

/* Jump to latest */
.jump { position: absolute; right: 14px; bottom: 12px; z-index: 4; border: 1px solid var(--line); background: var(--white); color: var(--navy); border-radius: 999px; padding: 8px 14px 8px 12px; font-size: 13px; font-weight: 700; box-shadow: var(--shadow); display: inline-flex; gap: 6px; align-items: center; animation: fade 0.2s; }
.jump svg { width: 16px; height: 16px; }
.jump.has-new { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* Composer */
.composer-wrap { flex: none; background: var(--white); border-top: 1px solid var(--line); padding: 8px 10px calc(8px + var(--safe-b)); position: relative; z-index: 6; }
.app:not(.in-thread):not(.kb-open) .composer-wrap { padding-bottom: 8px; }
.typing { min-height: 0; font-size: 12px; color: var(--ink-3); padding: 0 8px 6px; font-style: italic; }
.typing:empty { display: none; }
.compose-ctx { display: flex; align-items: center; gap: 8px; padding: 6px 6px 8px 10px; margin-bottom: 4px; border-left: 2px solid var(--gold); font-size: 13px; color: var(--ink-2); }
.compose-ctx.ask-mode { border-color: var(--gold); background: var(--gold-wash); border-radius: 0 10px 10px 0; }
.compose-ctx.offer-mode { border-color: var(--navy); background: var(--sand); border-radius: 0 10px 10px 0; }
.compose-ctx p { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compose-ctx b { color: var(--navy); }
.compose-ctx select { border: 0; background: transparent; font-weight: 700; color: var(--navy); font-size: 13px; padding: 0 2px; }
.compose-row { display: flex; align-items: flex-end; gap: 6px; max-width: 860px; margin: 0 auto; }
.compose-box { flex: 1; min-width: 0; background: var(--ivory); border: 1px solid var(--line-2); border-radius: 22px; display: flex; align-items: flex-end; transition: border-color 0.2s; }
.compose-box:focus-within { border-color: var(--navy); background: var(--white); }
.compose-box textarea { flex: 1; min-width: 0; border: 0; background: transparent; resize: none; padding: 10px 14px; font-size: 16px; line-height: 1.4; max-height: 160px; min-height: 42px; outline: none; }
.send { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--navy); color: var(--white); display: grid; place-items: center; flex: none; transition: transform 0.15s var(--ease), opacity 0.2s, background 0.2s; }
.send:disabled { background: var(--line-2); }
.send svg { width: 19px; height: 19px; }
.send:active { transform: scale(0.94); }
.compose-row .icon-btn { width: 42px; height: 42px; }
.compose-thumbs { display: flex; gap: 6px; padding: 0 4px 8px; }
.compose-thumbs div { position: relative; width: 58px; height: 58px; border-radius: 10px; overflow: hidden; background: var(--sand); }
.compose-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.compose-thumbs button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(19, 33, 60, 0.75); color: #fff; font-size: 13px; line-height: 1; }
.compose-thumbs .up { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255, 255, 255, 0.6); }
.compose-locked { text-align: center; font-size: 13.5px; color: var(--ink-2); padding: 6px 0; }
.mention-pop { position: absolute; left: 10px; right: 10px; bottom: 100%; margin-bottom: 6px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; max-width: 420px; }
.mention-pop button { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: none; padding: 9px 12px; text-align: left; font-size: 14px; }
.mention-pop button.on, .mention-pop button:hover { background: var(--ivory); }
.mention-pop button span { color: var(--ink-3); font-size: 12.5px; }

/* Right rail (desktop) */
.rail { display: none; }
.rail-card { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 12px; }
.rail-card h3 { font-size: 1.1rem; }
.checklist { display: grid; gap: 2px; }
.checklist button { display: flex; gap: 10px; align-items: center; border: 0; background: none; text-align: left; padding: 7px 0; font-size: 13.5px; color: var(--ink); }
.checklist button i { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-2); flex: none; display: grid; place-items: center; }
.checklist button.done { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-2); }
.checklist button.done i { background: var(--good); border-color: var(--good); }
.checklist button.done i::after { content: ''; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.person-row { display: flex; gap: 10px; align-items: center; text-decoration: none; background: none; border: 0; padding: 0; text-align: left; width: 100%; }
.person-row b { display: block; font-size: 14px; color: var(--navy); }
.person-row .grow > span { font-size: 12.5px; color: var(--ink-2); display: block; }

/* =====================================================================
   Screens
   ===================================================================== */

.page-title { display: grid; gap: 6px; margin: 6px 0 18px; }
.page-title h1 { font-size: 1.9rem; line-height: 1.15; }
.page-title p { color: var(--ink-2); max-width: 56ch; }

.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.search .input { padding-left: 42px; border-radius: 999px; background: var(--white); }

.member-row { display: flex; gap: 14px; align-items: center; padding: 14px 16px; text-decoration: none; }
.member-row + .member-row { border-top: 1px solid var(--line); }
.member-row:active, .member-row:hover { background: var(--ivory); }
.member-row .info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.member-row .info b { color: var(--navy); font-size: 15px; font-weight: 700; display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.member-row .info b span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-row .line { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-row .meta { font-size: 12px; color: var(--ink-3); display: flex; gap: 10px; }
.meet { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 6px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scroll-snap-type: x proximity; }
.meet::-webkit-scrollbar { display: none; }
.meet-card { flex: none; width: 200px; scroll-snap-align: start; background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 16px 14px; display: grid; gap: 8px; justify-items: center; text-align: center; text-decoration: none; }
.meet-card b { color: var(--navy); font-size: 14.5px; }
.meet-card .why { font-size: 12.5px; color: var(--gold-deep); line-height: 1.35; min-height: 2.7em; }
.meet-card .co { font-size: 12.5px; color: var(--ink-2); margin-top: -6px; }

.profile-hero { text-align: center; display: grid; justify-items: center; gap: 10px; padding: 10px 0 6px; }
.profile-hero h1 { font-size: 1.85rem; line-height: 1.15; }
.profile-hero .headline { color: var(--ink-2); font-size: 14.5px; }
.profile-hero .badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; align-items: center; }
.profile-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 16px; background: var(--white); overflow: hidden; }
.stat-row div { padding: 12px 8px; text-align: center; display: grid; gap: 1px; }
.stat-row div + div { border-left: 1px solid var(--line); }
.stat-row b { font-family: var(--serif); font-weight: 500; font-size: 1.45rem; color: var(--navy); line-height: 1.2; }
.stat-row span { font-size: 11.5px; color: var(--ink-3); letter-spacing: 0.04em; }
.review { display: grid; gap: 8px; padding: 16px 0; }
.review + .review { border-top: 1px solid var(--line); }
.review blockquote { margin: 0; font-family: var(--serif); font-size: 16.5px; line-height: 1.5; color: var(--ink); }
.review .by { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-2); }
.review .by b { color: var(--navy); }

.rep-card { background: var(--navy); color: var(--white); border-radius: 20px; padding: 20px; display: grid; gap: 14px; position: relative; overflow: hidden; }
.rep-card::after { content: ''; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; border: 1px solid rgba(201, 174, 124, 0.25); box-shadow: 0 0 0 24px rgba(201, 174, 124, 0.05); pointer-events: none; }
.rep-card .eyebrow { color: var(--gold-soft); }
.rep-card h2 { color: var(--white); font-size: 1.6rem; }
.rep-card .progress { background: rgba(255, 255, 255, 0.14); }
.rep-card .needs { font-size: 13px; color: rgba(255, 255, 255, 0.78); }
.rep-card .row b { font-family: var(--serif); font-weight: 500; font-size: 1.6rem; color: var(--white); }

.ladder { display: grid; gap: 0; }
.ladder > div { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 12px 0; }
.ladder > div + div { border-top: 1px solid var(--line); }
.ladder .rung { width: 28px; height: 28px; display: grid; place-items: center; }
.ladder .rung i { width: 10px; height: 10px; transform: rotate(45deg); background: var(--line-2); }
.ladder .on .rung i { background: var(--gold); }
.ladder b { color: var(--navy); }
.ladder p { font-size: 13.5px; color: var(--ink-2); }

.invite-card { position: relative; border-radius: 20px; padding: 26px 22px; background: var(--navy); color: var(--white); display: grid; gap: 12px; overflow: hidden; }
.invite-card::before { content: ''; position: absolute; inset: 8px; border: 1px solid rgba(201, 174, 124, 0.35); border-radius: 14px; pointer-events: none; }
.invite-card .code { font-family: var(--caps); font-size: 1.6rem; letter-spacing: 0.18em; color: var(--gold-soft); }
.invite-card p { color: rgba(255, 255, 255, 0.8); font-size: 14px; }
.invite-dots { display: flex; gap: 8px; }
.invite-dots i { width: 12px; height: 12px; transform: rotate(45deg); border: 1.5px solid var(--gold-soft); }
.invite-dots i.full { background: var(--gold-soft); }

.perk { display: grid; gap: 8px; }
.perk.locked { opacity: 0.72; }
.perk h3 { font-size: 1.2rem; }
.perk .how { background: var(--gold-wash); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; color: var(--gold-deep); }

.notif { display: flex; gap: 12px; padding: 14px 16px; align-items: flex-start; text-decoration: none; border: 0; background: none; width: 100%; text-align: left; }
.notif + .notif { border-top: 1px solid var(--line); }
.notif.unread { background: linear-gradient(90deg, rgba(163, 131, 80, 0.08), transparent); }
.notif p { font-size: 14px; line-height: 1.45; color: var(--ink); }
.notif time { font-size: 12px; color: var(--ink-3); }
.notif .n-ic { width: 38px; height: 38px; border-radius: 50%; background: var(--gold-wash); color: var(--gold-deep); display: grid; place-items: center; flex: none; }
.notif .n-ic svg { width: 18px; height: 18px; }

.locked-groups { text-align: center; display: grid; gap: 12px; justify-items: center; padding: 24px 18px; }
.locked-groups .lock { width: 52px; height: 52px; border-radius: 50%; background: var(--gold-wash); color: var(--gold-deep); display: grid; place-items: center; }
.locked-groups .lock svg { width: 22px; height: 22px; }
.locked-groups .progress { width: 100%; max-width: 280px; }
.group-names { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }

.guide h2 { font-size: 1.45rem; margin-bottom: 6px; }
.guide section { display: grid; gap: 10px; padding: 22px 0; }
.guide section + section { border-top: 1px solid var(--line); }
.guide p { color: var(--ink-2); line-height: 1.65; }
.guide .rules { display: grid; gap: 14px; }
.guide .rules div { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.guide .rules span { font-family: var(--caps); color: var(--gold-deep); font-size: 20px; line-height: 1.2; }
.guide .rules b { color: var(--navy); display: block; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--white); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 620px; }
.table th, .table td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); font-weight: 750; background: var(--ivory); }
.table tr:last-child td { border-bottom: 0; }
.app-card { display: grid; gap: 12px; }
.app-card .app-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-2); }
.app-card .quote-box { background: var(--ivory); border-radius: 12px; padding: 12px 14px; font-size: 14px; color: var(--ink); white-space: pre-wrap; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 60px; }
.bars i { flex: 1; background: var(--gold-soft); border-radius: 3px 3px 0 0; min-height: 2px; }

/* =====================================================================
   Onboarding & walkthrough
   ===================================================================== */

.onb { min-height: var(--app-h); display: flex; flex-direction: column; background: var(--white); }
.onb-top { display: flex; align-items: center; gap: 12px; padding: calc(14px + var(--safe-t)) 16px 8px; }
.onb-steps { flex: 1; display: flex; gap: 5px; }
.onb-steps i { flex: 1; height: 3px; border-radius: 3px; background: var(--line); transition: background 0.3s; }
.onb-steps i.on { background: var(--gold); }
.onb-body { flex: 1; padding: 20px 20px 24px; max-width: 520px; width: 100%; margin: 0 auto; display: grid; align-content: start; gap: 18px; animation: fadeup 0.4s var(--ease); }
@keyframes fadeup { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.onb-body h1 { font-size: 2rem; line-height: 1.15; }
.onb-body .lead { color: var(--ink-2); font-size: 15.5px; line-height: 1.6; }
.onb-foot { padding: 12px 20px calc(16px + var(--safe-b)); max-width: 520px; width: 100%; margin: 0 auto; display: grid; gap: 10px; }
.seat-card { border-radius: 22px; background: var(--navy); color: var(--white); padding: 34px 24px 30px; display: grid; justify-items: center; gap: 14px; text-align: center; position: relative; overflow: hidden; animation: seat 0.9s var(--ease); }
.seat-card::before { content: ''; position: absolute; inset: 10px; border: 1px solid rgba(201, 174, 124, 0.4); border-radius: 15px; pointer-events: none; }
.seat-card .no { font-family: var(--caps); font-size: 3rem; letter-spacing: 0.08em; color: var(--gold-soft); line-height: 1; }
.seat-card .kind { font-size: 10.5px; font-weight: 800; letter-spacing: 0.3em; text-transform: uppercase; color: rgba(255, 255, 255, 0.75); }
@keyframes seat { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
.av-picker { display: flex; align-items: center; gap: 16px; }
.av-picker .av { cursor: pointer; }
.suggest-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.suggest-tags button { border: 1px dashed var(--line-2); background: var(--white); color: var(--ink-2); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 600; }
.suggest-tags button:hover { border-color: var(--gold); color: var(--gold-deep); }
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 50px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--white); }
.tag-input:focus-within { border-color: var(--navy); }
.tag-input input { flex: 1; min-width: 120px; border: 0; outline: none; font-size: 16px; padding: 4px; background: transparent; }

.tour-scrim { position: fixed; inset: 0; z-index: 300; pointer-events: auto; }
.tour-hole { position: fixed; z-index: 301; border-radius: 16px; box-shadow: 0 0 0 9999px rgba(19, 33, 60, 0.55); transition: all 0.35s var(--ease); pointer-events: none; }
.tour-hole::after { content: ''; position: absolute; inset: -4px; border-radius: 19px; border: 1.5px solid var(--gold-soft); }
.tour-card { position: fixed; z-index: 302; left: 16px; right: 16px; max-width: 360px; margin: 0 auto; background: var(--white); border-radius: 18px; padding: 18px 18px 14px; box-shadow: var(--shadow-lg); display: grid; gap: 10px; transition: top 0.35s var(--ease), bottom 0.35s var(--ease); animation: fade 0.25s; }
.tour-card h3 { font-size: 1.25rem; }
.tour-card p { font-size: 14.5px; color: var(--ink-2); line-height: 1.55; }
.tour-card .tour-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.tour-dots { display: flex; gap: 5px; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.tour-dots i.on { background: var(--gold); width: 16px; border-radius: 3px; }

/* =====================================================================
   Public pages
   ===================================================================== */

.pub { min-height: 100dvh; display: flex; flex-direction: column; background: var(--ivory); }
.pub-hero { background: var(--navy); color: var(--white); padding: calc(36px + var(--safe-t)) 22px 52px; display: grid; gap: 28px; justify-items: center; text-align: center; position: relative; overflow: hidden; }
.pub-hero > * { position: relative; }
.pub-hero .stack { justify-items: center; }
.pub-hero::before { content: ''; position: absolute; right: -120px; top: -140px; width: 420px; height: 420px; border-radius: 50%; border: 1px solid rgba(201, 174, 124, 0.22); box-shadow: 0 0 0 40px rgba(201, 174, 124, 0.04), 0 0 0 80px rgba(201, 174, 124, 0.03); pointer-events: none; }
.pub-hero .wordmark { justify-self: center; }
.pub-hero h1 { color: var(--white); font-size: clamp(2.2rem, 8.5vw, 3.8rem); line-height: 1.08; max-width: 16ch; }
.pub-hero h1 em { font-style: italic; color: var(--gold-soft); }
.pub-hero p { color: rgba(255, 255, 255, 0.78); max-width: 44ch; font-size: 16px; line-height: 1.6; }
.pub-hero .btn.ghost { color: var(--white); border-color: rgba(255, 255, 255, 0.35); }
.pub-hero .btn.ghost:hover { border-color: var(--white); }
.pub-hero .btn.light { background: var(--white); color: var(--navy); }
.pub-hero .cta { display: grid; gap: 10px; width: 100%; max-width: 360px; }
.pub-hero .seats { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--gold-soft); letter-spacing: 0.04em; }
.pub-hero .seats::before { content: ''; width: 7px; height: 7px; transform: rotate(45deg); background: var(--gold-soft); }
.pub-body { padding: 36px 22px 48px; max-width: 980px; margin: 0 auto; width: 100%; display: grid; gap: 34px; }
.pillars { display: grid; gap: 24px; }
.pillar { display: grid; gap: 8px; justify-items: center; text-align: center; }
.pillar p { max-width: 36ch; }
.pillar span { font-family: var(--caps); font-size: 13px; letter-spacing: 0.2em; color: var(--gold-deep); }
.pillar h3 { font-size: 1.4rem; }
.pillar p { color: var(--ink-2); line-height: 1.6; }
.pub-foot { padding: 24px 22px calc(28px + var(--safe-b)); text-align: center; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line); }
.pub-foot a { color: var(--ink-2); }
.pub-panel { flex: 1; display: flex; flex-direction: column; }
.pub-panel .pub-top { padding: calc(18px + var(--safe-t)) 20px 10px; display: flex; justify-content: space-between; align-items: center; }
.pub-panel .pub-top .wordmark { align-items: flex-start; }
.pub-panel .pub-top .wordmark i { padding-left: 0; }
.pub-form { padding: 16px 20px 40px; max-width: 480px; width: 100%; margin: 0 auto; display: grid; gap: 18px; animation: fadeup 0.4s var(--ease); }
.pub-form h1 { font-size: 2rem; line-height: 1.15; }
.pub-form .lead { color: var(--ink-2); line-height: 1.6; }
.sponsor-card { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: grid; gap: 12px; }
.sponsor-card .row b { color: var(--navy); display: block; }
.sponsor-card blockquote { margin: 0; font-family: var(--serif); font-size: 16.5px; line-height: 1.5; color: var(--ink); border-left: 2px solid var(--gold); padding-left: 12px; }
.done-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--gold-wash); color: var(--gold-deep); display: grid; place-items: center; }
.done-mark svg { width: 28px; height: 28px; }

/* =====================================================================
   Wider screens: the same app, opened up
   ===================================================================== */

@media (min-width: 720px) {
  .page { padding: 28px 28px 48px; }
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .scrim { align-items: center; padding: 24px; }
  .sheet { width: min(520px, 100%); border-radius: 22px; padding: 24px; max-height: calc(100dvh - 48px); animation: rise-in 0.28s var(--ease); }
  .sheet::before { display: none; }
  @keyframes rise-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
  .toast { top: auto; bottom: 28px; }
  .pub-hero { padding: 48px 48px 80px; gap: 34px; }
  .pub-body { padding: 56px 48px; }
  .pillars { grid-template-columns: repeat(3, 1fr); gap: 36px; }
  .pub-form { padding-top: 28px; }
}

@media (min-width: 1000px) {
  .app { flex-direction: row; }
  .tabbar { display: none; }
  .app.in-thread .tabbar { display: none; }
  .sidebar { display: flex; flex-direction: column; width: 264px; flex: none; background: var(--white); border-right: 1px solid var(--line); padding: 22px 14px 16px; gap: 18px; overflow-y: auto; }
  .sidebar .wordmark { align-self: center; margin: 4px 0 6px; }
  .side-nav { display: grid; gap: 2px; }
  .side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none; font-weight: 650; font-size: 14.5px; color: var(--ink-2); position: relative; }
  .side-nav a svg { width: 20px; height: 20px; flex: none; }
  .side-nav a:hover { background: var(--ivory); color: var(--navy); }
  .side-nav a.on { background: var(--sand); color: var(--navy); }
  .side-nav a .count { margin-left: auto; min-width: 20px; height: 20px; border-radius: 10px; background: var(--gold); color: var(--white); font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 6px; }
  .side-label { font-size: 10.5px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); padding: 0 12px 4px; display: flex; justify-content: space-between; align-items: center; }
  .side-chats { display: grid; gap: 1px; }
  .side-chats a { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 10px; text-decoration: none; font-size: 14px; color: var(--ink-2); }
  .side-chats a:hover { background: var(--ivory); }
  .side-chats a.on { background: var(--sand); color: var(--navy); }
  .side-chats a.unread { color: var(--navy); font-weight: 700; }
  .side-chats a .count { margin-left: auto; min-width: 18px; height: 18px; border-radius: 9px; background: var(--gold); color: var(--white); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
  .side-chats .hash { width: 24px; height: 24px; border-radius: 7px; background: var(--sand); color: var(--navy); display: grid; place-items: center; font-family: var(--caps); font-size: 12px; flex: none; }
  .side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 6px 0; border-top: 1px solid var(--line); text-decoration: none; }
  .side-foot b { display: block; font-size: 14px; color: var(--navy); }
  .app-main { flex: 1; min-width: 0; }
  .topbar { padding: 10px 16px 10px 20px; min-height: 64px; }
  .topbar .back.mobile-only { display: none; }
  .composer-wrap { padding: 10px 16px 14px; }
  .app .composer-wrap { padding-bottom: 14px; }
  .room-layout { flex: 1; min-height: 0; display: flex; }
  .room-layout .chat { flex: 1; min-width: 0; }
  .ask-chip { width: 260px; }
}

@media (min-width: 1280px) {
  .rail { display: flex; flex-direction: column; gap: 14px; width: 320px; flex: none; padding: 16px; overflow-y: auto; border-left: 1px solid var(--line); background: var(--ivory); }
  .rail-hide-wide { display: none !important; }
}

@media (max-width: 999px) {
  .desktop-only { display: none !important; }
}
@media (min-width: 1000px) {
  .mobile-only { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* =====================================================================
   Motion. Only opacity and transform are animated, so everything runs on
   the compositor at 60fps. Reduced-motion users get none of it (see above).
   ===================================================================== */

:root { --ease-out: cubic-bezier(0.16, 1, 0.3, 1); }

/* Inputs on dark backgrounds keep dark text on their white field. */
.pub-hero .input { color: var(--ink); background: var(--white); border-color: transparent; }
.pub-hero .input::placeholder { color: var(--ink-3); letter-spacing: 0.04em; font-weight: 500; }
.pub-hero .form-error:not(:empty) { color: #f3c2b4; font-size: 14px; }

/* Landing: a composed, staggered entrance. */
.pub-hero.intro > * { opacity: 0; animation: rise-up 0.9s var(--ease-out) forwards; }
.pub-hero.intro > *:nth-child(1) { animation-delay: 0.05s; }
.pub-hero.intro > *:nth-child(2) { animation-delay: 0.18s; }
.pub-hero.intro > *:nth-child(3) { animation-delay: 0.34s; }
.pub-hero.intro ~ .pub-body .pillar { opacity: 0; animation: rise-up 0.8s var(--ease-out) forwards; }
.pub-hero.intro ~ .pub-body .pillar:nth-child(1) { animation-delay: 0.45s; }
.pub-hero.intro ~ .pub-body .pillar:nth-child(2) { animation-delay: 0.55s; }
.pub-hero.intro ~ .pub-body .pillar:nth-child(3) { animation-delay: 0.65s; }
@keyframes rise-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.code-form { animation: rise-up 0.45s var(--ease-out); }
.shake { animation: shake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(2px); } 30%, 50%, 70% { transform: translateX(-4px); } 40%, 60% { transform: translateX(4px); } }

/* Page changes on the public site (View Transitions API, where supported). */
::view-transition-old(root) { animation: 0.2s ease both vt-out; }
::view-transition-new(root) { animation: 0.38s var(--ease-out) both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

/* App screens: tabs fade up, pushed screens slide in from the right. */
.view-enter { animation: view-in 0.32s var(--ease-out) both; }
.view-push { animation: view-push 0.36s var(--ease-out) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes view-push { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }

/* Lists settle in with a short stagger instead of popping. */
.stagger > * { animation: view-in 0.4s var(--ease-out) both; }
.stagger > *:nth-child(2) { animation-delay: 0.03s; }
.stagger > *:nth-child(3) { animation-delay: 0.06s; }
.stagger > *:nth-child(4) { animation-delay: 0.09s; }
.stagger > *:nth-child(5) { animation-delay: 0.12s; }
.stagger > *:nth-child(6) { animation-delay: 0.15s; }
.stagger > *:nth-child(n + 7) { animation-delay: 0.18s; }

/* New chat messages arrive softly. */
.mrow.arrive { animation: view-in 0.26s var(--ease-out) both; }

/* Loading: content-shaped placeholders instead of spinners. */
.loading-block:not([data-more]) { display: grid; gap: 12px; padding: 4px 0; place-items: stretch; }
.loading-block:not([data-more]) .spinner { display: none; }
.loading-block:not([data-more])::before,
.loading-block:not([data-more])::after { content: ''; height: 76px; border-radius: 16px; background: linear-gradient(90deg, var(--sand) 0%, #f8f5ef 50%, var(--sand) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.loading-block:not([data-more])::after { height: 120px; opacity: 0.7; }
.skel-msg { display: grid; grid-template-columns: 38px 1fr; gap: 10px; padding: 12px 14px; }
.skel-msg i { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--sand) 0%, #f8f5ef 50%, var(--sand) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.skel-msg i:first-child { width: 38px; height: 38px; border-radius: 50%; grid-row: span 2; }
.skel-msg i:nth-child(2) { width: 30%; height: 12px; margin-top: 4px; }
.skel-msg i:nth-child(3) { width: 72%; height: 12px; }

/* Touch feedback that feels physical. */
.list-item, .member-row, .notif, .ask-chip, .meet-card, .tabbar a, .side-nav a { transition: background 0.18s, transform 0.18s var(--ease-out); }
.list-item:active, .member-row:active, .notif:active, .ask-chip:active, .meet-card:active { transform: scale(0.985); }
.tabbar a:active svg { transform: scale(0.9); }
.tabbar a svg { transition: transform 0.18s var(--ease-out); }

@media (prefers-reduced-motion: reduce) {
  .pub-hero.intro > *, .pub-hero.intro ~ .pub-body .pillar { opacity: 1; }
}
