/* New Beginnings · Marriage Introductions
   Design tokens come from the approved prototype and the main website. No inline styles are used
   anywhere (the Content-Security-Policy forbids them), so every look lives in this file. */

@font-face { font-family: "Barlow"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/barlow-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }

:root {
  --cream: #F8F6F1;
  --header: #FDFCF9;
  --text: #1B2A2D;
  --muted: #51605F;
  --muted-strong: #3E4D50;
  --teal: #005465;
  --teal-dark: #003A46;
  --gold: #EAB339;
  --gold-pale: #FFF6DE;
  --gold-text: #6E4B00;
  --pale: #E6F0F1;
  --beige: #EFECE4;
  --danger: #7E2518;
  --danger-pale: #F8E9E5;
  --ok: #1F6B3A;
  --ok-pale: #E5F2E9;
  --border: #ECE6D8;
  --option-border: #E3DFD5;
  --white: #FFFFFF;
  --shadow: 0 2px 14px rgba(0, 84, 101, 0.08);
  --radius-card: 24px;
  --radius-pill: 999px;
  --font-head: "Barlow", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--text);
  font-family: var(--font-body); font-size: 15px; line-height: 1.5;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--teal); }
a:hover { color: var(--teal-dark); }
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--font-head); font-weight: 600; margin: 0; line-height: 1.15; color: var(--text); }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
p { margin: 0; }
.muted { color: var(--muted); }
.muted-strong { color: var(--muted-strong); }
.small { font-size: 13px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.row-between { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.grow { flex: 1 1 auto; }
.center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--teal); color: #fff; padding: 8px 14px; z-index: 10; }
.skip-link:focus { left: 8px; top: 8px; }
.debug { background: var(--beige); padding: 12px; border-radius: 12px; overflow-x: auto; font-size: 12px; }

/* ---------- Header, navigation, footer ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 20px; background: var(--header); border-bottom: 1px solid var(--border);
}
.brand {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  font-family: var(--font-head); font-weight: 600; font-size: 21px; letter-spacing: -0.01em;
  text-transform: lowercase; color: var(--teal);
}
.brand-logo { display: block; height: 44px; width: auto; max-width: 62vw; }
@media (max-width: 480px) { .brand-logo { height: 28px; } }
@media (max-width: 380px) { .brand-logo { height: 23px; } }
.header-user { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 14px; }
.avatar-initial {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border-radius: 50%; background: var(--pale); color: var(--teal); font-weight: 600; font-size: 13px;
}
.site-nav { background: var(--header); border-bottom: 1px solid var(--border); padding: 0 12px; }
.site-nav ul { list-style: none; margin: 0 auto; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; max-width: 1180px; }
.site-nav a, .link-button {
  display: inline-block; padding: 12px 12px; text-decoration: none; color: var(--muted-strong);
  font-weight: 500; font-size: 14px; border-bottom: 3px solid transparent; background: none; border-top: 0; border-left: 0; border-right: 0;
  font-family: inherit; cursor: pointer;
}
.site-nav a:hover, .link-button:hover { color: var(--teal); }
.site-nav a[aria-current="page"] { color: var(--teal); border-bottom-color: var(--gold); }
.nav-end { margin-left: auto; }
.inline-form { display: inline; margin: 0; }
@media (max-width: 600px) {
  .site-header { padding: 10px 16px; gap: 8px; }
  .site-header .pill-gold { font-size: 11px; padding: 4px 10px; }
  .header-name { display: none; }
  .site-nav { padding: 0 4px; }
  .site-nav ul { flex-wrap: nowrap; overflow-x: auto; gap: 0; -webkit-overflow-scrolling: touch; }
  .site-nav li { flex: 0 0 auto; }
  .site-nav a, .link-button { padding: 12px 10px; white-space: nowrap; }
}

.page { flex: 1 0 auto; width: 100%; margin: 0 auto; padding: 20px 20px 40px; display: flex; flex-direction: column; gap: 16px; }
.is-narrow .page { max-width: 600px; }
.is-wide .page { max-width: 1180px; }
.site-footer { padding: 20px; text-align: center; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }

/* ---------- Components ---------- */
.pill {
  display: inline-block; padding: 5px 12px; border-radius: var(--radius-pill);
  background: var(--pale); color: var(--teal); font-size: 12px; font-weight: 600;
}
.pill-gold { background: var(--gold); color: var(--teal-dark); }
.pill-step { align-self: flex-start; }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: var(--radius-pill);
  background: var(--pale); color: var(--teal-dark); font-size: 12px; font-weight: 600;
}
.badge-gold { background: var(--gold-pale); color: var(--gold-text); }
.badge-danger { background: var(--danger-pale); color: var(--danger); }
.badge-ok { background: var(--ok-pale); color: var(--ok); }
.badge-grey { background: var(--beige); color: var(--muted-strong); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }

