/* =====================================================================
   The Marianas Collective — design system
   Brand colors are injected from the administration portal via /theme.css
   (CSS custom properties). Values below are fallbacks only.
   ===================================================================== */

:root {
  --navy: var(--c-navy, #102B37);
  --ocean: var(--c-ocean, #193748);
  --teal: var(--c-teal, #426D70);
  --sage: var(--c-sage, #789780);
  --sand: var(--c-sand, #E8DDCB);
  --ivory: var(--c-ivory, #FAF7F1);
  --gold: var(--c-gold, #C9A36B);
  --earth: var(--c-earth, #80664C);
  --charcoal: var(--c-charcoal, #283238);

  --ink: var(--charcoal);
  --muted: #5d6a70;
  --line: rgba(16, 43, 55, 0.12);
  --surface: #ffffff;
  --danger: #a3392e;
  --success: #2f6b4f;
  --warning: #8a6420;

  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 43, 55, .06), 0 8px 28px rgba(16, 43, 55, .08);
  --shadow-lg: 0 24px 60px rgba(16, 43, 55, .18);
  --max: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { max-width: 100%; display: block; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--navy); }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--navy); line-height: 1.2; font-weight: 600; margin: 0 0 .6em; letter-spacing: -.005em; }
h1 { font-size: clamp(2rem, 4vw, 2.9rem); }
h2 { font-size: clamp(1.55rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
.site-header.on-dark :focus-visible, .hero :focus-visible, .section-dark :focus-visible, .page-hero :focus-visible, .card-dark :focus-visible, .site-footer :focus-visible, .sidebar :focus-visible, .status-panel :focus-visible { outline-color: var(--gold); }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--gold); color: var(--navy); padding: .6rem 1rem; z-index: 1000; font-weight: 600; }
.skip-link:focus { left: 1rem; top: 1rem; }
.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; }

.container { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }
.narrow { width: min(100% - 2.5rem, 760px); margin-inline: auto; }
.eyebrow { font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; color: var(--teal); margin-bottom: .75rem; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 46rem; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .75rem; } .mt-2 { margin-top: 1.5rem; } .mt-3 { margin-top: 2.5rem; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 1.5rem; }
.flex { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 1rem; }

/* ---------------------------------------------------------------- Header */
.announcement { background: var(--gold); color: var(--navy); text-align: center; font-size: .92rem; padding: .45rem 1rem; font-weight: 600; }
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(250, 247, 241, .92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.site-header.on-dark { position: absolute; width: 100%; background: transparent; border-bottom-color: rgba(232, 221, 203, .14); backdrop-filter: none; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 74px; }
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--navy); }
.brand img { width: 38px; height: 38px; object-fit: contain; }
.brand-text { font-family: var(--font-display); font-size: 1.18rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.on-dark .brand, .on-dark .nav a { color: var(--sand); }
.nav { display: flex; align-items: center; gap: .25rem; }
.nav a { color: var(--charcoal); text-decoration: none; font-weight: 500; font-size: .98rem; padding: .5rem .8rem; border-radius: 999px; }
.nav a:hover, .nav a[aria-current="page"] { background: rgba(66, 109, 112, .12); color: var(--navy); }
.on-dark .nav a:hover { background: rgba(232, 221, 203, .12); color: #fff; }
.nav .btn { margin-left: .4rem; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; padding: .45rem .6rem; color: inherit; cursor: pointer; }
.on-dark .nav-toggle { color: var(--sand); border-color: rgba(232,221,203,.3); }
.nav-toggle span { display: block; width: 22px; height: 2px; background: currentColor; margin: 4px 0; border-radius: 2px; }

@media (max-width: 920px) {
  .nav-toggle { display: block; }
  .nav { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--ivory); padding: 1rem 1.25rem 1.5rem; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); display: none; }
  .nav.open { display: flex; }
  .on-dark .nav { background: var(--navy); }
  .nav a { padding: .8rem 1rem; font-size: 1.05rem; }
  .nav .btn { margin: .4rem 0 0; }
}

/* ---------------------------------------------------------------- Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font: inherit; font-weight: 600; font-size: 1rem; line-height: 1.2; padding: .8rem 1.35rem; border-radius: 999px; border: 1.5px solid transparent; text-decoration: none; cursor: pointer; transition: transform .15s ease, background .15s ease, box-shadow .15s ease, color .15s; min-height: 46px; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--navy); color: var(--ivory); }
.btn-primary:hover { background: var(--ocean); color: #fff; box-shadow: 0 8px 22px rgba(16,43,55,.25); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: #d6b27d; color: var(--navy); box-shadow: 0 8px 24px rgba(201,163,107,.35); }
.btn-outline { border-color: currentColor; color: var(--navy); background: transparent; }
.btn-outline:hover { background: rgba(16,43,55,.06); color: var(--navy); }
.btn-light { border-color: rgba(232,221,203,.55); color: var(--sand); background: transparent; }
.btn-light:hover { background: rgba(232,221,203,.1); color: #fff; }
.btn-ghost { background: transparent; color: var(--teal); padding-inline: .6rem; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8a2e25; color: #fff; }
.btn-sm { padding: .45rem .9rem; min-height: 36px; font-size: .9rem; }
.btn-block { width: 100%; }
button.link { background: none; border: 0; padding: 0; color: var(--teal); font: inherit; cursor: pointer; text-decoration: underline; }

/* ---------------------------------------------------------------- Hero network */
.hero { position: relative; min-height: min(100vh, 900px); display: flex; align-items: center; color: var(--sand); overflow: hidden;
  background: radial-gradient(1200px 700px at 70% 40%, rgba(66,109,112,.35), transparent 60%),
              radial-gradient(900px 600px at 15% 80%, rgba(25,55,72,.9), transparent 60%),
              linear-gradient(160deg, var(--navy) 0%, var(--ocean) 55%, #0b1f28 100%); }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 30% 50%, rgba(16,43,55,.75) 0%, rgba(16,43,55,.25) 45%, transparent 70%); pointer-events: none; }
.hero-content { position: relative; z-index: 2; padding: 9rem 0 6rem; max-width: 880px; }
.hero .eyebrow { color: var(--gold); }
.on-dark .nav a.btn-gold { color: var(--navy); }
.on-dark .nav a.btn-gold:hover { background: #d6b27d; color: var(--navy); }
.hero h1 { color: #fff; font-size: clamp(2.1rem, 5.6vw, 4.2rem); letter-spacing: .06em; text-transform: uppercase; margin-bottom: .3em; font-weight: 600; text-shadow: 0 2px 30px rgba(0,0,0,.35); }
.hero-domain { font-size: clamp(.85rem, 1.3vw, 1rem); letter-spacing: .32em; text-transform: uppercase; color: rgba(232,221,203,.75); margin: -.4rem 0 1.4rem; font-weight: 600; }
.hero .tagline { font-family: var(--font-display); font-size: clamp(1.35rem, 2.6vw, 1.9rem); color: var(--gold); margin-bottom: .8rem; }
.hero .subtag { font-size: clamp(1.02rem, 1.6vw, 1.2rem); color: rgba(232,221,203,.88); max-width: 36rem; margin-bottom: 2.2rem; }
.hero .cta { display: flex; gap: .9rem; flex-wrap: wrap; }
.hero-note { position: absolute; z-index: 2; bottom: 1.25rem; right: 1.5rem; font-size: .8rem; color: rgba(232,221,203,.62); max-width: 25rem; text-align: right; line-height: 1.5; }
.hero-note strong { color: var(--sand); }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #7fd6a4; margin-right: .4rem; box-shadow: 0 0 0 0 rgba(127,214,164,.6); animation: livepulse 2s infinite; vertical-align: middle; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(127,214,164,.55); } 70% { box-shadow: 0 0 0 8px rgba(127,214,164,0); } 100% { box-shadow: 0 0 0 0 rgba(127,214,164,0); } }
@media (max-width: 760px) { .hero-note { left: 1.25rem; right: 1.25rem; text-align: left; max-width: none; } }

/* ---------------------------------------------------------------- Sections */
.section { padding: 5.5rem 0; }
.section-tight { padding: 3.5rem 0; }
.section-sand { background: linear-gradient(180deg, var(--sand), #efe6d7); }
.section-dark { background: linear-gradient(160deg, var(--navy), var(--ocean)); color: var(--sand); }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark .eyebrow { color: var(--gold); }
.section-dark .muted, .section-dark .lead { color: rgba(232,221,203,.8); }
.section-head { max-width: 760px; margin-bottom: 3rem; }
.section-head.center { margin-inline: auto; }

.page-hero { background: linear-gradient(160deg, var(--navy), var(--ocean)); color: var(--sand); padding: 4.5rem 0 3.5rem; position: relative; overflow: hidden; }
.page-hero h1 { color: #fff; margin-bottom: .3em; }
.page-hero .lead { color: rgba(232,221,203,.85); }
.page-hero .eyebrow { color: var(--gold); }
.page-hero::after { content: ""; position: absolute; right: -80px; top: -80px; width: 420px; height: 420px; background: url("../images/network-mark.svg") no-repeat center / contain; opacity: .12; pointer-events: none; }

.grid { display: grid; gap: 1.4rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); }
.card h3, .card h2.h3 { margin-bottom: .4rem; }
.card p:last-child { margin-bottom: 0; }
.card-dark { background: rgba(250,247,241,.05); border-color: rgba(232,221,203,.14); box-shadow: none; color: var(--sand); }
.card-dark h3, .card-dark h2.h3 { color: #fff; }
.card .icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(66,109,112,.12); color: var(--teal); margin-bottom: 1rem; }
.card-dark .icon { background: rgba(201,163,107,.15); color: var(--gold); }
.card .icon svg { width: 22px; height: 22px; }
.card-link { text-decoration: none; color: inherit; display: block; transition: transform .15s, box-shadow .15s; }
.card-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: inherit; }

.steps { counter-reset: step; display: grid; gap: 1rem; grid-template-columns: repeat(5, minmax(0,1fr)); }
.steps li { list-style: none; position: relative; padding: 1.4rem 1.2rem 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.steps li::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: var(--gold); font-weight: 700; margin-bottom: .7rem; font-family: var(--font-display); }
.steps li strong { display: block; color: var(--navy); margin-bottom: .25rem; }
.steps li span { color: var(--muted); font-size: .95rem; }
.steps { padding: 0; margin: 0; }
@media (max-width: 960px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

.quote { font-family: var(--font-display); font-size: clamp(1.25rem, 2.2vw, 1.6rem); line-height: 1.5; color: #fff; border-left: 3px solid var(--gold); padding-left: 1.5rem; margin: 0; }
.motto { font-family: var(--font-display); color: var(--gold); font-size: 1.3rem; }

.prose { max-width: 760px; }
.prose h2 { margin-top: 2.2rem; }
.prose h3 { margin-top: 1.6rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin: .35rem 0; }
.prose blockquote { margin: 1.5rem 0; padding: 1rem 1.25rem; border-left: 3px solid var(--gold); background: rgba(201,163,107,.1); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.policy-meta { display: inline-flex; gap: .75rem; flex-wrap: wrap; font-size: .9rem; color: var(--muted); padding: .7rem 1rem; background: rgba(201,163,107,.12); border-radius: var(--radius-sm); margin-bottom: 1.5rem; }

details.faq { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1.25rem; margin-bottom: .75rem; }
details.faq summary { cursor: pointer; font-weight: 600; color: var(--navy); list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
details.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--teal); }
details.faq[open] summary::after { content: "–"; }
details.faq p { margin: .8rem 0 0; color: var(--muted); }

/* ---------------------------------------------------------------- Forms */
.form-card { max-width: 520px; margin: 0 auto; }
.auth-wrap { min-height: calc(100vh - 74px); display: grid; place-items: center; padding: 3rem 1.25rem; background: radial-gradient(900px 500px at 80% 0%, rgba(66,109,112,.12), transparent 60%), var(--ivory); }
.auth-card { width: min(100%, 480px); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 2.4rem 2.2rem; box-shadow: var(--shadow-lg); }
.auth-card h1 { font-size: 1.9rem; }
.field { margin-bottom: 1.15rem; }
label, .label { display: block; font-weight: 600; color: var(--navy); margin-bottom: .35rem; font-size: .98rem; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1.5px solid #7d898f; border-radius: var(--radius-sm); padding: .75rem .9rem; min-height: 48px; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal); }
input[type=color] { width: 54px; height: 44px; border: 1.5px solid #7d898f; border-radius: var(--radius-sm); padding: 3px; background: #fff; cursor: pointer; }
.help { font-size: .88rem; color: var(--muted); margin-top: .3rem; }
.field-error { color: var(--danger); font-size: .9rem; margin: .35rem 0 0; font-weight: 500; }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.check { display: flex; gap: .7rem; align-items: flex-start; font-weight: 400; color: var(--ink); cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: .15rem; accent-color: var(--teal); flex-shrink: 0; }
.form-actions { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-top: 1.5rem; }
.hp { position: absolute !important; left: -9999px !important; }
.code-input { font-size: 1.6rem !important; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.secret-box { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.1rem; letter-spacing: .12em; background: var(--sand); padding: 1rem; border-radius: var(--radius-sm); word-break: break-all; text-align: center; color: var(--navy); }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.05rem; }
.codes li { list-style: none; background: var(--sand); padding: .55rem .8rem; border-radius: 8px; text-align: center; color: var(--navy); }
.codes { padding: 0; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.4rem; margin: 0 0 1.4rem; }
legend { font-weight: 700; color: var(--navy); padding: 0 .4rem; font-family: var(--font-display); font-size: 1.1rem; }

/* ---------------------------------------------------------------- Alerts & badges */
.alert { border-radius: var(--radius-sm); padding: .95rem 1.15rem; margin-bottom: 1.25rem; border: 1px solid; font-size: .98rem; }
.alert-success { background: #edf6f0; border-color: #b9dcc6; color: var(--success); }
.alert-error { background: #fbeeec; border-color: #ecc1bb; color: var(--danger); }
.alert-notice { background: #fbf4e7; border-color: #ead5ad; color: var(--warning); }
.alert-info { background: #ecf3f3; border-color: #c2d8d8; color: var(--teal); }
.badge { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .02em; padding: .22rem .6rem; border-radius: 999px; background: rgba(66,109,112,.12); color: var(--teal); white-space: nowrap; }
.badge-gold { background: rgba(201,163,107,.2); color: #7a5a24; }
.badge-success { background: #e2f1e8; color: var(--success); }
.badge-danger { background: #f8e1de; color: var(--danger); }
.badge-muted { background: #eceeef; color: #59666c; }

/* ---------------------------------------------------------------- App shell (member & admin) */
.app-shell { display: grid; grid-template-columns: 270px minmax(0, 1fr); min-height: calc(100vh - 74px); }
.sidebar { background: var(--navy); color: var(--sand); padding: 1.6rem 1rem 2rem; position: sticky; top: 74px; height: calc(100vh - 74px); overflow-y: auto; }
.sidebar h4 { font-family: var(--font-body); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin: 1.6rem .75rem .5rem; font-weight: 700; }
.sidebar h4:first-child { margin-top: 0; }
.sidebar a { display: flex; align-items: center; gap: .65rem; color: rgba(232,221,203,.88); text-decoration: none; padding: .6rem .75rem; border-radius: 10px; font-size: .97rem; }
.sidebar a:hover { background: rgba(232,221,203,.08); color: #fff; }
.sidebar a[aria-current="page"] { background: rgba(201,163,107,.18); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.sidebar .soon { margin-left: auto; font-size: .68rem; color: rgba(232,221,203,.45); text-transform: uppercase; letter-spacing: .08em; }
.sidebar .disabled { opacity: .55; pointer-events: none; }
.sidebar .count { margin-left: auto; background: var(--gold); color: var(--navy); font-size: .75rem; font-weight: 700; padding: .05rem .5rem; border-radius: 999px; }
.app-main { padding: 2.2rem clamp(1.25rem, 3vw, 3rem) 4rem; min-width: 0; }
.app-main h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.8rem; }
.page-head p { margin: 0; }
.admin-shell .sidebar { background: #0d222c; }
.sidebar-toggle { display: none; }
@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; display: none; }
  .sidebar.open { display: block; }
  .sidebar-toggle { display: inline-flex; margin: 1rem clamp(1.25rem, 3vw, 3rem) 0; }
}

.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.35rem; }
.stat .num { font-family: var(--font-display); font-size: 2rem; color: var(--navy); line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: .92rem; }
.status-panel { border-radius: var(--radius); padding: 1.8rem; background: linear-gradient(135deg, var(--navy), var(--ocean)); color: var(--sand); position: relative; overflow: hidden; }
.status-panel h2 { color: #fff; }
.status-panel::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 260px; height: 260px; background: url("../images/network-mark.svg") no-repeat center / contain; opacity: .15; }
.progress-steps { display: flex; gap: .4rem; margin: 1.2rem 0; flex-wrap: wrap; }
.progress-steps > span { flex: 1; min-width: 110px; font-size: .82rem; padding: .55rem .7rem; border-radius: 8px; background: rgba(232,221,203,.08); color: rgba(232,221,203,.6); border: 1px solid rgba(232,221,203,.12); }
.progress-steps > span.done { background: rgba(120,151,128,.28); color: #fff; border-color: rgba(120,151,128,.5); }
.progress-steps > span.current { background: rgba(201,163,107,.25); color: #fff; border-color: var(--gold); }
ol.progress-steps { list-style: none; padding: 0; }
.progress-steps li { flex: 1; min-width: 180px; padding: .6rem .8rem; border-radius: 8px; background: rgba(232,221,203,.08); color: rgba(232,221,203,.85); border: 1px solid rgba(232,221,203,.18); }
.progress-steps li strong { display: block; color: #fff; }
.progress-steps li.done { background: rgba(120,151,128,.28); border-color: rgba(120,151,128,.5); }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.table { width: 100%; border-collapse: collapse; font-size: .96rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: .85rem 1rem; border-bottom: 1px solid var(--line); background: #fbfaf7; white-space: nowrap; }
.table td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fcfbf8; }
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }
.pagination { display: flex; gap: .5rem; margin-top: 1rem; align-items: center; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; margin: 0; }
.kv dt { color: var(--muted); font-size: .92rem; }
.kv dd { margin: 0; font-weight: 500; }
.inline-form { display: inline; }
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: end; margin-bottom: 1.2rem; }
.toolbar .field { margin: 0; }
.perm-group { margin-bottom: 1.2rem; }
.perm-group h3, .perm-group h2.h3 { font-size: 1rem; font-family: var(--font-body); text-transform: uppercase; letter-spacing: .1em; color: var(--teal); margin-bottom: .5rem; }
.color-row { display: flex; gap: .8rem; align-items: center; }
.color-row input[type=text] { max-width: 140px; font-family: ui-monospace, Menlo, monospace; }
.swatches { display: flex; gap: .4rem; flex-wrap: wrap; }
.swatches span { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); }
.feature-row { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--line); }
.feature-row:last-child { border-bottom: 0; }
.feature-row h3, .feature-row h2.h3 { font-size: 1.05rem; margin: 0 0 .15rem; font-family: var(--font-body); font-weight: 700; }
.feature-row p { margin: 0; font-size: .92rem; color: var(--muted); }

/* ---------------------------------------------------------------- Footer */
.site-footer { background: #0b1f28; color: rgba(232,221,203,.75); padding: 4rem 0 2rem; font-size: .95rem; }
.site-footer a { color: rgba(232,221,203,.85); text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.site-footer h4 { color: var(--gold); font-family: var(--font-body); font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 1rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin: .45rem 0; }
.footer-bottom { border-top: 1px solid rgba(232,221,203,.12); margin-top: 3rem; padding-top: 1.5rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: rgba(232,221,203,.65); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- Accessibility & motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .site-header, .site-footer, .sidebar, .hero canvas { display: none !important; }
  body { background: #fff; }
}
.footer-brand, .footer-brand .brand-text { color: var(--sand); }
.auth-top { align-items: start; }
.center .lead { margin-inline: auto; }
.install-card { width: min(100%, 640px); text-align: left; }
.install-card.center { text-align: center; }
.install-card ol { text-align: left; }
.h3 { font-size: 1.2rem; }
h2.h3 { font-size: 1.25rem; }
.checklist { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .3rem; font-size: .95rem; }
.checklist .ok { color: var(--success); }
.checklist .fail { color: var(--danger); font-weight: 600; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; background: rgba(16,43,55,.06); padding: .1rem .35rem; border-radius: 5px; }
.brand-stack { display: flex; flex-direction: column; line-height: 1.15; }
.brand-sub { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; opacity: .7; font-weight: 600; }
@media (max-width: 520px) { .brand-text { font-size: .98rem; letter-spacing: .04em; } .brand img { width: 32px; height: 32px; } .brand-sub { font-size: .64rem; } }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.feature-soon { font-size: .85rem; font-weight: 600; color: var(--muted); white-space: nowrap; padding: .45rem .9rem; border: 1px dashed rgba(16,43,55,.25); border-radius: 999px; }
/* ---------------------------------------------------------------- Family tree */
.tree-frame { overflow: auto; background: linear-gradient(180deg, #fff, #fbf8f2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; min-height: 360px; max-height: 75vh; cursor: grab; }
.tree-frame:fullscreen { max-height: none; background: var(--ivory); }
.tree-frame.dragging { cursor: grabbing; user-select: none; }
.tree-canvas { transform-origin: 0 0; transition: transform .15s ease; width: max-content; }
.htree, .htree ul { list-style: none; margin: 0; padding: 0; }
.htree li { display: flex; align-items: center; position: relative; padding: .35rem 0 .35rem 2rem; }
.htree > li { padding-left: 0; }
.htree ul { display: flex; flex-direction: column; justify-content: center; position: relative; margin-left: 2rem; }
.htree ul::before { content: ""; position: absolute; left: 0; top: 50%; width: 2rem; border-top: 1.5px solid rgba(66,109,112,.45); transform: translateX(-100%); }
.htree ul > li::before { content: ""; position: absolute; left: 0; top: 50%; width: 2rem; border-top: 1.5px solid rgba(66,109,112,.45); }
.htree ul > li::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 1.5px solid rgba(66,109,112,.45); }
.htree ul > li:first-child::after { top: 50%; }
.htree ul > li:last-child::after { bottom: 50%; }
.htree ul > li:only-child::after { display: none; }
.htree ul { margin-left: 0; padding-left: 2rem; }
.htree ul::before { left: 2rem; }
.tnode { position: relative; background: #fff; border: 1.5px solid rgba(16,43,55,.14); border-left: 4px solid var(--teal); border-radius: 10px; padding: .55rem 2.2rem .55rem .85rem; min-width: 190px; max-width: 260px; box-shadow: 0 2px 10px rgba(16,43,55,.06); }
.tnode-living { border-left-color: var(--sage); }
.tnode-unknown { border-left-color: #a9b3b7; }
.tnode-deceased { border-left-color: var(--gold); }
.tname { display: block; font-weight: 700; color: var(--navy); text-decoration: none; line-height: 1.3; }
.tname:hover { text-decoration: underline; }
.tyears, .tvia, .tspouse { display: block; font-size: .82rem; color: var(--muted); }
.tvia { color: var(--earth); font-style: italic; }
.tspouse a { color: var(--teal); }
.trecenter { position: absolute; top: .45rem; right: .55rem; text-decoration: none; color: var(--teal); font-size: 1.05rem; }
.tree-zoom { margin-left: auto; }
.name-columns { columns: 3 220px; padding-left: 1.1rem; }
/* ---------------------------------------------------------------- Kinship & member network */
.picker { position: relative; }
.picker-results { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% - 1.2rem); background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); list-style: none; margin: 0; padding: .3rem; max-height: 260px; overflow: auto; }
.picker-results li { padding: .55rem .7rem; border-radius: 6px; cursor: pointer; }
.picker-results li:hover, .picker-results li:focus { background: rgba(66,109,112,.1); outline: none; }
.picker-results li:focus { box-shadow: inset 0 0 0 3px var(--teal); }
.kin-path { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 1rem; }
.kin-chain { margin: 0; padding-left: 1.4rem; }
.kin-chain li { padding: .25rem 0; }
.kin-chain li:last-child { font-weight: 700; }
.connection summary { cursor: pointer; color: var(--teal); font-weight: 600; }
.mn-frame { position: relative; background: radial-gradient(circle at 50% 40%, #fff, #f4efe6); border: 1px solid var(--line); border-radius: var(--radius); height: 68vh; min-height: 420px; overflow: hidden; }
.mn-frame:fullscreen { height: 100vh; }
#member-network { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.mn-tip { position: absolute; pointer-events: none; background: var(--navy); color: #fff; font-size: .85rem; padding: .35rem .6rem; border-radius: 6px; white-space: nowrap; }
.mn-legend { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: .9rem; font-size: .88rem; color: var(--muted); }
.mn-legend span { display: inline-flex; align-items: center; gap: .45rem; }
.lg { display: inline-block; width: 34px; height: 0; border-top: 3px solid; }
.lg-bio { border-color: #426D70; }
.lg-marriage { border-color: #C9A36B; }
.lg-partner { border-color: #C9A36B; border-top-style: dashed; }
.lg-legal { border-color: #789780; border-top-style: dashed; }
.lg-trad { border-color: #80664C; border-top-style: dotted; }
.lg-other { border-color: #8a96a0; border-top-style: dotted; }
@media (max-width: 700px) { .kin-path { grid-template-columns: 1fr; } }

/* ---- v0.5.0: Research Center, Invite & Connect ---- */
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 1.2rem; }
.tabs a { padding: .55rem .95rem; border-radius: 10px 10px 0 0; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; }
.tabs a:hover { color: var(--ink, #102B37); }
.tabs a[aria-current="page"] { color: var(--ink, #102B37); border-bottom-color: var(--gold, #C9A35B); }
.request-card h2 { margin-bottom: .35rem; }
.request-card .between, .response .between { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.form-wide { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); align-items: start; }
@media (max-width: 960px) { .form-wide { grid-template-columns: 1fr; } }
fieldset.field { border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem .4rem; }
fieldset.field legend { font-weight: 600; padding: 0 .4rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; background: var(--sand, #F4EEE3); border: 1px solid var(--line); border-radius: 999px; padding: .2rem .35rem .2rem .75rem; font-size: .92rem; }
.chip-x { border: 0; background: transparent; cursor: pointer; font-size: 1.1rem; line-height: 1; color: var(--muted); padding: 0 .3rem; }
.chip-x:hover { color: #9b2c2c; }
.file-list { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: .8rem; }
.file-list li { display: flex; flex-direction: column; gap: .25rem; max-width: 180px; }
.file-list img { width: 180px; height: 135px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.file-doc { display: inline-block; padding: .55rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; word-break: break-word; }
.file-doc::before { content: "PDF · "; color: var(--muted); font-size: .85rem; }
.evidence { margin-top: .9rem; padding: .7rem .9rem; border-left: 3px solid var(--gold, #C9A35B); background: rgba(201, 163, 91, .08); border-radius: 0 8px 8px 0; }
.response-actions { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-start; margin-top: .9rem; padding-top: .7rem; border-top: 1px solid var(--line); }
details.report summary, .response-actions details summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.member-list { list-style: none; padding: 0; margin: 0; }
.member-list li { display: flex; justify-content: space-between; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.mb-2 { margin-bottom: 2rem; }
.mt-1 { margin-top: .75rem; }
.card > .between { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }

/* ---- v0.6.0: Cemetery & Memorial Explorer ---- */
.map-card .between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.cem-map { height: 460px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #e7eef0; position: relative; margin: .6rem 0; }
.cem-map-sm { height: 340px; }
.cem-svg { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.cem-svg.dragging { cursor: grabbing; }
.cem-sea { fill: #dfe9ec; }
.cem-island { fill: #efe6d3; stroke: #c9b994; stroke-width: 1; vector-effect: non-scaling-stroke; }
.cem-island-label { fill: #80664C; font-family: var(--font-display); font-style: italic; }
.cem-label { fill: #102B37; font-family: var(--font-body); font-weight: 600; dominant-baseline: middle; paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.cem-pt { stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.cem-cemetery { fill: #102B37; }
.cem-grave { fill: #426D70; }
.cem-marker { fill: #C9A36B; }
.cem-approx { fill: rgba(16, 43, 55, .08); stroke: rgba(16, 43, 55, .45); stroke-dasharray: 4 3; stroke-width: 1; vector-effect: non-scaling-stroke; }
.cem-svg a:hover .cem-pt, .cem-svg a:focus .cem-pt { fill: #a3392e; }
.cem-map-empty { padding: 3rem 1rem; }
.legend-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin: 0 .25rem 0 .6rem; vertical-align: middle; }
.lg-cem { background: #102B37; } .lg-grave { background: #426D70; } .lg-marker { background: #C9A36B; }
.headstone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .9rem; margin-top: .6rem; }
.headstone-card { display: flex; flex-direction: column; gap: .3rem; padding: .6rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-decoration: none; color: inherit; }
.headstone-card:hover { border-color: var(--teal); }
.headstone-card img, .headstone-ph { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; background: linear-gradient(160deg, #e8ddcb, #d5cab4); }
.headstone-ph { display: block; }
.file-list-lg img { width: 260px; height: 200px; }
.inscription { white-space: pre-wrap; font-family: var(--font-display); font-size: 1.15rem; line-height: 1.6; background: #f6f2ea; border-radius: 10px; padding: 1rem 1.2rem; margin: 0 0 .8rem; text-align: center; }
textarea.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.mt-2 { margin-top: 1.5rem; }

/* ---- v0.7.0: Messages and Family Circles ---- */
.convo-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.convo-list li a { display: grid; gap: .15rem; padding: .85rem 1.1rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: inherit; }
.convo-list li a:hover { border-color: var(--teal); }
.convo-list li.unread a { border-left: 4px solid var(--gold); }
.convo-list li.unread .convo-title { font-weight: 700; }
.convo-title { font-weight: 600; }
.convo-preview { color: var(--muted); font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo-meta { font-size: .82rem; color: var(--muted); }
.thread { max-height: 62vh; overflow-y: auto; display: flex; flex-direction: column; gap: .8rem; padding: 1.1rem; }
.msg { max-width: 78%; align-self: flex-start; background: #f3efe7; border-radius: 14px 14px 14px 4px; padding: .6rem .9rem; }
.msg.mine { align-self: flex-end; background: #e3edef; border-radius: 14px 14px 4px 14px; }
.msg.staff { border: 1px solid rgba(163, 57, 46, .35); }
.msg-head { font-size: .85rem; margin-bottom: .2rem; }
.msg-body { word-wrap: break-word; overflow-wrap: anywhere; }
.msg-actions { margin-top: .3rem; font-size: .82rem; }
.msg-actions details summary { color: var(--muted); cursor: pointer; }
.msg-system { text-align: center; color: var(--muted); font-size: .85rem; font-style: italic; margin: .2rem 0; }
.composer { margin-top: .8rem; display: flex; flex-direction: column; gap: .6rem; }
.composer textarea { width: 100%; }
.composer .between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.request-box { border-left: 4px solid var(--gold); margin-bottom: 1rem; }
@media (max-width: 640px) { .msg { max-width: 92%; } }
button.link.small { font-size: .875rem; }

/* ---------------------------------------------------------------- Heritage (0.8.0) */
.form-medium { max-width: 820px; }
.kv-stack { grid-template-columns: 1fr; gap: .15rem; }
.kv-stack dd { margin-bottom: .6rem; }
ul.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.citations { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.cite-list { list-style: none; padding: 0; margin: .35rem 0 0; display: grid; gap: .5rem; }
.cite-list .chip { padding: .1rem .6rem; font-size: .8rem; margin-left: .3rem; }
.classif { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .8rem; }
.classif dt { margin: 0; }
.heritage-section h2 { font-size: 1.45rem; }
.diff-old, .diff-new { border-radius: 10px; padding: .7rem .9rem; max-height: 320px; overflow: auto; }
.diff-old { background: #f8efed; }
.diff-new { background: #ecf5ef; }
.chip-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem; }
.chip-link { text-decoration: none; color: var(--ink, #102B37); padding: .3rem .8rem; }
.chip-link:hover { border-color: var(--teal); }
audio.media, video.media { width: 100%; display: block; margin-bottom: .4rem; }
video.media { max-height: 70vh; background: #000; border-radius: 10px; }

/* ---------------------------------------------------------------- Moderation (0.10.0) */
.case-msg { border-left: 3px solid var(--line); padding: .35rem .8rem; }
.case-msg.from-staff, .case-msg.aud-reporter, .case-msg.aud-subject { border-left-color: var(--teal); }
.case-msg.aud-internal { border-left-color: var(--gold, #C9A24B); background: #faf6ec; }
.case-msg.from-member { border-left-color: var(--line); }
.qr-wrap { margin: .5rem 0 1rem; }
.qr-code { display: block; width: 208px; height: 208px; max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.brand-preview { width: 64px; height: 64px; object-fit: contain; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; padding: 4px; }
.rel-sources { margin: -.4rem 0 1rem; padding-left: .2rem; }
.rel-sources summary { cursor: pointer; color: var(--teal); }
.grid-sidebar { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 860px) { .grid-sidebar { grid-template-columns: 1fr; } }
.pre-wrap { white-space: pre-wrap; }
.page-slot { padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.lg-private { display: inline-block; width: 10px; height: 10px; border: 0; border-radius: 50%; background: #c4ccd1; vertical-align: middle; }
.date-row { display: grid; grid-template-columns: 2fr 1fr; gap: .5rem; }
.marriage { padding: .9rem 0; border-bottom: 1px solid var(--line); }
.marriage:last-of-type { border-bottom: 0; }

/* Surname registry → ancestral branches (rc.13) */
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { margin: .1rem 0; }
.crumbs { margin: 0 0 .6rem; color: var(--muted); }
.branch-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); margin-top: .8rem; }
.branch-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .9rem 1rem; background: var(--ivory); }
.branch-card h3 { margin: .1rem 0 .3rem; font-size: 1.15rem; }
.branch-num { margin: 0; font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.branch-sketch { display: block; width: 100%; max-width: 360px; height: auto; margin: .4rem auto .2rem; }
.branch-connections { margin-top: 1rem; }
.branch-gen { columns: 2 18rem; margin: 0 0 .8rem; padding-left: 1.2rem; }
.branch-gen li { break-inside: avoid; margin: .15rem 0; }
.branch-subs { margin-left: 1.4rem; border-left: 2px solid var(--line); padding-left: .8rem; }

/* Trees a family (branch) belongs to (rc.12) */
.tree-choices { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem 1rem; margin: 0; }
.tree-choices legend { font-weight: 600; padding: 0 .35rem; }
.tree-choice-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .1rem 1rem; max-height: 16rem; overflow: auto; }

/* Add a person / connect people (rc.10) */
.conn-row { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .8rem 1rem .4rem; margin: 0 0 1rem; background: var(--ivory); }
.conn-row legend { font-weight: 600; padding: 0 .35rem; }
.conn-row.has-error { border-color: var(--danger, #9b2c2c); }
.conn-marriage { margin: 0 0 .6rem; }
.never-married { font-size: .9rem; }

/* Person profile and family group sheet (rc.9) */
.person-head { margin-bottom: 1rem; }
.person-head h1 { margin-bottom: .15rem; }
.name-title { font-weight: 400; color: var(--muted); }
.person-sub { margin: 0; font-size: 1.05rem; color: var(--ink); }
.sex-sym { display: inline-block; margin-right: .35rem; font-weight: 700; color: var(--teal); }
.sex-sym.sex-female { color: var(--earth); }
.profile-tabs { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 3px solid var(--teal); margin: 0 0 1rem; }
.profile-tabs a { padding: .5rem .85rem; border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--surface); color: var(--ocean); text-decoration: none; font-size: .95rem; }
.profile-tabs a:hover { background: var(--ivory); text-decoration: underline; }
.profile-tabs a[aria-current="page"] { background: var(--teal); border-color: var(--teal); color: #fff; font-weight: 600; }
.facts-card { margin: 0 0 1rem; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
.facts { width: 100%; border-collapse: collapse; background: var(--ivory); }
.facts th[scope="row"] { width: 11rem; text-align: left; vertical-align: top; padding: .55rem .8rem; background: var(--teal); color: #fff; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,.18); }
.facts td { padding: .55rem .8rem; vertical-align: top; border-bottom: 1px solid var(--line); }
.facts td + td { border-left: 1px solid var(--line); }
.facts tr > td:nth-child(2):not([colspan]) { width: 11rem; white-space: nowrap; }
.facts tr:last-child th, .facts tr:last-child td { border-bottom: 0; }
.facts .facts-head th[scope="row"] { background: var(--ocean); }
.facts .facts-title { margin: 0; font: inherit; color: inherit; }
.facts-children { margin: 0; padding-left: 1.4rem; }
.facts-children li { margin: .15rem 0; }
.facts-notes { white-space: normal; }
.pl-fact abbr { text-decoration: none; font-weight: 700; }
.pl-fact { margin-left: .35rem; }
.pl-age { color: var(--muted); }
@media (max-width: 640px) {
  .facts, .facts tbody { display: block; }
  .facts tr { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); border-bottom: 1px solid var(--line); }
  .facts tr:last-child { border-bottom: 0; }
  .facts th[scope="row"] { width: auto; grid-column: 1; grid-row: 1 / span 2; border-bottom: 0; }
  .facts td { grid-column: 2; border-bottom: 0; }
  .facts tr > td:nth-child(2):not([colspan]) { width: auto; white-space: normal; padding-bottom: .1rem; }
  .facts td + td { border-left: 0; padding-top: 0; color: var(--muted); }
  .facts td + td a { color: var(--teal); }
}

/* Section links at the top of long forms (1.0.0-rc.15). */
.form-nav { display: flex; flex-wrap: wrap; gap: .4rem .5rem; margin: 0 0 1.25rem; }
.form-nav a { font-size: .875rem; padding: .3rem .75rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: inherit; background: var(--surface); }
.form-nav a:hover, .form-nav a:focus-visible { border-color: currentColor; }
.form-section { scroll-margin-top: 6rem; }
.form-section h3.h4 { margin: .75rem 0 .5rem; padding-bottom: .25rem; border-bottom: 1px solid var(--line); }

/* ---------------------------------------------------------------------------
   TNG-style edit forms for people and families (1.0.0-rc.16)
   --------------------------------------------------------------------------- */
.tabs span[aria-current="page"] { padding: .55rem .95rem; font-weight: 600; color: var(--ink); border-bottom: 3px solid var(--gold); }
.tng-head { margin: .25rem 0 .5rem; }
.tng-head h1 { margin: 0; font-size: clamp(1.5rem, 2.4vw, 2rem); }
.tng-id { font-weight: 400; color: var(--muted); }
.tng-meta { margin: .2rem 0 0; }
.tng-modified { margin: .35rem 0 0; font-size: .8rem; color: var(--muted); }
.tng-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; margin: .75rem 0 1rem; padding: .4rem .9rem; border-radius: var(--radius-sm); background: var(--navy); color: rgba(255,255,255,.55); font-size: .85rem; }
.tng-toolbar a, .tng-toolbar .linklike { color: #fff; text-decoration: none; font-weight: 500; }
.tng-toolbar a:hover, .tng-toolbar .linklike:hover, .tng-toolbar a:focus-visible, .tng-toolbar .linklike:focus-visible { text-decoration: underline; }
.linklike { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.tng-form { display: grid; gap: .9rem; }
.tng-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: .35rem 1.25rem 1rem; scroll-margin-top: 6rem; }
.tng-section > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem; padding: .55rem 0 .45rem; }
.tng-section > summary::-webkit-details-marker { display: none; }
.tng-section > summary::before { content: ""; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid var(--ink); transform: rotate(-90deg); transition: transform .15s; }
.tng-section[open] > summary::before { transform: rotate(0); }
.tng-section > summary h2 { margin: 0; font-family: var(--font-body); font-size: 1.1rem; font-weight: 700; }
.tng-section > summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.tng-row { display: grid; gap: .5rem .75rem; margin-top: .5rem; align-items: end; }
.tng-row .field { margin: 0; }
.tng-row label, .tng-events label { font-size: .85rem; }
.tng-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tng-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tng-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tng-checks { align-self: center; padding-top: 1.2rem; }
.tng-consent { margin-top: .85rem; font-size: .9rem; }
.tng-note { margin: .25rem 0 .75rem; font-size: .9rem; }
.tng-events { display: grid; gap: .5rem; }
.tng-ev-head, .tng-ev { display: grid; grid-template-columns: 8.5rem minmax(9rem, 13rem) minmax(0, 1fr); gap: .5rem .75rem; align-items: start; }
.tng-ev-head span { font-weight: 600; font-size: .9rem; }
.tng-ev-label { font-weight: 600; padding-top: .6rem; }
.tng-ev .field { margin: 0; }
.tng-place { display: flex; flex-wrap: wrap; gap: .5rem; }
.tng-place > input { flex: 1 1 14rem; }
.tng-place > select { flex: 0 1 15rem; }
.tng-place > .field-error { flex-basis: 100%; }
.tng-ev-span { grid-column: 2 / -1; padding-top: .5rem; line-height: 1.9; }
.tng-section-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: .1rem 0 .6rem; }
.tng-family { display: grid; grid-template-columns: 7.5rem 1fr; gap: .25rem .75rem; margin: .5rem 0 0; padding: .75rem 0 0; border-top: 1px solid var(--line); }
.tng-family dt { font-weight: 600; }
.tng-family dd { margin: 0; }
.tng-kids { margin: 0; padding-left: 1.25rem; }
.tng-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .75rem 1rem; margin-top: .25rem; background: var(--ivory); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 -6px 18px rgba(16,43,55,.06); }
.tng-actions-gap { flex: 1 1 auto; }
.tng-partner { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) auto; gap: .5rem .75rem; align-items: start; margin-top: .6rem; }
.tng-partner > .tng-ev-label { padding-top: .6rem; }
.tng-partner-buttons { display: flex; flex-wrap: wrap; gap: .35rem; }
.tng-create { grid-column: 2 / -1; }
.tng-create > summary { display: inline-block; cursor: pointer; }
.tng-create[open] > summary { margin-bottom: .5rem; }
.tng-create .tng-row { margin: 0 0 .5rem; padding: .75rem; background: var(--ivory); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.tng-children { width: 100%; max-width: 54rem; border-collapse: collapse; margin: .25rem 0 .75rem; font-size: .95rem; }
.tng-children th { text-align: left; padding: .45rem .6rem; background: var(--navy); color: #fff; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; }
.tng-children td { padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tng-children td.num { width: 2.5rem; color: var(--muted); }
.tng-children .sub { display: block; color: var(--muted); font-size: .85rem; }
.tng-newchild { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr) minmax(0, 14rem); gap: .5rem .75rem; align-items: start; }
@media (max-width: 760px) {
  .tng-cols-3, .tng-cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tng-ev-head { display: none; }
  .tng-ev, .tng-newchild, .tng-partner { grid-template-columns: 1fr; }
  .tng-ev-span, .tng-create { grid-column: auto; }
  .tng-ev-label { padding-top: 0; }
  .tng-family { grid-template-columns: 6rem 1fr; }
}
.tng-ev-span-field { grid-column: 2 / -1; }
@media (max-width: 760px) { .tng-ev-span-field { grid-column: auto; } }
.tng-cols-flags { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr) auto; }
@media (max-width: 760px) { .tng-cols-flags { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tng-partner .tng-create { margin-top: -.15rem; }
