/* People Connector — design tokens & shared styles */

:root {
  --bg: #EFE9E0;
  --surface: #F8F3EB;
  --surface-2: #E7DFD2;
  --surface-warm: #E2D7C5;
  --text: #1A1714;
  --text-muted: #6E6157;
  --text-soft: #A09689;
  --accent: #B89878;
  --accent-deep: #8C6E4F;
  --accent-soft: #E2D2B9;
  --border: rgba(31,23,15,0.10);
  --border-strong: rgba(31,23,15,0.18);
  --danger: #B5675E;
  --success: #6F7F5E;
  --grain: 0.08;
  --shadow-card: 0 1px 0 rgba(31,23,15,0.04), 0 12px 28px -18px rgba(31,23,15,0.18);
  --shadow-soft: 0 1px 30px -12px rgba(31,23,15,0.12);
  --hero-warm-1: #E8D6BD;
  --hero-warm-2: #D6B89A;
  --hero-warm-3: #C9A07A;
  --hero-cool: #B7A99A;
}

[data-theme="dark"] {
  --bg: #15110F;
  --surface: #1E1916;
  --surface-2: #2A231F;
  --surface-warm: #322822;
  --text: #F3EEE8;
  --text-muted: #B6ADA4;
  --text-soft: #786E66;
  --accent: #C9A983;
  --accent-deep: #E2C098;
  --accent-soft: #4A3B2C;
  --border: rgba(243,238,232,0.08);
  --border-strong: rgba(243,238,232,0.18);
  --danger: #C9756A;
  --success: #9AAB85;
  --grain: 0.05;
  --shadow-card: 0 1px 0 rgba(0,0,0,0.4), 0 18px 40px -22px rgba(0,0,0,0.6);
  --shadow-soft: 0 1px 30px -12px rgba(0,0,0,0.5);
  --hero-warm-1: #3A2C20;
  --hero-warm-2: #2C2018;
  --hero-warm-3: #1A1310;
  --hero-cool: #2A231F;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
  transition: background 600ms ease, color 600ms ease;
  min-height: 100vh;
}

/* film grain */
.grain {
  position: fixed; inset: 0; z-index: 100;
  pointer-events: none;
  opacity: var(--grain);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.7 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
[data-theme="dark"] .grain { mix-blend-mode: soft-light; }

/* typography */
.serif { font-family: 'Instrument Serif', 'Times New Roman', serif; font-weight: 400; letter-spacing: -0.015em; }
.italic { font-style: italic; }
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-soft);
  font-weight: 500;
  margin: 0;
}
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.015em; }
a { color: inherit; text-decoration: none; }
a.underline { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; text-decoration-color: var(--text-soft); }
a.underline:hover { text-decoration-color: var(--text); }

/* top nav */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 36px;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 400ms ease, box-shadow 400ms ease, background 400ms ease;
}
.topbar.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 1px 24px -16px rgba(31,23,15,0.18);
}
.brand {
  font-weight: 300;
  font-size: 13px;
  display: flex; align-items: center; gap: 10px;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}
.brand img {
  width: 28px; height: 28px;
  fill: currentColor;
  color: var(--text);
  filter: invert(0);
}
[data-theme="dark"] .brand img {
  filter: invert(1);
}
.brand .em { font-style: normal; color: var(--text-soft); margin: 0 1px; font-weight: 400; }
.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-actions {
  display: flex; align-items: center; gap: 22px;
  font-size: 14px;
}
.nav-end { display: flex; align-items: center; gap: 8px; }
.nav-actions a:not(.cta-soft) {
  color: var(--text-muted);
  transition: color 300ms ease;
}
.nav-actions a:not(.cta-soft):hover { color: var(--text); }

