/* Vår Slekt Family Archive */
:root{
  --navy:#1B4B73;
  --navy-deep:#0F304C;
  --parchment:#F7F2E7;
  --parchment-deep:#EDE3C8;
  --brass:#A07C2E;
  --brass-light:#C9A960;
  --ink:#2A2622;
  --soft-ink:#6B6255;
  --line:#DCD0B0;
  --white:#FFFFFF;
  --red:#B3392C;
}
*{ box-sizing:border-box; margin:0; padding:0; }
body{
  background:var(--parchment);
  color:var(--ink);
  font-family:'PT Sans', system-ui, sans-serif;
  line-height:1.6;
  min-height:100vh;
}
h1,h2{ font-family:'Spectral', serif; color:var(--navy-deep); font-weight:600; line-height:1.2; }
.eyebrow{
  font-family:'IBM Plex Mono', monospace; font-size:11.5px; letter-spacing:.12em;
  text-transform:uppercase; color:var(--brass); font-weight:500;
}
.mark{
  display:inline-flex; align-items:center; justify-content:center;
  width:44px; height:44px; border:1.5px solid var(--brass); border-radius:4px;
  font-family:'IBM Plex Mono', monospace; font-size:16px; color:var(--brass); letter-spacing:.05em;
}
.mark.small{ width:28px; height:28px; font-size:11px; margin-right:4px; }

/* ============ GATE (public surface) ============ */
.gate{
  min-height:100vh; display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding:28px 16px;
  background:
    radial-gradient(ellipse 90% 55% at 70% -10%, rgba(27,75,115,0.09), transparent 60%),
    var(--parchment);
}
.gate-card{
  width:100%; max-width:420px; background:var(--white);
  border:1px solid var(--line); border-radius:12px;
  box-shadow:0 18px 50px rgba(42,38,34,0.12);
  padding:38px 36px 30px;
}
.gate-head{ text-align:center; margin-bottom:26px; }
.markline{ display:flex; justify-content:center; margin-bottom:14px; }
.gate-head h1{ font-size:30px; }
.tagline{ color:var(--soft-ink); font-size:13.5px; margin-top:4px; }

