/* ==========================================================================
   CoDevMate design system — tokens and components from the design board.
   Dark by default; light follows the system setting, and data-theme on <html> overrides either way.
   Mobile first; desktop layout from 768px.
   ========================================================================== */

:root {
  color-scheme: dark;

  --bg: #0b1120;
  --bg-raised: #0e1526;
  --surface: #131c2e;
  --surface-2: #1c2740;
  --border: #263149;
  --border-strong: #334063;
  --line: #1f2a42;

  --text: #e8edf5;
  --text-2: #cbd5e1;
  --muted: #9aa7bd;
  --faint: #7c8aa3;
  --placeholder: #6b7891;

  --logo: #f0531f;
  --accent: #f0531f;
  --accent-hover: #ff6a3d;
  --accent-2: #ff7a4d;
  --accent-text: #ff8a5c;
  --accent-text-hover: #ffae8a;
  --accent-soft: #3d1e12;
  --accent-softer: #2a160e;
  --badge: #ff7a4d;
  --badge-text: #0b1120;
  --online: #34d399;

  --danger-bg: #3a1620;
  --danger: #fecdd3;
  --danger-strong: #fda4af;
  --success-bg: #123a2c;
  --success: #a7f3d0;

  /* Text on selected/soft-accent surfaces, tags and chrome materials */
  --on-accent: #0b1120;
  --selected-text: #fff;
  --accent-strong-text: #ffc4ab;
  --tag-blue-bg: #172a46;  --tag-blue: #bfdbfe;
  --tag-amber-bg: #3a2a10; --tag-amber: #fde68a;
  --tag-pink-bg: #3a1a33;  --tag-pink: #fbcfe8;
  --notif-request: #ffae8a;
  --notif-accepted: #6ee7b7;
  --dot-blue: #60a5fa;
  --dot-amber: #fbbf24;
  --code-string: #86efac;
  --danger-border: #7f1d2d;
  --error-border: #be123c;
  --focus-ring: rgba(255, 122, 77, .25);
  --chrome: rgba(11, 17, 32, .72);
  --chrome-tab: rgba(14, 21, 38, .72);
  --floating: rgba(28, 39, 64, .8);
  --thread-bg: #0f1729;
  --notif-new: #1d130f;
  --scrim: rgba(2, 6, 16, .6);
  --shadow: rgba(0, 0, 0, .4);
  --shadow-strong: rgba(0, 0, 0, .6);
  --google-border: transparent;

  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Lato', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, monospace;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-xl: 22px;
  --pill: 999px;

  --header-h: 64px;
  --tabbar-h: 68px;
}

/* Light theme: once for "follow the system", once for an explicit choice. Keep the two blocks identical. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;

    --bg: #f4f5f9;
    --bg-raised: #eceff5;
    --surface: #ffffff;
    --surface-2: #e9ecf3;
    --border: #dfe3ec;
    --border-strong: #c7cedb;
    --line: #e4e8ef;

    --text: #0f172a;
    --text-2: #334155;
    --muted: #586378;
    --faint: #667185;
    --placeholder: #8a94a6;

    --accent: #f0531f;
    --accent-hover: #ff6a3d;
    --accent-2: #f0531f;
    --accent-text: #c2410c;
    --accent-text-hover: #9a3412;
    --accent-soft: #fde4d8;
    --accent-softer: #fef1ea;
    --badge: #f0531f;
    --badge-text: #0b1120;
    --online: #059669;

    --danger-bg: #fdecef;
    --danger: #9f1239;
    --danger-strong: #be123c;
    --success-bg: #e2f5ec;
    --success: #047857;

    --selected-text: #7c2d12;
    --accent-strong-text: #9a3412;
    --tag-blue-bg: #e2ecfc;  --tag-blue: #1d4ed8;
    --tag-amber-bg: #fcf0d6; --tag-amber: #92400e;
    --tag-pink-bg: #fce7f3;  --tag-pink: #9d174d;
    --notif-request: #c2410c;
    --notif-accepted: #047857;
    --dot-blue: #2563eb;
    --dot-amber: #d97706;
    --code-string: #15803d;
    --danger-border: #fda4af;
    --error-border: #e11d48;
    --focus-ring: rgba(240, 83, 31, .22);
    --chrome: rgba(255, 255, 255, .72);
    --chrome-tab: rgba(255, 255, 255, .78);
    --floating: rgba(255, 255, 255, .85);
    --thread-bg: #f8f9fc;
    --notif-new: #fff5ef;
    --scrim: rgba(15, 23, 42, .32);
    --shadow: rgba(15, 23, 42, .1);
    --shadow-strong: rgba(15, 23, 42, .18);
    --google-border: #c7cedb;
  }
}
:root[data-theme="light"] {
  color-scheme: light;

  --bg: #f4f5f9;
  --bg-raised: #eceff5;
  --surface: #ffffff;
  --surface-2: #e9ecf3;
  --border: #dfe3ec;
  --border-strong: #c7cedb;
  --line: #e4e8ef;

  --text: #0f172a;
  --text-2: #334155;
  --muted: #586378;
  --faint: #667185;
  --placeholder: #8a94a6;

  --accent: #f0531f;
  --accent-hover: #ff6a3d;
  --accent-2: #f0531f;
  --accent-text: #c2410c;
  --accent-text-hover: #9a3412;
  --accent-soft: #fde4d8;
  --accent-softer: #fef1ea;
  --badge: #f0531f;
  --badge-text: #0b1120;
  --online: #059669;

  --danger-bg: #fdecef;
  --danger: #9f1239;
  --danger-strong: #be123c;
  --success-bg: #e2f5ec;
  --success: #047857;

  --selected-text: #7c2d12;
  --accent-strong-text: #9a3412;
  --tag-blue-bg: #e2ecfc;  --tag-blue: #1d4ed8;
  --tag-amber-bg: #fcf0d6; --tag-amber: #92400e;
  --tag-pink-bg: #fce7f3;  --tag-pink: #9d174d;
  --notif-request: #c2410c;
  --notif-accepted: #047857;
  --dot-blue: #2563eb;
  --dot-amber: #d97706;
  --code-string: #15803d;
  --danger-border: #fda4af;
  --error-border: #e11d48;
  --focus-ring: rgba(240, 83, 31, .22);
  --chrome: rgba(255, 255, 255, .72);
  --chrome-tab: rgba(255, 255, 255, .78);
  --floating: rgba(255, 255, 255, .85);
  --thread-bg: #f8f9fc;
  --notif-new: #fff5ef;
  --scrim: rgba(15, 23, 42, .32);
  --shadow: rgba(15, 23, 42, .1);
  --shadow-strong: rgba(15, 23, 42, .18);
  --google-border: #c7cedb;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }
.icon { flex-shrink: 0; }

a { color: var(--accent-text); text-decoration: none; }
@media (hover: hover) { a:hover { color: var(--accent-text-hover); } }

h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); letter-spacing: -0.01em; line-height: 1.15; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: var(--r);
}
.skip-link:focus { top: 12px; color: var(--on-accent); }

/* ---------- Layout ---------- */