/* transparent navbar until scroll */
.transparent-nav .topbar {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom-color: transparent;
}
.transparent-nav .topbar.scrolled {
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--border);
  box-shadow: 0 1px 24px -16px rgba(31,23,15,0.18);
}
.theme-toggle {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color 300ms ease, border-color 300ms ease;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.nav-burger {
  display: none;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  align-items: center; justify-content: center;
  transition: color 300ms ease, border-color 300ms ease;
}
.nav-burger:hover { color: var(--text); border-color: var(--border-strong); }

/* buttons */
.cta {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px;
  background: var(--text);
  color: var(--bg);
  border-radius: 999px;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 400ms cubic-bezier(.2,.7,.2,1), box-shadow 400ms ease, opacity 300ms ease;
  text-decoration: none;
}
.cta:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); opacity: 0.92; }
.cta-soft {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background 300ms ease, border-color 300ms ease;
  text-decoration: none;
}
.cta-soft:hover { background: var(--surface); border-color: var(--text); }
.cta-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-family: inherit; font-size: 14px; cursor: pointer;
  transition: color 300ms, border-color 300ms, background 300ms;
  text-decoration: none;
}
.cta-ghost:hover { color: var(--text); background: var(--surface); }
.cta-danger {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px;
  background: transparent;
  color: var(--danger);
  border: 1px solid color-mix(in oklab, var(--danger) 40%, transparent);
  border-radius: 999px;
  font-family: inherit; font-size: 14px; cursor: pointer;
  transition: background 300ms ease;
  text-decoration: none;
}
.cta-danger:hover { background: color-mix(in oklab, var(--danger) 8%, transparent); }
.link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text); font-size: 14px;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 4px;
  transition: gap 400ms ease, border-color 300ms ease;
  text-decoration: none;
}
.link-arrow:hover { gap: 14px; border-color: var(--text); }

/* cards & inputs */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field label, .label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  font-weight: 500;
}
.input, .select, .textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-strong);
  padding: 10px 0 12px;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  width: 100%;
  outline: none;
  transition: border-color 400ms ease;
  border-radius: 0;
}
.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus,
.input:-webkit-autofill:active,
.textarea:-webkit-autofill,
.textarea:-webkit-autofill:hover,
.textarea:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--bg) inset;
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  transition: background-color 5000s ease-in-out 0s;
}
.input::placeholder, .textarea::placeholder { color: var(--text-soft); opacity: 1; }
.input:focus::placeholder, .textarea:focus::placeholder { color: var(--text-soft); opacity: 1; }
.input:focus, .select:focus, .textarea:focus { border-bottom-color: var(--text); }
.textarea { min-height: 88px; resize: vertical; padding-top: 12px; line-height: 1.55; }
.select { appearance: none; padding-right: 24px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%236E6157' stroke-width='1.4' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 4px center;
}
[data-theme="dark"] .select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%23B6ADA4' stroke-width='1.4' fill='none' stroke-linecap='round'/></svg>");
}

/* segmented radio */
.seg {
  display: inline-flex; gap: 6px;
  padding: 4px;
  background: var(--surface-2);
  border-radius: 999px;
  border: 1px solid var(--border);
}
.seg label {
  padding: 8px 16px; border-radius: 999px;
  font-size: 13px; cursor: pointer; color: var(--text-muted);
  transition: background 300ms ease, color 300ms ease;
  letter-spacing: normal; text-transform: none; font-weight: 500;
}
.seg input { display: none; }
.seg input:checked + label { background: var(--surface); color: var(--text); box-shadow: var(--shadow-soft); }

/* chip */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px; font-weight: 500;
  background: var(--surface-2);
  color: var(--text-muted);
  letter-spacing: 0.01em;
}
.chip.active { background: color-mix(in oklab, var(--accent) 22%, var(--surface)); color: var(--accent-deep); }
.chip.success { background: color-mix(in oklab, var(--success) 18%, var(--surface)); color: var(--success); }
.chip.danger { background: color-mix(in oklab, var(--danger) 12%, var(--surface)); color: var(--danger); }
.chip.dot::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: 0.7;
}

/* divider */
.rule { height: 1px; background: var(--border); border: 0; margin: 0; }
.rule-faint {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
  border: 0; margin: 0;
}

