/* B-Connect design system. Light by default, dark when the OS asks for it. */
:root {
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ink: #0D1117;
  --ink-2: #060b0f;
  --bg: #F6F7F5;
  --surface: #FFFFFF;
  --surface-2: #F2F4F1;
  --border: #E3E6E2;
  --border-strong: #C7CBC6;
  --text: #111418;
  --text-2: #4A525D;
  --muted: #78808B;
  --accent: #1D9E75;
  --accent-hover: #0F6E56;
  --accent-soft: #E1F5EE;
  --accent-ink: #085041;
  --warn-bg: #FAEEDA;
  --warn-ink: #633806;
  --warn-line: #EF9F27;
  --prem-bg: #854F0B;
  --prem-ink: #FAC775;
  --danger: #C2410C;
  --danger-soft: #FDECE4;
  --ok-bg: #DCFCE7;
  --ok-ink: #166534;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(13, 17, 23, .04), 0 4px 16px rgba(13, 17, 23, .04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A0E13;
    --surface: #11171F;
    --surface-2: #161E28;
    --border: #232D3A;
    --border-strong: #354152;
    --text: #E7EBF0;
    --text-2: #AAB4C1;
    --muted: #7C8796;
    --accent-soft: rgba(29, 158, 117, .16);
    --accent-ink: #6FD4B0;
    --warn-bg: #33270F;
    --warn-ink: #F3C97A;
    --danger: #F28B6B;
    --danger-soft: #3A1F17;
    --ok-bg: #12301F;
    --ok-ink: #7BE0A4;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-optical-sizing: auto; letter-spacing: .003em; font-family: var(--font); color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.hidden, [hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.inline { display: inline; }
.grow { flex: 1; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 600; cursor: pointer; transition: transform 160ms var(--ease-out), background .12s, border-color .12s, color .12s; white-space: nowrap; text-decoration: none !important; }
.btn:active, .side-i:active, .tab:active, .stat:active, .tabbar a:active, .choice:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--border-strong); }
.btn-ghost-dark { background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .88); border-color: rgba(255, 255, 255, .16); }
.btn-ghost-dark:hover { background: rgba(255, 255, 255, .12); }
.btn-warn { background: #BA7517; color: #fff; }
.btn-warn:hover { background: var(--prem-bg); }
.btn-danger-text { background: none; border: 0; color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { padding: 12px 24px; font-size: 14.5px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; font-size: inherit; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Top nav ---------- */
.nav { height: 56px; background: rgba(13, 17, 23, .82); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); border-bottom: 1px solid rgba(255, 255, 255, .06); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; position: sticky; top: 0; z-index: 40; }
.logo { font-size: 17px; font-weight: 600; color: #fff !important; letter-spacing: -.01em; text-decoration: none !important; }
.logo span { color: var(--accent); }
.nav-r { display: flex; align-items: center; gap: 8px; }
.lang-switch { display: flex; padding: 2px; border-radius: 8px; background: rgba(255, 255, 255, .08); margin-right: 4px; }
.lang-switch a { padding: 4px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, .6); text-decoration: none !important; min-width: 32px; text-align: center; }
.lang-switch a:hover { color: #fff; }
.lang-switch a.on { background: rgba(255, 255, 255, .16); color: #fff; }
.nav-link { color: rgba(255, 255, 255, .72); font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 7px; }
.nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.nav-chip { display: flex; align-items: center; gap: 8px; color: rgba(255, 255, 255, .8); font-size: 13px; text-decoration: none !important; }
.pip { font-size: 10.5px; padding: 2px 8px; border-radius: 99px; font-weight: 600; }
.pip-free { background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .7); }
.pip-prem { background: var(--prem-bg); color: var(--prem-ink); }

/* ---------- Avatars ---------- */
.av { flex-shrink: 0; display: grid; place-items: center; overflow: hidden; border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av-xs { width: 28px; height: 28px; font-size: 10.5px; border-radius: 7px; }
.av-sm { width: 40px; height: 40px; font-size: 12.5px; }
.av-md { width: 48px; height: 48px; font-size: 14px; }
.av-lg { width: 76px; height: 76px; font-size: 22px; border-radius: 14px; }
.nav .av { background: #0F2E1E; color: var(--accent); }

/* ---------- Landing ---------- */
.hero { background: var(--ink); padding: 64px 20px 72px; position: relative; overflow: hidden; }
.grid-bg { position: absolute; inset: 0; background-image: linear-gradient(rgba(29, 158, 117, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(29, 158, 117, .06) 1px, transparent 1px); background-size: 42px 42px; }
.hero-in { max-width: 680px; margin: 0 auto; position: relative; text-align: center; }
.badge-live { display: inline-flex; align-items: center; gap: 6px; background: rgba(29, 158, 117, .14); border: 1px solid rgba(29, 158, 117, .32); border-radius: 99px; padding: 4px 13px; font-size: 12px; color: #6FD4B0; margin-bottom: 20px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.hero h1 { font-size: clamp(32px, 5.4vw, 56px); font-weight: 650; color: #fff; line-height: 1.05; letter-spacing: -.03em; margin-bottom: 16px; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero p { font-size: 16px; color: rgba(255, 255, 255, .62); line-height: 1.7; margin: 0 auto 28px; max-width: 520px; }
.hero-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.network { margin-top: 44px; height: 160px; }
.network svg { width: 100%; height: 100%; }
@media (prefers-reduced-motion: reduce) { .network animate, .network animateMotion { display: none; } .dot { animation: none; } }
.sector-bar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 20px; text-align: center; }
.eyebrow { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 12px; }
.eyebrow.acc { color: var(--accent); }
.sector-pills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 620px; margin: 0 auto; }
.sector-pill { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-size: 13.5px; font-weight: 500; color: var(--text-2); }
.sector-pill b { color: var(--text); font-weight: 600; }
.section { padding: 56px 20px; max-width: 920px; margin: 0 auto; width: 100%; }
.section h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 650; letter-spacing: -.022em; line-height: 1.15; margin-bottom: 28px; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.step { padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.step-n { font-size: 30px; font-weight: 600; color: var(--border-strong); margin-bottom: 12px; }
.step h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.step p { font-size: 13.5px; color: var(--text-2); line-height: 1.65; }
.dark-band { background: var(--ink); padding: 56px 20px; text-align: center; color: #fff; }
.dark-band h2 { color: #fff; font-size: clamp(24px, 3vw, 32px); font-weight: 650; letter-spacing: -.022em; line-height: 1.15; margin-bottom: 28px; }
.dark-band .eyebrow { color: rgba(255, 255, 255, .45); }
.plans { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; max-width: 640px; margin: 0 auto; text-align: left; }
.plan { padding: 24px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); display: flex; flex-direction: column; }
.plan.feat { border-color: var(--accent); background: #0F161D; color: #fff; }
.plan h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.plan-badge { align-self: flex-start; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; margin-bottom: 10px; }
.price { font-size: 30px; font-weight: 600; color: var(--accent); margin-bottom: 16px; }
.price span { font-size: 13px; font-weight: 400; color: var(--muted); }
.plan.feat .price { color: #fff; }
.plan.feat .price span { color: rgba(255, 255, 255, .5); }
.feature { font-size: 13px; color: var(--text-2); padding: 6px 0; border-bottom: 1px solid var(--border); display: flex; gap: 8px; }
.plan.feat .feature { color: rgba(255, 255, 255, .7); border-color: rgba(255, 255, 255, .08); }
.feature .yes { color: var(--accent); font-weight: 700; }
.feature .no { color: var(--muted); }
.plan .btn { margin-top: auto; }
.plan .features { margin-bottom: 18px; }
.cta-band { background: var(--ink); padding: 8px 20px 64px; text-align: center; }
.cta-band h2 { color: #fff; font-size: 26px; font-weight: 600; margin-bottom: 8px; }
.cta-band p { color: rgba(255, 255, 255, .55); margin-bottom: 22px; }
.footer { background: var(--ink-2); padding: 16px 20px; text-align: center; font-size: 12px; color: rgba(255, 255, 255, .4); }
.footer a { color: rgba(255, 255, 255, .55); }

/* ---------- Auth ---------- */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); flex: 1; min-height: calc(100vh - 56px); }
.auth-side { background: var(--ink); padding: 48px 40px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.auth-side-in { position: relative; max-width: 440px; }
.auth-side h1 { font-size: clamp(24px, 2.6vw, 34px); font-weight: 600; color: #fff; line-height: 1.2; margin: 26px 0 14px; letter-spacing: -.015em; }
.auth-side p { color: rgba(255, 255, 255, .58); font-size: 14px; line-height: 1.7; margin-bottom: 22px; }
.bullet { display: flex; gap: 10px; margin-bottom: 10px; font-size: 13.5px; color: rgba(255, 255, 255, .7); }
.bullet::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 8px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: var(--surface); }
.auth-box { width: 100%; max-width: 400px; }
.auth-box h2 { font-size: 22px; font-weight: 600; margin-bottom: 4px; letter-spacing: -.01em; }
.auth-box .sub { color: var(--text-2); font-size: 13.5px; margin-bottom: 22px; }
.switch { text-align: center; margin-top: 14px; font-size: 13px; color: var(--text-2); }
.stepper { display: flex; align-items: center; gap: 6px; margin-bottom: 22px; }
.stepper .s { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--border); color: var(--muted); transition: all .15s; }
.stepper .s.act { background: var(--ink); color: #fff; }
.stepper .s.done { background: var(--accent); color: #fff; }
.stepper .line { flex: 1; height: 1px; background: var(--border); }
@media (prefers-color-scheme: dark) { .stepper .s.act { background: #fff; color: var(--ink); } }
.choices { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-bottom: 16px; }
.choice { position: relative; display: flex; align-items: center; gap: 8px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 9px; cursor: pointer; font-size: 13.5px; font-weight: 500; background: var(--surface); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:hover { border-color: var(--border-strong); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice.disabled { opacity: .45; cursor: default; }
.plan-opts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.plan-opt { justify-content: space-between; }
.plan-opt .t { font-weight: 600; }
.plan-opt .d { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.plan-opt .p { font-weight: 700; color: var(--accent); }
.rec { background: var(--accent); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 99px; margin-left: 4px; font-weight: 600; }
.fine { text-align: center; font-size: 12px; color: var(--muted); margin-top: 10px; }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span, .label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 5px; color: var(--text-2); }
.field small { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 400; }
.field input:not([type=radio]):not([type=checkbox]):not([type=range]):not([type=file]), .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: var(--surface-2); transition: border .12s, box-shadow .12s; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(29, 158, 117, .14); }
.field input[type=range] { width: 100%; accent-color: var(--accent); }
textarea { resize: vertical; }
.g2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.errors { background: var(--danger-soft); color: var(--danger); border-radius: 9px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
.errors ul { margin-left: 16px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); flex: 1; min-height: calc(100vh - 56px); }
.side { background: var(--surface); border-right: 1px solid var(--border); padding: 14px 0; display: flex; flex-direction: column; position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; }
.side-h { font-size: 10.5px; font-weight: 600; color: var(--muted); letter-spacing: .09em; text-transform: uppercase; padding: 0 16px; margin: 14px 0 4px; }
.side-i { display: flex; align-items: center; gap: 10px; padding: 8px 16px; font-size: 13.5px; color: var(--text-2); border-left: 2px solid transparent; text-decoration: none !important; background: none; border-top: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; cursor: pointer; }
.side-i:hover { background: var(--surface-2); color: var(--text); }
.side-i.on { background: var(--accent-soft); color: var(--accent-ink); border-left-color: var(--accent); font-weight: 600; }
.side-i i { font-size: 17px; width: 18px; text-align: center; }
.cnt { margin-left: auto; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 99px; font-style: normal; }
.cnt-prem { margin-left: auto; background: var(--prem-bg); color: var(--prem-ink); font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 99px; }
.side-foot { padding: 16px; border-top: 1px solid var(--border); margin-top: auto; }
.side-co { font-size: 13px; font-weight: 600; margin: 8px 0 1px; }
.side-sec { font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 99px; vertical-align: middle; }
.chip-free { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.chip-prem { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-line); }
.meter-row { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin: 10px 0 3px; }
.meter-row b { color: var(--accent); }
.meter { height: 4px; background: var(--border); border-radius: 99px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.main { padding: 28px; min-width: 0; }
.main-in { max-width: 980px; }
.page-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-h h1 { font-size: 22px; font-weight: 650; margin-bottom: 3px; letter-spacing: -.018em; line-height: 1.2; }
.page-h p { color: var(--text-2); font-size: 13.5px; }
.tabbar { display: none; }

/* ---------- Cards & widgets ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.card h3 { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; color: inherit; text-decoration: none !important; transition: border-color .12s; box-shadow: var(--shadow); }
.stat:hover { border-color: var(--border-strong); }
.stat-l { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; display: flex; justify-content: space-between; }
.stat-n { font-size: 28px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-s { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.stat-s.up { color: var(--ok-ink); }
.stat-s.warn { color: var(--warn-ink); }
.blur { filter: blur(5px); user-select: none; }
.banner { background: var(--surface); border: 1px solid rgba(29, 158, 117, .25); border-left: 3px solid var(--accent); border-radius: 10px; padding: 14px 16px; margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.banner strong { display: block; font-size: 13.5px; margin-bottom: 2px; }
.banner span { font-size: 12.5px; color: var(--text-2); }
.banner .meter { margin-top: 8px; max-width: 320px; }
.banner.warn { border-color: var(--warn-line); background: var(--warn-bg); }
.banner.warn strong { color: var(--warn-ink); }
.banner.warn span { color: var(--warn-ink); opacity: .85; }
.row-h { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0 12px; }
.row-h h2 { font-size: 15px; font-weight: 600; }
.row-h a { font-size: 12.5px; font-weight: 600; }
.list { display: flex; flex-direction: column; gap: 10px; }
.empty { background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 32px 20px; text-align: center; color: var(--text-2); }
.empty .big { font-size: 30px; margin-bottom: 8px; }
.empty strong { display: block; color: var(--text); margin-bottom: 4px; font-size: 14.5px; }
.empty .btn { margin-top: 14px; }

/* Match card */
.match { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; gap: 14px; align-items: flex-start; box-shadow: var(--shadow); }
.match:hover { border-color: var(--border-strong); }
.ring { position: relative; width: 54px; height: 54px; flex-shrink: 0; }
.ring svg { width: 54px; height: 54px; transform: rotate(-90deg); }
.ring .track { stroke: var(--border); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 15px; font-weight: 700; }
.ring.hi { color: var(--accent); } .ring.mid { color: #D98A0B; } .ring.lo { color: #D64545; }
.m-name { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--text); }
.m-name a { color: inherit; }
.ver { display: inline-flex; align-items: center; gap: 2px; background: var(--accent-soft); color: var(--accent-ink); font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 99px; }
.m-meta { font-size: 12.5px; color: var(--text-2); margin: 2px 0 6px; display: flex; gap: 10px; flex-wrap: wrap; }
.m-desc { font-size: 13px; color: var(--text-2); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.reasons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.reason { font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); padding: 2px 9px; border-radius: 99px; }
.reason.key { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); font-weight: 600; }
.layers { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px 14px; margin-top: 10px; }
.layer-l { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.layer .meter { height: 3px; }
.locked { margin-top: 10px; font-size: 12px; color: var(--muted); }
.locked a { font-weight: 600; }
.m-actions { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }

/* Connection rows */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 9px 14px; font-size: 13.5px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none !important; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.conn { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; color: inherit; text-decoration: none !important; }
a.conn:hover { border-color: var(--border-strong); }
.conn.unread { border-left: 3px solid var(--accent); }
.conn-n { font-size: 14px; font-weight: 600; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.conn-p { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn-intro { font-size: 13px; color: var(--text-2); background: var(--surface-2); border-radius: 8px; padding: 9px 11px; margin-top: 8px; }
.conn-t { font-size: 11.5px; color: var(--muted); white-space: nowrap; text-align: right; }
.udot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin: 6px 0 0 auto; }
.status { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.status-pending { background: var(--warn-bg); color: var(--warn-ink); border-color: transparent; }
.status-declined { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.status-active { background: var(--ok-bg); color: var(--ok-ink); border-color: transparent; }
.status-expiring { background: var(--warn-bg); color: var(--warn-ink); border-color: transparent; }

/* Messages */
.inbox { display: grid; grid-template-columns: 280px minmax(0, 1fr); height: calc(100vh - 56px); margin: -28px; }
.inbox-list { border-right: 1px solid var(--border); overflow-y: auto; background: var(--surface); }
.inbox-h { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14px; font-weight: 600; }
.th { display: block; padding: 12px 16px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none !important; }
.th:hover { background: var(--surface-2); }
.th.on { background: var(--accent-soft); }
.th-n { font-size: 13.5px; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.th-n small { font-size: 11px; color: var(--muted); font-weight: 400; white-space: nowrap; }
.th-p { font-size: 12.5px; color: var(--text-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.th.unread .th-n span::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 6px; vertical-align: middle; }
.chat { display: flex; flex-direction: column; background: var(--bg); min-width: 0; }
.chat-h { padding: 12px 18px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.chat-h .n { font-size: 14px; font-weight: 600; }
.chat-h .s { font-size: 12px; color: var(--text-2); }
.lim { margin-left: auto; font-size: 11.5px; padding: 3px 9px; border-radius: 99px; font-weight: 600; white-space: nowrap; }
.lim-free { background: var(--warn-bg); color: var(--warn-ink); }
.lim-ok { background: var(--accent-soft); color: var(--accent-ink); }
.bubbles { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; list-style: none; }
.bubble { max-width: 68%; align-self: flex-start; }
.bubble p { padding: 9px 13px; border-radius: 3px 12px 12px 12px; background: var(--surface); border: 1px solid var(--border); font-size: 13.5px; line-height: 1.6; }
.bubble.me { align-self: flex-end; }
.bubble.me p { background: var(--accent); color: #fff; border-color: var(--accent); border-radius: 12px 3px 12px 12px; }
.bubble.intro p { border-style: dashed; }
.bubble .t { font-size: 11px; color: var(--muted); margin-top: 3px; }
.bubble.me .t { text-align: right; }
.composer { padding: 12px 18px; background: var(--surface); border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; resize: none; min-height: 42px; max-height: 140px; background: var(--surface-2); }
.composer textarea:focus { border-color: var(--accent); outline: none; }
.limit-note { flex: 1; padding: 10px 12px; background: var(--warn-bg); border-radius: 8px; font-size: 13px; color: var(--warn-ink); }
.back-link { display: none; font-size: 12.5px; }

/* Needs */
.need { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.need + .need { margin-top: 10px; }
.need.expiring { border-left: 3px solid var(--warn-line); }
.need.done { opacity: .65; }
.need-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 6px; }
.need-t { font-size: 14.5px; font-weight: 600; }
.need-d { font-size: 13px; color: var(--text-2); margin-bottom: 10px; line-height: 1.6; }
.need-stats { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); margin-bottom: 10px; flex-wrap: wrap; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tag { font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); padding: 2px 9px; border-radius: 99px; }
.need-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Profile */
.profile-head { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.logo-wrap { position: relative; }
.logo-up { position: absolute; bottom: -4px; right: -4px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); display: grid; place-items: center; color: #fff; cursor: pointer; font-size: 13px; }
.logo-up input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.p-name { font-size: 19px; font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sector-tag { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-ink); }
.p-meta { font-size: 12.5px; color: var(--text-2); margin: 4px 0 10px; display: flex; gap: 14px; flex-wrap: wrap; }
.p-desc { font-size: 13.5px; line-height: 1.7; color: var(--text-2); margin-bottom: 14px; }
.p-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.p-grid .card + .card { margin-top: 0; }
.li { font-size: 13px; color: var(--text-2); padding: 6px 0; border-bottom: 1px solid var(--border); display: flex; gap: 8px; align-items: baseline; }
.li:last-child { border-bottom: 0; }
.li .yes { color: var(--accent); font-weight: 700; }
.li .no { color: var(--danger); font-weight: 700; }
.li .pts { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.photo { position: relative; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo form { position: absolute; top: 4px; right: 4px; }
.photo button { background: rgba(0, 0, 0, .6); color: #fff; border: 0; border-radius: 6px; font-size: 11px; padding: 2px 7px; cursor: pointer; }
.photo-add { aspect-ratio: 4 / 3; border: 1px dashed var(--border-strong); border-radius: 8px; display: grid; place-items: center; color: var(--muted); position: relative; cursor: pointer; font-size: 22px; background: var(--surface-2); text-decoration: none !important; }
.photo-add:hover { border-color: var(--accent); color: var(--accent); }
.photo-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.stars { color: #E2A008; letter-spacing: 1px; }
.review { padding: 10px 0; border-bottom: 1px solid var(--border); }
.review:last-child { border: 0; }
.rating-pick { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; margin-bottom: 10px; }
.rating-pick input { position: absolute; opacity: 0; }
.rating-pick label { font-size: 24px; color: var(--border-strong); cursor: pointer; }
.rating-pick input:checked ~ label, .rating-pick label:hover, .rating-pick label:hover ~ label { color: #E2A008; }
.rating-pick input:focus-visible + label { outline: 2px solid var(--accent); border-radius: 4px; }

/* Analytics */
.a-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.a-grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.a-grid .card + .card, .a-grid2 .card + .card { margin-top: 0; }
.a-l { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; margin-bottom: 8px; }
.a-n { font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; }
.a-s { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 110px; margin-top: 14px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bar i { width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; opacity: .85; }
.bar span { font-size: 11px; color: var(--muted); }
.bar b { font-size: 11px; color: var(--text-2); font-weight: 600; }
.funnel-r { display: grid; grid-template-columns: 110px minmax(0, 1fr) 36px; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 12.5px; color: var(--text-2); }
.funnel-r .meter { height: 6px; }
.funnel-r b { text-align: right; color: var(--text); }
.viewer { display: flex; gap: 10px; align-items: center; padding: 6px 0; }
.viewer .n { font-size: 13px; font-weight: 600; }
.viewer .s { font-size: 12px; color: var(--text-2); }
.viewer .t { margin-left: auto; font-size: 11.5px; color: var(--muted); }

/* Billing */
.bill-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
.bill-n { font-size: 16px; font-weight: 600; margin-bottom: 3px; }
.mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mini div { background: var(--surface-2); border-radius: 8px; padding: 12px; }
.mini span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
.mini b { font-size: 14px; }
.soon { display: flex; flex-wrap: wrap; gap: 6px; }
.soon span { font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); padding: 2px 9px; border-radius: 99px; }

/* Modal & gate pages (server-rendered overlays) */
.overlay { position: fixed; inset: 0; background: rgba(6, 11, 15, .55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 60; backdrop-filter: blur(2px); }
.overlay { animation: scrim .2s ease-out; }
@keyframes scrim { from { background: rgba(6, 11, 15, 0); backdrop-filter: blur(0); } }
.modal { animation: sheet .32s var(--ease-out); transform-origin: 50% 60%; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; width: 100%; max-width: 460px; padding: 24px; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal h3 { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.modal > p { font-size: 13.5px; color: var(--text-2); margin-bottom: 16px; line-height: 1.6; }
.gate-icon { font-size: 28px; margin-bottom: 10px; }
.gate-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.gate-list div { font-size: 13px; color: var(--text-2); display: flex; gap: 8px; }
.gate-list div::before { content: "✓"; color: var(--accent); font-weight: 700; }
.counter { font-size: 11.5px; color: var(--muted); margin-top: 4px; text-align: right; }

@keyframes sheet { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* Toast */
.toasts { position: fixed; bottom: 18px; right: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 11px 16px; background: var(--ink); color: #fff; border-radius: 9px; font-size: 13.5px; display: flex; gap: 8px; align-items: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); animation: tin .32s var(--ease-out), tout .3s ease 4.5s forwards; max-width: 380px; }
.toast-ok::before { content: "✓"; color: var(--accent); font-weight: 700; }
.toast-error::before { content: "!"; color: #F09595; font-weight: 700; }
@keyframes tin { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes tout { to { opacity: 0; transform: translateY(6px); visibility: hidden; } }

/* Public pages */
.public-wrap { max-width: 920px; margin: 0 auto; padding: 28px 20px 56px; width: 100%; flex: 1; }
.error-page { text-align: center; padding: 80px 20px; flex: 1; }
.error-page h1 { font-size: 24px; margin-bottom: 8px; }
.error-page p { color: var(--text-2); margin-bottom: 20px; }

/* ---------- Responsive ---------- */
/* ---------- Layout helpers ---------- */
fieldset { border: 0; min-width: 0; }
.js fieldset[data-step]:not(.cur) { display: none; }
fieldset h2 { font-size: 20px; font-weight: 650; letter-spacing: -.016em; margin-bottom: 3px; }
fieldset .sub { margin-bottom: 18px; }
.narrow { max-width: 640px; }
.back-row { display: inline-block; font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.section-gap { margin-bottom: 22px; }
.mt { margin-top: 14px; }
.mt-s { margin-top: 8px; }
.pad { padding: 16px; }
.ellipsis { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.inline-dot { display: inline-block; margin: 0 0 1px 4px; vertical-align: middle; }
a.viewer { color: inherit; text-decoration: none !important; border-radius: 8px; }
a.viewer:hover .n { color: var(--accent); }
.conn-actions { display: flex; flex-direction: column; gap: 6px; }
.choices-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.review-h { font-size: 13px; margin-bottom: 3px; }
.review-form { padding-bottom: 14px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.upload-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; }
.w-label { width: 90px; flex: none; }
.center-empty { margin: auto; border: 0; background: none; max-width: 360px; }
.a-s.up { color: var(--ok-ink); }
.public-wrap > .card + .p-grid, .public-wrap > .p-grid + .card { margin-top: 12px; }
.main-in > .card + .p-grid, .main-in > .p-grid + .card { margin-top: 12px; }
/* Worst-case data guards (see `npm run seed:worst`). */
.m-name a, .conn-n, .p-name, .th-n span, .chat-h .n, .side-co, .viewer .n, .need-t, .li, .page-h h1, .page-h p, .review-h, .nav-chip .nm, .p-meta, .bubble .t, .conn-intro, .m-desc, .need-d, .p-desc, .review p { overflow-wrap: anywhere; min-width: 0; }
.reason { border-radius: 8px; max-width: 100%; }
.ver, .status, .chip, .lim { flex-shrink: 0; }
.conn { position: relative; }
.mobile-only { display: none; }
@media (max-width: 760px) { .mobile-only { display: block; } .mobile-only .side-i { padding-left: 0; } }
.label-row { display: flex !important; justify-content: space-between; gap: 8px; }
.label-row a { font-weight: 500; }
.av-warn { background: var(--warn-bg); color: var(--warn-ink); }
.info-rows { margin-top: 4px; }
.m-actions .status { align-self: center; }
.photo-add label { position: absolute; inset: 0; display: grid; place-items: center; cursor: pointer; }

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .a-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .nav { padding: 0 16px; }
  .nav-chip .nm { display: none; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { display: none; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .main { padding: 20px 16px 88px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--border); z-index: 50; padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; font-size: 10.5px; color: var(--text-2); position: relative; text-decoration: none !important; }
  .tabbar a i { font-size: 20px; }
  .tabbar a.on { color: var(--accent); font-weight: 600; }
  .tabbar .cnt { position: absolute; top: 3px; left: 54%; margin: 0; font-size: 9.5px; padding: 0 5px; }
  .steps, .plans, .p-grid, .a-grid, .a-grid2, .sector-pills { grid-template-columns: minmax(0, 1fr); }
  .layers { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .inbox { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 56px - 60px); margin: -20px -16px -88px; }
  .inbox.has-thread .inbox-list { display: none; }
  .inbox:not(.has-thread) .chat { display: none; }
  .back-link { display: inline; }
  .bubble { max-width: 88%; }
  .mini { grid-template-columns: minmax(0, 1fr); }
  .choices-3 { grid-template-columns: minmax(0, 1fr); }
  .conn { flex-wrap: wrap; }
  .conn > .conn-t { position: absolute; top: 14px; right: 16px; }
  .conn .conn-n { padding-right: 56px; }
  .conn-actions { flex-direction: row; width: 100%; padding-left: 60px; }
  .g2 { grid-template-columns: minmax(0, 1fr); }
  .match { gap: 12px; padding: 14px; }
  .toasts { left: 16px; right: 16px; bottom: 76px; }
}

/* Translucent bottom tab bar on phones */
@media (max-width: 760px) {
  .tabbar { background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); }
}

/* Accessibility preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .modal, .toast { animation: fade .2s ease !important; }
  @keyframes fade { from { opacity: 0; } }
  .btn:active, .side-i:active, .tab:active, .stat:active, .tabbar a:active, .choice:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .nav { background: var(--ink); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .tabbar { background: var(--surface) !important; backdrop-filter: none !important; }
  .overlay { backdrop-filter: none; background: rgba(6, 11, 15, .7); }
}
@media (prefers-contrast: more) {
  :root { --border: #8A9099; --text-2: #2A3038; --muted: #4A525D; }
  .btn-secondary, .card, .match, .conn, .need, .stat { border-width: 1.5px; }
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Phones: the language switch takes the room the sign-up button had; the page itself always offers sign-up. */
.nav .logo, .nav .nav-link { white-space: nowrap; }
@media (max-width: 480px) {
  .nav-r > .btn { display: none; }
}

/* Audit log filters: one row on wide screens, stacked on phones. */
.audit-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 10px; align-items: end; }
.audit-filters .field { margin-bottom: 0; min-width: 0; }
.audit-filters select { width: 100%; }
@media (max-width: 760px) { .audit-filters { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  #audit .viewer { flex-wrap: wrap; align-items: flex-start; }
  #audit .viewer .grow { flex: 1 1 0; }
  #audit .viewer .t { flex-basis: 100%; margin-left: 42px; margin-top: -2px; }
}