.container { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 16px; }
.container-md { max-width: 1120px; }
.container-sm { max-width: 1040px; }
@media (min-width: 768px) { .container { padding: 0 32px; } }

.page { padding-top: 20px; padding-bottom: calc(var(--tabbar-h) + 40px); }
@media (min-width: 768px) { .page { padding-top: 32px; padding-bottom: 64px; } }

.split { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.split > .split-side { flex: 1 1 260px; min-width: 0; }
.split > .split-main { flex: 999 1 520px; min-width: 0; }

.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 28px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.ml-auto { margin-left: auto; }
.mt-auto { margin-top: auto; }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; }

/* ---------- Type helpers ---------- */

.display { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.03em; }
.page-title { font-family: var(--font-display); font-weight: 800; font-size: 1.75rem; letter-spacing: -0.03em; }
@media (min-width: 768px) { .page-title { font-size: 2.125rem; } }
.lead { font-size: 1.0625rem; color: var(--muted); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 0.875rem; }
.tiny { font-size: 0.8125rem; }
.bold { font-weight: 700; }
.eyebrow {
  font-size: 0.8125rem; font-weight: 700; color: var(--faint);
  letter-spacing: 0.06em; text-transform: uppercase; margin: 0;
  font-family: var(--font-body);
}
.prose { font-size: 1rem; line-height: 1.65; color: var(--text-2); white-space: pre-line; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: var(--r);
  border: 1px solid transparent; background: transparent; color: var(--text);
  font-weight: 700; font-size: 0.9375rem; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, transform .1s ease-out;
}
@media (hover: hover) { .btn:hover { color: var(--text); } }
.btn-primary { background: var(--accent); color: var(--on-accent); }
@media (hover: hover) { .btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); } }
.btn-outline { border-color: var(--border-strong); }
@media (hover: hover) { .btn-outline:hover { border-color: var(--accent-2); background: var(--surface); } }
.btn-ghost { color: var(--muted); }
@media (hover: hover) { .btn-ghost:hover { color: var(--text); background: var(--surface); } }
.btn-danger { background: transparent; border-color: var(--danger-border); color: var(--danger-strong); }
@media (hover: hover) { .btn-danger:hover { background: var(--danger-bg); color: var(--danger); } }
.btn-muted { background: var(--surface-2); color: var(--muted); cursor: default; }
@media (hover: hover) { .btn-muted:hover { color: var(--muted); } }
.btn-google { background: #fff; color: #1f2937; border-color: var(--google-border); }
@media (hover: hover) { .btn-google:hover { background: #f1f5f9; color: #1f2937; } }
.btn-lg { height: 3.375rem; font-size: 1rem; border-radius: 14px; padding: 0 24px; }
.btn-sm { position: relative; height: 2.25rem; padding: 0 12px; font-size: 0.875rem; border-radius: 10px; }
.btn-sm::after { content: ''; position: absolute; inset: -4px 0; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; padding: 0; }
.btn-icon.btn-sm { width: 36px; }
.btn-link { background: none; border: 0; padding: 6px 0; color: var(--accent-text); font-weight: 700; cursor: pointer; }
@media (hover: hover) { .btn-link:hover { color: var(--accent-text-hover); } }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--r);
  border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer;
}
@media (hover: hover) { .icon-btn:hover { border-color: var(--border-strong); background: var(--surface); color: var(--text); } }
.icon-btn.is-active { color: var(--accent-text); }

/* ---------- Forms ---------- */

.form { display: flex; flex-direction: column; gap: 18px; margin: 0; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.label, .field > label, legend.label { font-size: 0.875rem; font-weight: 700; color: var(--text-2); padding: 0; }
.help { font-size: 0.8125rem; color: var(--faint); }
.counter { font-size: 0.75rem; color: var(--faint); align-self: flex-end; }
.counter.is-over { color: var(--danger-strong); }

.input, .select, .textarea {
  width: 100%; min-width: 0; height: 50px; padding: 0 16px;
  border-radius: var(--r); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-size: 1rem;
}
.textarea { height: auto; padding: 12px 16px; line-height: 1.5; resize: vertical; }
.select { appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239aa7bd' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
.input::placeholder, .textarea::placeholder { color: var(--placeholder); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--focus-ring); }
.input-pill { border-radius: var(--pill); height: 2.875rem; padding: 0 18px; }
.on-raised .input, .on-raised .select, .on-raised .textarea { background: var(--bg); }

.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--error-border); }
.errorlist { list-style: none; margin: 0; padding: 0; font-size: 0.8125rem; color: var(--danger-strong); }

.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-icon > .input { padding-left: 42px; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset > legend { margin-bottom: 12px; }

/* Checkbox / radio rows */
.check { display: flex; align-items: center; gap: 10px; min-height: 2.75rem; font-size: 0.9375rem; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex-shrink: 0; }

/* Toggle switch (a checkbox) */
.switch-row { display: flex; align-items: center; gap: 16px; padding: 14px 16px; cursor: pointer; }
.switch-row + .switch-row { border-top: 1px solid var(--line); }
.switch {
  appearance: none; position: relative; flex-shrink: 0; width: 46px; height: 28px; margin: 0;
  border-radius: var(--pill); background: var(--border-strong); cursor: pointer; transition: background .15s;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .25); transition: transform .25s cubic-bezier(.3, 1.4, .5, 1);
}
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); }

/* Chips: <label class="chip"><input type="checkbox|radio"><span>…</span></label> */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 16px; border-radius: var(--pill);
  border: 1px solid var(--border-strong); color: var(--text-2); font-size: 0.875rem;
  cursor: pointer; user-select: none; transition: border-color .15s, background .15s;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
@media (hover: hover) { .chip:hover { border-color: var(--accent-2); } }
.chip:has(input:checked) { border-color: var(--accent-2); background: var(--accent-soft); color: var(--selected-text); font-weight: 700; }
.chip:has(input:focus-visible) { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.chip-sm { min-height: 2rem; padding: 0 12px; font-size: 0.8125rem; }
.chip-sm::after { content: ''; position: absolute; inset: -6px 0; }
.chip-box { border-radius: var(--r); min-height: 3.125rem; justify-content: center; }
.chips-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }

