/* ── Design tokens ──────────────────────────────────────────────────────────── */
:root {
  --color-primary:       #C13383;
  --color-primary-dark:  #a82c72;
  --color-primary-light: #fce8f3;
  --color-secondary:     #443199;
  --color-bg:            #F4F4F6;
  --color-surface:       #FFFFFF;
  --color-text:          #1A1D2E;
  --color-text-muted:    #616875;  /* darkened from #6B7280 → clears WCAG AA 4.5:1 on the #F4F4F6 bg */
  --color-border:        #E5E7EB;
  --color-success:       #10B981;
  --color-error:         #EF4444;
  --color-warning:       #F59E0B;
  --color-info:          #3B82F6;

  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.10);

  --sidebar-width: 240px;
  --nav-height:    64px;
  --guest-bar-h:   56px;
  --header-height: 56px;
  --content-max:   900px;
  --font: 'Nunito', system-ui, -apple-system, sans-serif;
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font: inherit; }
a { color: inherit; text-decoration: none; }
input, select, textarea { font: inherit; }

/* ── Mobile shell ───────────────────────────────────────────────────────────── */
#root {
  display: flex;
  min-height: 100vh;
}
#app {
  flex: 1;
  min-height: 100vh;
  overflow-y: auto;
  padding-bottom: var(--nav-height);
  background: var(--color-surface);
}
#app:has(.landing) {
  padding-bottom: 0;
  background: transparent;
}
body:has(.landing) {
  background: #ffffff;
}

/* ── Bottom nav (mobile) ────────────────────────────────────────────────────── */
#bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 100;
}
#bottom-nav.hidden { display: none; }

/* ── Guest browse bar (logged-out visitors on feed / detail) ─────────────────── */
#guest-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--guest-bar-h);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  z-index: 200;
}
.guest-bar__brand {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-weight: 800; color: var(--color-text);
}
.guest-bar__brand img { width: 28px; height: 28px; }
.guest-bar__brand span { font-size: 1.05rem; }
.guest-bar__actions { display: flex; align-items: center; gap: 8px; }

/* Offset page content so the fixed bar never covers it (incl. sticky headers) */
body.guest-browsing #app { padding-top: var(--guest-bar-h); padding-bottom: 0; }
body.guest-browsing .page__header { top: var(--guest-bar-h); }

/* Profile page: back-button header scrolls normally — profile content is short and
   a sticky bar floating between the guest bar and content looks disconnected.
   Two rules needed: base overrides sticky, guest rule wins over body.guest-browsing .page__header
   which has specificity 0,2,1 — we need 0,3,1 to beat it on top. */
.page--profile-v2 > .page__header { position: relative; top: 0; }
body.guest-browsing .page--profile-v2 > .page__header { position: relative; top: 0; }

/* Feed page: sticky header combines h2 + filter chips (~88px) → first card disappears
   behind it after only 16px of scroll for guests. Make it scroll with content so the
   guest bar (56px) is the only fixed element, giving cards full visible runway. */
body.guest-browsing .page--feed .page__header { position: relative; top: auto; }

.nav-item {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; padding: 8px 4px 10px;
  color: var(--color-text-muted); transition: color .15s; font-size: .7rem;
}
.nav-item:active, .nav-item--active { color: var(--color-primary); }
.nav-item__icon { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; }
.nav-item__label { white-space: nowrap; }

/* ── Page ───────────────────────────────────────────────────────────────────── */
.page { min-height: 100%; }
.page__header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky; top: 0; z-index: 10;
}
.page__header h2 { font-size: 1.1rem; font-weight: 700; flex: 1; }
.page__subtitle { color: var(--color-text-muted); font-size: .9rem; padding: 0 16px 8px; }
.page__footer { padding: 16px; }
.page--centered { display: flex; align-items: center; justify-content: center; min-height: 80vh; }
.page--form .form { padding: 20px 16px 32px; }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 12px 20px; border-radius: var(--radius-md);
  font-size: .95rem; font-weight: 600;
  transition: opacity .15s, transform .1s; white-space: nowrap;
}
.btn:active { opacity: .85; transform: scale(.98); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn--full { width: 100%; }
.btn--sm { padding: 8px 14px; font-size: .85rem; }
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-primary-dark); }
.btn--outline { border: 2px solid var(--color-primary); color: var(--color-primary); }
.btn--ghost  { border: 2px solid var(--color-border); color: var(--color-text-muted); }
.btn--ghost:disabled { opacity: .4; cursor: default; }
.btn--success { background: var(--color-success); color: #fff; }
.btn--error   { background: var(--color-error);   color: #fff; }
.btn-back {
  width: 36px; height: 36px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; color: var(--color-text-muted); background: var(--color-bg);
  flex-shrink: 0;
}
.btn-link { color: var(--color-primary); font-size: .9rem; text-decoration: underline; }
.btn-icon { font-size: 1.2rem; padding: 4px; display: inline-flex; align-items: center; justify-content: center; color: var(--color-text); }
.btn-icon svg { display: block; }

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 500; }
.form-input {
  padding: 12px 14px; border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md); background: var(--color-surface);
  font-size: 1rem; transition: border-color .15s; width: 100%;
}
.form-input:focus { outline: none; border-color: var(--color-primary); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: .8rem; color: var(--color-text-muted); }

/* ── Password reveal ─────────────────────────────────────────────────────── */
.input-password-wrap { position: relative; }
.input-password-wrap .form-input,
.input-password-wrap .ob-input { padding-right: 56px; }
.btn-pwd-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; color: var(--color-text-muted);
  font-size: .78rem; font-weight: 600; letter-spacing: .02em;
  padding: 4px 6px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color .15s;
}
.btn-pwd-toggle:hover { color: var(--color-text); }

