:root {
    --ink: #183b3a;
    --muted: #657776;
    --brand: #247f78;
    --brand-dark: #17665f;
    --gold: #d6a84f;
    --paper: #fffdf9;
    --wash: #f3f7f5;
    --line: #d8e4df;
    --danger: #a54141;
    --shadow: 0 18px 50px rgba(24, 59, 58, 0.10);
    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --font-body: "Manrope", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--wash);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% -10%, rgba(36,127,120,.10), transparent 34%),
        radial-gradient(circle at 92% 8%, rgba(214,168,79,.12), transparent 28%),
        var(--wash);
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.skip-link {
    position: absolute;
    left: 16px;
    top: 12px;
    z-index: 100;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--ink);
    color: white;
    text-decoration: none;
    font-weight: 700;
    transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }
#main-content:focus { outline: none; }
#main-content:focus-visible { outline: 3px solid rgba(36,127,120,.35); outline-offset: 4px; }

.auth-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
    background: var(--paper);
}
.auth-story {
    padding: 48px clamp(32px, 6vw, 88px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: white;
    background:
        radial-gradient(circle at 80% 15%, rgba(214,168,79,.45), transparent 30%),
        linear-gradient(150deg, #123c39, #247f78);
}
.auth-story a.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    align-self: start;
    text-decoration: none;
    color: white;
}
.auth-story .auth-brand img {
    width: 42px;
    height: 42px;
    display: block;
    filter: none;
}
.auth-story .brand-wordmark {
    font-family: var(--font-body);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    color: white;
}
.auth-story h1 { max-width: 600px; margin: 32px 0 16px; font-family: var(--font-display); font-size: clamp(42px, 6vw, 72px); line-height: .98; font-weight: 500; }
.auth-story p { max-width: 520px; margin: 0; font-size: 18px; line-height: 1.65; color: rgba(255,255,255,.82); }
.auth-quote { border-left: 2px solid var(--gold); padding-left: 18px; font-size: 14px; color: rgba(255,255,255,.72); }
.auth-panel { display: grid; place-items: center; padding: 32px; }
.auth-card { width: min(100%, 430px); }
.eyebrow { margin: 0 0 10px; color: var(--brand); font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
.auth-card h2, .page-title { margin-bottom: 10px; font-family: var(--font-display); font-size: clamp(32px, 4vw, 46px); font-weight: 500; }
.subtle { color: var(--muted); line-height: 1.6; }
.field { display: grid; gap: 7px; margin: 18px 0; }
.field label, .field .field-label { font-size: 13px; font-weight: 700; }
.field input, .field select, .field textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 13px 14px;
    color: var(--ink);
    background: white;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(36,127,120,.12); }
.btn {
    border: 0;
    border-radius: 12px;
    padding: 12px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--ink);
    background: #e9efec;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
}
.btn:hover { filter: brightness(.97); }
.btn:disabled { cursor: not-allowed; opacity: .55; filter: none; }
.btn-primary { color: white; background: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { border: 1px solid var(--line); background: white; }
.btn-danger { color: var(--danger); background: #fff0f0; }
.btn-wide { width: 100%; }
.fine-print { margin-top: 18px; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; }
.check-line { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; color: var(--ink); font-size: 14px; line-height: 1.5; }
.check-line input { margin-top: 3px; accent-color: var(--brand); }

.app-layout { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 10;
    display: flex; flex-direction: column; padding: 28px 18px;
    border-right: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(255,253,249,.98), rgba(244,248,246,.96)),
        var(--paper);
}
.brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 10px 28px; }
.brand a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--ink);
}
.brand img { width: 36px; height: 36px; display: block; flex-shrink: 0; }
.brand .brand-wordmark {
    font-family: var(--font-body);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}