/* Segmented control */
.segmented {
  display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 4px; padding: 4px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
}
.segmented > * {
  display: flex; align-items: center; justify-content: center; position: relative;
  min-height: 42px; padding: 0 12px; border-radius: 10px; color: var(--muted); font-size: 0.875rem;
  cursor: pointer; text-align: center;
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented > :has(input:checked), .segmented > [aria-current="page"], .segmented > [aria-selected="true"] {
  background: var(--accent-soft); color: var(--selected-text); font-weight: 700;
}
.segmented > :has(input:focus-visible) { outline: 2px solid var(--accent-2); }
.segmented-solid > :has(input:checked) { background: var(--accent); color: var(--on-accent); }
.segmented { position: relative; isolation: isolate; }
.seg-pill { position: absolute; z-index: -1; inset: 0; border-radius: 10px; background: var(--accent-soft); view-transition-name: seg-pill; }
.segmented > [aria-current="page"]:has(.seg-pill) { background: transparent; }
.seg-indicator { position: absolute; z-index: -1; top: 4px; bottom: 4px; left: 0; border-radius: 10px; background: var(--accent-soft); will-change: transform, width; }
.segmented-solid .seg-indicator { background: var(--accent); }
.segmented.has-indicator > :has(input:checked) { background: transparent; }

/* ---------- Tags, badges, avatars ---------- */

.tag, .badge, .tiny, .counter, .tab, .bubble-time, .convo .time, .help { letter-spacing: .01em; }
.tag {
  display: inline-flex; align-items: center; font-size: 0.75rem; font-weight: 700;
  padding: 5px 10px; border-radius: var(--r-sm); line-height: 1.2; white-space: nowrap;
}
.tag-purple { background: var(--accent-soft); color: var(--accent-strong-text); }
.tag-blue { background: var(--tag-blue-bg); color: var(--tag-blue); }
.tag-green { background: var(--success-bg); color: var(--success); }
.tag-amber { background: var(--tag-amber-bg); color: var(--tag-amber); }
.tag-pink { background: var(--tag-pink-bg); color: var(--tag-pink); }
.tag-gray { background: var(--surface-2); color: var(--text-2); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

.skill-pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 14px;
  border-radius: var(--pill); border: 1px solid var(--border-strong); color: var(--text-2); font-size: 0.875rem;
}
.skill-pill.is-match { border-color: var(--accent-2); color: var(--accent-strong-text); }

.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--badge); color: var(--badge-text); font-size: 11px; font-weight: 700; line-height: 1;
}
.badge-dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--badge); border: 2px solid var(--bg); }
.icon-btn .badge, .tab .badge { position: absolute; top: 2px; right: 2px; }

.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  border-radius: 50%; overflow: hidden; color: #fff; font-weight: 700;
  width: 40px; height: 40px; font-size: 14px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-md { width: 40px; height: 40px; font-size: 14px; }
.avatar-lg { width: 52px; height: 52px; font-size: 18px; }
.avatar-xl { width: 92px; height: 92px; font-size: 32px; font-family: var(--font-display); }
.avatar-xxl { width: 112px; height: 112px; font-size: 40px; font-family: var(--font-display); }

/* ---------- Cards & panels ---------- */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; }
.card-lg { border-radius: var(--r-xl); padding: 24px; }
@media (min-width: 768px) { .card-lg { padding: 32px; } }
.card-accent { border-color: var(--accent-2); }
.card-link { display: block; color: var(--text); transition: border-color .15s; }
@media (hover: hover) { .card-link:hover { border-color: var(--border-strong); color: var(--text); } }
.panel-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.panel-list > * + * { border-top: 1px solid var(--line); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--text); }
@media (hover: hover) { a.list-row:hover { background: var(--bg-raised); color: var(--text); } }

.note-box { padding: 14px 16px; border-radius: var(--r); background: var(--bg); font-size: 0.9375rem; line-height: 1.55; color: var(--text-2); white-space: pre-line; }
.tip { padding: 16px; border-radius: 14px; border: 1px dashed var(--border-strong); font-size: 0.875rem; color: var(--muted); }

.progress { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent-2); border-radius: 3px; }

.empty { text-align: center; padding: 48px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty .icon-wrap { width: 64px; height: 64px; border-radius: 18px; background: var(--accent-softer); color: var(--accent-text);
  display: flex; align-items: center; justify-content: center; }

/* ---------- Alerts / toasts ---------- */

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); font-size: 0.875rem; }
.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-info { background: var(--accent-softer); color: var(--accent-strong-text); }

.toasts {
  position: fixed; z-index: 60; left: 16px; right: 16px; top: 12px;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
@media (min-width: 768px) { .toasts { left: auto; right: 24px; top: 80px; width: 380px; } }
.toast {
  pointer-events: auto; display: flex; gap: 10px; align-items: center;
  padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text); font-size: 0.9375rem;
  box-shadow: 0 12px 32px var(--shadow); animation: toast-in .2s ease-out;
}
.toast.is-error { border-color: var(--danger-border); }
.toast.is-success .icon { color: var(--online); }
.toast.is-error .icon { color: var(--danger-strong); }
.toast button { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px) scale(.98); } }
.toast.is-leaving { animation: toast-out .18s ease-in forwards; }
.toast > span { flex: 1; }
.toast .toast-action { margin-left: 0; color: var(--accent-text); font-weight: 700; padding: 6px 8px; }

/* ---------- Menus (<details class="menu">) ---------- */

.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; z-index: 40; right: 0; top: calc(100% + 8px); min-width: 220px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px;
  padding: 6px; box-shadow: 0 16px 40px var(--shadow);
}
.menu-panel { transform-origin: top right; }
.menu-panel-left { right: auto; left: 0; transform-origin: top left; }
.menu-panel-center { right: auto; left: 50%; translate: -50% 0; transform-origin: top center; }
.menu[open] > .menu-panel { animation: menu-in .2s cubic-bezier(.2, .9, .3, 1); }
.menu.is-closing > .menu-panel { animation: menu-out .14s ease-in forwards; }
@keyframes menu-in { from { opacity: 0; scale: .96; } }
@keyframes menu-out { to { opacity: 0; scale: .96; } }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 0 12px;
  border: 0; border-radius: 10px; background: none; color: var(--text); font-size: 0.9375rem; text-align: left; cursor: pointer;
}
@media (hover: hover) { .menu-item:hover { background: var(--surface-2); color: var(--text); } }
.menu-item.is-danger { color: var(--danger-strong); }
.menu-item[aria-current] { background: var(--accent-softer); color: var(--selected-text); font-weight: 700; }