/* motion */
.fade-in, .fade-up { opacity: 0; will-change: opacity, transform, filter; transition: opacity 700ms cubic-bezier(.2,.7,.2,1), transform 800ms cubic-bezier(.2,.7,.2,1), filter 700ms cubic-bezier(.2,.7,.2,1); }
.fade-up { transform: translateY(14px); filter: blur(6px); }
.fade-in.in, .fade-up.in { opacity: 1; transform: none; filter: blur(0); }
.delay-1 { transition-delay: 90ms; }
.delay-2 { transition-delay: 200ms; }
.delay-3 { transition-delay: 340ms; }
.delay-4 { transition-delay: 500ms; }
@media (prefers-reduced-motion: reduce) {
  .fade-in, .fade-up { opacity: 1; transform: none; filter: none; transition: none; }
}

/* layout */
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 36px; }
.wrap-narrow { width: 100%; max-width: 720px; margin: 0 auto; padding: 0 36px; }

/* messages — flash notifications shown below the topbar */
.messages-bar {
  position: relative;
  z-index: 40;
  padding: 24px 0 8px;
  background: var(--bg);
}
.messages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.messages li {
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-left-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-card);
  animation: msg-in 360ms cubic-bezier(.2,.7,.2,1) both;
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
.messages li.error   { background: color-mix(in oklab, var(--danger)  10%, var(--surface)); border-left-color: var(--danger);       color: var(--danger); }
.messages li.success { background: color-mix(in oklab, var(--success) 10%, var(--surface)); border-left-color: var(--success);      color: var(--success); }
.messages li.info    { background: var(--surface-2);                                         border-left-color: var(--border-strong); color: var(--text-muted); }
.messages li.warning { background: color-mix(in oklab, var(--accent)  15%, var(--surface)); border-left-color: var(--accent-deep);  color: var(--accent-deep); }

.err { font-size: 12px; color: var(--danger); display: block; margin-top: 4px; }
.hint { font-size: 14px; color: var(--text-muted); margin: 0; }
.meta { font-size: 13px; color: var(--text-soft); }
.aux { font-size: 13px; color: var(--text-muted); text-align: center; margin-top: 16px; }
.aux a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* footer */
.footer {
  margin-top: 120px;
  padding: 56px 36px 48px;
  border-top: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 13px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px;
}
.footer-links { display: flex; gap: 28px; }
.footer-links a { color: var(--text-muted); transition: color 300ms ease; }
.footer-links a:hover { color: var(--text); }

/* ── auth shell ─────────────────────────────────────────────── */
.auth-shell {
  min-height: calc(100vh - 64px);
  display: flex; align-items: center; justify-content: center;
  padding: 48px 24px;
}
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 40px 36px;
  box-shadow: var(--shadow-card);
}
.auth-card h1 { font-size: 19px; margin-top: 10px; margin-bottom: 4px; }
.auth-form { margin-top: 28px; display: flex; flex-direction: column; gap: 20px; }
.row.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-check { display: flex; align-items: flex-start; gap: 10px; }
.field-check label { font-size: 13px; color: var(--text-muted); text-transform: none; letter-spacing: 0; font-weight: 400; }
.field-check input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; accent-color: var(--text); }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; color: var(--text-soft);
  margin: 4px 0;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── home hero (base; overridden by home.css) ──────────────── */
.hero {
  position: relative; overflow: hidden;
  min-height: calc(100vh - 80px);
  isolation: isolate;
}