.pill { border-radius: 999px; padding: 5px 9px; color: var(--brand-dark); background: #dcefeb; font-size: 11px; font-weight: 800; }
.nav { display: grid; gap: 5px; }
.nav a { padding: 11px 12px; border-radius: 10px; display: flex; gap: 10px; text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 650; }
.nav a:hover, .nav a.active { color: var(--ink); background: #eaf2ef; }
.nav-icon { width: 19px; text-align: center; }
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--line); padding: 18px 8px 0; }
.mini-profile { display: flex; align-items: center; gap: 10px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: white; background: linear-gradient(135deg, var(--brand), var(--gold)); font-weight: 800; }
.mini-profile strong, .mini-profile span { display: block; }
.mini-profile span { color: var(--muted); font-size: 12px; }
.main { grid-column: 2; min-width: 0; padding: 38px clamp(22px, 5vw, 72px) 90px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 34px; }
.topbar-leading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-brand { display: none; align-items: center; gap: 8px; text-decoration: none; flex-shrink: 0; color: var(--ink); }
.topbar-brand img { height: 28px; width: 28px; display: block; }
.topbar-brand .brand-wordmark {
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.tracking-context { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 750; }
.tracking-context select { max-width: 210px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--ink); background: white; }
.tracking-banner { margin-bottom: 22px; }
.mobile-nav { display: none; }
.page-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-header .subtle { max-width: 650px; margin-bottom: 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.content-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.card { border: 1px solid var(--line); border-radius: 18px; padding: 22px; background: var(--paper); box-shadow: 0 5px 24px rgba(24,59,58,.04); }
.card h3 { margin-bottom: 8px; font-family: var(--font-display); font-weight: 500; }
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: 1 / -1; }
.stat { font-family: var(--font-display); font-size: 38px; }
.stat-label { color: var(--muted); font-size: 13px; }
.progress { height: 7px; overflow: hidden; border-radius: 99px; background: #e5ece9; }
.progress > span { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--gold)); }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.discovery-count { margin-left: auto; align-self: center; color: var(--muted); font-size: 13px; font-weight: 700; }
.discovery-filters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; margin-bottom: 22px; }
.discovery-filters .form-actions { align-items: end; }
.filter-chip { border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; color: var(--muted); background: white; cursor: pointer; }
.filter-chip.active { border-color: var(--brand); color: white; background: var(--brand); }
.profile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.discovery-pagination { display: flex; justify-content: center; padding-top: 24px; }
.profile-card { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease; }
.profile-card:hover { transform: translateY(-2px); box-shadow: 0 22px 48px rgba(24,59,58,.12); }
.profile-photo {
    position: relative;
    overflow: hidden;
    height: 280px;
    display: flex;
    align-items: end;
    padding: 18px;
    color: white;
    background-size: cover;
    background-position: center;
}
.profile-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(12,37,35,.78), rgba(12,37,35,.08) 55%, transparent 78%);
    z-index: 0;
    pointer-events: none;
}
.profile-photo-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}
.profile-photo > div { position: relative; z-index: 1; width: 100%; }
.profile-photo.one { background: linear-gradient(135deg,#bcd8d3,#247f78); }
.profile-photo.two { background: linear-gradient(135deg,#ead8bb,#9d7148); }
.profile-photo.three { background: linear-gradient(135deg,#cdc2da,#70598a); }
.profile-photo h3 { margin: 0; font-family: var(--font-display); font-size: 25px; font-weight: 500; }
.profile-body { padding: 18px; }
.profile-meta { min-height: 42px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.profile-actions .btn { flex: 1 1 calc(50% - 8px); padding: 9px 10px; font-size: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { border-radius: 999px; padding: 6px 9px; color: var(--brand-dark); background: #e7f2ef; font-size: 11px; font-weight: 700; text-transform: capitalize; }

.form-card { max-width: 840px; margin: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-section { margin: 28px 0 8px; padding-top: 24px; border-top: 1px solid var(--line); grid-column: 1 / -1; }
.form-section:first-child { margin-top: 0; border-top: 0; }
.radio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.radio-card { border: 1px solid var(--line); border-radius: 13px; padding: 14px; cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--brand); background: #eef7f4; }
.radio-card input { margin-right: 6px; accent-color: var(--brand); }
.radio-card strong { display: block; margin-bottom: 5px; }
.radio-card span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.visibility-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.visibility-options .notice { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 22px; grid-column: 1 / -1; }
.notice { border-left: 3px solid var(--gold); border-radius: 8px; padding: 13px 15px; color: #66562f; background: #fff8e9; font-size: 13px; line-height: 1.5; }
.empty { padding: 56px 24px; text-align: center; }
.empty-mark { width: 52px; height: 52px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; color: var(--brand); background: #e2f1ed; font-size: 24px; }
.note-dialog { width: min(92vw, 560px); border: 0; padding: 0; border-radius: 18px; background: transparent; box-shadow: var(--shadow); }
.note-dialog::backdrop { background: rgba(14, 39, 37, .52); backdrop-filter: blur(3px); }
.note-dialog .card { margin: 0; }

.biodata-sheet {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255,253,249,.98), rgba(247,251,249,.96)),
        var(--paper);
    box-shadow: var(--shadow);
}
.biodata-hero {
    display: grid;
    grid-template-columns: minmax(240px, 0.95fr) minmax(0, 1.2fr);
    gap: 0;
    min-height: 360px;
}
.biodata-hero-media {
    position: relative;
    min-height: 360px;
    background:
        linear-gradient(160deg, rgba(36,127,120,.18), transparent 45%),
        linear-gradient(135deg, #d7ebe6, #f3e7cf);
}
.biodata-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    min-height: 360px;
}
.biodata-hero-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--brand-dark);
    font-family: var(--font-display);
    font-size: 64px;
    font-weight: 500;
}
.biodata-hero-copy {
    padding: clamp(24px, 4vw, 40px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
}
.biodata-hero-copy h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(34px, 4vw, 48px);
    font-weight: 500;
    line-height: 1.05;
}
.biodata-kicker {
    margin: 0;
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.biodata-summary {
    margin: 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.55;
}
.biodata-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.biodata-body {
    display: grid;
    gap: 0;
    border-top: 1px solid var(--line);
}
.biodata-section {
    padding: clamp(22px, 3vw, 32px);
    border-top: 1px solid var(--line);
}
.biodata-section:first-child { border-top: 0; }
.biodata-section h3 {
    margin: 0 0 16px;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 500;
}
.biodata-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
}
.biodata-fact {
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(244,248,246,.9);
    border: 1px solid rgba(216,228,223,.8);
}
.biodata-fact span,
.biodata-fact strong { display: block; }
.biodata-fact span {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.biodata-fact strong {
    font-size: 15px;
    font-weight: 650;
    text-transform: capitalize;
    line-height: 1.4;
}
.profile-copy { white-space: pre-line; color: var(--muted); line-height: 1.7; margin: 0; }
.photo-gallery {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 12px;
}
.gallery-photo {
    position: relative;
    overflow: hidden;
    min-height: 180px;
    border-radius: 16px;
    background: var(--wash);
}
.gallery-photo:first-child {
    grid-row: span 2;
    min-height: 372px;
}
.gallery-photo img { width: 100%; height: 100%; min-height: inherit; object-fit: cover; display: block; }
.gallery-photo .btn { position: absolute; right: 8px; bottom: 8px; padding: 7px 10px; font-size: 11px; }
.photo-gallery.compact { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.photo-gallery.compact .gallery-photo,
.photo-gallery.compact .gallery-photo:first-child {
    grid-row: auto;
    min-height: 180px;
}
.private-photo {
    min-height: 220px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    padding: 24px;
    color: white;
    background:
        radial-gradient(circle at 20% 20%, rgba(214,168,79,.28), transparent 40%),
        linear-gradient(135deg, rgba(36,127,120,.82), rgba(24,59,58,.94));
    text-align: center;
}
.private-photo span { max-width: 280px; font-weight: 750; }
.member-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.member-header { margin-bottom: 20px; }
.share-panel { display: grid; gap: 18px; }
.share-panel .form-grid { align-items: end; }
.share-links { display: grid; gap: 14px; }
.share-link-card {
    display: grid;
    gap: 12px;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #f7fbf9;
}
.share-link-card .field { margin: 0; }
.admin-community-header { display: grid; grid-template-columns: 1fr minmax(300px, .8fr); gap: 24px; align-items: start; }
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 20px 0 26px; }
.admin-stats > div { padding: 14px; border-radius: 12px; background: var(--wash); }
.admin-stats strong, .admin-stats span { display: block; }
.admin-stats strong { font-family: var(--font-display); font-size: 26px; }
.admin-stats span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.admin-members { display: grid; gap: 8px; }
.admin-member { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.admin-member-info strong, .admin-member-info span { display: block; }
.admin-member-info span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.verification-review-list { display: grid; gap: 18px; }
.verification-review-card { display: grid; gap: 20px; }
.verification-review-heading { display: flex; justify-content: space-between; align-items: start; gap: 18px; }
.verification-review-heading h3 { margin: 12px 0 4px; }
.verification-application { padding: 18px; border-radius: 14px; background: var(--wash); }
.verification-application h4 { margin: 0 0 8px; }
.verification-review-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: end; }
.verification-review-form .form-actions { padding-top: 0; grid-column: auto; }
.notification-button { position: relative; min-width: 44px; }
.notification-button span { position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; border-radius: 999px; display: grid; place-items: center; padding: 0 5px; color: white; background: var(--danger); font-size: 10px; }
.notification-list { padding: 0; overflow: hidden; }
.notification-item { width: 100%; border: 0; border-top: 1px solid var(--line); padding: 18px 20px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; color: var(--ink); background: var(--paper); text-align: left; cursor: pointer; }
.notification-item:first-child { border-top: 0; }
.notification-item:hover, .notification-item.unread { background: #f1f8f5; }
.notification-icon { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: var(--brand); background: #dff0eb; font-size: 20px; }
.notification-copy strong, .notification-copy span, .notification-copy small { display: block; }
.notification-copy span { margin-top: 4px; color: var(--muted); line-height: 1.45; }
.notification-copy small { margin-top: 7px; color: #879593; }
.unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; padding: 13px 18px; border-radius: 12px; color: white; background: var(--ink); box-shadow: var(--shadow); animation: slide-in .25s ease-out; }
@keyframes slide-in { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .toast, .profile-card { animation: none; transition: none; }
}

@media (max-width: 960px) {
    .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .span-4 { grid-column: span 6; }
    .biodata-hero { grid-template-columns: 1fr; }
    .biodata-hero-media,
    .biodata-hero-media img { min-height: 300px; }
    .photo-gallery { grid-template-columns: 1fr 1fr; }
    .gallery-photo:first-child { grid-row: auto; min-height: 240px; }
}
@media (max-width: 760px) {
    .auth-layout { display: block; background: var(--paper); }
    .auth-story { min-height: 330px; padding: 28px 24px; }
    .auth-story h1 { font-size: 42px; }
    .auth-story p { font-size: 15px; }
    .auth-quote { display: none; }
    .auth-panel { padding: 38px 24px; }
    .app-layout { display: block; }
    .sidebar { display: none; }
    .main { padding: 24px 18px 96px; }
    .mobile-nav {
        position: fixed; inset: auto 0 0; z-index: 30;
        display: grid; grid-template-columns: repeat(5, 1fr);
        border-top: 1px solid var(--line); padding: 9px 5px max(9px, env(safe-area-inset-bottom));
        background: rgba(255,253,249,.96); backdrop-filter: blur(14px);
    }
    .mobile-nav a { display: grid; gap: 4px; justify-items: center; color: var(--muted); font-size: 10px; text-decoration: none; }
    .mobile-nav a.active { color: var(--brand); font-weight: 800; }
    .topbar { margin-bottom: 24px; }
    .topbar-brand { display: inline-flex; }
    .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
    .tracking-context span { display: none; }
    .tracking-context select { max-width: 160px; }
    .page-header { align-items: start; flex-direction: column; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1 1 auto; }
    .profile-grid, .form-grid { grid-template-columns: 1fr; }
    .discovery-filters { grid-template-columns: 1fr 1fr; }
    .radio-grid { grid-template-columns: 1fr; }
    .visibility-options { grid-template-columns: 1fr; }
    .admin-community-header { grid-template-columns: 1fr; }
    .admin-stats { grid-template-columns: 1fr 1fr; }
    .admin-member { grid-template-columns: auto minmax(0, 1fr) auto; }
    .admin-member .btn { grid-column: 2 / -1; justify-self: start; }
    .verification-review-heading { flex-direction: column; }
    .verification-review-form { grid-template-columns: 1fr; }
    .verification-review-form .form-actions { grid-column: 1; }
    .span-4, .span-6, .span-8 { grid-column: 1 / -1; }
    .profile-photo { height: 300px; }
    .topbar .help-button { display: none; }
    .biodata-facts { grid-template-columns: 1fr; }
    .photo-gallery { grid-template-columns: 1fr; }
    .note-dialog {
        width: 100vw;
        max-width: none;
        margin: 0;
        margin-top: auto;
        border-radius: 18px 18px 0 0;
        max-height: min(92vh, 720px);
    }
    .note-dialog .card {
        border-radius: 18px 18px 0 0;
        max-height: min(92vh, 720px);
        overflow: auto;
        padding-bottom: max(18px, env(safe-area-inset-bottom));
    }
}
@media (max-width: 420px) {
    .profile-grid { grid-template-columns: 1fr; }
    .discovery-filters { grid-template-columns: 1fr; }
    .page-title { font-size: 36px; }
    .topbar { align-items: flex-start; }
    .topbar > .pill { display: none; }
    .tracking-context select { max-width: 150px; }
}

@media print {
    body { background: white; }
    .skip-link, .sidebar, .topbar, .mobile-nav, .member-actions, .page-actions, .toast, .note-dialog { display: none !important; }
    .main { padding: 0; grid-column: 1; }
    .biodata-sheet, .card { box-shadow: none; }
}