/* ---------- App header ---------- */

.topbar { position: sticky; top: 0; z-index: 30; background: var(--chrome);
  backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid transparent; transition: border-color .2s; view-transition-name: topbar; }
.topbar.is-scrolled { border-bottom-color: var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 12px; min-height: var(--header-h); }
@media (min-width: 768px) { .topbar-inner { gap: 24px; } }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 1.1875rem; }
@media (hover: hover) { .brand:hover { color: var(--text); } }
.brand-mark { width: 30px; height: 30px; color: var(--logo); flex-shrink: 0; }

.mainnav { display: none; gap: 4px; }
.mainnav a { display: inline-flex; align-items: center; gap: 8px; height: 2.5rem; padding: 0 14px; border-radius: 10px; color: var(--text-2); font-size: 0.9375rem; }
@media (hover: hover) { .mainnav a:hover { color: var(--text); background: var(--surface); } }
.mainnav a[aria-current="page"] { background: var(--accent-softer); color: var(--selected-text); font-weight: 700; }

.topbar-search { display: none; flex: 1 1 220px; max-width: 420px; }
.topbar-search .input { height: 2.5rem; border-radius: 10px; border-color: var(--border); font-size: 0.9375rem; }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.topbar-actions .icon-btn { width: 40px; height: 40px; border-radius: 10px; }
@media (max-width: 767.98px) { .desktop-only { display: none !important; } }
@media (min-width: 768px) {
  .mainnav, .topbar-search { display: flex; }
  .mobile-only { display: none !important; }
}

/* Notifications dropdown */
.notif-panel { width: min(380px, calc(100vw - 32px)); padding: 0; }
.notif-panel header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.notif-panel footer { padding: 10px 16px; border-top: 1px solid var(--line); text-align: center; font-size: 0.875rem; }

/* ---------- Mobile tab bar ---------- */

.tabbar {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: var(--chrome-tab); border-top: 1px solid var(--line); view-transition-name: tabbar;
  backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
}
@media (min-width: 768px) { .tabbar { display: none; } }
.tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  height: 52px; color: var(--faint); font-size: 0.6875rem; }
@media (hover: hover) { .tab:hover { color: var(--text); } }
.tab[aria-current="page"] { color: var(--text); font-weight: 700; }
.tab[aria-current="page"] .icon { color: var(--accent-text); }
.tab .badge { right: calc(50% - 22px); top: 0; }
.tab-post span { width: 50px; height: 44px; border-radius: 14px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; }

/* ---------- Auth shell ---------- */

.auth { display: flex; flex-wrap: wrap; min-height: 100vh; }
.auth-aside { display: none; }
@media (min-width: 900px) {
  .auth-aside {
    display: flex; flex-direction: column; gap: 48px; flex: 1 1 480px;
    background: var(--bg-raised); border-right: 1px solid var(--line); padding: 48px 56px;
  }
}
.auth-aside .auth-pitch { margin: auto 0; max-width: 460px; display: flex; flex-direction: column; gap: 20px; }
.auth-aside h2 { font-weight: 800; font-size: 3rem; line-height: 1.05; letter-spacing: -0.03em; }
.auth-main { flex: 1 1 480px; display: flex; flex-direction: column; padding: 16px 20px 32px; }
@media (min-width: 900px) { .auth-main { align-items: center; justify-content: center; padding: 48px 32px; } }
.auth-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 24px; margin: 0 auto; }
.auth-top { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
@media (min-width: 900px) { .auth-top { display: none; } }
.auth-card h1 { font-weight: 800; font-size: 2rem; letter-spacing: -0.03em; }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 0.8125rem; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.icon-hero { width: 64px; height: 64px; border-radius: 18px; background: var(--accent-softer); color: var(--accent-text);
  display: flex; align-items: center; justify-content: center; }

/* ---------- Landing ---------- */

.site-header { border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; min-height: 72px; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin-left: auto; }
.site-nav a:not(.btn) { color: var(--text-2); font-size: 0.9375rem; padding: 10px 0; }
/* Floating pill navigation (public pages) */
.theme-toggle { width: 36px; border-radius: var(--pill); }
.theme-toggle .i-moon { display: none; }
.theme-toggle span { display: inline-flex; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .i-sun { display: none; }
  :root:not([data-theme="dark"]) .theme-toggle .i-moon { display: inline-flex; }
}
:root[data-theme="light"] .theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-moon { display: inline-flex; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: inline-flex; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
.pill-nav-wrap { position: sticky; top: 0; z-index: 30; padding: 12px 16px 0; }
.pill-nav { display: flex; align-items: center; gap: 12px 28px; max-width: 880px; margin: 0 auto; padding: 8px 8px 8px 18px;
  border-radius: var(--pill); border: 1px solid var(--border); background: var(--chrome);
  backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); box-shadow: 0 8px 30px var(--shadow); }
.pill-nav .brand { font-size: 1.0625rem; }
.pill-nav .brand-mark { width: 26px; height: 26px; }
.pill-nav-links { display: flex; gap: 26px; }
.pill-nav-links a { color: var(--text-2); font-size: 0.9375rem; padding: 10px 2px; -webkit-tap-highlight-color: transparent; transition: opacity .1s ease-out; }
.pill-nav-links a:active { opacity: .6; }
@media (hover: hover) { .pill-nav-links a:hover { color: var(--text); } }
.pill-nav-actions { display: flex; gap: 8px; margin-left: auto; }
.pill-nav .btn { border-radius: var(--pill); }
.btn-ink { background: var(--text); color: var(--bg); }
@media (hover: hover) { .btn-ink:hover { background: var(--text-2); color: var(--bg); } }
.btn-soft { background: var(--surface-2); color: var(--text); }
@media (hover: hover) { .btn-soft:hover { background: var(--border); color: var(--text); } }

/* Landing hero: a soft panel on a dot grid; two people branch into the merge icon, the project comes out */
.lp-hero-wrap { max-width: 1240px; padding-top: 20px; }
.lp-hero { position: relative; overflow: hidden; border-radius: 32px; border: 1px solid var(--border); padding: 40px 20px 56px;
  background: radial-gradient(circle at 1px 1px, var(--border) 1px, transparent 0) 0 0 / 22px 22px, var(--bg-raised);
  display: flex; flex-direction: column; align-items: center; gap: 36px; }
@media (min-width: 900px) { .lp-hero { padding: 56px 40px 72px; } }

.lp-stage { position: relative; width: 100%; max-width: 1000px; height: 400px; }
.lp-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.lp-lines-v { display: none; }
.lp-lines path { fill: none; stroke: var(--border-strong); stroke-width: 2; vector-effect: non-scaling-stroke;
  stroke-dasharray: 600; stroke-dashoffset: 600; animation: lp-draw .55s cubic-bezier(.2, .9, .3, 1) .3s forwards; }
.lp-lines .lp-line-out { animation-delay: .8s; }
.lp-dot { position: absolute; left: var(--x); top: var(--y); width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-softer); opacity: 0; animation: lp-fade .25s ease-out var(--d) forwards; }