/* ── list shell ─────────────────────────────────────────────── */
.list-shell { max-width: 800px; margin: 0 auto; padding: 56px 36px 80px; }
.list-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
  margin-bottom: 36px;
}
.list-head h1 { font-size: 32px; }
.list-head h1 .em { font-family: 'Instrument Serif', serif; font-style: italic; }
.list-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.list-tabs a {
  padding: 10px 18px;
  font-size: 13px; color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: color 300ms, border-color 300ms;
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none;
}
.list-tabs a:hover { color: var(--text); }
.list-tabs a.active { color: var(--text); border-bottom-color: var(--text); }
.list-tabs .count {
  font-size: 11px; padding: 2px 7px;
  background: var(--surface-2); border-radius: 999px;
  color: var(--text-soft);
}
.list { list-style: none; padding: 0; margin: 0; }
.entry {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 16px 20px;
  padding: 24px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 8px;
  transition: box-shadow 300ms ease;
}
.entry:hover { box-shadow: var(--shadow-card); }
.entry .num { font-size: 13px; color: var(--text-soft); padding-top: 3px; }
.entry .name { font-size: 16px; font-weight: 500; }
.entry .name .em { font-family: 'Instrument Serif', serif; font-style: italic; font-weight: 400; color: var(--text-muted); }
.entry .where { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.entry .sep { margin: 0 6px; opacity: 0.4; }
.entry .actions { grid-column: 3; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; justify-content: center; }
.entry .more { font-size: 12px; color: var(--text-soft); }
.empty { text-align: center; padding: 80px 20px; color: var(--text-muted); }
.empty h2 { font-size: 22px; margin-bottom: 12px; }
.empty p { margin-bottom: 24px; }

/* ── search form shell ──────────────────────────────────────── */
.search-shell {
  max-width: 900px; margin: 0 auto; padding: 56px 36px 80px;
  display: grid; grid-template-columns: 200px 1fr; gap: 0 48px; align-items: start;
}
.search-head { grid-column: 1 / -1; margin-bottom: 48px; }
.search-head h1 { font-size: 32px; }
.search-head h1 .em { font-family: 'Instrument Serif', serif; font-style: italic; }
.search-head .lede { font-size: 15px; color: var(--text-muted); margin-top: 12px; max-width: 560px; }
.rail { position: sticky; top: 88px; }
.rail .ord { font-size: 11px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--text-soft); margin-bottom: 16px; font-weight: 500; }
.rail ol { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.rail a {
  display: flex; gap: 10px; align-items: baseline;
  font-size: 13px; color: var(--text-soft);
  padding: 6px 10px; border-radius: 6px;
  transition: color 300ms, background 300ms;
  text-decoration: none;
}
.rail a:hover, .rail a.active { color: var(--text); background: var(--surface-2); }
.rail .num { color: var(--text-soft); font-size: 11px; min-width: 18px; }
.rail .meta { font-size: 12px; color: var(--text-soft); margin-top: 20px; line-height: 1.6; }
.sections { display: flex; flex-direction: column; gap: 64px; }
.sec { scroll-margin-top: 100px; }
.sec h2 { font-size: 22px; margin-bottom: 20px; }
.sec h2 .em { font-family: 'Instrument Serif', serif; font-style: italic; }
.sec .hint { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
.sec .fields { display: flex; flex-direction: column; gap: 24px; }
.sec .row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.sec .row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; }
.savebar {
  position: sticky; bottom: 24px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  background: color-mix(in oklab, var(--surface) 94%, transparent);
  border: 1px solid var(--border);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  margin-top: 32px;
  grid-column: 2;
}
.savebar .progress { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-soft); }
.savebar .bar { width: 120px; height: 3px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.savebar .bar span { display: block; height: 100%; background: var(--accent-deep); border-radius: 99px; }
.savebar .actions { display: flex; gap: 10px; }

/* ── match shell ─────────────────────────────────────────────── */
.match-shell { max-width: 800px; margin: 0 auto; padding: 40px 36px 80px; }
.match-back {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-muted);
  margin-bottom: 32px;
  transition: color 300ms;
  text-decoration: none;
}
.match-back:hover { color: var(--text); }
.match-head {
  display: grid; grid-template-columns: 1fr auto; gap: 32px;
  margin-bottom: 40px;
}
.match-head h1 { font-size: 28px; }
.match-head h1 .em { font-family: 'Instrument Serif', serif; font-style: italic; }
.match-head .lede { font-size: 15px; color: var(--text-muted); line-height: 1.6; margin-top: 12px; max-width: 460px; }
.meta-side {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex; flex-direction: column; gap: 10px;
  min-width: 200px;
  font-size: 13px;
  align-self: flex-start;
}
.meta-side .row { display: flex; justify-content: space-between; gap: 12px; }
.meta-side .lbl { color: var(--text-soft); }
.meta-side .val { color: var(--text); font-weight: 500; text-align: right; }
.stage-progress {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 40px;
}
.stage-progress .stage { background: var(--surface); padding: 16px 18px; }
.stage-progress .stage.done { background: color-mix(in oklab, var(--success) 8%, var(--surface)); }
.stage-progress .stage.current { background: color-mix(in oklab, var(--accent) 10%, var(--surface)); }
.stage-progress .stage .ord { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-soft); margin-bottom: 4px; }
.stage-progress .stage .ttl { font-size: 14px; font-weight: 500; }
.stage-progress .stage .sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.stage-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 32px;
}
.panel-head { padding: 28px 28px 24px; }
.panel-head h2 { font-size: 22px; }
.panel-head h2 .em { font-family: 'Instrument Serif', serif; font-style: italic; }
.panel-head .sub { font-size: 14px; color: var(--text-muted); margin-top: 10px; }
.panel-body { padding: 28px; border-top: 1px solid var(--border); }
.panel-foot { padding: 16px 28px; background: var(--surface-2); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.panel-foot .note { font-size: 13px; color: var(--text-muted); max-width: 340px; }
.other-side { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 32px; }
.other-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}
.other-card .who { font-size: 16px; font-weight: 500; margin-bottom: 12px; }
.other-card .desc { font-size: 14px; color: var(--text-muted); }
.other-card .desc dl { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.other-card .desc dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.15em; color: var(--text-soft); }
.other-card .desc dd { margin: 0; font-size: 14px; color: var(--text); }