.panel h2{ font-size:20px; margin-bottom:8px; }
.panel-note{ font-size:13.5px; color:var(--soft-ink); margin-bottom:16px; }
label{ display:block; font-size:13px; font-weight:700; margin:14px 0 5px; }
label .opt{ font-weight:400; color:var(--soft-ink); }
input{
  width:100%; padding:11px 13px; font-size:15px; font-family:inherit;
  border:1px solid var(--line); border-radius:7px; background:#FDFBF5; color:var(--ink);
}
input:focus{ outline:2px solid var(--navy); outline-offset:1px; border-color:var(--navy); }
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  font-weight:700; font-size:15px; font-family:inherit; cursor:pointer;
  padding:12px 22px; border-radius:7px; border:none; width:100%;
  margin-top:20px;
  transition:background .15s ease;
}
.btn.primary{ background:var(--navy); color:#fff; }
.btn.primary:hover{ background:var(--navy-deep); }
.btn.primary:disabled{ background:#8FA3B5; cursor:wait; }
.btn.ghost{
  background:transparent; color:#DCE7F1; border:1px solid rgba(255,255,255,0.35);
  width:auto; margin:0; padding:7px 14px; font-size:13px;
}
.btn.ghost:hover{ border-color:#fff; color:#fff; }
.btn.small{ padding:7px 14px; font-size:13px; }
.error{ color:var(--red); font-size:13.5px; margin-top:12px; }
.gate-links{
  margin-top:18px; text-align:center; font-size:13.5px; color:var(--soft-ink);
  display:flex; gap:10px; justify-content:center; align-items:center;
}
.linklike{
  background:none; border:none; padding:0; font:inherit; cursor:pointer;
  color:var(--navy); font-weight:700; font-size:13.5px;
}
.linklike:hover{ text-decoration:underline; }
.gate-foot{
  margin-top:22px; font-family:'IBM Plex Mono', monospace;
  font-size:11px; letter-spacing:.08em; color:var(--soft-ink);
}

/* ============ AUTHENTICATED SHELL ============ */
.topbar{
  background:var(--navy-deep); color:#fff;
  padding:0 clamp(16px, 4vw, 40px); height:60px;
  display:flex; align-items:center; justify-content:space-between;
}
.brand{
  font-family:'Spectral', serif; font-weight:600; font-size:17px;
  display:flex; align-items:center; gap:8px;
}
.brand .mark{ border-color:var(--brass-light); color:var(--brass-light); }
.brand-sub{ color:#C7D5E2; font-weight:400; font-size:14px; }
.topbar-right{ display:flex; align-items:center; gap:14px; }
.whoami{ font-size:13px; color:#C7D5E2; }

.app-body{ max-width:960px; margin:0 auto; padding:44px clamp(16px, 4vw, 32px) 80px; }
.welcome h1{ font-size:clamp(26px, 4vw, 36px); margin-top:8px; }
.welcome-sub{ color:var(--soft-ink); max-width:56ch; margin-top:10px; font-size:15.5px; }

.status-grid{ display:flex; flex-wrap:wrap; gap:16px; margin-top:34px; }
.status-card{
  flex:1; min-width:180px; background:var(--white);
  border:1px solid var(--line); border-radius:10px; padding:18px 20px;
  box-shadow:0 1px 4px rgba(42,38,34,0.06);
}
.status-card .label{
  font-family:'IBM Plex Mono', monospace; font-size:10.5px; letter-spacing:.1em;
  text-transform:uppercase; color:var(--brass); font-weight:500;
}
.status-card .num{ font-family:'Spectral', serif; font-size:30px; font-weight:600; color:var(--navy-deep); margin-top:4px; }
.status-card .d{ font-size:12.5px; color:var(--soft-ink); }

/* ============ FAMILY RECORDS ============ */
.records-wrap{ margin-top:44px; }
.records-search input{
  max-width:460px; margin-top:12px;
  padding:12px 16px; font-size:15.5px;
}
.rec-results{ margin-top:14px; max-width:640px; }
.rec-hit{
  display:flex; justify-content:space-between; align-items:baseline; gap:14px;
  width:100%; text-align:left; background:var(--white); border:1px solid var(--line);
  border-radius:8px; padding:12px 16px; margin-bottom:8px; cursor:pointer;
  font:inherit; color:var(--ink);
}
.rec-hit:hover{ border-color:var(--navy); }
.rec-hit .h-name{ font-weight:700; font-size:15px; }
.rec-hit .h-meta{ font-family:'IBM Plex Mono', monospace; font-size:11.5px; color:var(--soft-ink); white-space:nowrap; }
.rec-empty{ color:var(--soft-ink); font-size:14px; padding:8px 2px; }

.rec-detail{
  margin-top:16px; background:var(--white); border:1px solid var(--line);
  border-radius:10px; padding:24px 28px; max-width:640px; box-shadow:0 1px 4px rgba(42,38,34,0.06);
}
.rec-detail h2{ font-size:22px; }
.rec-detail .d-meta{ font-family:'IBM Plex Mono', monospace; font-size:12px; color:var(--soft-ink); margin-top:6px; }
.rec-detail .d-aka{ font-size:13.5px; color:var(--soft-ink); margin-top:4px; font-style:italic; }
.d-section{ margin-top:18px; border-top:1px solid var(--line); padding-top:14px; }
.d-section .label{
  font-family:'IBM Plex Mono', monospace; font-size:10.5px; letter-spacing:.1em;
  text-transform:uppercase; color:var(--brass); font-weight:500; margin-bottom:8px;
}
.d-vitals{ width:100%; font-size:14px; border-collapse:collapse; }
.d-vitals td{ padding:4px 0; vertical-align:top; }
.d-vitals td:first-child{ color:var(--soft-ink); width:34%; }
.lineage{ display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.lineage .link-chip{
  background:#E4EBF2; color:var(--navy-deep); font-size:12.5px; font-weight:700;
  padding:5px 12px; border-radius:14px; border:none; cursor:pointer; font-family:inherit;
}
.lineage .link-chip.me{ background:#F4E9CE; color:#7A5B1E; cursor:default; }
.lineage .sep{ color:var(--soft-ink); font-size:12px; }
.dispute{
  margin-top:14px; background:#FBF3E0; border:1px solid var(--brass-light);
  border-radius:8px; padding:12px 16px; font-size:13.5px;
}
.dispute .label{ color:#7A5B1E; font-weight:700; font-family:'PT Sans'; font-size:12.5px; text-transform:none; letter-spacing:0; }
.d-close{ margin-top:18px; }

.tribe-list-wrap{ margin-top:44px; }
.tribe-list{ list-style:none; margin-top:14px; border-top:1px solid var(--line); }
.tribe-list li{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 4px; border-bottom:1px solid var(--line); font-size:15px;
}
.tribe-list .t-name{ font-weight:700; }
.tribe-list .t-status{
  font-family:'IBM Plex Mono', monospace; font-size:11px; letter-spacing:.06em;
  padding:4px 10px; border-radius:12px;
}
.tribe-list .t-status.on{ background:#E4F0E4; color:#2E6B33; }
.tribe-list .t-status.off{ background:var(--parchment-deep); color:var(--soft-ink); }

@media (prefers-reduced-motion: reduce){
  *{ transition:none !important; }
}