.card {
  background: var(--white); border-radius: var(--radius-card); box-shadow: var(--shadow);
  padding: 18px; display: flex; flex-direction: column; gap: 12px;
}
.card h2 { font-size: 18px; }
.card-flat { background: var(--beige); box-shadow: none; }
.card-pale { background: var(--pale); box-shadow: none; color: var(--teal-dark); }
.card-gold { background: var(--gold-pale); box-shadow: none; color: var(--gold-text); }

.notice {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 20px;
  background: var(--pale); color: var(--teal-dark); font-size: 14px;
}
.notice-success { background: var(--ok-pale); color: var(--ok); }
.notice-error { background: var(--danger-pale); color: var(--danger); }
.notice-warn { background: var(--gold-pale); color: var(--gold-text); }
.notice-grey { background: var(--beige); color: var(--muted-strong); }

.btn, .btn-secondary, .btn-solid, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
  min-height: 52px; padding: 14px 22px; border-radius: var(--radius-pill); font: inherit; font-weight: 600; font-size: 16px;
  text-decoration: none; cursor: pointer; border: 2px solid transparent;
}
.btn { background: var(--gold); color: var(--teal-dark); }
.btn:hover { background: #dfa52a; color: var(--teal-dark); }
.btn-secondary { background: var(--white); color: var(--teal); border-color: var(--teal); min-height: 46px; font-size: 15px; padding: 10px 18px; }
.btn-secondary:hover { background: var(--pale); color: var(--teal-dark); }
.btn-solid { background: var(--teal); color: #fff; min-height: 46px; font-size: 15px; padding: 10px 18px; }
.btn-solid:hover { background: var(--teal-dark); color: #fff; }
.btn-danger { background: var(--white); color: var(--danger); border-color: var(--danger); min-height: 46px; font-size: 15px; padding: 10px 18px; }
.btn-danger:hover { background: var(--danger-pale); }
.btn-small { min-height: 38px; padding: 6px 14px; font-size: 14px; }
.btn-block { display: flex; width: 100%; }
.btn[disabled], .btn-secondary[disabled], .btn-solid[disabled], .btn-danger[disabled] { opacity: 0.45; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions-stack { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label, legend.label {
  font-family: var(--font-head); font-weight: 600; font-size: 17px; padding: 0;
}
.req-mark { color: var(--danger); font-weight: 600; }
.help { font-size: 13px; color: var(--muted); }
.field-error { font-size: 13px; color: var(--danger); font-weight: 500; }
.field.has-error input[type=text], .field.has-error input[type=email], .field.has-error input[type=tel], .field.has-error input[type=date],
.field.has-error input[type=datetime-local], .field.has-error input[type=url],
.field.has-error select, .field.has-error textarea { border-color: var(--danger); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field { gap: 8px; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=datetime-local], input[type=url], input[type=search], input[type=number], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 18px; border: 1.5px solid var(--gold); border-radius: var(--radius-pill);
  font: inherit; color: var(--text); background: var(--white);
}
textarea { border-radius: 20px; min-height: 110px; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--teal) 50%), linear-gradient(135deg, var(--teal) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
input[readonly] { background: var(--beige); border-color: var(--option-border); }
.code-input { font-size: 28px; letter-spacing: 0.35em; text-align: center; font-variant-numeric: tabular-nums; }

/* Choice chips: radio and checkbox inputs that look like the prototype's pill buttons */
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices.stacked { flex-direction: column; align-items: stretch; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice label {
  display: flex; align-items: center; min-height: 44px; padding: 8px 16px; border: 2px solid var(--option-border);
  border-radius: var(--radius-pill); background: var(--white); color: var(--text); font-weight: 500; font-size: 14px; cursor: pointer;
}
.choice input:checked + label { background: var(--teal); border-color: var(--teal); color: #fff; }
.choice input:focus-visible + label { outline: 3px solid var(--gold); outline-offset: 2px; }
.choice input:disabled + label { opacity: 0.5; cursor: not-allowed; }
.tickbox { display: flex; gap: 12px; align-items: flex-start; }
.tickbox input[type=checkbox] { flex: none; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--teal); }
.tickbox label { font-size: 14px; line-height: 1.45; }
.counter { font-size: 13px; color: var(--muted); text-align: right; }

/* ---------- Steps and progress ---------- */
.progress { display: flex; gap: 6px; }
.progress span { flex: 1; height: 6px; border-radius: 3px; background: var(--option-border); }
.progress span.done { background: var(--teal); }
.progress span.now { background: var(--gold); }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: flex; gap: 14px; }
.timeline .rail { display: flex; flex-direction: column; align-items: center; flex: none; }
.timeline .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--option-border); background: #fff; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; }
.timeline .line { flex: 1; width: 2px; background: var(--option-border); min-height: 18px; }
.timeline .done .dot { background: var(--teal); border-color: var(--teal); }
.timeline .done .line { background: var(--teal); }
.timeline .current .dot { border-color: var(--gold); background: var(--gold); }
.timeline .body { padding-bottom: 18px; display: flex; flex-direction: column; gap: 2px; }
.timeline .body strong { font-weight: 600; }
.timeline .body span { font-size: 14px; color: var(--muted); }
.timeline .todo .body strong { color: var(--muted-strong); font-weight: 500; }

.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.checklist .mark { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--option-border); color: #fff; margin-top: 1px; }
.checklist .ok .mark { background: var(--teal); }
.checklist .wait .mark { background: var(--gold); color: var(--teal-dark); }
.checklist .no .mark { background: var(--danger); }
.checklist .sub { display: block; font-size: 13px; color: var(--muted); }

dl.facts { margin: 0; display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 8px 14px; font-size: 14px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* ---------- Member cards and photos ---------- */
.person { display: flex; gap: 14px; align-items: center; }
.avatar {
  flex: none; position: relative; width: 66px; height: 66px; margin: 5px; border-radius: 50%; overflow: hidden;
  background: #C8D8D9; box-shadow: 0 0 0 3px var(--header), 0 0 0 5px var(--gold);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-lg { width: 96px; height: 96px; }
.avatar-blank::before { content: ""; position: absolute; left: 31%; top: 16%; width: 38%; height: 38%; border-radius: 50%; background: #7E9EA2; filter: blur(4px); }
.avatar-blank::after { content: ""; position: absolute; left: 14%; top: 54%; width: 72%; height: 56%; border-radius: 50% 50% 0 0; background: #7E9EA2; filter: blur(4px); }
.person .name { font-family: var(--font-head); font-weight: 600; font-size: 20px; }
.score { height: 8px; border-radius: 4px; background: var(--option-border); overflow: hidden; }
.score progress { width: 100%; height: 8px; display: block; appearance: none; border: 0; background: var(--option-border); }
.score progress::-webkit-progress-bar { background: var(--option-border); }
.score progress::-webkit-progress-value { background: var(--teal); }
.score progress::-moz-progress-bar { background: var(--teal); }

/* ---------- Staff dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--white); border-radius: 20px; padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--text); }
.stat .num { font-family: var(--font-head); font-weight: 600; font-size: 30px; color: var(--teal); line-height: 1; }
.stat .lbl { font-size: 13px; color: var(--muted); }
a.stat:hover { background: var(--pale); }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 980px) { .layout-2 { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); } }
.pipeline { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 12px; }
@media (max-width: 520px) { .pipeline { grid-template-columns: minmax(0, 1fr); } }
.column { background: var(--beige); border-radius: 20px; padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.column > header { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--font-head); font-weight: 600; }
.column .count { color: var(--muted); font-size: 14px; }
.mini-card { background: var(--white); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; text-decoration: none; color: var(--text); font-size: 13px; }
.mini-card:hover { box-shadow: var(--shadow); }
.mini-card strong { font-size: 14px; }
.mini-card .flag { color: var(--danger); font-weight: 600; }
.mini-card .sub { color: var(--muted); }

table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data tr:hover td { background: #FBFAF6; }
.table-wrap { position: relative; overflow-x: auto; background: var(--white); border-radius: 20px; box-shadow: var(--shadow); padding: 6px 8px; }
.card .table-wrap { background: transparent; box-shadow: none; border-radius: 0; padding: 0; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs a { padding: 8px 14px; border-radius: var(--radius-pill); background: var(--white); text-decoration: none; font-weight: 500; font-size: 14px; border: 1.5px solid var(--option-border); color: var(--muted-strong); }
.tabs a[aria-current="page"] { background: var(--teal); color: #fff; border-color: var(--teal); }

.quiz-q { font-family: var(--font-head); font-weight: 600; font-size: 22px; line-height: 1.25; }
.answer-right { border-color: var(--ok) !important; background: var(--ok-pale) !important; color: var(--ok) !important; }
.answer-wrong { border-color: var(--danger) !important; background: var(--danger-pale) !important; color: var(--danger) !important; }
.option-static { display: flex; align-items: center; min-height: 44px; padding: 8px 16px; border: 2px solid var(--option-border); border-radius: 20px; background: var(--white); font-size: 14px; font-weight: 500; }

.qr-box { background: #fff; padding: 12px; border-radius: 16px; display: inline-block; }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; letter-spacing: 0.08em; background: var(--beige); padding: 12px 14px; border-radius: 14px; overflow-wrap: anywhere; }

@media (min-width: 700px) {
  body { font-size: 16px; }
  h1 { font-size: 32px; }
}
@media print {
  .site-header, .site-nav, .site-footer, .actions { display: none; }
}

/* ---------- Additions: introductions, cards, small helpers ---------- */
.card-link { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; }
.card-link:hover { box-shadow: 0 4px 18px rgba(0, 84, 101, 0.16); }
.btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.badge-pale { background: var(--pale); color: var(--teal-dark); }
.notice-pale { background: var(--pale); color: var(--teal-dark); }
.card-flat.row-between { padding: 10px 14px; border-radius: 20px; background: var(--beige); }
.num-inline { font-family: 'Barlow', sans-serif; font-weight: 600; font-size: 16px; color: var(--teal); }
.tick-line { display: flex; gap: 6px; align-items: center; color: var(--teal-dark); }
.back { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 500; text-decoration: none; }
.danger-link { color: var(--danger); text-decoration: underline; }
details.card > summary { cursor: pointer; font-weight: 600; min-height: 32px; }
details.card[open] > summary { margin-bottom: 12px; }
.card details:not(.card) { background: var(--beige); border-radius: 16px; padding: 10px 14px; }
.card details:not(.card) > summary { cursor: pointer; font-weight: 600; min-height: 28px; }
.card details:not(.card)[open] > summary { margin-bottom: 12px; }
input[type=file] { font: inherit; max-width: 100%; color: var(--muted); padding: 10px; border: 1px dashed var(--option-border); border-radius: 16px; background: #fff; width: 100%; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; margin-right: 12px; padding: 8px 16px; border: 0; border-radius: 999px; background: var(--beige); color: var(--teal); cursor: pointer; }

/* ---- staff screens ---- */
.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; }
.match-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.match-row:last-child { border-bottom: 0; }
.match-row .fit { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted-strong); }
.match-row .fit .score { flex: 1; min-width: 70px; max-width: 160px; }
.flag-row { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.flag-row:last-child { border-bottom: 0; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 760px) { .two-col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.party-box { background: var(--pale); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.event-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.event-list li { display: grid; grid-template-columns: 130px 1fr; gap: 10px; }
.event-list .when { color: var(--muted); }
.note-item { border-top: 1px solid var(--border); padding-top: 8px; font-size: 14px; }
.photo-frame { width: 140px; height: 140px; border-radius: 16px; overflow: hidden; background: var(--beige); }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.warn-text { color: var(--danger); font-weight: 600; }
.right { margin-left: auto; }
.reply { background: var(--pale); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.reply dt { color: var(--muted); }

/* Receipt: label above value, no browser-default indent on the values. */
dl.receipt { margin: 0; }
dl.receipt dt { margin: 0; }
dl.receipt dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; }

/* Several small forms inside one card: a line and some air between them. */
.subform { gap: 12px; }
.subform + .subform { border-top: 1px solid var(--border); padding-top: 20px; margin-top: 8px; }
.subform h3 { margin: 0; }

/* ---- admin sections ---- */
.admin-tabs { border-bottom: 1px solid var(--border); margin: 0 0 4px; }
.admin-tabs ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 6px; }
.admin-tabs a { display: block; padding: 10px 12px; font-weight: 600; font-size: 14px; color: var(--muted-strong); text-decoration: none; border-bottom: 3px solid transparent; }
.admin-tabs a:hover { color: var(--teal); }
.admin-tabs a[aria-current="page"] { color: var(--teal); border-bottom-color: var(--gold); }
@media (max-width: 640px) {
  .admin-tabs ul { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .admin-tabs li { flex: 0 0 auto; }
  .admin-tabs a { white-space: nowrap; }
}
fieldset.rules-group { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.rules-group.card { padding: 20px; }
fieldset.rules-group legend { padding: 0; margin: 0 0 4px; }
fieldset.rules-group legend h2 { margin: 0; }
.rule-row { padding: 12px 0; border-top: 1px solid var(--border); }
.rule-row:first-of-type { border-top: 0; }
.rule-input { display: flex; align-items: center; gap: 8px; }
.rule-input input[type=number] { width: 8em; }
.rule-input input[type=text], .rule-input input[type=email], .rule-input input[type=url] { width: 100%; max-width: 32em; }
.rule-input .unit { color: var(--muted); font-size: 14px; }
.rule-reset { margin-top: 2px; }
.sticky-save { position: sticky; bottom: 0; background: linear-gradient(to top, var(--cream) 70%, rgba(248, 246, 241, 0)); padding: 14px 0 6px; }
ul.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

/* ---- wording editor ---- */
textarea.wording-box { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; line-height: 1.5; width: 100%; min-height: 12em; }
pre.email-preview { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--pale); border-radius: 12px; padding: 14px 16px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; margin: 0; }
.preview-page { border: 1px dashed var(--option-border); border-radius: 16px; padding: 16px; background: #fff; }
code { background: var(--beige); padding: 1px 6px; border-radius: 6px; font-size: 13px; }

/* ---- questions screens ---- */
.grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.sub-tabs ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sub-tabs a { display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--beige); color: var(--muted-strong); text-decoration: none; font-size: 14px; font-weight: 600; }
.sub-tabs a:hover { color: var(--teal); }
.sub-tabs a[aria-current="page"] { background: var(--teal); color: #fff; }
.item-row { display: grid; gap: 8px; grid-template-columns: 1fr; padding: 12px 0; border-top: 1px solid var(--border); align-items: start; }
.item-row:first-of-type { border-top: 0; }
@media (min-width: 720px) { .item-row { grid-template-columns: minmax(0, 1fr) auto; } }
.item-row.is-retired .item-name { opacity: 0.6; }
.item-edit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.item-edit input[type=text] { flex: 1 1 14em; min-width: 0; }
.item-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.item-actions form { margin: 0; }
.opt-row { display: flex; gap: 10px; align-items: center; }
.opt-row .opt-letter { flex: none; width: 1.6em; font-weight: 700; color: var(--teal); text-transform: uppercase; }
.opt-row input[type=text] { flex: 1 1 auto; min-width: 0; }
.opt-row input[type=radio] { flex: none; width: 22px; height: 22px; accent-color: var(--teal); }
input.input-short, .field input.input-short { width: 7em; max-width: 100%; }
input.input-date, .field input.input-date { width: 13em; max-width: 100%; }

/* Permissions table: the tick boxes line up under their column heading, the same in every group */
.access-table { table-layout: fixed; min-width: 40rem; }
.access-table th[scope="row"] { font-weight: 600; text-align: left; vertical-align: top; white-space: normal; }
.access-table th:not([scope="row"]) { width: 8rem; text-align: center; }
.access-table td { text-align: center; vertical-align: top; }
.access-table input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--teal); }

/* Health: one line per check */
.health-list li { padding: 10px 0; border-top: 1px solid var(--border); }
.health-list li:first-child { border-top: 0; }

/* Page links under long lists */
.pager { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-top: 8px; }
.pager ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.pager a, .pager span[aria-current] { display: inline-block; min-width: 2.2em; padding: 6px 10px; border-radius: 999px; text-align: center; font-weight: 600; font-size: 14px; }
.pager a { color: var(--teal); text-decoration: none; border: 1px solid var(--border); background: var(--white); }
.pager a:hover { border-color: var(--teal); }
.pager span[aria-current] { background: var(--teal); color: var(--white); }

/* A row of search choices that wraps on small screens */
.filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.filters .field { flex: 1 1 12rem; margin: 0; }
.filters .field:not(.grow) { max-width: 18rem; }
.filters .field.grow { flex: 2 1 16rem; }

/* Two-way switch (dashboard: everyone / only mine) */
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: var(--white); align-self: flex-start; }
.segmented a { padding: 6px 14px; font-size: 14px; font-weight: 600; color: var(--muted-strong); text-decoration: none; }
.segmented a[aria-current="true"] { background: var(--teal); color: var(--white); }

/* Interest list: a box only robots fill in, kept off screen and away from screen readers */
.visually-hidden-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.help-block { margin-top: -6px; }
.text-link { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: var(--teal); text-decoration: underline; cursor: pointer; }
.help-block p, .help-block { font-size: 13px; color: var(--muted); }

/* Italics (a word from another language). The fonts have no true italic, so give the slant a little room. */
em { font-style: italic; padding-right: .08em; }
