/* Fonts are self-hosted: no third-party requests. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-ext.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/atkinson.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/atkinson-ext.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --paper: #eef1f5;
  --paper-deep: #e3e8ef;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --ink: #1b2340;
  --ink-hover: #2b3660;
  --ink-2: #4b5573;
  --ink-3: #737c97;
  --line: #d9dfe9;
  --line-strong: #b8c1d2;

  /* One colour per role; used for badge strips, chips and avatars. */
  --student: #2c4ba5;
  --student-soft: #e5ebf8;
  --serving: #2e7155;
  --serving-soft: #e0efe7;
  --shepherd: #6d3b8e;
  --shepherd-soft: #efe6f5;
  --older: #e3a43a;
  --older-ink: #8a5a0b;
  --older-soft: #fbefd8;

  --warn: #a8570a;
  --warn-soft: #fff4e2;
  --error: #b3302f;
  --error-soft: #fbe6e5;
  --focus: #2c4ba5;

  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --text: "Atkinson Hyperlegible Next", ui-sans-serif, system-ui, sans-serif;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.4375rem;
  --step-3: 1.75rem;
  --step-4: 2.125rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.5 var(--text);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--display); font-weight: 650; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.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; }
.muted { color: var(--ink-2); font-size: var(--step--1); }

/* ---------- controls ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.6rem 1rem; border-radius: 10px; border: 1px solid transparent;
  font-weight: 650; font-size: 0.9375rem; line-height: 1.2; white-space: nowrap;
  background: none;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-hover); }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn-quiet { color: var(--ink-2); }
.btn-quiet:hover { background: rgb(27 35 64 / 0.06); color: var(--ink); }
.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.875rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.btn-row-end { justify-content: flex-end; }
.file-btn { cursor: pointer; }
.file-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }

.link { background: none; border: 0; padding: 0; color: var(--student); font-weight: 650; text-decoration: underline; text-underline-offset: 2px; }

.select, .input, .textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface);
  padding: 0.55rem 0.75rem; line-height: 1.3;
}
.select {
  appearance: none; padding-right: 2.2rem; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%234b5573' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 0.7rem center / 14px;
}
.select:hover, .input:hover, .textarea:hover { border-color: var(--ink-3); }
.select-sm { padding: 0.35rem 2rem 0.35rem 0.6rem; font-size: 0.875rem; border-radius: 8px; }
.textarea { resize: vertical; min-height: 5rem; }
.textarea[readonly] { background: var(--surface-2); color: var(--ink-2); }

.seg { display: inline-flex; padding: 4px; gap: 2px; background: var(--paper-deep); border-radius: 12px; }
.seg button {
  border: 0; background: none; padding: 0.5rem 1rem; border-radius: 9px;
  font-weight: 650; font-size: 0.9375rem; color: var(--ink-2);
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(27 35 64 / 0.12), 0 0 0 1px rgb(27 35 64 / 0.06); }
.seg-sm button { padding: 0.35rem 0.75rem; font-size: 0.875rem; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem;
  padding: 0.75rem clamp(1rem, 3vw, 2rem);
  background: rgb(238 241 245 / 0.88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.brand-mark { width: 38px; height: 38px; color: var(--ink); flex: none; }
.brand-title { font-size: var(--step-1); }
.brand-sub { font-size: var(--step--1); color: var(--ink-2); }
.tools { display: flex; justify-content: flex-end; gap: 0.25rem; }

main { max-width: 1280px; margin: 0 auto; padding: clamp(1rem, 3vw, 2.25rem) clamp(1rem, 3vw, 2rem) 5rem; }

/* ---------- name badges (the shared visual) ---------- */

.badge {
  --role: var(--student); --role-text: #fff;
  display: flex; flex-direction: column; min-width: 0; width: 100%;
  text-align: left; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 12px; overflow: hidden; padding: 0 0 0.6rem;
}
button.badge:hover { border-color: var(--ink); }
.badge-strip {
  position: relative; display: block; padding: 0.7rem 0.75rem 0.25rem;
  background: var(--role); color: var(--role-text);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.01em;
}
/* the punched slot a lanyard clip goes through */
.badge-strip::before {
  content: ""; position: absolute; top: 5px; left: 50%; width: 22px; height: 4px; margin-left: -11px;
  border-radius: 4px; background: rgb(255 255 255 / 0.55);
}
.badge-name { padding: 0.45rem 0.75rem 0; font: 650 var(--step-1)/1.15 var(--display); overflow-wrap: anywhere; }
.badge-meta { padding: 0.1rem 0.75rem 0; font-size: var(--step--1); color: var(--ink-2); }
.badge.is-large { max-width: 320px; }
.badge.is-large .badge-name { font-size: var(--step-2); }