.lp-node { position: absolute; left: var(--x); top: var(--y); translate: 0 -50%; width: 23%; min-width: 200px;
  display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 14px 34px var(--shadow);
  animation: lp-in .6s cubic-bezier(.2, .9, .3, 1) var(--d) both; }
.lp-in-left { --from: -24px; }
.lp-out { --from: -40px; }
/* Cards travel along the flow: toward the merge, then out of it */
.lp-person { display: flex; align-items: center; gap: 10px; }
.lp-person b { display: block; font-size: 0.9375rem; }
.lp-person small, .lp-eyebrow { display: block; color: var(--muted); font-size: 0.75rem; letter-spacing: .01em; }
.lp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lp-chips span { font-size: 0.75rem; letter-spacing: .01em; font-weight: 700; padding: 4px 9px; border-radius: var(--pill); background: var(--surface-2); color: var(--text-2); }
.lp-match { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; font-weight: 700; color: var(--accent-text); }
.lp-chat { gap: 8px; }
.lp-bubble { max-width: 90%; padding: 8px 12px; font-size: 0.8125rem; line-height: 1.35; }
.lp-bubble-them { align-self: flex-start; background: var(--surface-2); border-radius: 14px 14px 14px 5px; }
.lp-bubble-me { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-radius: 14px 14px 5px 14px; }

.lp-icon { position: absolute; left: 50%; top: 200px; translate: -50% -50%; width: 128px; height: 128px; border-radius: 32px;
  display: flex; align-items: center; justify-content: center; background: var(--logo);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 55%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -6px 14px rgba(120, 30, 0, .25), 0 22px 44px rgba(240, 83, 31, .32);
  animation: lp-pop .5s cubic-bezier(.2, .9, .3, 1) .05s both; }
.lp-icon svg { width: 62%; height: 62%; }

.lp-tile { position: absolute; left: var(--x); top: var(--y); width: 56px; height: 56px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 12px 26px var(--shadow);
  animation: lp-pop .45s cubic-bezier(.2, .9, .3, 1) var(--d) both; }
.lp-tile-idea { background: #fde68a; color: #78350f; rotate: -6deg; }
.lp-tile-ship { background: #bfdbfe; color: #1e3a8a; rotate: 5deg; }

.lp-copy { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 20px; max-width: 760px; }
.lp-copy h1 { font-weight: 800; font-size: clamp(2.5rem, 6.2vw, 4.5rem); line-height: 1.02; letter-spacing: -0.035em; text-wrap: balance; }
.lp-copy h1 span { display: block; color: var(--faint); }
.lp-copy .lead { font-size: clamp(1.0625rem, 2vw, 1.25rem); max-width: 560px; }
.lp-ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 4px; }
.lp-ctas .btn { border-radius: 16px; }

@keyframes lp-draw { to { stroke-dashoffset: 0; } }
@keyframes lp-fade { to { opacity: 1; } }
@keyframes lp-in { from { opacity: 0; transform: translate(var(--from, 0), var(--from-y, 0)) scale(.96); } }
@keyframes lp-pop { from { opacity: 0; transform: scale(.88); } }

/* Phones and small tablets: the same flow, rotated to run top to bottom. The mark itself stays upright. */
@media (max-width: 899.98px) {
  .lp-stage { max-width: 440px; height: 564px; }
  .lp-lines-h, .lp-tile { display: none; }
  .lp-lines-v { display: block; }
  .lp-dot { left: var(--mx); top: var(--my); }
  .lp-node { left: var(--mx); top: var(--my); translate: none; width: 48%; min-width: 0; padding: 12px; gap: 8px; }
  .lp-in-left { --from: 0; --from-y: -16px; height: 64px; justify-content: center; }
  .lp-out { --from: 0; --from-y: -24px; }
  .lp-node .lp-chips { display: none; }
  .lp-node .lp-person { gap: 8px; min-width: 0; }
  .lp-node .lp-person > span:last-child { min-width: 0; }
  .lp-node .lp-person b, .lp-node .lp-person small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lp-node .avatar { width: 32px; height: 32px; font-size: 12px; }
  .lp-node b { font-size: 0.875rem; }
  .lp-bubble { max-width: 100%; font-size: 0.75rem; padding: 7px 10px; }
  .lp-icon { top: 248px; width: 96px; height: 96px; border-radius: 26px; }
}

/* Sections */
.lp-section { max-width: 1240px; padding-top: 88px; scroll-margin-top: 72px; }
html:has(body.landing) { scroll-behavior: smooth; }
.lp-section-head { display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; margin-bottom: 36px; }
.lp-board-more { display: flex; justify-content: center; margin-top: 28px; }
.lp-section-head h2 { font-weight: 800; font-size: clamp(1.75rem, 4vw, 2.625rem); letter-spacing: -0.03em; max-width: 720px; }
.lp-steps, .lp-why { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 18px; }
.lp-step { display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: 24px; background: var(--surface); border: 1px solid var(--border); }
.lp-step h3, .lp-why h3 { font-size: 1.25rem; }
.lp-mini { display: flex; flex-direction: column; gap: 10px; padding: 16px; margin-bottom: 8px; border-radius: 16px; min-height: 132px; justify-content: center;
  background: radial-gradient(circle at 1px 1px, var(--border) 1px, transparent 0) 0 0 / 18px 18px, var(--bg-raised); }
.lp-mini > b { font-family: var(--font-display); font-size: 1rem; }
.lp-step-num { font-family: var(--font-display); font-weight: 800; font-size: 0.875rem; color: var(--accent-text); letter-spacing: .04em; }
.lp-why > div { display: flex; flex-direction: column; gap: 10px; padding: 8px 4px; }
.lp-why-icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: var(--accent-softer); color: var(--accent-text); }
.lp-final { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; padding: 56px 20px; border-radius: 32px;
  border: 1px solid var(--border); background: radial-gradient(circle at 1px 1px, var(--border) 1px, transparent 0) 0 0 / 22px 22px, var(--bg-raised); }
