:root {
  --navy-950: #101c28;
  --navy-800: #21384a;
  --navy-700: #315268;
  --olive-700: #586348;
  --olive-500: #7d8967;
  --sand-100: #f5f0e6;
  --sand-200: #e7ddc9;
  --paper: #fffefa;
  --ink: #18232d;
  --muted: #63707a;
  --danger: #a33434;
  --focus: #d99124;
  --radius: 16px;
  --shadow: 0 16px 45px rgba(16, 28, 40, .09);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; background: var(--sand-100); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; line-height: 1.58; }
a { color: var(--navy-700); text-underline-offset: 3px; }
a:hover { color: var(--olive-700); }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.container { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 99; background: white; padding: 10px 14px; }
.skip-link:focus { top: 12px; }
.site-header { background: var(--navy-950); color: white; }
.nav { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { color: white; font-weight: 850; font-size: 1.35rem; text-decoration: none; letter-spacing: -.03em; }
.nav-links { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 18px; }
.nav-links a, .link-button { color: white; font-weight: 650; text-decoration: none; }
.inline-form { display: inline; margin: 0; }
.link-button { border: 0; background: transparent; cursor: pointer; padding: 0; }
.page-shell { min-height: 68vh; padding-block: 48px 72px; }
.site-footer { background: var(--navy-950); color: #dce3e8; padding: 30px 0; font-size: .88rem; }
.site-footer a { color: white; }
h1, h2, h3 { color: var(--navy-950); line-height: 1.15; letter-spacing: -.025em; }
h1 { font-size: clamp(2rem, 6vw, 4.6rem); margin: .15em 0 .35em; }
h2 { font-size: clamp(1.3rem, 3vw, 2rem); }
.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); max-width: 65ch; color: #40505d; }
.eyebrow { color: var(--olive-700); font-weight: 800; font-size: .78rem; letter-spacing: .11em; text-transform: uppercase; }
.hero { display: grid; grid-template-columns: 1.5fr .8fr; gap: 52px; align-items: center; padding: 44px 0 72px; }
.hero-panel { background: var(--navy-800); color: white; padding: 28px; border-radius: var(--radius); box-shadow: var(--shadow); display: grid; grid-template-columns: auto 1fr; gap: 16px; }
.hero-panel p { margin: 0; }
.step-number { color: var(--sand-200); font-weight: 900; }
.feature-grid, .match-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--paper); border: 1px solid rgba(33, 56, 74, .12); border-radius: var(--radius); padding: clamp(22px, 4vw, 34px); box-shadow: var(--shadow); }
.narrow { width: min(680px, 100%); margin-inline: auto; }
.center { text-align: center; }
.button-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 24px; }
.button { display: inline-flex; justify-content: center; align-items: center; border: 2px solid var(--navy-800); border-radius: 9px; background: var(--navy-800); color: white; padding: 11px 18px; font-weight: 750; text-decoration: none; cursor: pointer; min-height: 46px; }
.button:hover { background: var(--navy-950); color: white; }
.button-secondary { background: transparent; color: var(--navy-800); }
.button-danger { background: var(--danger); border-color: var(--danger); }
.button.secondary { background: transparent; color: var(--navy-800); }
.button.danger, button.danger { background: var(--danger); border-color: var(--danger); color: white; }
.button-small { min-height: 38px; padding: 7px 13px; }
.full { width: 100%; }
.auth-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .55fr); gap: 28px; align-items: start; max-width: 960px; margin: auto; }
.auth-note { background: var(--olive-700); color: white; border-radius: var(--radius); padding: 26px; }
.auth-note h2 { color: white; }
.field { margin: 0 0 18px; }
.field > label:not(.checkbox-row) { display: block; font-weight: 750; margin-bottom: 6px; }
.field input:not([type=checkbox]), .field select, .field textarea { width: 100%; padding: 11px 12px; border: 1px solid #aeb7bd; border-radius: 8px; background: white; color: var(--ink); }
.field-error input, .field-error select, .field-error textarea { border-color: var(--danger); }
.checkbox-row { display: flex; gap: 10px; align-items: flex-start; font-weight: 650; }
.checkbox-row input { width: 20px; height: 20px; margin-top: 3px; }
.help-text, .muted { color: var(--muted); font-size: .9rem; }
.help-text ul { margin: 6px 0; padding-left: 20px; }
.error-text, .errorlist { color: var(--danger); font-weight: 650; }
.stack-links { margin-top: 22px; display: flex; flex-direction: column; gap: 8px; }
.messages { margin-bottom: 20px; }
.message { background: #e9f2e3; border-left: 5px solid var(--olive-500); padding: 12px 16px; border-radius: 6px; }
.status-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: auto; border-radius: 50%; background: var(--olive-700); color: white; font-size: 1.8rem; }
.progress { height: 8px; border-radius: 999px; background: var(--sand-200); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--olive-700); }
.profile-header { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; }
.profile-header h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
.avatar { width: 108px; height: 108px; border-radius: 50%; overflow: hidden; background: var(--olive-700); color: white; display: grid; place-items: center; font-size: 2.5rem; font-weight: 850; flex: 0 0 auto; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-small { width: 58px; height: 58px; font-size: 1.25rem; }
.section-heading { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin: 48px 0 22px; }
.section-heading h1, .section-heading h2, .section-heading p { margin-block: 3px; }
.timeline { border-left: 2px solid var(--sand-200); margin-left: 14px; padding-left: 34px; display: grid; gap: 20px; }
.timeline-item { position: relative; }
.timeline-dot { position: absolute; left: -44px; top: 32px; width: 17px; height: 17px; border: 4px solid var(--sand-100); border-radius: 50%; background: var(--olive-700); }
.action-links { display: flex; gap: 16px; margin-top: 18px; }
.danger-link { color: var(--danger); }
.empty-state { grid-column: 1 / -1; text-align: center; }
.match-grid { grid-template-columns: repeat(2, 1fr); }
.match-head { display: flex; gap: 16px; align-items: center; }
.match-head h2, .match-head p { margin: 2px 0; }
.match-label { display: inline-block; background: var(--sand-200); color: var(--olive-700); font-weight: 800; padding: 7px 11px; border-radius: 999px; }
.notice { border-left: 5px solid var(--focus); background: #fff7e8; padding: 12px 14px; }
.prose { max-width: 75ch; }
.narrow-card { width: min(720px, 100%); margin: 0 auto 22px; }
.page-header { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 24px; }
.page-header h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); }
.real-counters, .stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0 0 36px; }
.real-counters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.real-counters > div { background: var(--navy-800); color: white; border-radius: var(--radius); padding: 22px; }
.real-counters strong, .stats-grid strong { display: block; font-size: 2rem; }
.real-counters span, .stats-grid span { display: block; color: inherit; }
.privacy-callout { margin-top: 24px; border-left: 5px solid var(--olive-700); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(230px, 1fr); gap: 20px; align-items: start; }
.list-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding: 14px 0; border-bottom: 1px solid var(--sand-200); color: inherit; text-decoration: none; }
.list-row:last-child { border-bottom: 0; }
.list-row > span { flex: 1; color: var(--muted); }
.list-row > small { color: var(--muted); }
.search-form { display: flex; gap: 10px; }
.search-form input { flex: 1; min-width: 0; padding: 11px 12px; border: 1px solid #aeb7bd; border-radius: 8px; }
.tabs, .filter-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.tabs a, .filter-links a { padding: 8px 12px; border-radius: 999px; background: var(--sand-100); text-decoration: none; }
.tabs a[aria-current="page"] { background: var(--navy-800); color: white; }
.filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.filter-grid label { display: grid; gap: 5px; font-weight: 700; }
.filter-grid input, .filter-grid select { width: 100%; min-width: 0; padding: 9px; border: 1px solid #aeb7bd; border-radius: 7px; }
.detail-list { display: grid; grid-template-columns: minmax(100px, .45fr) 1.5fr; gap: 8px 16px; }
.detail-list dt { font-weight: 800; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.danger-zone { border-top: 5px solid var(--danger); }
.legal-copy h2 { margin-top: 2rem; }
.cookie-banner { position: fixed; z-index: 80; right: 18px; bottom: 18px; width: min(430px, calc(100% - 36px)); padding: 18px; border: 1px solid var(--sand-200); border-radius: 12px; background: var(--paper); box-shadow: var(--shadow); }
.cookie-banner p { margin-top: 0; }
.cookie-banner label { margin-right: 12px; }
.app-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr) 230px; gap: 24px; align-items: start; }
.app-layout > .page-shell { width: 100%; min-width: 0; }
.left-rail, .right-rail { position: sticky; top: 22px; padding-top: 46px; }
.side-nav { display: grid; gap: 5px; }
.side-nav a, .disabled-link { display: block; border-radius: 9px; padding: 10px 12px; text-decoration: none; font-weight: 720; }
.side-nav a:hover { background: var(--sand-200); }
.disabled-link { color: var(--muted); cursor: not-allowed; font-size: .86rem; }
.rail-card { border: 1px solid rgba(33, 56, 74, .12); border-radius: 12px; background: rgba(255, 254, 250, .72); padding: 18px; }
.rail-card h2 { font-size: 1.1rem; }
.nav-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding-inline: 5px; border-radius: 999px; background: var(--focus); color: var(--navy-950); font-size: .72rem; font-weight: 900; }
.mobile-nav { display: none; }
.page-title { font-size: clamp(2rem, 5vw, 3.2rem); }
.composer { margin-bottom: 24px; }
.composer h2 { margin-top: 0; }
.feed-list, .people-list, .notification-list { display: grid; gap: 16px; }
.post-card { padding: clamp(18px, 3vw, 28px); }
.post-head, .person-row { display: flex; gap: 14px; align-items: center; }
.post-head h2, .person-row h2, .person-row h3 { margin: 0; font-size: 1.1rem; }
.post-head p, .person-row p { margin: 3px 0; }
.post-text { margin-block: 20px; overflow-wrap: anywhere; }
.photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin: 16px -8px; }
.photo-grid img { width: 100%; height: 260px; object-fit: cover; background: var(--sand-200); }
.post-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; border-top: 1px solid var(--sand-200); padding-top: 12px; }
.post-actions form { display: flex; align-items: center; gap: 7px; }
.post-actions select { max-width: 145px; padding: 5px; border: 1px solid #aeb7bd; border-radius: 6px; }
.dark-link { color: var(--navy-700); }
.comments { margin-top: 22px; }
.comment { border-top: 1px solid var(--sand-200); padding: 18px 0 0; margin-top: 18px; }
.comment.reply { margin-left: 28px; border-left: 3px solid var(--sand-200); border-top: 0; padding: 12px 0 0 16px; }
.reply-form { display: none; margin-top: 12px; }
.reply-form.visible { display: block; }
.reply-form textarea { width: 100%; padding: 9px; border: 1px solid #aeb7bd; border-radius: 7px; }
.people-list .person-row { justify-content: space-between; padding: 18px 22px; }
.person-row > div:nth-child(2) { flex: 1; }
.no-underline { text-decoration: none; color: inherit; }
.group-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.group-hero { display: flex; justify-content: space-between; gap: 26px; align-items: center; }
.group-hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
.admin-panel { display: grid; gap: 22px; margin-top: 32px; }
.invite-panel { margin-bottom: 20px; }
.invite-panel .person-row { justify-content: space-between; padding-block: 12px; border-top: 1px solid var(--sand-200); }
.admin-panel form { display: grid; gap: 7px; }
.inline-controls { display: flex; gap: 8px; }
.inline-controls input { flex: 1; min-width: 0; padding: 10px; border: 1px solid #aeb7bd; border-radius: 8px; }
.notification { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 18px 22px; }
.notification.unread { border-left: 5px solid var(--focus); }
.pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 18px; padding: 28px 0 0; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.profile-actions form { margin: 0; }
.chat-shell { padding: 0; overflow: hidden; }
.chat-head { padding: 20px 24px; border-bottom: 1px solid var(--sand-200); }
.chat-head h1 { margin: 8px 0 0; font-size: 1.6rem; }
.message-stream { min-height: 360px; max-height: 55vh; overflow-y: auto; padding: 20px; background: #f8f5ee; }
.chat-message { width: fit-content; max-width: min(78%, 560px); margin: 0 0 12px; padding: 10px 14px; border-radius: 4px 14px 14px; background: white; box-shadow: 0 3px 12px rgba(16, 28, 40, .08); overflow-wrap: anywhere; }
.chat-message.mine { margin-left: auto; border-radius: 14px 4px 14px 14px; background: #dfe9d7; }
.chat-message p { margin: 0 0 4px; }
.chat-message span, .chat-message button { color: var(--muted); font-size: .72rem; }
.chat-composer { padding: 18px 22px; }
.chat-composer .field { margin-bottom: 9px; }
.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; }

@media (max-width: 780px) {
  .hero, .auth-layout, .feature-grid, .match-grid, .dashboard-grid { grid-template-columns: 1fr; }
  .app-layout { display: block; }
  .left-rail, .right-rail { display: none; }
  .app-layout > .page-shell { padding-bottom: 110px; }
  .mobile-nav { position: fixed; z-index: 50; display: grid; grid-template-columns: repeat(5, 1fr); left: 0; right: 0; bottom: 0; min-height: 66px; padding: 7px max(7px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left)); border-top: 1px solid #cfd4d0; background: rgba(255, 254, 250, .96); box-shadow: 0 -7px 24px rgba(16, 28, 40, .11); }
  .mobile-nav a { display: grid; justify-items: center; align-content: center; gap: 1px; color: var(--navy-800); text-decoration: none; font-size: .68rem; font-weight: 750; }
  .mobile-nav span { font-size: 1.25rem; }
  .mobile-nav .mobile-create span { display: grid; place-items: center; width: 38px; height: 38px; margin-top: -19px; border-radius: 50%; background: var(--navy-800); color: white; }
  .group-grid { grid-template-columns: 1fr; }
  .group-hero { display: block; }
  .profile-header { grid-template-columns: auto 1fr; }
  .profile-header > .button { grid-column: 1 / -1; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav { align-items: flex-start; padding-block: 15px; }
  .nav-links { gap: 10px 14px; font-size: .92rem; }
}

@media (max-width: 480px) {
  .container { width: min(100% - 22px, 1120px); }
  .page-shell { padding-block: 28px 52px; }
  .nav { display: block; }
  .nav-links { justify-content: flex-start; margin-top: 12px; }
  .hero { padding-top: 18px; gap: 28px; }
  .button-row > * { width: 100%; }
  .profile-header { display: block; }
  .profile-header .avatar { margin-bottom: 18px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .timeline { margin-left: 7px; padding-left: 24px; }
  .timeline-dot { left: -34px; }
  .site-header .nav { display: flex; }
  .site-header .nav-links > a:last-of-type { display: none; }
  .photo-grid img { height: 190px; }
  .people-list .person-row { align-items: flex-start; flex-wrap: wrap; }
  .notification { align-items: flex-start; flex-direction: column; }
  .real-counters, .stats-grid, .filter-grid { grid-template-columns: 1fr; }
  .search-form { display: grid; }
  .cookie-banner { bottom: 82px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