.role-student { --role: var(--student); --role-soft: var(--student-soft); --role-text: #fff; }
.role-serving { --role: var(--serving); --role-soft: var(--serving-soft); --role-text: #fff; }
.role-shepherd { --role: var(--shepherd); --role-soft: var(--shepherd-soft); --role-text: #fff; }
.role-older { --role: var(--older); --role-soft: var(--older-soft); --role-text: var(--ink); }

/* table number, shaped like the tent cards on dining tables */
.tent, .match-table {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 3.5rem; padding: 0.35rem 0.5rem 0.4rem; border-radius: 10px;
  background: var(--ink); color: #fff; font: 700 var(--step-3)/1 var(--display);
}
.tent span, .match-table span { font: 600 0.6875rem/1.2 var(--text); color: rgb(255 255 255 / 0.75); margin-bottom: 0.15rem; }

/* ---------- attendee view ---------- */

.attendee { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
.persona { display: flex; flex-direction: column; gap: 0.9rem; padding-top: 1rem; position: sticky; top: 6.5rem; }
.persona-title { font-size: var(--step-4); line-height: 1.05; letter-spacing: -0.02em; }
.lede { color: var(--ink-2); max-width: 36rem; }
.field-label { font-weight: 650; font-size: var(--step--1); margin-bottom: -0.5rem; }
.quick { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.7rem 0.3rem 0.5rem;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 0.875rem; font-weight: 600;
}
.chip-btn::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--role); }
.chip-btn:hover { border-color: var(--ink-3); }
.chip-btn.is-on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.try { margin-top: 0.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.try h3 { font-size: var(--step-0); margin-bottom: 0.5rem; }
.try ol { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.5rem; color: var(--ink-2); font-size: 0.9375rem; }
.try li::marker { font-family: var(--display); font-weight: 700; color: var(--ink); }

.stage {
  display: grid; place-items: center; padding: clamp(1rem, 2.5vw, 2rem) 1rem;
  background:
    radial-gradient(60% 50% at 50% 45%, rgb(255 255 255 / 0.7), transparent 70%),
    var(--paper-deep);
  border-radius: 28px;
}
.phone {
  width: min(392px, 100%); padding: 11px; border-radius: 54px; background: #141a30;
  box-shadow: 0 0 0 1px #2c3557, 0 30px 60px -20px rgb(20 26 48 / 0.45), 0 12px 24px -12px rgb(20 26 48 / 0.3);
}
.phone-screen {
  position: relative; display: flex; flex-direction: column; height: clamp(560px, calc(100vh - 210px), 760px);
  border-radius: 43px; overflow: hidden; background: var(--surface-2);
}
.phone-screen::before { /* camera pill */
  content: ""; position: absolute; z-index: 5; top: 10px; left: 50%; width: 104px; height: 30px; margin-left: -52px;
  border-radius: 20px; background: #0d1122;
}
.app-bar {
  display: flex; align-items: center; gap: 0.6rem; padding: 3.25rem 1.1rem 0.9rem;
  background: var(--ink); color: #fff;
}
.app-logo { width: 28px; height: 28px; color: var(--older); flex: none; }
.app-logo svg { width: 100%; height: 100%; }
.app-name { flex: 1; font: 650 var(--step-1)/1.1 var(--display); }
.app-avatar {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--role); color: var(--role-text); font-size: 0.8125rem; font-weight: 700;
  box-shadow: 0 0 0 2px rgb(255 255 255 / 0.85);
}
.app-tabs { display: flex; background: var(--surface); border-bottom: 1px solid var(--line); }
.app-tabs button {
  flex: 1; border: 0; background: none; padding: 0.8rem 0.5rem 0.7rem; font-weight: 650; color: var(--ink-3);
  border-bottom: 3px solid transparent; display: inline-flex; justify-content: center; align-items: center; gap: 0.4rem;
}
.app-tabs button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.count {
  display: inline-grid; place-items: center; min-width: 1.3rem; height: 1.3rem; padding: 0 0.35rem;
  border-radius: 999px; background: var(--error); color: #fff; font-size: 0.75rem; font-weight: 700;
}
.app-body { flex: 1; overflow-y: auto; padding: 1.25rem 1rem 2rem; }
.app-h { font-size: var(--step-1); }
.app-prompt { margin: 0.4rem 0 1rem; color: var(--ink-2); font-size: 0.9375rem; }

.slots { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.slot { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.slot-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.8rem 0.9rem; cursor: pointer; }
.slot-when { display: flex; flex-direction: column; }
.slot-day { font-size: var(--step--1); color: var(--ink-2); }
.slot-meal { font: 650 var(--step-1)/1.15 var(--display); }
.slot.is-locked { background: var(--surface-2); }
.slot.is-locked .slot-head { cursor: default; }
.slot.is-locked .slot-meal { color: var(--ink-2); }
.slot-note { display: flex; align-items: center; gap: 0.35rem; padding: 0 0.9rem 0.8rem; margin-top: -0.25rem; font-size: var(--step--1); color: var(--ink-2); }
.slot-note svg { width: 13px; height: 13px; flex: none; }

.switch {
  appearance: none; flex: none; position: relative; width: 52px; height: 32px; margin: 0;
  border-radius: 999px; background: #c9d0dd; cursor: pointer; transition: background 0.18s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgb(20 26 48 / 0.3); transition: transform 0.18s;
}
.switch:checked { background: var(--serving); }
.switch:checked::after { transform: translateX(20px); }
.switch:disabled { cursor: not-allowed; opacity: 0.45; }
.switch:focus-visible { outline-offset: 3px; border-radius: 999px; }

/* the published appointment, torn off like a ticket stub */
.match {
  display: grid; grid-template-columns: 1fr auto; column-gap: 0.75rem; align-items: center;
  margin: 0 0.6rem 0.6rem; padding: 0.75rem 0.8rem; border-radius: 12px;
  background: var(--serving-soft); border-top: 2px dashed rgb(46 113 85 / 0.35);
}
.match-who { grid-column: 1; font-size: var(--step--1); color: var(--serving); font-weight: 700; }
.match-name { grid-column: 1; font: 650 var(--step-1)/1.15 var(--display); }
.match-meta { grid-column: 1; font-size: var(--step--1); color: var(--ink-2); }
.match-table { grid-column: 2; grid-row: 1 / span 3; font-size: var(--step-2); min-width: 3.1rem; }

.inbox { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.msg { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 0.85rem 0.9rem; position: relative; }
.msg.is-unread { border-color: var(--ink); }
.msg.is-unread::before { content: ""; position: absolute; top: 1.15rem; left: -5px; width: 9px; height: 9px; border-radius: 50%; background: var(--error); }
.msg-head { display: flex; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.25rem; }
.msg-head strong { font-family: var(--display); font-weight: 650; }
.msg time { font-size: var(--step--1); color: var(--ink-3); flex: none; }
.msg p { font-size: 0.9375rem; color: var(--ink-2); }
.app-empty { text-align: center; padding: 3rem 1rem; color: var(--ink-2); font-size: 0.9375rem; }
.app-empty-title { font: 650 var(--step-1)/1.2 var(--display); color: var(--ink); margin-bottom: 0.4rem; }

.push {
  position: absolute; z-index: 6; top: 48px; left: 10px; right: 10px;
  display: flex; gap: 0.65rem; align-items: flex-start; padding: 0.7rem 0.8rem; text-align: left;
  border: 0; border-radius: 20px; background: rgb(250 251 253 / 0.94); backdrop-filter: blur(16px);
  box-shadow: 0 12px 30px -8px rgb(20 26 48 / 0.45);
  transform: translateY(-140%); opacity: 0; pointer-events: none;
  transition: transform 0.55s cubic-bezier(0.2, 0.9, 0.25, 1.1), opacity 0.3s;
}
.push.is-in { transform: none; opacity: 1; pointer-events: auto; }
.push.no-anim { transition: none; }
.push-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 10px; background: var(--ink); color: var(--older); }
.push-icon svg { width: 26px; height: 26px; }
.push-text { display: flex; flex-direction: column; min-width: 0; font-size: 0.875rem; line-height: 1.3; }
.push-app { display: flex; justify-content: space-between; color: var(--ink-3); font-size: 0.75rem; }
.push-text strong { margin-top: 0.1rem; }
.push-body { color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- registration team ---------- */

.subtabs { display: flex; gap: 1.5rem; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; }
.subtabs button {
  border: 0; background: none; padding: 0.4rem 0 0.75rem; font-weight: 650; color: var(--ink-2);
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.subtabs button:hover { color: var(--ink); }
.subtabs button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }

/* the five slots in order, on one track */
.timeline {
  list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem;
  position: relative;
}
.timeline::before { content: ""; position: absolute; top: 1.6rem; left: 10%; right: 10%; height: 2px; background: var(--line-strong); }
.stop {
  position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
  padding: 0.75rem 0.5rem 0.9rem; border: 1px solid transparent; border-radius: 16px; background: none; text-align: center;
}
.stop:hover { background: rgb(255 255 255 / 0.55); }
.stop.is-current { background: var(--surface); border-color: var(--ink); box-shadow: 0 8px 20px -14px rgb(20 26 48 / 0.5); }
.stop-dot {
  display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--student); color: #fff;
}
.stop-dot svg { width: 0.85rem; height: 0.85rem; }
.stop.st-closed .stop-dot { background: var(--ink); border-color: var(--ink); }
.stop.st-matched .stop-dot { background: var(--older); border-color: var(--older); color: var(--ink); }
.stop.st-published .stop-dot { background: var(--serving); border-color: var(--serving); }
.stop-when { display: flex; flex-direction: column; }
.stop-day { font-size: var(--step--1); color: var(--ink-2); }
.stop-meal { font: 650 var(--step-1)/1.15 var(--display); }
.stop-count { font-size: 0.75rem; color: var(--ink-2); line-height: 1.35; }

.status { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.status.st-open { background: var(--student-soft); color: var(--student); }
.status.st-closed { background: #e2e6ef; color: var(--ink); }
.status.st-matched { background: var(--older-soft); color: var(--older-ink); }
.status.st-published { background: var(--serving-soft); color: var(--serving); }

.slot-panel, .people-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: clamp(1.1rem, 3vw, 2rem);
}
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem 2rem; margin-bottom: 1.25rem; }
.panel-title { font-size: var(--step-4); letter-spacing: -0.02em; }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; font-size: var(--step--1); color: var(--ink-3); }
.steps li { display: flex; align-items: center; gap: 0.4rem; }
.step-n {
  display: grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%;
  border: 1.5px solid var(--line-strong); font-weight: 700; font-size: 0.75rem;
}
.step-n svg { width: 0.75rem; height: 0.75rem; }
.steps .is-done { color: var(--ink-2); }
.steps .is-done .step-n { background: var(--serving); border-color: var(--serving); color: #fff; }
.steps .is-now { color: var(--ink); font-weight: 700; }
.steps .is-now .step-n { background: var(--ink); border-color: var(--ink); color: #fff; }

.panel-actions {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem;
  padding: 0.9rem 1rem 0.9rem 1.2rem; border-radius: 14px; margin-bottom: 1.75rem;
}
.panel-actions.st-open { background: var(--student-soft); }
.panel-actions.st-closed { background: #e7eaf1; }
.panel-actions.st-matched { background: var(--older-soft); }
.panel-actions.st-published { background: var(--serving-soft); }
.flag { display: inline-flex; align-items: center; gap: 0.3rem; margin-left: 0.35rem; color: var(--warn); font-weight: 700; }
.flag svg { width: 15px; height: 15px; }

.signups { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.group-title { font-size: var(--step-1); display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.25rem; }
.n { font: 600 var(--step--1)/1 var(--text); color: var(--ink-2); background: var(--paper); padding: 0.2rem 0.5rem; border-radius: 999px; }
.sub-title { font: 650 var(--step--1)/1.3 var(--text); color: var(--ink-2); margin: 1rem 0 0.4rem; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.person-chip {
  display: inline-flex; align-items: baseline; gap: 0.4rem; padding: 0.3rem 0.65rem 0.3rem 0.55rem;
  border-radius: 8px; border: 1px solid var(--line); border-left: 4px solid var(--role); background: var(--surface);
  font-weight: 600; font-size: 0.875rem;
}
.person-chip span { font-weight: 400; color: var(--ink-2); font-size: var(--step--1); }
.person-chip:hover { border-color: var(--ink-3); border-left-color: var(--role); }
.skipped { margin-top: 1rem; }

.matched-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2rem; align-items: start; }
.board { display: grid; gap: 2rem; }
.pair-group .muted { margin-top: 0.25rem; }
.pairs, .lonelies { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; gap: 0.6rem; }

.pair {
  display: grid; grid-template-columns: auto minmax(0, 1fr) 2.5rem minmax(0, 1fr) minmax(0, 11.5rem); align-items: center; gap: 0 0.75rem;
  padding: 0.6rem; border-radius: 16px; background: var(--surface-2); border: 1px solid transparent;
}
.pair .tent { align-self: stretch; }
.thread { position: relative; height: 2px; background: repeating-linear-gradient(90deg, var(--ink-3) 0 5px, transparent 5px 9px); }
.thread::after { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--ink); }
.pair.has-warn { background: var(--warn-soft); border-color: rgb(168 87 10 / 0.25); }
.pair.has-error { background: var(--error-soft); border-color: rgb(179 48 47 / 0.35); }
.pair.has-error .thread { background: repeating-linear-gradient(90deg, var(--error) 0 5px, transparent 5px 9px); }
.pair.has-error .thread::after { background: var(--error); }
.pair-edit { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; }
.pair-edit .select { width: 100%; }
.pair-edit .select { min-width: 0; }
.issues { grid-column: 2 / -1; list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: var(--step--1); font-weight: 600; }
.issues li { display: inline-flex; align-items: center; gap: 0.35rem; }
.issues svg { width: 14px; height: 14px; flex: none; }
.issue-warn { color: var(--warn); }
.issue-error { color: var(--error); }

.is-lonely .group-title { color: var(--warn); }
.lonely {
  display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) minmax(0, 15rem); gap: 0.5rem 1rem; align-items: center;
  padding: 0.6rem; border-radius: 16px; border: 1.5px dashed var(--line-strong);
}
.lonely-reason { font-size: 0.9375rem; color: var(--ink-2); }
.hint { font-size: var(--step--1); color: var(--ink-3); }

.side { display: grid; gap: 1rem; position: sticky; top: 6.5rem; }
.side-card { background: var(--surface-2); border-radius: 16px; padding: 1.1rem; display: grid; gap: 0.6rem; }
.side-title { font: 650 var(--step-0)/1.2 var(--display); }
.import-result { border-radius: 10px; padding: 0.7rem 0.8rem; background: var(--serving-soft); font-size: var(--step--1); display: grid; gap: 0.3rem; }
.import-result.is-bad { background: var(--warn-soft); }
.import-result ul { margin: 0; padding-left: 1.1rem; }

/* people */
.people-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1.5rem; margin-bottom: 1.5rem; }
.people-head .lede { margin-top: 0.5rem; max-width: 34rem; }
.tally { display: flex; gap: 1.75rem; margin: 0; }
.tally div { display: flex; flex-direction: column-reverse; }
.tally dt { font-size: var(--step--1); color: var(--ink-2); }
.tally dd { margin: 0; font: 700 var(--step-3)/1 var(--display); }
.people-tools { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-bottom: 1rem; }
.people-tools .input { max-width: 20rem; }
.table-wrap { overflow-x: auto; }
.people { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.people th { text-align: left; font-size: var(--step--1); font-weight: 650; color: var(--ink-2); padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.people td { padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.people tbody tr:hover { background: var(--surface-2); }
.name-link { border: 0; background: none; padding: 0; font-weight: 650; text-align: left; }
.name-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.cell-sub { display: block; font-size: var(--step--1); color: var(--ink-3); }
.people .select-sm { width: 11rem; }
.des-shepherd { border-color: var(--shepherd); box-shadow: inset 4px 0 0 var(--shepherd); }
.des-older { border-color: var(--older); box-shadow: inset 4px 0 0 var(--older); }
.dots { display: inline-flex; gap: 5px; }
.dot { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.dot.is-on { background: var(--ink); border-color: var(--ink); }
.empty-row { text-align: center; padding: 2rem; }

/* ---------- toast and dialogs ---------- */

.toast {
  position: fixed; z-index: 30; left: 1rem; right: 1rem; bottom: 1.5rem; margin: 0 auto; width: fit-content; max-width: 40rem;
  transform: translateY(160%);
  display: flex; align-items: center; gap: 1rem;
  padding: 0.75rem 0.9rem 0.75rem 1.1rem; border-radius: 14px; background: var(--ink); color: #fff;
  box-shadow: 0 16px 40px -12px rgb(20 26 48 / 0.5); transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.25, 1);
  font-size: 0.9375rem;
}
.toast.is-in { transform: none; }
.toast:empty { display: none; }
.toast-btn { flex: none; border: 0; background: var(--older); color: var(--ink); font-weight: 700; padding: 0.45rem 0.8rem; border-radius: 9px; }

.dialog {
  border: 0; border-radius: 22px; padding: 0; max-width: min(680px, calc(100vw - 2rem)); width: 100%;
  color: var(--ink); box-shadow: 0 30px 80px -20px rgb(20 26 48 / 0.5);
}
.dialog::backdrop { background: rgb(27 35 64 / 0.45); }
.dialog-sm { max-width: min(440px, calc(100vw - 2rem)); }
.dialog form { padding: 1.5rem; display: grid; gap: 0.75rem; }
.dialog form h2 { font-size: var(--step-2); }
.dialog form p { color: var(--ink-2); }
.dialog form .btn-row { margin-top: 0.5rem; }
.notes { padding: 1.75rem; display: grid; gap: 0.9rem; max-height: 85vh; overflow-y: auto; }
.notes-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.notes-head h2 { font-size: var(--step-3); }
.notes h3 { font-size: var(--step-1); margin-top: 0.5rem; }
.notes p, .notes li { color: var(--ink-2); max-width: 62ch; }
.notes ul { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.5rem; }
.notes strong { color: var(--ink); }

/* ---------- smaller screens ---------- */

@media (max-width: 1100px) {
  .matched-layout { grid-template-columns: 1fr; }
  .side { position: static; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 920px) {
  .topbar { grid-template-columns: 1fr auto; }
  .mode { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; }
  .mode button { flex: 1; }
  .attendee { grid-template-columns: 1fr; gap: 0.9rem; }
  .persona { display: contents; }
  .persona .badge.is-large { display: none; }
  .stage { order: 1; margin-top: 0.4rem; }
  .try { order: 2; }
  .pair { grid-template-columns: auto minmax(0, 1fr) 2.5rem minmax(0, 1fr); }
  .pair-edit { grid-column: 2 / -1; margin-top: 0.6rem; flex-direction: row; align-items: center; }
  .pair-edit .select { width: auto; max-width: 22rem; flex: 1; }
  .issues { grid-column: 2 / -1; }
  .lonely { grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); }
  .lonely .pair-edit { grid-column: 1 / -1; margin-top: 0; }
}

@media (max-width: 760px) {
  .brand-sub, .tools .btn:first-child { display: none; }
  .timeline { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 0.5rem; }
  .timeline li { flex: 0 0 9.5rem; scroll-snap-align: start; }
  .timeline::before { left: 4.75rem; right: auto; width: calc(9.5rem * 4 + 2rem); }
  .signups, .side { grid-template-columns: 1fr; }
  .pair { grid-template-columns: auto minmax(0, 1fr); row-gap: 0; }
  .pair .tent { grid-row: 1 / span 3; align-self: start; }
  .pair .thread { width: 2px; height: 1.25rem; margin-left: 1.5rem; background: repeating-linear-gradient(180deg, var(--ink-3) 0 5px, transparent 5px 9px); }
  .pair.has-error .thread { background: repeating-linear-gradient(180deg, var(--error) 0 5px, transparent 5px 9px); }
  .pair .badge { grid-column: 2; }
  .pair-edit { grid-column: 1 / -1; }
  .issues { grid-column: 1 / -1; }
  .lonely { grid-template-columns: 1fr; }
  .stage { padding: 1rem 0.5rem; border-radius: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