/* stage include panels (inherited from stage templates) */
.stage-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 16px;
}

/* responsive */
@media (max-width: 880px) {
  .topbar { padding-left: 22px; padding-right: 22px; }
  .nav-actions { gap: 14px; }
  .search-shell { grid-template-columns: 1fr; }
  .rail { display: none; }
  .savebar { grid-column: 1; }
  .match-head { grid-template-columns: 1fr; }
  .meta-side { min-width: unset; }
  .other-side { grid-template-columns: 1fr; }
  .list-shell, .match-shell { padding-left: 22px; padding-right: 22px; }
  .auth-card { padding: 28px 24px; }
  .search-shell { padding-left: 22px; padding-right: 22px; }
}
@media (max-width: 600px) {
  .hero { padding: 60px 22px; }
  .messages-bar { padding: 16px 0 4px; }
  .messages li { padding: 12px 16px; font-size: 13px; border-radius: 10px; }
  .entry { grid-template-columns: 1fr; }
  .entry .num { display: none; }
  .entry .actions { grid-column: 1; align-items: flex-start; }
  .sec .row, .sec .row-3 { grid-template-columns: 1fr; }

  /* mobile nav — nav-end stays in topbar row; nav-actions drops down */
  .nav-burger { display: inline-flex; }
  .nav-actions { display: none; }
  .topbar.nav-open .nav-actions {
    display: flex;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    padding: 12px 22px 20px; gap: 8px;
    background: color-mix(in oklab, var(--bg) 96%, transparent);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid var(--border);
    z-index: 49;
  }
  .topbar.nav-open .nav-actions .cta-soft { justify-content: center; }
}

/* ── language checkbox grid ──────────────────────────────────────── */
.language-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.lang-option {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background 200ms, border-color 200ms;
}
.lang-option:has(input:checked) {
  background: color-mix(in oklab, var(--accent) 12%, var(--surface));
  border-color: var(--accent-deep);
}
.lang-option input { accent-color: var(--accent-deep); }

/* Language toggle (topbar) — single button showing the TARGET language */
.lang-toggle {
  display: inline-flex;
  align-items: center;
}
.lang-toggle .lang-btn {
  background: transparent;
  border: none;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 4px 6px;
  cursor: pointer;
  text-transform: uppercase;
  line-height: 1;
  transition: color 0.15s;
}
.lang-toggle .lang-btn:hover {
  color: var(--text);
}