.form-error {
  color: var(--color-error); font-size: .85rem;
  padding: 8px 12px; background: #FEE2E2; border-radius: var(--radius-sm);
}
.form-actions { display: flex; gap: 10px; }
.char-count { font-size: .8rem; color: var(--color-text-muted); text-align: right; }
.hidden { display: none !important; }

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--color-surface); border-radius: var(--radius-lg);
  padding: 16px; box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  cursor: pointer; transition: box-shadow .15s, transform .15s;
}
.card:hover  { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card:active { box-shadow: var(--shadow-md); }
.card__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.card__title  { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.card__meta   { display: flex; flex-wrap: wrap; gap: 8px; font-size: .85rem; color: var(--color-text-muted); margin-bottom: 10px; }
.meta-item    { display: inline-flex; align-items: center; gap: 5px; }
.card__footer { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; font-size: .85rem; color: var(--color-text-muted); }
.card__host   { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 150px; }
.host-name    { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__social { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; font-size: .8rem; color: var(--color-text-muted); }
.card__going  { line-height: 1; white-space: nowrap; }
.card__going--empty { font-style: italic; }
.card__social .attendee-stack__item { border-color: var(--color-surface, #fff); }

/* ── Sidequest card cover image ─────────────────────────────────────────────── */
.card--has-cover { padding: 0; }
.card__cover {
  position: relative;
  width: 100%; aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.card__cover img  { width: 100%; height: 100%; object-fit: cover; display: block; }
.card__cover-cat  {
  position: absolute; bottom: 8px; left: 10px;
  background: rgba(0,0,0,.52); color: #fff;
  font-size: .72rem; font-weight: 600;
  padding: 3px 8px; border-radius: var(--radius-full);
  letter-spacing: .02em;
}
.card__body { padding: 12px 14px 14px; }

/* ── Required field indicator ────────────────────────────────────────────────── */
.req { color: var(--color-error); font-weight: 600; margin-left: 2px; }

/* Select placeholder option — match input placeholder color */
select.form-input:invalid,
select.form-input option[value=""] { color: var(--color-text-muted); }
select.form-input option:not([value=""]) { color: var(--color-text); }

/* ── Cover image picker (inside csq-body) ────────────────────────────────────── */
.csq-cover-picker {
  position: relative;
  width: 100%; aspect-ratio: 16/9;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--color-border);
  overflow: hidden;
  margin-bottom: 4px;
  transition: border-color .15s;
}
.csq-cover-picker:hover { border-color: var(--color-primary); }
.csq-cover-preview {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.csq-cover-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; height: 100%; gap: 4px;
  background: none; border: none; cursor: pointer;
  color: var(--color-text-muted);
}
.csq-cover-empty__icon { font-size: 2rem; margin-bottom: 2px; }
.csq-cover-empty       { font-size: .9rem; }
.csq-cover-empty__hint { font-size: .75rem; color: var(--color-text-muted); margin-top: 2px; }
.csq-cover-change {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,.55); color: #fff;
  border: none; border-radius: var(--radius-sm);
  padding: 5px 12px; font-size: .8rem; cursor: pointer;
  transition: background .15s;
}
.csq-cover-change:hover { background: rgba(0,0,0,.75); }

/* ── Feed ───────────────────────────────────────────────────────────────────── */
.page--feed { display: flex; flex-direction: column; }
.filter-bar {
  display: flex; gap: 6px; overflow-x: auto;
  padding: 10px 16px; scrollbar-width: none;
  border-bottom: 1px solid var(--color-border);
}
.filter-bar::-webkit-scrollbar { display: none; }
.feed-list { display: flex; flex-direction: column; gap: 12px; padding: 16px 16px 80px; }

/* Feed header: title shares its row with the search field */
.page--feed .page__header h2 { flex: 0 0 auto; }
.feed-search { flex: 1 1 auto; min-width: 0; height: 38px; padding: 8px 14px; font-size: .95rem; }

/* Combined filter row: date dropdown + a divider + category chips */
.feed-filter-row {
  display: flex; align-items: center; gap: 8px; overflow-x: auto;
  padding: 10px 16px; scrollbar-width: none;
  border-bottom: 1px solid var(--color-border);
}
.feed-filter-row::-webkit-scrollbar { display: none; }
.feed-filter-divider { width: 1px; height: 20px; background: var(--color-border); flex-shrink: 0; }
.feed-date { position: relative; flex-shrink: 0; }
.feed-date-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 10px 0 12px;
  border: 1.5px solid var(--color-border); border-radius: var(--radius-full);
  background: var(--color-surface); color: var(--color-text);
  font-size: .8rem; font-weight: 500; font-family: inherit; cursor: pointer;
}
.feed-date-btn svg { color: var(--color-text-muted); flex-shrink: 0; }
.feed-date-btn--active { border-color: var(--color-primary); color: var(--color-primary); }
.feed-date-btn--active svg { color: var(--color-primary); }
.feed-date-menu {
  position: fixed; z-index: 100; min-width: 168px;
  padding: 6px; display: flex; flex-direction: column;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border); border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(26, 29, 46, .14);
}
.feed-date-opt {
  text-align: left; padding: 9px 12px; border-radius: var(--radius-sm, 8px);
  font-size: .85rem; color: var(--color-text); background: transparent; cursor: pointer;
}
.feed-date-opt:hover { background: var(--color-bg); }
.feed-date-opt--on { color: var(--color-primary); font-weight: 600; background: var(--color-bg); }

/* ── Profile completeness nudge ─────────────────────────────────────────────── */
.profile-nudge {
  position: relative;
  margin: 12px 16px 0;
  padding: 16px 40px 16px 16px;
  border-radius: var(--radius-lg, 16px);
  background: var(--color-surface, #fff);
  border: 1.5px solid var(--color-border);
  box-shadow: 0 2px 10px rgba(68, 49, 153, .06);
}
.profile-nudge__close {
  position: absolute; top: 8px; right: 10px;
  width: 26px; height: 26px; line-height: 1;
  border: none; background: transparent; cursor: pointer;
  font-size: 1.35rem; color: var(--color-text-muted, #888);
  border-radius: var(--radius-full, 999px);
}
.profile-nudge__close:hover { background: var(--color-bg, #f5f0ff); }
.profile-nudge__text { font-size: .9rem; line-height: 1.45; margin: 0 0 10px; color: var(--color-text, #1a1d2e); }
.profile-nudge__bar {
  height: 6px; border-radius: var(--radius-full, 999px);
  background: var(--color-bg, #efe9fb); overflow: hidden; margin-bottom: 12px;
}
.profile-nudge__bar-fill {
  height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, #C13383, #443199);
  transition: width .4s ease;
}

/* ── Verify-email banner ─────────────────────────────────────────────────────── */
.verify-banner {
  position: relative;
  margin: 12px 16px 0;
  padding: 14px 40px 14px 16px;
  border-radius: var(--radius-lg, 16px);
  background: linear-gradient(90deg, rgba(193, 51, 131, .08), rgba(68, 49, 153, .08));
  border: 1.5px solid var(--color-border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
}
.verify-banner__text { font-size: .9rem; line-height: 1.4; margin: 0; color: var(--color-text, #1a1d2e); flex: 1; min-width: 180px; }
.verify-banner__close {
  position: absolute; top: 6px; right: 10px;
  width: 26px; height: 26px; line-height: 1;
  border: none; background: transparent; cursor: pointer;
  font-size: 1.35rem; color: var(--color-text-muted, #888);
  border-radius: var(--radius-full, 999px);
}
.verify-banner__close:hover { background: var(--color-bg, #f5f0ff); }

/* ── Chips & badges ─────────────────────────────────────────────────────────── */
.chip {
  padding: 5px 12px; border-radius: var(--radius-full); font-size: .8rem; font-weight: 500;
  background: var(--color-bg); border: 1.5px solid var(--color-border);
  color: var(--color-text); white-space: nowrap; cursor: pointer; transition: background .1s, color .1s;
}
.chip--active   { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.chip--category { background: var(--color-primary-light); color: var(--color-primary); border-color: transparent; cursor: default; }
.chip--lang     { background: rgba(68,49,153,.1); color: #443199; border-color: transparent; cursor: default; }
.chip--sm       { padding: 3px 9px; font-size: .75rem; }
.chip-list      { display: flex; flex-wrap: wrap; gap: 6px; }
/* Darker green/red than the token swatches — the brand --color-success/-error
   fail WCAG AA on white at this small size (~2.5:1 / ~3.5:1). These pass ~5:1. */
.spots-badge      { font-size: .78rem; font-weight: 600; color: #047857; }
.spots-badge--full { color: #DC2626; }

.badge { padding: 3px 10px; border-radius: var(--radius-full); font-size: .75rem; font-weight: 600; }
.badge--default { background: var(--color-bg);   color: var(--color-text-muted); }
.badge--success { background: #D1FAE5; color: #065F46; }
.badge--error   { background: #FEE2E2; color: #991B1B; }
.badge--warning { background: #FEF3C7; color: #92400E; }
.badge--info    { background: #DBEAFE; color: #1E40AF; }
.badge--muted   { background: var(--color-bg);   color: var(--color-text-muted); }

/* ── Welcome ────────────────────────────────────────────────────────────────── */
.page--welcome {
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 100vh; padding: 48px 24px 40px;
  background: var(--color-secondary);
}
.welcome__hero {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; flex: 1; justify-content: center;
}
.welcome__logo    { width: 80px; height: 80px; }
.welcome__app-name { font-size: 1.8rem; font-weight: 800; color: #fff; letter-spacing: -.5px; }
.welcome__tagline  { font-size: 1.1rem; color: rgba(255,255,255,.7); text-align: center; max-width: 320px; line-height: 1.5; }
.welcome__actions  { display: flex; flex-direction: column; gap: 10px; }
.lang-switcher     { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; }
.lang-btn          { color: rgba(255,255,255,.6); font-size: .9rem; }
.lang-btn--active  { color: #fff; font-weight: 700; }

/* ── Auth ───────────────────────────────────────────────────────────────────── */
.page--auth { padding-bottom: 40px; background: var(--color-bg); min-height: 100vh; }
.auth__header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.auth__header h2 { font-size: 1.2rem; font-weight: 700; }
.auth__switch { text-align: center; padding: 12px; }

/* ── Avatar ─────────────────────────────────────────────────────────────────── */
.avatar {
  border-radius: var(--radius-full); object-fit: cover; flex-shrink: 0;
}
.avatar--initials {
  display: flex; align-items: center; justify-content: center;
  background: var(--color-primary-light); color: var(--color-primary);
  font-weight: 700; border-radius: var(--radius-full);
}
.avatar--lg { width: 80px !important; height: 80px !important; }
.avatar--placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--color-bg); border: 2px dashed var(--color-border);
  font-size: 2rem; border-radius: var(--radius-full); width: 80px; height: 80px;
}
.avatar-upload { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-bottom: 8px; }
.avatar-upload__preview { width: 80px; height: 80px; }

/* ── Tags ───────────────────────────────────────────────────────────────────── */
.tag {
  display: flex; align-items: center; gap: 4px; padding: 4px 10px;
  background: var(--color-primary-light); color: var(--color-primary);
  border-radius: var(--radius-full); font-size: .85rem;
}
.tag__remove { color: var(--color-primary); font-size: 1rem; line-height: 1; }

/* ── Interests & language chips ─────────────────────────────────────────────── */
.interests-grid  { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px; }
.lang-chips-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.interest-chip {
  padding: 10px 18px; border-radius: var(--radius-full);
  border: 2px solid var(--color-border); font-size: .9rem; font-weight: 500;
  transition: all .15s;
}
.interest-chip--active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* ── FAB ────────────────────────────────────────────────────────────────────── */
.fab {
  position: fixed; bottom: calc(var(--nav-height) + 16px); right: 24px;
  background: var(--color-primary); color: #fff;
  padding: 14px 22px; border-radius: var(--radius-full);
  font-size: .95rem; font-weight: 700; box-shadow: var(--shadow-md);
  display: flex; align-items: center; gap: 6px; z-index: 95;
}
.fab:hover { background: var(--color-primary-dark); }

/* ── Detail page (redesigned) ────────────────────────────────────────────────── */
.page--detail { background: var(--color-bg); min-height: 100%; }
/* Constrain to a tidy centered column, matching the profile page (.pv2-wrap). */
.detail__wrap {
  max-width: 620px; margin: 0 auto; padding: 16px 16px 40px;
  display: flex; flex-direction: column; gap: 12px;
}

/* Hero: a contained rounded card so the image never sprawls full-bleed and the
   floating controls align to its corners by construction. */
.detail__hero {
  position: relative; height: 210px; overflow: hidden;
  border-radius: var(--radius-lg); background: var(--color-border);
}
.detail__hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail__hero--gradient { height: 140px; background: linear-gradient(135deg, #C13383 0%, #443199 100%); }

.detail__ctrl {
  position: absolute; top: 12px; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.92); color: var(--color-text);
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  display: flex; align-items: center; justify-content: center;
}
.detail__ctrl svg { display: block; }
.detail__ctrl--back { left: 12px; }
.detail__ctrl-group { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; }
.detail__ctrl-group .detail__ctrl { position: static; }
.detail__cat {
  position: absolute; left: 12px; bottom: 12px;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: .72rem; font-weight: 700;
  padding: 4px 11px; border-radius: var(--radius-full); letter-spacing: .02em;
}

/* Primary headline info sits straight on the page, no card — the first thing scanned. */
.detail__head { padding: 4px 4px 2px; }
.detail__title { font-size: 1.4rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.25; margin-bottom: 12px; }
.detail__meta { display: flex; flex-direction: column; gap: 9px; }
.meta-row { display: flex; align-items: center; gap: 9px; font-size: .92rem; color: var(--color-text); }
.meta-row svg { flex-shrink: 0; color: var(--color-text-muted); }

.detail__card-host { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.detail__host-body { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.detail__host-body .label { display: block; font-size: .75rem; color: var(--color-text-muted); }
.detail__host-body strong { font-size: .95rem; }
.detail__desc { font-size: .95rem; line-height: 1.6; white-space: pre-wrap; margin: 0; }

.detail__safety-note { padding: 2px 4px; font-size: .8rem; line-height: 1.5; color: var(--color-text-muted); }
.detail__blocked-warning {
  border-radius: var(--radius-md, 10px); padding: 10px 12px;
  background: #FEF3F2; border: 1px solid #FECDCA; color: #B42318;
  font-size: .82rem; line-height: 1.45;
}
.detail__cta { display: flex; flex-direction: column; gap: 10px; margin-top: 2px; }
.detail__report { padding: 6px 4px 0; }
.detail__report .btn-link { display: inline-flex; align-items: center; gap: 6px; }

/* ── Host trust ──────────────────────────────────────────────────────────────── */
.host-trust { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; }
.host-trust__badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .7rem; font-weight: 700; color: var(--color-primary);
  background: rgba(193,51,131,.1); border-radius: 20px; padding: 2px 8px;
}
.host-trust__meta { font-size: .75rem; color: var(--color-text-muted); }
.host-trust__meta + .host-trust__meta::before { content: '·'; margin-right: 4px; }

/* ── Attendee stack ──────────────────────────────────────────────────────────── */
.attendee-stack { display: flex; align-items: center; }
.attendee-stack__item {
  background: none; border: 2px solid var(--color-bg); padding: 0; cursor: pointer;
  border-radius: 50%; margin-left: -10px; transition: transform .15s;
}
.attendee-stack__item:first-child { margin-left: 0; }
.attendee-stack__item:hover { transform: translateY(-2px); z-index: 1; position: relative; }
.attendee-stack__more {
  width: 36px; height: 36px; border-radius: 50%; margin-left: 8px; flex-shrink: 0;
  background: var(--color-border); color: var(--color-text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700;
}
.attendees__empty { font-size: .9rem; color: var(--color-text-muted); margin: 0; }
.attendees__teaser { font-size: .9rem; color: var(--color-text-muted); margin: 0; }
.attendees__teaser .link { color: var(--color-primary); font-weight: 600; }

/* ── Applicant cards ────────────────────────────────────────────────────────── */
.applicant-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 16px; margin: 12px 16px; }
.applicant-card__header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; cursor: pointer; }
.applicant-card__info { flex: 1; font-size: .85rem; color: var(--color-text-muted); display: flex; flex-direction: column; gap: 2px; }
.applicant-card__info strong { color: var(--color-text); font-size: .95rem; }
.applicant-card__message { font-size: .9rem; color: var(--color-text-muted); margin: 10px 0; }
.applicant-card__actions { display: flex; gap: 10px; }

/* ── Quest rows ─────────────────────────────────────────────────────────────── */
.quest-row { padding: 14px 16px; border-bottom: 1px solid var(--color-border); cursor: pointer; }
.quest-row:hover { background: var(--color-bg); }
.quest-row__main { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.quest-row__meta { font-size: .82rem; color: var(--color-text-muted); }
.quest-row__actions { margin-top: 8px; }

/* ── Tabs ───────────────────────────────────────────────────────────────────── */
.tabs { display: flex; border: 1.5px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; }
.tab { flex: 1; padding: 7px 14px; font-size: .85rem; font-weight: 500; color: var(--color-text-muted); transition: background .1s; }
.tab--active { background: var(--color-primary); color: #fff; }

/* ── Chat ───────────────────────────────────────────────────────────────────── */
.page--chat { display: flex; flex-direction: column; height: 100vh; position: relative; }
.chat__header {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid var(--color-border); background: var(--color-surface);
  position: sticky; top: 0; z-index: 10;
}
.chat__header strong { flex: 1; font-size: 1rem; }
.chat__messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; padding-bottom: 80px; }
.chat__input-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; gap: 8px; padding: 10px 16px;
  background: var(--color-surface); border-top: 1px solid var(--color-border); z-index: 20;
}
.chat__input-bar .form-input { flex: 1; padding: 10px 14px; }

.chat-msg { display: flex; gap: 8px; align-items: flex-end; }
.chat-msg--mine { flex-direction: row-reverse; }
.chat-msg__bubble {
  max-width: 75%; background: var(--color-bg);
  border-radius: var(--radius-lg); padding: 10px 12px;
}
.chat-msg--mine .chat-msg__bubble { background: var(--color-primary); color: #fff; }
.chat-msg__name  { display: block; font-size: .75rem; color: var(--color-text-muted); margin-bottom: 3px; }
.chat-msg__bubble p { font-size: .9rem; line-height: 1.4; }
.chat-msg__time  { display: block; font-size: .7rem; color: var(--color-text-muted); margin-top: 3px; text-align: right; }
.chat-msg--mine .chat-msg__time { color: rgba(255,255,255,.7); }

.participants-panel {
  position: absolute; top: 56px; right: 0; width: 220px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md); padding: 12px; z-index: 50;
}
.participants-panel h4 { font-size: .85rem; margin-bottom: 10px; }
.participant-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; font-size: .9rem; }
.participant-row__name { flex: 1; }
.participant-row__host {
  flex-shrink: 0; background: var(--color-primary-light); color: var(--color-primary);
  font-size: .62rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 100px;
}

/* ── Profile (legacy, kept for other-user cards) ─────────────────────────── */
.profile__hero { display: flex; align-items: center; gap: 16px; padding: 20px 16px; }
.profile__info { flex: 1; }
.profile__info h3 { font-size: 1.2rem; font-weight: 700; }
.profile__district { color: var(--color-text-muted); font-size: .9rem; margin-top: 4px; }
.profile__stats { display: flex; border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.stat { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 14px 8px; }
.stat:not(:last-child) { border-right: 1px solid var(--color-border); }
.stat strong { font-size: 1.3rem; font-weight: 800; }
.stat span   { font-size: .75rem; color: var(--color-text-muted); margin-top: 2px; }
.profile__section { padding: 14px 16px; border-bottom: 1px solid var(--color-border); }
.profile__since { padding: 12px 16px; font-size: .82rem; color: var(--color-text-muted); }
.verified-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: #D1FAE5; color: #065F46;
  padding: 3px 10px; border-radius: var(--radius-full); font-size: .78rem; font-weight: 600; margin-top: 6px;
}

/* ── Profile v2 ──────────────────────────────────────────────────────────── */
.page--profile-v2 {
  min-height: 100%; background: var(--color-bg);
}
/* Constrain width so it never stretches across a widescreen */
.pv2-wrap {
  max-width: 620px; margin: 0 auto; padding: 16px 16px 40px;
  display: flex; flex-direction: column; gap: 8px;
}

/* ── Identity card ── */
.pv2-identity {
  background: var(--color-surface); padding: 28px 24px 20px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  border: 1px solid var(--color-border); border-radius: var(--radius-lg); position: relative;
}
.pv2-avatar-wrap { position: relative; margin-bottom: 14px; }
.pv2-avatar {
  width: 100px; height: 100px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--color-surface);
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
}
.pv2-avatar-placeholder {
  width: 100px; height: 100px; border-radius: 50%;
  background: linear-gradient(135deg, #C13383 0%, #443199 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
}
.pv2-avatar-initial {
  font-size: 2.4rem; font-weight: 800; color: rgba(255,255,255,.55);
  line-height: 1; user-select: none;
}
.pv2-name { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; color: var(--color-text); }
.pv2-name__age { font-weight: 400; color: var(--color-text-muted); }
.pv2-loc  { font-size: .85rem; color: var(--color-text-muted); margin-top: 4px; }
.pv2-verified {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 8px;
  background: #D1FAE5; color: #065F46;
  font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 100px;
}

/* ── Bio ── */
.pv2-bio {
  font-size: .9rem;
  line-height: 1.55;
  color: var(--color-text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Stats row ── */
.pv2-stats {
  display: flex; background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden;
}
.pv2-stat {
  flex: 1; display: flex; flex-direction: column; align-items: center; padding: 14px 8px;
}
.pv2-stat:not(:last-child) { border-right: 1px solid var(--color-border); }
.pv2-stat strong { font-size: 1.3rem; font-weight: 800; color: var(--color-text); }
.pv2-stat span   { font-size: .7rem; color: var(--color-text-muted); margin-top: 2px; text-align: center; line-height: 1.3; }

/* ── Content sections ── */
.pv2-section {
  background: var(--color-surface);
  padding: 16px 16px 18px;
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
}
.pv2-section__label {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .09em; color: var(--color-text-muted); margin-bottom: 12px;
}
.pv2-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pv2-chip {
  padding: 7px 13px; border-radius: 100px; font-size: .83rem; font-weight: 500;
  background: var(--color-bg); border: 1.5px solid var(--color-border);
  color: var(--color-text); display: flex; align-items: center; gap: 5px;
}
.pv2-chip--goal  { background: var(--color-primary-light); border-color: transparent; color: var(--color-primary); }
.pv2-chip--lang  { background: rgba(68,49,153,.1); border-color: transparent; color: #443199; }
.pv2-chip--avail { background: #F0FDF4; border-color: transparent; color: #166534; }

.pv2-blocked-list { display: flex; flex-direction: column; gap: 8px; }
.pv2-blocked-row { display: flex; align-items: center; gap: 10px; }
.pv2-blocked-name { flex: 1; font-size: .9rem; font-weight: 600; color: var(--color-text); }

/* ── Footer ── */
.pv2-since {
  padding: 13px 16px; font-size: .8rem; color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
}
/* No extra padding — .pv2-wrap gap handles spacing, buttons are full-width */
.pv2-actions { display: flex; flex-direction: column; gap: 8px; }

/* ── Edit Profile ────────────────────────────────────────────────────────────── */
.ep-wrap {
  max-width: 620px; margin: 0 auto;
  padding: 16px 16px 48px;
  display: flex; flex-direction: column; gap: 8px;
}
.ep-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: 16px;
}
.ep-label {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .09em; color: var(--color-text-muted);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.ep-count { font-weight: 400; text-transform: none; letter-spacing: 0; font-size: .75rem; }
.ep-fields { display: flex; flex-direction: column; gap: 12px; }
.ep-field { display: flex; flex-direction: column; gap: 5px; font-size: .85rem; font-weight: 500; color: var(--color-text); }
.ep-photo-row { display: flex; align-items: center; gap: 16px; }
.ep-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ep-chip {
  padding: 7px 13px; border-radius: 100px;
  font-size: .83rem; font-weight: 500;
  background: var(--color-bg); border: 1.5px solid var(--color-border);
  color: var(--color-text); transition: all .13s;
}
.ep-chip:active { transform: scale(.95); }
.ep-chip--on { background: var(--color-secondary); color: #fff; border-color: var(--color-secondary); }
.ep-chip--on.ep-chip--goal  { background: var(--color-primary); border-color: var(--color-primary); }
.ep-chip--on.ep-chip--lang  { background: #443199; border-color: #443199; }
.ep-chip--on.ep-chip--avail { background: #166534; border-color: #166534; }

/* ── Connections ────────────────────────────────────────────────────────────── */
.connection-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--color-border); cursor: pointer; }
.connection-row:hover { background: var(--color-bg); }
.connection-row__info { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: .85rem; color: var(--color-text-muted); }
.connection-row__info strong { color: var(--color-text); font-size: .95rem; }

/* ── Aftercare ──────────────────────────────────────────────────────────────── */
.aftercare-list { padding: 0 16px 16px; }
.aftercare-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--color-border); cursor: pointer; }
.aftercare-row__check { margin-left: auto; font-size: 1.4rem; color: var(--color-text-muted); }
.aftercare-row--selected .aftercare-row__check { color: var(--color-primary); }

/* ── Attendance / success ───────────────────────────────────────────────────── */
.attendance-prompt, .success-state {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; padding: 32px 24px; text-align: center;
}
.attendance-prompt__icon, .success-state__icon { font-size: 3.5rem; }
.attendance-prompt h2, .success-state h2 { font-size: 1.4rem; font-weight: 800; }
.attendance-prompt p,  .success-state p  { color: var(--color-text-muted); max-width: 360px; }
.attendance-prompt__actions { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 400px; }

/* Verified result screens: gradient tick on success, neutral cross on failure */
.success-state--ok .success-state__icon,
.success-state--error .success-state__icon {
  width: 84px; height: 84px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 2.6rem; color: #fff;
  background: linear-gradient(135deg, #C13383, #443199);
}
.success-state--error .success-state__icon {
  background: var(--color-bg, #efe9fb); color: var(--color-text-muted, #888);
}

/* ── Spinner & empty state ──────────────────────────────────────────────────── */
.spinner-wrap { display: flex; justify-content: center; padding: 48px; }
.spinner {
  width: 36px; height: 36px; border: 3px solid var(--color-border);
  border-top-color: var(--color-primary); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { padding: 48px 24px; text-align: center; color: var(--color-text-muted); font-size: .95rem; }
.empty-state__headline { font-size: 1.1rem; font-weight: 600; color: var(--color-text); margin-bottom: 8px; }
.empty-state__subline { font-size: .9rem; color: var(--color-text-muted); margin: 0; }
.empty-state__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }

/* ── Create-Sidequest bottom sheet / modal ──────────────────────────────────── */
@keyframes sheet-up {
  from { transform: translateY(60%); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}
.csq-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-end;
  animation: fade-in .2s ease;
}
.csq-sheet {
  background: var(--color-surface);
  width: 100%;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden; /* clips scrollbar to rounded corners */
  animation: sheet-up .28s cubic-bezier(.32,1,.45,1);
}
.csq-inner {
  max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.csq-handle {
  width: 36px; height: 4px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  margin: 12px auto 4px;
  flex-shrink: 0;
}
.csq-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--color-border);
  position: sticky; top: 0;
  background: var(--color-surface);
  z-index: 1;
}
.csq-header__title { font-size: 1.05rem; font-weight: 700; margin: 0; }
.csq-close {
  width: 30px; height: 30px;
  border-radius: var(--radius-full);
  background: var(--color-bg);
  border: none; cursor: pointer;
  font-size: .8rem;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted);
  flex-shrink: 0;
  transition: background .15s;
}
.csq-close:hover { background: var(--color-border); }
.csq-body { padding: 20px 20px 32px; }
@media (min-width: 768px) {
  .csq-overlay { align-items: center; justify-content: center; padding: 40px 24px; }
  .csq-sheet {
    max-width: 560px; width: 100%;
    border-radius: var(--radius-lg);
    animation: slide-up .22s ease;
  }
  .csq-inner { max-height: 88dvh; }
  .csq-handle { display: none; }
  .csq-body { padding: 24px 28px 36px; }
}

/* ── Modal dialog ───────────────────────────────────────────────────────────── */
@keyframes fade-in  { from { opacity: 0; }                    to { opacity: 1; } }
@keyframes slide-up { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.50);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fade-in .15s ease;
}
.modal-dialog {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 24px 24px 20px;
  max-width: 320px; width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  animation: slide-up .2s ease;
}
.modal-dialog__title {
  font-size: 1.05rem; font-weight: 700;
  margin: 0 0 8px;
}
.modal-dialog__body {
  font-size: .9rem; color: var(--color-text-muted);
  line-height: 1.5; margin: 0 0 20px;
}
.modal-dialog__actions {
  display: flex; flex-direction: column; gap: 10px;
}

/* ── Toast ──────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: calc(var(--nav-height) + 16px); left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-secondary); color: #fff;
  padding: 12px 20px; border-radius: var(--radius-md);
  font-size: .9rem; font-weight: 500; box-shadow: var(--shadow-md);
  z-index: 999; opacity: 0; transition: opacity .25s, transform .25s;
  white-space: nowrap; max-width: 90vw;
}
.toast--visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast--success { background: var(--color-success); }
.toast--error   { background: var(--color-error); }
.toast--warning { background: var(--color-warning); color: var(--color-text); }

/* ════════════════════════════════════════════════════════════════════════════
   DESKTOP  ≥ 768px
   ════════════════════════════════════════════════════════════════════════════ */
@media (min-width: 768px) {

  /* ── Sidebar nav ── */
  #bottom-nav {
    position: fixed;
    left: 0; top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-top: none;
    border-right: 1px solid var(--color-border);
    padding: 80px 0 20px;
    gap: 4px;
    overflow-y: auto;
  }
  #bottom-nav::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 64px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
  }
  /* App name in sidebar */
  #sidebar-brand {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 64px;
    display: flex; align-items: center; gap: 10px;
    padding: 0 20px;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    z-index: 101;
    font-size: 1.1rem; font-weight: 800; color: var(--color-text);
    text-decoration: none;
  }
  #sidebar-brand img { width: 32px; height: 32px; }

  .nav-item {
    flex-direction: row;
    justify-content: flex-start;
    padding: 12px 20px;
    font-size: .95rem;
    border-radius: var(--radius-md);
    margin: 0 8px;
  }
  .nav-item__icon { width: 20px; height: 20px; }
  .nav-item--active { background: var(--color-primary-light); color: var(--color-primary); }

  /* ── App shell ── */
  #app {
    margin-left: var(--sidebar-width);
    padding-bottom: 0;
    min-height: 100vh;
  }
  #app.no-sidebar {
    margin-left: 0;
  }

  /* ── Page header ── */
  .page__header { padding: 18px 32px; }
  .page__header h2 { font-size: 1.3rem; }

  /* ── Content wrapper (centers content on wide screens) ── */
  /* NB: .page--detail is intentionally NOT here — like the profile page it fills
     the full #app width with its grey background and centers its own inner
     .detail__wrap column. Capping the page itself would expose the white #app
     at the sides on wide / zoomed-out viewports. */
  .page--feed,
  .page--list,
  .page--profile {
    max-width: 1200px;
    margin: 0 auto;
  }

  /* ── Feed grid ── */
  .filter-bar { padding: 12px 32px; gap: 8px; }
  .feed-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 24px 32px 40px;
  }

  /* ── Forms: center and constrain width ── */
  .page--form {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 24px;
    min-height: 100vh;
  }
  /* Header + form = one unified card on desktop */
  .page--form .page__header {
    width: 100%;
    max-width: 600px;
    position: relative;
    top: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-sm);
    padding: 14px 24px;
  }
  .page--form .form {
    width: 100%;
    max-width: 600px;
    background: var(--color-surface);
    padding: 28px 32px 36px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    border-top: none;
    margin-top: -1px; /* collapse the seam between header and body */
  }

  /* ── Welcome: split screen ── */
  .page--welcome {
    flex-direction: row;
    padding: 0;
    min-height: 100vh;
  }
  .welcome__hero {
    flex: 1;
    padding: 60px 48px;
    background: var(--color-secondary);
    justify-content: center;
    align-items: flex-start;
  }
  .welcome__tagline { text-align: left; }
  .welcome__actions {
    flex: 0 0 460px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 48px;
    background: var(--color-surface);
    gap: 14px;
  }
  .lang-switcher { justify-content: flex-start; }

  /* ── Auth: centered card ── */
  .page--auth {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 24px;
    background: var(--color-bg);
  }
  .auth__header { width: 100%; max-width: 480px; }
  .page--auth .form {
    width: 100%;
    max-width: 480px;
    background: var(--color-surface);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
  }
  .page--auth .auth__switch { width: 100%; max-width: 480px; }

  /* ── Detail page ── */
  /* The .detail__wrap column (max-width 620px) already centers the page like the
     profile, so only the hero height grows a touch on larger screens. */
  .detail__hero { height: 260px; }
  .detail__cta { flex-direction: row; flex-wrap: wrap; }

  /* ── Profile ── */
  .page--profile { max-width: 800px; margin: 0 auto; }
  .profile__hero { padding: 32px; gap: 24px; }
  .profile__info h3 { font-size: 1.4rem; }

  /* ── Host review & list pages ── */
  .applicant-card { margin: 12px 32px; }
  .quest-row, .connection-row { padding: 16px 32px; }

  /* ── Chat ── */
  .page--chat { max-width: 800px; margin: 0 auto; }
  .chat__input-bar {
    left: var(--sidebar-width);
    max-width: calc(800px + var(--sidebar-width));
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
  }

  /* ── FAB ── */
  .fab { bottom: 72px; right: 32px; }

  /* ── Legal footer (desktop: hidden — links rendered inside sidebar via JS) ── */
  #legal-footer { display: none !important; }

  /* ── Sidebar legal links (desktop only, injected by renderNav) ── */
  .sidebar-legal {
    margin: 0 8px;
    margin-top: auto;
    padding: 10px 12px;
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .sidebar-legal a,
  .sidebar-legal button {
    font-size: .72rem;
    color: var(--color-text-muted);
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
  }
  .sidebar-legal a:hover,
  .sidebar-legal button:hover { color: var(--color-primary); }

  /* ── Toast ── */
  .toast { bottom: 32px; }

  /* ── Centered pages (attendance/aftercare/pending) ── */
  .page--centered { min-height: 80vh; }
  .attendance-prompt, .success-state { padding: 48px; }
}

/* ════════════════════════════════════════════════════════════════════════════
   WIDE  ≥ 1200px
   ════════════════════════════════════════════════════════════════════════════ */
@media (min-width: 1200px) {
  .feed-list { grid-template-columns: repeat(3, 1fr); }
}

/* ════════════════════════════════════════════════════════════════════════════
   LANDING PAGE
   ════════════════════════════════════════════════════════════════════════════ */

.landing {
  width: 100%;
  overflow-x: hidden;
  font-family: 'Nunito', sans-serif;
}

/* ── Nav (glassmorphism — transparent over hero gradient) ── */
.landing-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 64px;
  background: rgba(0,0,0,.15);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.landing-nav__brand {
  display: flex; align-items: center; gap: 10px;
  color: #ffffff;
  font-family: 'Gajraj One', serif;
  font-size: 1.25rem;
}
.landing-nav__brand img { width: 32px; height: 32px; }
.landing-nav__actions { display: flex; align-items: center; gap: 10px; }
.landing-nav__lang { margin-right: 8px; margin-top: 0; display: flex; }
.landing-nav__brand span { display: none; }
.landing-nav__lang .lang-btn {
  color: rgba(255,255,255,.6);
  display: inline-flex; align-items: center;
  padding: 4px 2px; line-height: 1;
}
.landing-nav__lang .lang-btn--active { color: #ffffff; font-weight: 700; }
.landing-nav__lang > span { color: rgba(255,255,255,.3); line-height: 1; }

/* Landing-scoped button overrides (hero gradient context) */
.landing .btn--primary {
  background: #ffffff; color: #443199;
  font-family: 'Nunito', sans-serif; font-weight: 700;
}
.landing .btn--primary:hover { background: #f0ecff; color: #443199; }
.landing .btn--ghost {
  border-color: rgba(255,255,255,.4); color: #ffffff;
  font-family: 'Nunito', sans-serif;
}
.landing .btn--ghost:hover { border-color: rgba(255,255,255,.7); }
.btn--lp-outline {
  border: 2px solid rgba(255,255,255,.4); color: #ffffff; background: transparent;
  font-family: 'Nunito', sans-serif; font-weight: 600;
}
.btn--lp-outline:hover { border-color: rgba(255,255,255,.75); background: rgba(255,255,255,.08); }
.btn--ghost-white { border: 2px solid rgba(255,255,255,.3); color: rgba(255,255,255,.85); }
.btn--ghost-white:hover { border-color: rgba(255,255,255,.6); }

/* ── Hero ── */
.landing-hero {
  min-height: 100vh;
  background: linear-gradient(145deg, #C13383 0%, #792CA2 60%, #443199 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 100px 24px 60px;
  gap: 48px;
}
.landing-hero__inner {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 20px; max-width: 640px;
}
.landing-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.18); color: #ffffff;
  border: 1px solid rgba(255,255,255,.3);
  padding: 6px 16px; border-radius: var(--radius-full);
  font-family: 'Nunito', sans-serif;
  font-size: .85rem; font-weight: 700; letter-spacing: .01em;
}
.landing-hero__headline {
  font-family: 'Gajraj One', serif;
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 400;
  color: #ffffff;
  line-height: 1.1; letter-spacing: -.01em;
}
.landing-hero__tagline { display: none; }
.landing-hero__sub {
  font-size: 1.05rem; color: rgba(255,255,255,.82);
  line-height: 1.65; max-width: 500px;
  font-family: 'Nunito', sans-serif;
}
.landing-hero__cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.landing-btn-lg {
  padding: 15px 32px; font-size: 1rem; font-weight: 700;
  border-radius: var(--radius-full);
  font-family: 'Nunito', sans-serif;
}
.landing-trust-items {
  display: flex; flex-wrap: wrap; gap: 10px 20px;
  justify-content: center; margin-top: 4px;
}
.landing-trust-items span {
  font-size: .82rem; color: rgba(255,255,255,.7);
  display: flex; align-items: center; gap: 5px;
  font-family: 'Nunito', sans-serif;
}

/* ── Hero mockup cards ── */
.landing-hero__visual { width: 100%; max-width: 480px; }
.hero-mockup { position: relative; }
.hero-mockup__card {
  background: #ffffff; border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 0 8px 40px rgba(0,0,0,.25), 0 2px 8px rgba(0,0,0,.1);
  border: 1px solid rgba(255,255,255,.4);
}
.hero-mockup__card--offset {
  margin-top: -20px; margin-left: 32px;
  background: #F5F0FF;
  border-color: rgba(255,255,255,.6);
  box-shadow: 0 8px 40px rgba(68,49,153,.25);
}
.hero-mockup__card--offset .hero-mockup__title { color: #1A1D2E; }
.hero-mockup__card--offset .hero-mockup__meta  { color: rgba(26,29,46,.55); }
.hero-mockup__chip {
  display: inline-flex; padding: 4px 12px; border-radius: var(--radius-full);
  background: rgba(193,51,131,.12); color: #792CA2;
  font-family: 'Nunito', sans-serif;
  font-size: .78rem; font-weight: 700; margin-bottom: 10px;
}
.hero-mockup__card--offset .hero-mockup__chip { background: rgba(68,49,153,.1); color: #443199; }
.hero-mockup__title { font-weight: 700; font-size: .95rem; margin-bottom: 8px; color: #1A1D2E; font-family: 'Nunito', sans-serif; }
.hero-mockup__meta  { font-size: .8rem; color: rgba(26,29,46,.5); margin-bottom: 12px; font-family: 'Nunito', sans-serif; }
.hero-mockup__host  { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: rgba(26,29,46,.5); font-family: 'Nunito', sans-serif; }
.hero-mockup__avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #C13383, #792CA2); color: #ffffff;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700;
  font-family: 'Nunito', sans-serif;
}

/* ── Sections ── */
.landing-section { padding: 80px 24px; }
.landing-section--light { background: #ffffff; }
.landing-section--white { background: #ffffff; }
.landing-section + .landing-section { border-top: 1px solid #f0edf8; }
.landing-section__inner { max-width: 1100px; margin: 0 auto; }
.landing-section__title {
  font-family: 'Gajraj One', serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 400; text-align: center; margin-bottom: 10px;
  color: #443199; letter-spacing: -.01em;
}
.landing-section__sub {
  text-align: center; color: rgba(26,29,46,.6);
  font-size: 1rem; margin-bottom: 48px;
  max-width: 560px; margin-left: auto; margin-right: auto;
  line-height: 1.65;
  font-family: 'Nunito', sans-serif;
}

/* ── Activity cards ── */
.activity-cards {
  display: flex; gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
  padding-left: 2px; padding-right: 2px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(193,51,131,.35) transparent;
}
.activity-cards::-webkit-scrollbar { height: 4px; }
.activity-cards::-webkit-scrollbar-track { background: transparent; }
.activity-cards::-webkit-scrollbar-thumb { background: rgba(193,51,131,.35); border-radius: 9999px; }

.activity-card {
  flex: 0 0 260px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(68,49,153,.12);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(68,49,153,.08);
  cursor: pointer;
  transition: box-shadow .15s, transform .15s;
  display: flex; flex-direction: column;
  scroll-snap-align: start;
}
.activity-card:hover { box-shadow: 0 8px 28px rgba(68,49,153,.18); transform: translateY(-3px); }

.activity-card__img {
  height: 170px;
  background-size: cover; background-position: center;
  background-color: #F5F0FF;
  position: relative;
  display: flex; align-items: flex-end; padding: 10px;
}
.activity-card__img::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,.4) 100%);
  pointer-events: none;
}
.activity-card__chip {
  position: relative; z-index: 1;
  background: rgba(0,0,0,.4) !important;
  color: #fff !important;
  border-color: transparent !important;
  backdrop-filter: blur(6px);
  font-size: .75rem;
  font-family: 'Nunito', sans-serif;
}
.activity-card__body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.activity-card__body h3 {
  font-size: .92rem; font-weight: 700;
  line-height: 1.35; margin-bottom: 6px; color: #1A1D2E;
  font-family: 'Nunito', sans-serif;
}
.activity-card__meta {
  font-size: .78rem; color: rgba(26,29,46,.55);
  margin-bottom: 12px; line-height: 1.4; flex: 1;
  font-family: 'Nunito', sans-serif;
}
.activity-card__cta { width: 100%; margin-top: auto; }
/* Activity card CTA override — pink on white */
.activity-card .btn--primary { background: #C13383; color: #ffffff; }
.activity-card .btn--primary:hover { background: #a82c72; color: #ffffff; }

/* ── How it works steps ── */
.landing-steps {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.landing-step {
  background: #ffffff; border-radius: var(--radius-lg);
  padding: 28px; border: 1px solid rgba(68,49,153,.12);
  text-align: center; width: 100%; max-width: 320px;
  position: relative;
  box-shadow: 0 2px 8px rgba(68,49,153,.07);
}
.landing-step__icon { font-size: 2.5rem; margin-bottom: 8px; }
.landing-step__num {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #C13383, #792CA2); color: #ffffff;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700;
  font-family: 'Nunito', sans-serif;
  box-shadow: 0 2px 8px rgba(193,51,131,.4);
}
.landing-step h3 {
  font-size: 1rem; font-weight: 700; margin-bottom: 8px;
  color: #443199; font-family: 'Nunito', sans-serif;
}
.landing-step p  { font-size: .88rem; color: rgba(26,29,46,.6); line-height: 1.5; font-family: 'Nunito', sans-serif; }
.landing-step__arrow { font-size: 1.5rem; color: #C13383; transform: rotate(90deg); }

/* ── CTA section ── */
.landing-cta-section {
  background: linear-gradient(135deg, #443199 0%, #792CA2 100%);
  padding: 80px 24px;
}
.landing-cta-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; text-align: center; max-width: 600px; margin: 0 auto;
}
.landing-cta-inner h2 {
  font-family: 'Gajraj One', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 400; color: #ffffff; letter-spacing: -.01em;
}
.landing-cta-inner p { color: rgba(255,255,255,.75); font-size: 1rem; max-width: 440px; line-height: 1.6; font-family: 'Nunito', sans-serif; }
.landing-btn-dark {
  background: #C13383; color: #ffffff;
  font-weight: 700; border-radius: var(--radius-full);
  font-family: 'Nunito', sans-serif;
  padding: 15px 36px; font-size: 1rem;
  box-shadow: 0 4px 20px rgba(193,51,131,.4);
}
.landing-btn-dark:hover { background: #a82c72; color: #ffffff; }
/* kept for backwards compat */
.landing-btn-white { background: #443199; color: #fff; font-weight: 700; border-radius: var(--radius-full); }
.landing-btn-white:hover { background: #5a45b5; }

/* ── Footer ── */
.landing-footer {
  background: #ffffff; padding: 28px 24px 80px;
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; color: rgba(26,29,46,.45); font-size: .85rem;
  border-top: 1px solid #e5e7eb;
  font-family: 'Nunito', sans-serif;
}
.landing-footer .lang-btn        { color: rgba(26,29,46,.45); }
.landing-footer .lang-btn--active { color: #443199; font-weight: 700; }
.landing-footer__legal {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 6px 20px;
}
.landing-footer__legal a { color: rgba(26,29,46,.45); font-size: .8rem; text-decoration: none; }
.landing-footer__legal a:hover { color: #443199; }

/* ── Register consent text ── */
.form-legal-consent {
  font-size: .78rem; color: var(--color-text-muted);
  text-align: center; line-height: 1.5; margin-bottom: 4px;
}
.form-legal-consent a {
  color: var(--color-primary); text-decoration: underline; text-underline-offset: 2px;
}

/* ── Landing desktop ── */
@media (min-width: 768px) {
  .landing-nav { padding: 0 48px; }
  .landing-nav__brand span { display: inline; }

  .landing-hero {
    flex-direction: row; text-align: left;
    padding: 100px 64px 80px; gap: 64px;
    justify-content: center; align-items: center;
  }
  .landing-hero__inner { align-items: flex-start; text-align: left; flex: 1; }
  .landing-hero__cta   { justify-content: flex-start; }
  .landing-trust-items { justify-content: flex-start; }
  .landing-hero__visual { flex: 0 0 380px; }

  .landing-steps { flex-direction: row; align-items: flex-start; justify-content: center; gap: 0; }
  .landing-step  { flex: 1; max-width: 280px; }
  .landing-step__arrow { transform: rotate(0deg); margin-top: 60px; flex-shrink: 0; }

  .landing-footer { padding: 20px 48px; flex-direction: row; justify-content: space-between; }

  .activity-card { flex: 0 0 300px; }
  .activity-card__img { height: 200px; }
}

@media (min-width: 1200px) {
  .landing-hero { padding: 120px 80px 100px; gap: 80px; }
  .landing-hero__visual { flex: 0 0 460px; }
  .landing-section { padding: 100px 48px; }
}

/* ── Cookie consent banner & modal ─────────────────────────────────────────── */
#csq-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--color-secondary);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  z-index: 9999;
  font-size: .85rem;
  box-shadow: 0 -4px 20px rgba(0,0,0,.2);
}
.csq-banner__text { flex: 1; min-width: 200px; line-height: 1.5; }
.csq-banner__text a { color: #C13383; text-underline-offset: 2px; }
.csq-banner__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.csq-btn {
  padding: 8px 16px; border-radius: 8px; font-size: .83rem;
  font-weight: 600; cursor: pointer; border: none; font-family: inherit;
  white-space: nowrap; transition: opacity .15s;
}
.csq-btn:hover { opacity: .88; }
.csq-btn--primary   { background: #C13383; color: #fff; }
.csq-btn--secondary { background: #4B5563; color: #fff; }
.csq-btn--outline   { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.4); }

#csq-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 10000;
  padding: 16px;
}
.csq-modal__box {
  background: var(--color-surface);
  border-radius: 16px 16px 0 0;
  padding: 28px 24px 32px;
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
}
.csq-modal__box h3 {
  font-size: 1.1rem; font-weight: 700; margin-bottom: 20px;
  color: var(--color-text);
}
.csq-toggle-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--color-border);
}
.csq-toggle-row:last-of-type { border-bottom: none; }
.csq-toggle-row strong { display: block; font-size: .9rem; margin-bottom: 4px; }
.csq-toggle-row p { font-size: .82rem; color: var(--color-text-muted); line-height: 1.4; margin: 0; }
.csq-toggle {
  width: 36px; height: 20px; accent-color: #C13383;
  flex-shrink: 0; margin-top: 2px; cursor: pointer;
}
.csq-modal__actions {
  display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end;
}
.csq-modal__actions .csq-btn--secondary { background: #C13383; }
.csq-modal__actions .csq-btn--primary   { background: var(--color-secondary); }

/* ── Legal footer (injected into SPA) ──────────────────────────────────────── */
#legal-footer {
  position: fixed;
  bottom: var(--nav-height);
  left: 0; right: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 16px;
  z-index: 90;
  font-size: .72rem;
  color: var(--color-text-muted);
}
#legal-footer a {
  color: var(--color-text-muted);
  text-decoration: none;
}
#legal-footer a:hover { color: var(--color-primary); text-decoration: underline; }
#legal-footer #cookie-settings-btn {
  color: var(--color-text-muted);
  font-size: .72rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
#legal-footer #cookie-settings-btn:hover { color: var(--color-primary); }

/* ── Flatpickr brand theme ───────────────────────────────────────────────────── */
.flatpickr-calendar { font-family: var(--font-body, 'Nunito', sans-serif); border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,.12); }
.flatpickr-day.selected, .flatpickr-day.selected:hover,
.flatpickr-day.startRange, .flatpickr-day.endRange { background: #C13383; border-color: #C13383; }
.flatpickr-day:hover, .flatpickr-day:focus { background: #f5f0ff; border-color: #f5f0ff; }
.flatpickr-day.today { border-color: #C13383; }
.flatpickr-day.today:hover { background: #f5f0ff; }
.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg { fill: #C13383; }
.flatpickr-time input:hover, .flatpickr-time input:focus,
.flatpickr-time .flatpickr-am-pm:hover, .flatpickr-time .flatpickr-am-pm:focus { background: #f5f0ff; }
.flatpickr-calendar.hasTime .flatpickr-time { border-top: 1px solid #e8e0f5; }

/* Hide reCAPTCHA badge — disclosure text shown in footer instead (Google ToS compliant) */
.grecaptcha-badge { visibility: hidden !important; }
.legal-footer__recaptcha {
  display: block;
  margin-top: 6px;
  font-size: .68rem;
  color: var(--color-text-muted);
}
.legal-footer__recaptcha a { color: var(--color-text-muted); text-decoration: underline; }

/* Hide legal footer on mobile when bottom-nav is hidden (auth/onboarding pages) */
@media (max-width: 767px) {
  #bottom-nav.hidden ~ #legal-footer { display: none; }
  body:not(:has(#bottom-nav:not(.hidden))) #legal-footer { display: none; }
}

/* ── Admin panel ─────────────────────────────────────────────────────────────── */
.page--admin { padding: 0; }
.page--admin .page__header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.adm-back { color: var(--color-primary); font-size: .9rem; background: none; border: none; cursor: pointer; }
.adm-back:hover { text-decoration: underline; }

.adm-content { padding: 16px; max-width: 960px; margin: 0 auto; }

/* Login box */
.admin-login { display: flex; justify-content: center; padding: 60px 16px; }
.admin-login__box {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 32px 28px;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.admin-login__box h2 { font-size: 1.3rem; }
.admin-login__hint { font-size: .85rem; color: var(--color-text-muted); }
.admin-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  outline: none;
}
.admin-input:focus { border-color: var(--color-primary); }

/* Buttons */
.adm-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: .85rem; font-weight: 600; cursor: pointer;
  border: 1.5px solid transparent; transition: opacity .15s;
  white-space: nowrap;
}
.adm-btn:disabled { opacity: .5; cursor: default; }
.adm-btn--primary  { background: var(--color-primary);  color: #fff; border-color: var(--color-primary); }
.adm-btn--primary:hover:not(:disabled)  { background: var(--color-primary-dark); border-color: var(--color-primary-dark); }
.adm-btn--outline  { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.adm-btn--outline:hover:not(:disabled)  { background: var(--color-primary-light); }
.adm-btn--danger   { background: var(--color-error);    color: #fff; border-color: var(--color-error); }
.adm-btn--danger:hover:not(:disabled)   { opacity: .85; }
.adm-btn--ghost    { background: transparent; color: var(--color-text-muted); border-color: var(--color-border); }
.adm-btn--ghost:hover:not(:disabled)    { background: var(--color-bg); }
.adm-btn--sm       { padding: 5px 10px; font-size: .78rem; }

/* Panel */
.adm-panel { display: flex; flex-direction: column; gap: 16px; }
.adm-panel__header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}
.adm-panel__title h2 { font-size: 1.2rem; margin-bottom: 6px; }
.adm-panel__actions  { display: flex; flex-wrap: wrap; gap: 8px; }
.adm-status-row      { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.adm-dir             { font-size: .75rem; color: var(--color-text-muted); font-family: monospace; }

/* Badges */
.adm-badge { display: inline-block; padding: 2px 8px; border-radius: var(--radius-full); font-size: .75rem; font-weight: 600; }
.adm-badge--ok   { background: #d1fae5; color: #065f46; }
.adm-badge--warn { background: #fef3c7; color: #92400e; }
.adm-badge--err  { background: #fee2e2; color: #991b1b; }

/* Message bar */
.adm-msg { padding: 10px 14px; border-radius: var(--radius-sm); font-size: .875rem; }
.adm-msg.hidden    { display: none; }
.adm-msg--ok       { background: #d1fae5; color: #065f46; }
.adm-msg--info     { background: #dbeafe; color: #1e40af; }
.adm-msg--error    { background: #fee2e2; color: #991b1b; }
.adm-error         { color: var(--color-error); font-size: .85rem; }
.adm-error.hidden  { display: none; }
.adm-error-msg     { background: #fee2e2; color: #991b1b; padding: 12px; border-radius: var(--radius-sm); }

/* Table */
.adm-table-wrap { overflow-x: auto; background: var(--color-surface); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.adm-table      { width: 100%; border-collapse: collapse; }
.adm-th         { text-align: left; padding: 10px 14px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--color-text-muted); border-bottom: 1.5px solid var(--color-border); }
.adm-td         { padding: 10px 14px; font-size: .875rem; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.adm-row:last-child .adm-td { border-bottom: none; }
.adm-td--name   { font-family: monospace; font-size: .8rem; max-width: 240px; word-break: break-all; }
.adm-td--actions { white-space: nowrap; }
.adm-td--result  { min-width: 200px; }
.adm-td--empty   { text-align: center; color: var(--color-text-muted); padding: 28px; }
.adm-backup-name { display: block; }

/* Checks */
.adm-checks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.adm-check  { font-size: .78rem; color: var(--color-text-muted); }

.adm-count { font-size: .8rem; color: var(--color-text-muted); text-align: right; }

/* Log panel */
.adm-log-panel {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.adm-log-panel.hidden { display: none; }
.adm-log-panel__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--color-border);
}
.adm-log-pre {
  background: #1e1e2e;
  color: #cdd6f4;
  font-size: .75rem;
  font-family: 'Courier New', monospace;
  padding: 12px 14px;
  max-height: 360px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}

/* Spinners */
.adm-spinner        { padding: 40px; text-align: center; color: var(--color-text-muted); }
.adm-spinner-inline { font-size: .8rem; color: var(--color-text-muted); font-style: italic; }

/* Email / SMTP panel */
.adm-mail-panel { background: var(--color-surface); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); overflow: hidden; }
.adm-mail-panel.hidden { display: none; }
.adm-mail__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--color-border);
}
.adm-mail__header h3 { margin: 0; font-size: 1rem; }
.adm-mail__status { padding: 16px 20px; display: flex; flex-direction: column; gap: 6px; }
.adm-mail__status .adm-badge { align-self: flex-start; margin-bottom: 6px; }
.adm-mail-row { display: flex; justify-content: space-between; gap: 16px; font-size: .85rem; padding: 4px 0; border-bottom: 1px dashed var(--color-border); }
.adm-mail-key { color: var(--color-text-muted); }
.adm-mail-val { font-family: 'Courier New', monospace; word-break: break-all; text-align: right; }
.adm-mail__test { padding: 16px 20px; border-top: 1px solid var(--color-border); }
.adm-mail__test-row { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.adm-mail__test-row .admin-input { flex: 1; min-width: 180px; }
.adm-mail__result { margin: 10px 0 0; font-size: .85rem; }
.adm-mail__result.hidden { display: none; }
.adm-mail__result--ok  { color: #047857; }
.adm-mail__result--err { color: #DC2626; }
.adm-mail__hint { margin: 10px 0 0; font-size: .75rem; color: var(--color-text-muted); }

/* MFA setup panel */
.adm-mfa-panel { background: var(--color-surface); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); overflow: hidden; }
.adm-mfa-panel.hidden { display: none; }

.adm-mfa-setup {}
.adm-mfa-setup__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--color-border);
}
.adm-mfa-setup__header h3 { font-size: 1rem; margin: 0; }

.adm-mfa-setup__body {
  display: flex; flex-wrap: wrap; gap: 28px; padding: 24px 20px;
}
.adm-mfa-qr-col     { flex: 0 0 auto; display: flex; flex-direction: column; gap: 12px; }
.adm-mfa-confirm-col { flex: 1 1 260px; display: flex; flex-direction: column; gap: 10px; }

.adm-mfa-qr {
  width: 200px; height: 200px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.adm-mfa-step { font-size: .9rem; }
.adm-mfa-hint { font-size: .8rem; color: var(--color-text-muted); }

.adm-mfa-manual { font-size: .82rem; color: var(--color-text-muted); cursor: pointer; }
.adm-mfa-manual summary { padding: 4px 0; }
.adm-mfa-secret {
  display: block; margin-top: 6px; padding: 8px 12px;
  background: var(--color-bg); border-radius: var(--radius-sm);
  font-family: monospace; font-size: .85rem; word-break: break-all;
  user-select: all;
}

.adm-mfa-success {
  background: #d1fae5; border-radius: var(--radius-sm);
  padding: 14px; display: flex; flex-direction: column; gap: 8px; font-size: .875rem;
}
.adm-mfa-success.hidden { display: none; }
.adm-mfa-env-line {
  display: flex; align-items: center; gap: 8px;
  background: #1e1e2e; border-radius: var(--radius-sm); padding: 8px 12px;
}
.adm-mfa-env-line code {
  color: #a6e3a1; font-family: monospace; font-size: .85rem;
  word-break: break-all; flex: 1;
}
.adm-mfa-cmd {
  background: #1e1e2e; color: #cdd6f4;
  font-family: monospace; font-size: .8rem;
  padding: 8px 12px; border-radius: var(--radius-sm);
  margin: 0;
}

/* TOTP input — wider, centered digits */
.admin-input--totp {
  letter-spacing: .25em; font-size: 1.2rem; text-align: center; width: 160px;
}

/* TOTP overlay (prompt re-entering code for actions) */
.adm-totp-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.adm-totp-box {
  background: var(--color-surface); border-radius: var(--radius-md);
  padding: 28px 24px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--shadow-md); min-width: 280px;
}
.adm-totp-box h3 { font-size: 1rem; margin: 0; }

/* Label */
.adm-label { font-size: .82rem; font-weight: 600; color: var(--color-text-muted); }

/* ── Accessibility: skip-to-content link (WCAG 2.4.1 Bypass Blocks) ──────────── */
/* Visually hidden until it receives keyboard focus, then slides in as the first
   tab stop so keyboard users can jump past the landing nav to the hero. Wired in
   app.js with preventDefault so it never touches the hash router. */
.skip-link {
  position: fixed;
  top: -64px; left: 8px;
  z-index: 1000;
  padding: 10px 18px;
  background: var(--color-primary); color: #fff;
  font-weight: 700; font-size: .9rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: top .15s ease;
}
.skip-link:focus { top: 8px; }
/* The skip target is a layout section, not a control — focusing it for the jump
   shouldn't draw a full-width ring; the next Tab lands a normal ring on the CTA. */
#main-content:focus { outline: none; }

/* ── Back-to-top button (landing page) ──────────────────────────────────────── */
/* Floating, fixed to the viewport. Hidden (and out of tab order via visibility)
   until the page is scrolled down; wired in auth.js. */
.back-to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 200;
  width: 48px; height: 48px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  background: var(--color-primary); color: #fff;
  box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s, background .15s;
}
.back-to-top:hover { background: var(--color-primary-dark); }
.back-to-top--visible { opacity: 1; visibility: visible; transform: none; }

/* ── Accessibility: visible keyboard focus (WCAG 2.4.7) ─────────────────────── */
/* Placed at end of file so it wins source-order over earlier `outline:none`
   rules. `:focus-visible` only fires for keyboard/programmatic focus, so mouse
   clicks stay ring-free. */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
/* Text inputs read better with the ring hugging the field */
.form-input:focus-visible,
.admin-input:focus-visible,
.ob-input:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}
/* Pill/chip/round controls: keep the ring tight to the rounded edge */
.chip:focus-visible,
.ob-chip:focus-visible,
.nav-item:focus-visible,
.fab:focus-visible,
.btn:focus-visible {
  outline-offset: 3px;
}
/* Older engines without :focus-visible support fall back to a visible :focus
   ring rather than nothing. Modern engines ignore this via the :not() guard. */
@supports not selector(:focus-visible) {
  a:focus, button:focus, input:focus, textarea:focus, select:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
  }
}

/* ── Accessibility: respect reduced-motion preference ───────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