.lp-final h2 { font-weight: 800; font-size: clamp(1.75rem, 4.5vw, 2.75rem); letter-spacing: -0.03em; max-width: 640px; }
.lp-icon-sm { position: static; translate: none; width: 76px; height: 76px; border-radius: 22px; margin-bottom: 6px; animation: none; }
.landing .site-footer { margin-top: 88px; }

/* Waitlist (the locked homepage before launch) */
.waitlist .site-footer { margin-top: 48px; }
.wl-soon { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 12px; border-radius: var(--pill);
  background: var(--text); color: var(--bg); font-family: var(--font-display); font-weight: 700; font-size: 0.9375rem; }
.wl-live { position: relative; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.wl-live::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); animation: wl-ping 1.6s ease-out infinite; }
@keyframes wl-ping { to { scale: 2.8; opacity: 0; } }
.wl-form { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 14px; text-align: left; }
.wl-main { display: flex; gap: 10px; }
.wl-main .input { flex: 1; min-width: 0; height: 3.375rem; border-radius: 14px; font-size: 1rem; padding: 0 18px; }
.wl-extra { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; }
.wl-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.wl-form > .faint { text-align: center; }
.wl-done { display: flex; gap: 14px; align-items: flex-start; text-align: left; max-width: 520px; padding: 18px 20px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 14px 34px var(--shadow); animation: lp-pop .45s cubic-bezier(.2, .9, .3, 1) both; }
.wl-done b { font-family: var(--font-display); font-size: 1.125rem; }
.wl-done-icon { flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--accent-softer); color: var(--accent-text); }
.wl-share { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 10px; text-align: left;
  animation: lp-pop .45s .1s cubic-bezier(.2, .9, .3, 1) both; }
.wl-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 6px; }
.wl-stats > div { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border); }
.wl-stat-num { font-family: var(--font-display); font-weight: 800; font-size: 1.75rem; letter-spacing: -0.02em; line-height: 1.1; }
.wl-share-row { display: flex; gap: 8px; }
.wl-share-row .input { flex: 1; min-width: 0; font-size: 0.875rem; }
/* Desktop: a smaller diagram so the form sits above the fold on a laptop screen */
@media (min-width: 900px) {
  .waitlist .lp-hero { padding-top: 32px; gap: 28px; }
  .waitlist .lp-stage { zoom: .75; }
  .waitlist .lp-copy { gap: 18px; }
  .waitlist .lp-copy .lead { max-width: 640px; }
}
@media (max-width: 559.98px) {
  .wl-main { flex-direction: column; }
  .wl-main .input { flex: none; }
  .wl-extra { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .lp-lines path { stroke-dashoffset: 0; animation: none; }
  .lp-dot { opacity: 1; animation: none; }
  @keyframes lp-in { from { opacity: 0; } }
  @keyframes lp-pop { from { opacity: 0; } }
}
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 32px; }
.footer-cols { display: flex; flex-wrap: wrap; gap: 32px 48px; }
.footer-cols > div { display: flex; flex-direction: column; gap: 10px; flex: 1 1 140px; }
.footer-cols > div:first-child { flex: 2 1 260px; }
.footer-cols a { color: var(--text-2); font-size: 0.9375rem; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; margin-top: 32px; padding-top: 24px;
  border-top: 1px solid var(--line); font-size: 0.875rem; color: var(--faint); }
.footer-bottom a { color: var(--muted); }

/* ---------- Board ---------- */

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 12px; min-height: 2.625rem; padding: 0 12px; border-radius: 10px; color: var(--text-2); font-size: 0.9375rem; }
@media (hover: hover) { .side-nav a:hover { background: var(--surface); color: var(--text); } }
.side-nav a[aria-current] { background: var(--accent-softer); color: var(--selected-text); font-weight: 700; }
.side-nav .count { margin-left: auto; font-size: 0.8125rem; color: var(--faint); font-weight: 400; }
.side-nav .go { margin-left: auto; color: var(--faint); }
.menu-item .go { margin-left: auto; color: var(--faint); }
.title-switch { display: inline-flex; align-items: center; gap: 8px; border-radius: 12px; padding: 2px 4px 2px 0; }
.title-switch .chev { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-2); color: var(--text-2); transition: transform .2s cubic-bezier(.2, .9, .3, 1); }
.menu[open] > .title-switch .chev { transform: rotate(180deg); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-purple { background: var(--accent-2); } .dot-blue { background: var(--dot-blue); } .dot-green { background: var(--online); }
.dot-amber { background: var(--dot-amber); } .dot-pink { background: var(--badge); }

/* Filters: sidebar on desktop, full-screen sheet on mobile */
.filters { display: flex; flex-direction: column; gap: 22px; }
.filters-sheet-head, .filters-sheet-foot { display: none; }
@media (max-width: 767.98px) {
  .board-side { display: none; }
  .board-side.is-open {
    display: flex; flex-direction: column; position: fixed; z-index: 50; inset: 40px 0 0 0;
    background: var(--surface); border-radius: 24px 24px 0 0; border-top: 1px solid var(--border);
    box-shadow: 0 -20px 60px var(--shadow-strong); will-change: transform;
  }
  .board-side.is-open .filters { flex: 1; overflow-y: auto; padding: 18px 20px; }
  .board-side.is-open .filters-sheet-head { position: relative; display: flex; align-items: center; justify-content: space-between;
    padding: 18px 8px 8px; border-bottom: 1px solid var(--line); touch-action: none; cursor: grab; user-select: none; }
  .sheet-handle { position: absolute; top: 7px; left: 50%; width: 38px; height: 5px; margin-left: -19px; border-radius: 3px; background: var(--border-strong); }
  .board-side.is-open .filters-sheet-foot { display: block; padding: 14px 20px calc(20px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
  .board-side .side-nav, .board-side .board-side-divider { display: none; }
  body.has-sheet { overflow: hidden; }
  .sheet-scrim { position: fixed; inset: 0; z-index: 45; background: var(--scrim); opacity: 0; }
}
.scroll-list { max-height: 260px; overflow-y: auto; padding-right: 4px; }

.post-card { display: flex; flex-direction: column; gap: 12px; }
.post-card-head { display: flex; gap: 12px; align-items: flex-start; }
.post-card-title { color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 1.0625rem; line-height: 1.25; }
@media (hover: hover) { .post-card-title:hover { color: var(--accent-text-hover); } }
.post-card .desc { font-size: 0.9375rem; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card .skills-line { font-size: 0.8125rem; color: var(--muted); }
.post-card .actions { display: flex; gap: 10px; margin-top: auto; }
.post-card .actions > * { flex: 1; }
.save-btn { width: 40px; height: 40px; margin: -6px -8px 0 0; border: 0; background: none; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; cursor: pointer; }
@media (hover: hover) { .save-btn:hover { color: var(--text); background: var(--surface-2); } }
.save-btn.is-saved { color: var(--accent-text); }

.chip-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 24px; color: var(--muted); font-size: 0.875rem; }

/* ---------- Post detail ---------- */

.post-title { font-weight: 800; font-size: clamp(1.75rem, 4vw, 2.75rem); line-height: 1.08; letter-spacing: -0.03em; }

/* ---------- Skill picker ---------- */

.skill-picker { display: flex; flex-direction: column; gap: 16px; }
.skill-picker .selected-chips:empty::before { content: 'Nothing selected yet'; color: var(--faint); font-size: 0.875rem; }
.skill-group { display: flex; flex-direction: column; gap: 10px; }
.skill-group[hidden] { display: none; }
.skill-picker .chip[hidden] { display: none; }

/* ---------- Onboarding ---------- */

.stepper { display: flex; flex-direction: column; gap: 6px; }
.stepper-item { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; color: var(--text); }
.stepper-item[aria-current] { background: var(--accent-softer); }
.stepper-num { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border-strong); color: var(--muted);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.stepper-item[aria-current] .stepper-num, .stepper-item.is-done .stepper-num { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.steps-bar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.steps-bar span { height: 4px; border-radius: 2px; background: var(--border); }
.steps-bar span.is-done { background: var(--accent-2); }
@media (max-width: 767.98px) { .onboarding .stepper { display: none; } }
@media (min-width: 768px) { .onboarding .steps-bar { display: none; } }

.avatar-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.file-input { font-size: 0.875rem; color: var(--muted); }
.file-input::file-selector-button {
  height: 40px; padding: 0 16px; margin-right: 12px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font-weight: 700; cursor: pointer;
}

/* ---------- Messages ---------- */

.inbox { display: flex; gap: 16px; align-items: stretch; height: calc(100vh - var(--header-h) - var(--tabbar-h) - 24px); padding-top: 12px; }
@media (min-width: 768px) { .inbox { height: calc(100vh - var(--header-h) - 48px); padding-top: 24px; } }
.inbox-list, .inbox-thread, .inbox-context { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; min-width: 0; }
.inbox-list { flex: 1 1 300px; display: flex; flex-direction: column; }
.inbox-list .scroll { overflow-y: auto; flex: 1; }
.inbox-thread { flex: 999 1 460px; display: flex; flex-direction: column; position: relative; view-transition-name: thread; }
.inbox-context { flex: 0 0 280px; display: none; flex-direction: column; gap: 16px; background: none; border: 0; overflow-y: auto; }
@media (min-width: 1180px) { .inbox-context { display: flex; } }
.inbox-empty-thread { flex: 999 1 460px; display: none; }
@media (min-width: 768px) { .inbox-empty-thread { display: flex; align-items: center; justify-content: center; } }
@media (max-width: 767.98px) {
  .inbox.has-active .inbox-list { display: none; }
  .inbox:not(.has-active) .inbox-thread { display: none; }
  .inbox { height: calc(100vh - var(--header-h) - var(--tabbar-h)); padding-top: 0; }
  .inbox-list, .inbox-thread { border-radius: 0; border-left: 0; border-right: 0; border-top: 0; }
  .container.inbox-container { padding: 0; }
}
.convo { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--text); }
@media (hover: hover) { .convo:hover { background: var(--bg-raised); color: var(--text); } }
.convo[aria-current] { background: var(--accent-softer); }
.convo .preview { font-size: 0.875rem; color: var(--muted); }
.convo.is-unread .preview { color: var(--text); font-weight: 700; }
.convo .time { font-size: 0.75rem; color: var(--faint); flex-shrink: 0; }
.convo.is-unread .time { color: var(--accent-text); font-weight: 700; }
.thread-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.thread-body { flex: 1; overflow-y: auto; padding: 20px 16px; display: flex; flex-direction: column; gap: 10px; background: var(--thread-bg); }
.thread-body > :first-child { margin-top: auto; }
.load-older { align-self: center; padding: 6px 14px; border-radius: var(--pill); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); font: inherit; font-size: 0.8125rem; cursor: pointer; }
.load-older:hover:not(:disabled) { color: var(--text); border-color: var(--border-strong); }
.load-older:disabled { cursor: progress; opacity: .7; }
.bubble { max-width: min(78%, 560px); padding: 10px 14px; font-size: 0.9375rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble-them { align-self: flex-start; background: var(--surface-2); border-radius: 18px 18px 18px 6px; }
.bubble-me { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-radius: 18px 18px 6px 18px; }
.bubble-time { font-size: 0.6875rem; color: var(--faint); }
.bubble-me + .bubble-time { align-self: flex-end; }
.bubble { transition: opacity .25s ease-out, transform .3s cubic-bezier(.2, .9, .3, 1); }
.bubble-me { transform-origin: bottom right; } .bubble-them { transform-origin: bottom left; }
.bubble.htmx-added { opacity: 0; transform: translateY(8px) scale(.96); }
.bubble.is-pending { opacity: .6; }
.bubble.is-failed { background: var(--danger-bg); color: var(--danger); cursor: pointer; }
.bubble-failed-note { align-self: flex-end; font-size: 0.75rem; color: var(--danger-strong); }
.new-messages { position: absolute; left: 50%; bottom: 84px; translate: -50% 0; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px; height: 2.25rem; padding: 0 14px; border-radius: var(--pill); border: 1px solid var(--border-strong);
  background: var(--floating); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); color: var(--text); font-weight: 700; font-size: 0.875rem;
  cursor: pointer; box-shadow: 0 8px 24px var(--shadow); animation: toast-in .2s ease-out; }
.thread-compose { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); }
.send-btn { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer; }
@media (hover: hover) { .send-btn:hover { background: var(--accent-hover); } }
.online { color: var(--online); font-size: 0.75rem; }

/* ---------- Notifications ---------- */

.notif { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; color: var(--text); }
@media (hover: hover) { .notif:hover { background: var(--bg-raised); color: var(--text); } }
.notif.is-new { background: var(--notif-new); }
.notif-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-icon.is-request { background: var(--accent-soft); color: var(--notif-request); }
.notif-icon.is-accepted { background: var(--success-bg); color: var(--notif-accepted); }
.notif-icon.is-post { background: var(--tag-blue-bg); color: var(--tag-blue); }

/* ---------- Profile ---------- */

.profile-card { display: flex; flex-direction: column; gap: 18px; }
.profile-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.link-row { display: flex; align-items: center; gap: 10px; min-height: 2.5rem; padding: 0 8px; border-radius: 10px; color: var(--text); font-size: 0.875rem; overflow-wrap: anywhere; }
@media (hover: hover) { .link-row:hover { background: var(--bg-raised); color: var(--text); } }
.link-row .icon { color: var(--muted); }
.banner { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--bg-raised); }

/* ---------- Settings ---------- */

.settings-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.settings-nav::-webkit-scrollbar { display: none; }
.settings-nav a { flex-shrink: 0; display: flex; align-items: center; min-height: 2.5rem; padding: 0 14px; border-radius: 10px; color: var(--text-2); font-size: 0.9375rem; }
@media (hover: hover) { .settings-nav a:hover { background: var(--surface); color: var(--text); } }
.settings-nav a[aria-current] { background: var(--accent-softer); color: var(--selected-text); font-weight: 700; }
@media (min-width: 768px) {
  .settings-nav { flex-direction: column; overflow: visible; margin: 0; padding: 0; }
  .settings-nav a { min-height: 2.625rem; padding: 0 12px; }
}
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; padding-top: 20px; border-top: 1px solid var(--line); }

/* ---------- allauth pages (rendered through the element overrides) ---------- */

.allauth-content { display: flex; flex-direction: column; gap: 18px; }
.allauth-content ul:not(.errorlist) { padding-left: 18px; margin: 0; color: var(--text-2); }
.allauth-content table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.allauth-content th, .allauth-content td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }

/* ---------- Utilities ---------- */

.hide-empty:empty { display: none; }
[hidden] { display: none !important; }
.htmx-request.htmx-indicator, .htmx-request .htmx-indicator { opacity: 1; }
.htmx-indicator { opacity: 0; transition: opacity .2s; }
#results.htmx-request { opacity: .6; transition: opacity .2s; }

/* Switching theme eases the change instead of flashing (removed again by app.js) */
html.theme-switching, html.theme-switching *, html.theme-switching *::before, html.theme-switching *::after {
  transition: background-color .3s ease, border-color .3s ease, color .3s ease !important;
}

/* Press feedback: on pointer-down, instantly */
.btn, .icon-btn, .chip, .tab, .send-btn, .save-btn, .segmented > *, .menu-item, .convo, .list-row, .card-link,
.side-nav a, .mainnav a, .settings-nav a, .link-row, .stepper-item, .notif, .title-switch, summary { -webkit-tap-highlight-color: transparent; }
.icon-btn, .send-btn, .save-btn, .chip, .tab, .card-link, .segmented > * { transition: background-color .15s, border-color .15s, color .15s, transform .1s ease-out; }
.btn:active:not([disabled]):not(.btn-muted), .icon-btn:active, .send-btn:active, .save-btn:active, .chip:active, .segmented > :active { transform: scale(.97); }
.tab:active { transform: scale(.92); }
.card-link:active { transform: scale(.99); }
.menu-item:active, .convo:active, a.list-row:active, .side-nav a:active, .mainnav a:active, .settings-nav a:active,
.link-row:active, .notif:active, .stepper-item:active { background: var(--surface-2); }

/* Page transitions: deeper pages slide in from the right and go back out to the right */
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: .3s; animation-timing-function: cubic-bezier(.2, .9, .3, 1); }
@media (max-width: 767.98px) {
  html:active-view-transition-type(forward)::view-transition-old(root) { animation: .3s cubic-bezier(.2, .9, .3, 1) both vt-out-left; }
  html:active-view-transition-type(forward)::view-transition-new(root) { animation: .3s cubic-bezier(.2, .9, .3, 1) both vt-in-right; }
  html:active-view-transition-type(back)::view-transition-old(root) { animation: .3s cubic-bezier(.2, .9, .3, 1) both vt-out-right; }
  html:active-view-transition-type(back)::view-transition-new(root) { animation: .3s cubic-bezier(.2, .9, .3, 1) both vt-in-left; }
}
@keyframes vt-in-right { from { transform: translateX(100%); } }
@keyframes vt-out-left { to { transform: translateX(-30%); opacity: .6; } }
@keyframes vt-in-left { from { transform: translateX(-30%); opacity: .6; } }
@keyframes vt-out-right { to { transform: translateX(100%); } }

@media (prefers-reduced-motion: reduce) {
  /* No sliding, scaling or springing; keep short fades and colour changes. */
  *, *::before, *::after { transition-property: opacity, color, background-color, border-color !important; scroll-behavior: auto !important; }
  :active { transform: none !important; scale: none !important; }
  .switch::after { transition: none !important; }
  @keyframes toast-in { from { opacity: 0; } }
  @keyframes toast-out { to { opacity: 0; } }
  @keyframes menu-in { from { opacity: 0; } }
  @keyframes menu-out { to { opacity: 0; } }
  .bubble.htmx-added { transform: none; }
  /* app.js adds no slide direction under reduced motion, so page changes stay a plain cross-fade */
}
@media (prefers-reduced-transparency: reduce) {
  .topbar { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .tabbar { background: var(--bg-raised); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .new-messages { background: var(--surface-2); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .pill-nav { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .topbar { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom-color: var(--border-strong); }
  .tabbar { background: var(--bg-raised); backdrop-filter: none; -webkit-backdrop-filter: none; border-top-color: var(--border-strong); }
  .card, .panel-list, .menu-panel, .toast, .inbox-list, .inbox-thread, .lp-node, .lp-step, .lp-hero, .lp-final { border-color: var(--border-strong); }
  .pill-nav { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; border-color: var(--border-strong); }
  :root { --muted: color-mix(in srgb, var(--text) 78%, var(--bg)); --faint: color-mix(in srgb, var(--text) 68%, var(--bg)); }
}

/* Inputs rendered without our classes (allauth forms, plain {{ field }}) */
.field > input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]),
.field > select, .field > textarea {
  width: 100%; min-width: 0; height: 50px; padding: 0 16px; border-radius: var(--r);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 1rem;
}
.field > textarea { height: auto; padding: 12px 16px; }
.field > input:focus, .field > select:focus, .field > textarea:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--focus-ring); }
.field > input::placeholder { color: var(--placeholder); }
.field .help a { font-weight: 700; }
