:root {
  --parchment: #fcfaf7;
  --champagne: #f1e9db;
  --midnight: #0f172a;
  --slate: #334155;
  --stone: #78716c;
  --gold: #b08d57;
  --deep-blue: #003087;
  --navy: #425772;
  --burgundy: #8d3c3d;
  --burgundy-deep: #572526;
  --olive: #576045;
  --mustard: #b99a45;
  --ink: #1a120c;
  --cream-ink: #f7f3ea;
  --border: rgba(15, 23, 42, 0.12);
  --border-strong: rgba(15, 23, 42, 0.3);
  --cream: #f7f3ea;
  --g1: #007c85;
  --g2: #335c81;
  --g3: #7d337d;
  --g4: #d11c7a;
  --audience-col: 18.75rem;
  --head: "Readex Pro", system-ui, sans-serif;
  --text: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--parchment);
  color: var(--midnight);
  font-family: var(--text);
}

a { color: var(--deep-blue); }
button, input { font-family: inherit; }
h1, h2, h3 { font-family: var(--head); margin: 0; line-height: 1.15; }
h1 { font-size: 2.2rem; font-weight: 700; }
h2 { font-size: 1.35rem; font-weight: 700; }
p { margin: 0; line-height: 1.55; }

.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--midnight);
  color: #fff;
  padding: 0.4rem 0.7rem;
  border-radius: 0.4rem;
  z-index: 40;
}
.skip:focus { top: 0.5rem; }

.caps {
  font-family: var(--head);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--gold);
}

.muted { color: var(--stone); }
.lead { margin-top: 0.7rem; }

#top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0;
  background: rgba(252, 250, 247, 0.94);
  border-bottom: 1px solid var(--border);
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.menu-open {
  display: none;
  align-items: center;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--midnight);
  font-family: var(--head);
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
}
.menu-open:hover,
.menu-open:focus-visible,
.menu-open[aria-expanded="true"] {
  background: var(--midnight);
  color: #fff;
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 22;
  background: rgba(15, 23, 42, 0.28);
  border: 0;
}

.sheet-label {
  margin: 0.85rem 0.75rem 0.15rem;
  font-family: var(--head);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
  font-weight: 700;
}

#nav {
  display: flex;
  gap: 0.2rem;
  align-items: center;
  flex-wrap: nowrap;
  width: min(76rem, 100%);
  padding: 0 1.5rem;
}

#nav > a,
.nav-btn {
  white-space: nowrap;
  text-decoration: none;
  color: var(--slate);
  background: transparent;
  border: 0;
  font-family: var(--head);
  font-weight: 500;
  font-size: 0.88rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
}

#nav > a.on,
.nav-btn.on,
#nav > a:hover,
.nav-btn:hover,
#nav > a:focus-visible,
.nav-btn:focus-visible {
  background: var(--midnight);
  color: #fff;
}

#nav > a.closed {
  color: var(--stone);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
#nav > a.closed.on,
#nav > a.closed:hover,
#nav > a.closed:focus-visible {
  background: var(--midnight);
  color: #fff;
  box-shadow: none;
}

.menu { position: relative; }

.drop {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 16rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.35rem;
  box-shadow: 0 14px 30px -18px rgba(15, 23, 42, 0.45);
}

.drop a {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  text-decoration: none;
  color: var(--midnight);
  font-family: var(--head);
  font-size: 0.88rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.4rem;
}
.drop a:hover,
.drop a:focus-visible,
.drop a.on {
  background: var(--midnight);
  color: #fff;
}
.drop a.closed { color: var(--stone); }
.drop a.closed:hover,
.drop a.closed:focus-visible,
.drop a.closed.on {
  background: var(--midnight);
  color: #fff;
}

.tag {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.8;
}

.account-dock {
  position: fixed;
  left: max(1.75rem, env(safe-area-inset-left, 0px));
  bottom: max(1.75rem, env(safe-area-inset-bottom, 0px));
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
}

.account {
  position: relative;
  width: 2.75rem;
  height: 2.75rem;
  border: 2px solid #fff;
  border-radius: 999px;
  padding: 0;
  overflow: hidden;
  background: var(--midnight);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 24px -14px rgba(15, 23, 42, 0.7);
}
.account img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.account:hover,
.account:focus-visible {
  background: var(--midnight);
  color: #fff;
  box-shadow: 0 0 0 3px var(--midnight);
}

.account-panel {
  width: min(18rem, calc(100vw - 2rem));
  background: #fff;
  color: var(--midnight);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.85rem 1rem;
  box-shadow: 0 14px 30px -18px rgba(15, 23, 42, 0.45);
}
.account-name {
  font-family: var(--head);
  font-weight: 700;
  font-size: 1rem;
}
.account-note { margin-top: 0.45rem; font-size: 0.88rem; }
.account.account-signed-out { color: #fff; }
.account span,
.account { font-family: var(--head); font-weight: 700; }

.account-panel label {
  display: block;
  margin: 0.65rem 0 0.25rem;
  font-family: var(--head);
  font-size: 0.75rem;
  font-weight: 600;
}
.account-panel input {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 0.45rem;
  padding: 0.45rem 0.6rem;
  background: #fff;
  color: var(--midnight);
  font: inherit;
}
.auth-btn {
  display: inline-flex;
  justify-content: center;
  width: 100%;
  margin-top: 0.75rem;
  border: 0;
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  background: var(--midnight);
  color: #fff;
  font-family: var(--head);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}
.auth-btn:hover,
.auth-btn:focus-visible {
  background: var(--deep-blue);
  color: #fff;
}
.auth-google {
  background: #fff;
  color: var(--midnight);
  border: 1px solid var(--border-strong);
}
.auth-google:hover,
.auth-google:focus-visible {
  background: var(--midnight);
  color: #fff;
}
.auth-text {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.35rem 0;
  border: 0;
  background: transparent;
  color: var(--deep-blue);
  font-family: var(--head);
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
}
.auth-text:hover,
.auth-text:focus-visible {
  text-decoration: underline;
}
.auth-error {
  margin-top: 0.55rem;
  color: #8d3c3d;
  font-size: 0.85rem;
}
.account-panel { width: min(22rem, calc(100vw - 2rem)); }

#app {
  flex: 1;
  width: min(76rem, 100%);
  margin: 0 auto;
  padding: 1.6rem 1.5rem 6.5rem;
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 0.8rem;
  min-height: 15rem;
  display: flex;
  align-items: flex-end;
  padding: 1.6rem;
  color: #fff;
  background: var(--midnight);
}
.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.15), rgba(15, 23, 42, 0.85));
  pointer-events: none;
}
.hero .caps { color: rgba(255, 255, 255, 0.85); }
.hero h1 { margin: 0.3rem 0 0.4rem; }
.hero p { max-width: 40rem; color: rgba(255, 255, 255, 0.92); }

.sub-page { width: 100%; }
.sub-page h1 { font-size: 2rem; margin: 0; }
.sub-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1.5rem;
  margin: 1.25rem 0 0;
}
.sub-facts div { margin: 0; }
.sub-facts dt {
  font-family: var(--head);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone);
}
.sub-facts dd { margin: 0.2rem 0 0; font-size: 1.05rem; }
.sub-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.1rem; }
.sub-actions .profile-add,
.sub-actions .entry-remove { margin-top: 0; }
.sub-alert {
  margin: 1rem 0 0;
  padding: 0.75rem 0.9rem;
  background: #f8f1e4;
  border: 1px solid var(--border);
}
.sub-alert.is-error { background: #f8ecec; color: var(--burgundy); }
.sub-table-wrap { overflow-x: auto; margin-top: 0.6rem; }
.sub-table { width: 100%; border-collapse: collapse; }
.sub-table th,
.sub-table td {
  text-align: left;
  padding: 0.65rem 0.4rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.sub-table th {
  font-family: var(--head);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--stone);
}
.sub-dialog {
  border: 1px solid var(--border);
  background: var(--parchment, #fcfaf7);
  color: var(--midnight);
  padding: 1.25rem;
  max-width: 32rem;
}
.sub-dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
.sub-dialog h2 { margin: 0 0 0.5rem; font-size: 1.35rem; }
@media (max-width: 720px) {
  .sub-facts { grid-template-columns: 1fr; }
}

.uploads-page { width: 100%; }
.uploads-page h1 { font-size: 2rem; margin: 0; }
.uploads-page h2 { margin: 1.6rem 0 0.7rem; font-size: 1.35rem; }
.upload-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1.25rem;
  margin-top: 1.25rem;
  padding: 1rem 1.1rem 1.15rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
}
.upload-form h2 { grid-column: 1 / -1; margin: 0; font-size: 1.2rem; }
.upload-form label { display: block; font-family: var(--head); font-weight: 600; font-size: 0.85rem; }
.upload-form label.wide { grid-column: 1 / -1; }
.upload-form input,
.upload-form select,
.upload-form textarea {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border-strong);
  border-radius: 0.45rem;
  background: #fff;
  color: var(--midnight);
  font: inherit;
}
.upload-form .profile-add { justify-self: start; }
.upload-form .muted { grid-column: 1 / -1; margin: 0; }
.upload-status { margin: 0.8rem 0 0; color: var(--navy); }
.upload-list, .sheet-uploads { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.upload-row, .sheet-upload {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem 0.85rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
}
.sheet-uploads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.sheet-upload {
  margin: 0;
  padding: 0.9rem 1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  align-items: flex-start;
}
.upload-kind {
  font-family: var(--head);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--burgundy);
}
.upload-pending {
  font-family: var(--head);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--stone);
}
.upload-row .entry-remove { margin-left: auto; }
@media (max-width: 720px) {
  .upload-form, .sheet-uploads { grid-template-columns: 1fr; }
}

.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 1.1rem 1.25rem;
}
.sec { margin-top: 1rem; }

.pill {
  display: inline-block;
  font-family: var(--head);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--champagne);
  color: var(--slate);
}
.pill.gold { background: var(--gold); color: #fff; }

.profile-form { width: 100%; }
.entry {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.25rem;
}
.entry-field:has(textarea),
.entry-check,
.entry-actions,
.entry .chips,
.entry-legend { grid-column: 1 / -1; }
.q-head {
  display: grid;
  grid-template-columns: 4.75rem minmax(0, 1fr) var(--audience-col);
  align-items: center;
  gap: 0.75rem 0.35rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}
.save-mark {
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: center;
  justify-self: end;
  min-height: 1.1em;
  font-family: var(--head);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: right;
  color: var(--stone);
}
.save-mark.is-saved { color: #0d6b4d; letter-spacing: 0; text-transform: none; }
.save-tick { font-size: 1rem; line-height: 1; }
.save-mark.is-error { color: var(--burgundy); text-transform: none; letter-spacing: 0; }
.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;
}
.profile-form h1 { font-size: 2rem; }
.profile-lead { margin: 0.45rem 0 0.2rem; }
.q {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.q label,
.q-label {
  display: block;
  font-family: var(--head);
  font-weight: 600;
  font-size: 1rem;
}
.q-line {
  display: grid;
  grid-template-columns: 4.75rem minmax(0, 1fr) var(--audience-col);
  align-items: center;
  gap: 0.75rem 0.35rem;
  margin-top: 0.45rem;
}
.q-line-solo { grid-template-columns: 4.75rem minmax(0, 1fr); }
.q input:not([type="file"]),
.q textarea,
.q select,
.entry input:not([type="checkbox"]),
.entry textarea,
.entry select {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: #fff;
  color: var(--midnight);
  font: inherit;
}
.entry input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  flex: none;
  margin: 0;
  padding: 0;
  accent-color: var(--navy);
}
.q textarea { resize: vertical; min-height: 7rem; }
.q input::placeholder,
.q textarea::placeholder,
.entry input::placeholder,
.entry textarea::placeholder {
  color: #9c968e;
  font-style: italic;
  opacity: 1;
}
.upload {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 5.75rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 0.5rem;
}
.upload-preview {
  display: grid;
  place-items: center;
  flex: none;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 999px;
  overflow: hidden;
  background: var(--champagne);
  color: var(--navy);
  font-family: var(--head);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.upload-doc { border-radius: 0.45rem; }
.upload-copy { min-width: 0; }
.upload-name,
.upload-hint,
.upload-status { margin: 0; }
.upload-name { font-weight: 600; }
.upload-hint { margin-top: 0.15rem; color: var(--stone); font-size: 0.85rem; }
.upload-status { margin-top: 0.25rem; color: var(--burgundy); font-size: 0.85rem; }
.upload-btn {
  position: relative;
  display: inline-flex;
  margin-top: 0.55rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--navy);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font-family: var(--head);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.upload-btn:hover,
.upload-btn:focus-within {
  background: var(--navy);
  color: var(--cream-ink);
}
.upload-btn input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.audience {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.15rem;
  padding: 0.18rem;
  background: var(--champagne);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
}
.audience button {
  flex: 1;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--stone);
  font-family: var(--head);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.38rem 0.4rem;
  white-space: nowrap;
  cursor: pointer;
}
.audience button:hover,
.audience button:focus-visible {
  background: #fff;
  color: var(--midnight);
}
.audience button[aria-pressed="true"]::before {
  content: "✓";
  margin-right: 0.28em;
  font-weight: 700;
}
.audience button[data-audience="private"][aria-pressed="true"],
.audience button[data-audience="private"][aria-pressed="true"]:hover,
.audience button[data-audience="private"][aria-pressed="true"]:focus-visible {
  background: var(--olive);
  color: var(--cream-ink);
}
.audience button[data-audience="fellows"][aria-pressed="true"],
.audience button[data-audience="fellows"][aria-pressed="true"]:hover,
.audience button[data-audience="fellows"][aria-pressed="true"]:focus-visible {
  background: var(--navy);
  color: var(--cream-ink);
}
.audience button[data-audience="public"][aria-pressed="true"],
.audience button[data-audience="public"][aria-pressed="true"]:hover,
.audience button[data-audience="public"][aria-pressed="true"]:focus-visible {
  background: var(--burgundy);
  color: var(--cream-ink);
}
.audience button:disabled,
.audience button:disabled:hover,
.audience button:disabled:focus-visible {
  background: transparent;
  color: #b7b0a6;
  cursor: not-allowed;
  box-shadow: none;
}

.profile-progress {
  position: relative;
  margin: 1.35rem 0 0.35rem;
}
.profile-progress ol {
  display: flex;
  justify-content: space-between;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  z-index: 1;
}
.profile-progress li { flex: 1; min-width: 0; }
.profile-progress a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--stone);
  font-family: var(--head);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}
.profile-progress a[aria-current="step"] { color: var(--burgundy); }
.progress-mark {
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  background: #fff;
  color: var(--slate);
  border: 1px solid var(--border-strong);
  font-size: 0.78rem;
  font-weight: 700;
}
.profile-progress a.is-done .progress-mark {
  background: var(--navy);
  color: var(--cream-ink);
  border-color: var(--navy);
}
.profile-progress a[aria-current="step"] .progress-mark {
  background: var(--mustard);
  color: var(--ink);
  border-color: var(--mustard);
  box-shadow: 0 0 0 4px #f3e6c8;
}
.profile-progress a:hover .progress-mark,
.profile-progress a:focus-visible .progress-mark {
  background: var(--navy);
  color: var(--cream-ink);
  border-color: var(--navy);
}
.profile-progress a[aria-current="step"]:hover .progress-mark,
.profile-progress a[aria-current="step"]:focus-visible .progress-mark {
  background: var(--mustard);
  color: var(--ink);
  border-color: var(--mustard);
}
.profile-progress a[aria-current="step"] { color: var(--burgundy); }
.progress-rail {
  position: absolute;
  z-index: 0;
  left: calc(100% / 12);
  right: calc(100% / 12);
  top: 0.9rem;
  height: 3px;
  background: var(--champagne);
  border-radius: 999px;
}
.progress-rail span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--navy), var(--burgundy));
  border-radius: 999px;
}
.profile-save-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.35rem;
}
.profile-save {
  min-height: 2.75rem;
  padding: 0.65rem 1.2rem;
  border: 0;
  border-radius: 0.85rem;
  background: var(--navy);
  color: var(--cream-ink);
  font-family: var(--head);
  font-weight: 700;
  cursor: pointer;
}
.profile-save:hover,
.profile-save:focus-visible {
  background: var(--midnight);
  color: var(--cream-ink);
}
.profile-save:disabled { cursor: wait; opacity: 0.72; }
.profile-save-status { margin: 0; color: var(--navy); font-weight: 600; }
.profile-save-status.is-error { color: var(--burgundy); }
.profile-next {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 1.4rem 0 0.4rem;
}
.profile-back,
.profile-forward {
  text-decoration: none;
  border-radius: 0.85rem;
}
.profile-back {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.1rem;
  padding: 0.65rem 0.95rem;
  background: #fff;
  color: var(--midnight);
  border: 1px solid var(--border-strong);
  font-family: var(--head);
  font-weight: 600;
}
.profile-back-name {
  color: var(--stone);
  font-size: 0.78rem;
  font-weight: 500;
}
.profile-back:hover,
.profile-back:focus-visible {
  background: var(--navy);
  color: var(--cream-ink);
  border-color: var(--navy);
}
.profile-back:hover .profile-back-name,
.profile-back:focus-visible .profile-back-name { color: var(--cream-ink); }
.profile-forward {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.12rem;
  margin-left: auto;
  min-width: min(16rem, 70%);
  padding: 0.75rem 1.1rem;
  background: var(--burgundy);
  color: var(--cream-ink);
}
.profile-forward-kicker {
  font-family: var(--head);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f3d6d2;
}
.profile-forward-name {
  font-family: var(--head);
  font-size: 1.05rem;
  font-weight: 700;
}
.profile-forward:hover,
.profile-forward:focus-visible {
  background: var(--burgundy-deep);
  color: var(--cream-ink);
}
.profile-panel { margin-top: 0.35rem; }
.profile-panel h2 { margin: 0.85rem 0 0.15rem; color: var(--navy); }
.profile-sub {
  margin: 1.15rem 0 0.15rem;
  font-size: 1.05rem;
}
.q-hint { margin-top: 0.25rem; color: var(--stone); font-size: 0.85rem; }
.q-hint a { color: var(--deep-blue); font-weight: 600; }
.q-hint a:hover,
.q-hint a:focus-visible { text-decoration: underline; }
a.profile-add { display: inline-block; text-decoration: none; }
.offer-list { list-style: none; margin: 1rem 0 0; padding: 0; }
.offer-list li { margin-top: 0.9rem; }
.offer-list a { font-family: var(--head); font-weight: 600; color: var(--deep-blue); }
.offer-list a:hover,
.offer-list a:focus-visible { text-decoration: underline; }
.offer-list p { margin: 0.2rem 0 0; color: var(--slate); }
.q-line-start { align-items: start; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; flex: 1; min-width: 0; }
.q .chips label,
.entry .chips label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.32rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--slate);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.2;
}
.entry .chips label:has(input:checked) {
  border-color: var(--navy);
  background: #eef2f6;
  color: var(--navy);
}
.entry {
  margin-top: 0.85rem;
  padding: 0.35rem 0.9rem 0.85rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
}
.entry-field { display: block; margin-top: 0.7rem; }
.entry-field span,
.entry-legend {
  display: block;
  margin-bottom: 0.3rem;
  font-family: var(--head);
  font-size: 0.85rem;
  font-weight: 600;
}
.entry-field {
  display: grid;
  grid-template-columns: 4.75rem minmax(0, 1fr);
  column-gap: 0.35rem;
  align-items: start;
}
.entry-field > :not(.save-mark) { grid-column: 2; }
.entry-check {
  display: grid;
  grid-template-columns: 4.75rem minmax(0, 1fr);
  align-items: center;
  margin-top: 0.35rem;
  grid-column: 1;
}
.entry-check .check-copy {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--slate);
  font-weight: 500;
}
.entry-actions { display: flex; justify-content: flex-end; margin-top: 0.7rem; }
.profile-add,
.entry-remove {
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--midnight);
  font-family: var(--head);
  font-weight: 600;
  cursor: pointer;
}
.profile-add { margin-top: 0.85rem; padding: 0.45rem 0.9rem; }
.entry-remove { padding: 0.35rem 0.75rem; font-size: 0.82rem; }
.profile-add:hover,
.profile-add:focus-visible,
.entry-remove:hover,
.entry-remove:focus-visible {
  background: var(--navy);
  color: var(--cream-ink);
  border-color: var(--navy);
}
.resource-list { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.resource-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.ellipsis::after {
  content: "...";
  display: inline-block;
  width: 1.1em;
  animation: profile-dots 1.1s steps(4, end) infinite;
}
@keyframes profile-dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}

@media (max-width: 860px) {
  .entry { grid-template-columns: 1fr; }
  .q-line,
  .q-line-solo { grid-template-columns: 4.75rem minmax(0, 1fr); }
  .q-line .audience { grid-column: 2; }
  .q-head { grid-template-columns: 4.75rem minmax(0, 1fr); }
  .q-head .audience { grid-column: 2; }
  .audience { width: max-content; max-width: 100%; }
  .audience button { flex: none; padding: 0.38rem 0.72rem; }
}

@media (max-width: 1180px) {
  #top { justify-content: flex-start; padding-left: 1.25rem; padding-right: 1.25rem; }
  .menu-open { display: inline-flex; }
  #nav {
    display: none;
    width: auto;
    position: fixed;
    z-index: 24;
    left: 0.75rem;
    right: 0.75rem;
    top: 4.2rem;
    bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0;
    overflow: auto;
    background: #fff;
    border-radius: 1rem;
    padding: 0.35rem 0.35rem 1rem;
    box-shadow: 0 18px 50px -24px rgba(15, 23, 42, 0.55);
  }
  #nav.open { display: flex; width: auto; padding: 0.35rem 0.35rem 1rem; }
  #nav > a,
  .drop a {
    border-radius: 0.55rem;
  }
  .drop {
    position: static;
    min-width: 0;
    border: 0;
    box-shadow: none;
    padding: 0 0 0.2rem 0.35rem;
  }
  .hero h1 { font-size: 1.7rem; }
  #app { padding-left: 6rem; }
  .profile-next { flex-direction: column; }
  .profile-forward { min-width: 0; width: 100%; margin-left: 0; }
  .progress-label { font-size: 0.64rem; }
  .profile-view-bar { align-items: stretch; }
  .profile-edit { justify-content: center; }
}

.profile-edit-back { margin: 0 0 0.6rem; }
.profile-edit-back a { font-family: var(--head); font-weight: 600; color: var(--deep-blue); }
.profile-edit-back a:hover,
.profile-edit-back a:focus-visible { text-decoration: underline; }

.profile-view-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}
.accent-picker { position: relative; }
.accent-current {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 0.55rem;
  background: #fff;
  color: var(--navy);
  font-family: var(--head);
  font-weight: 600;
  cursor: pointer;
}
.accent-current:hover,
.accent-current:focus-visible {
  border-color: var(--midnight);
  color: var(--navy);
  background: #fff;
}
.accent-choices {
  display: none;
  position: absolute;
  z-index: 6;
  top: 100%;
  right: 0;
  gap: 0.45rem;
  padding: 0.7rem 0.55rem 0.55rem;
  background: #fff;
  border: 1px solid var(--border-strong);
  box-shadow: 0 8px 24px rgba(26, 18, 12, 0.12);
}
.accent-picker:hover .accent-choices,
.accent-picker:focus-within .accent-choices,
.accent-picker.is-open .accent-choices { display: flex; }
.accent-swatch {
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  flex: 0 0 auto;
}
.accent-current .accent-swatch { cursor: inherit; }
.accent-swatch[aria-pressed="true"] {
  outline: 2px solid var(--midnight);
  outline-offset: 3px;
}
.accent-swatch:focus-visible {
  outline: 2px solid var(--deep-blue);
  outline-offset: 3px;
}
.accent-swatch--navy { background: #425772; }
.accent-swatch--burgundy { background: #8d3c3d; }
.accent-swatch--olive { background: #576045; }
.accent-swatch--teal { background: #346470; }
.accent-swatch--purple { background: #5c3a5b; }
.accent-swatch--mustard { background: #b99a45; }
.accent-swatch--orange { background: #b4733d; }
.accent-name {
  font-family: var(--head);
  font-weight: 600;
  color: var(--navy);
}
.accent-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.accent-status.is-error {
  position: static;
  width: auto;
  height: auto;
  margin: 0.35rem 0 0;
  overflow: visible;
  clip: auto;
  color: var(--burgundy);
  font-size: 0.9rem;
}
.profile-view-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.view-as-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1 1 18rem;
  min-width: 0;
}
.view-as-row {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem 1.15rem;
  flex-wrap: wrap;
}
.view-as {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-family: var(--head);
  font-weight: 600;
}
.personal-url {
  margin: 1rem 0 0;
  max-width: 42rem;
  color: var(--slate);
  font-size: 0.95rem;
  line-height: 1.45;
}
.personal-url a {
  font-family: var(--head);
  font-weight: 600;
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.personal-url a:hover,
.personal-url a:focus-visible {
  color: var(--deep-blue);
}
.view-as select {
  min-width: 16rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: 0.55rem;
  background: #fff;
  color: var(--midnight);
  font: inherit;
}
.profile-edit {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.15rem;
  background: var(--burgundy);
  color: var(--cream-ink);
  text-decoration: none;
  border-radius: 999px;
  font-family: var(--head);
  font-weight: 700;
}
.profile-edit:hover,
.profile-edit:focus-visible {
  background: var(--burgundy-deep);
  color: var(--cream-ink);
}
.view-note {
  margin: 0 0 0.6rem;
  max-width: 24rem;
  color: var(--slate);
  line-height: 1.4;
}
.view-signin { margin: 0.7rem 0 0; }
.sheet-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: min(36rem, 72vh);
  margin-top: 1rem;
  border-radius: 0.8rem;
  overflow: hidden;
  background: var(--midnight);
}
.sheet-portrait {
  position: relative;
  min-height: min(36rem, 72vh);
  background:
    linear-gradient(160deg, #6b705c 0%, #425772 55%, #0f172a 100%);
}
.sheet-portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}
.sheet-initials {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--head);
  font-size: clamp(4rem, 8vw, 7rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(247, 243, 234, 0.88);
}
.sheet-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: center;
  justify-items: start;
  column-gap: 1.15rem;
  row-gap: 1.35rem;
  min-height: min(36rem, 72vh);
  padding: 2.4rem 2.2rem 2.4rem 10%;
  color: var(--cream-ink);
  background: var(--midnight);
}
.sheet-identity-copy { display: contents; }
.sheet-person {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 1.15rem;
  min-width: 0;
}
.sheet-mark-slot {
  flex: none;
  min-height: 0;
}
.sheet-mark {
  display: block;
  width: 8.25rem;
  height: auto;
}
.sheet-name-block {
  min-width: 0;
}
.sheet-grade {
  grid-column: 1 / -1;
  justify-self: start;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 0.32rem 0.75rem 0.28rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--card-grade, var(--gold)) 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--card-grade, var(--gold)) 62%, transparent);
  font-family: var(--head);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--gold);
}
.sheet-details {
  grid-column: 1 / -1;
  min-width: 0;
}
.sheet-identity h1 {
  margin: 0;
  font-size: clamp(2.6rem, 4.6vw, 4.4rem);
  font-weight: 700;
  color: #fff;
  max-width: 12ch;
}
.sheet-role,
.sheet-identity .sheet-meta,
.sheet-identity .sheet-place,
.sheet-identity .sheet-web {
  grid-column: 1 / -1;
  margin: 0;
}
.sheet-role {
  font-size: 1.15rem;
  color: rgba(247, 243, 234, 0.92);
}
.sheet-identity .sheet-meta,
.sheet-identity .sheet-place,
.sheet-identity .sheet-web {
  margin-top: 0.45rem;
  color: rgba(247, 243, 234, 0.86);
  line-height: 1.45;
}
.sheet-identity .sheet-place {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.sheet-place .sheet-flag {
  display: block;
  flex: none;
  width: 1.25rem;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
  border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(247, 243, 234, 0.45);
}
.sheet-web a { color: var(--cream-ink); font-weight: 600; }
.sheet-web a:hover,
.sheet-web a:focus-visible { color: #fff; text-decoration: underline; }
.profile-sheet {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1rem;
  padding: 0;
  background: transparent;
  border: 0;
}
.profile-sheet:empty { display: none; }
.sheet-suggest {
  margin: 0;
  padding: 0.15rem 0 0.15rem 0.85rem;
  border-left: 3px solid var(--burgundy);
  border-radius: 0;
  background: transparent;
  color: var(--slate);
}
.sheet-block {
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
}
.sheet-tone-about { padding: 0.15rem 0 0; }
.sheet-block h2 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--navy);
}
.sheet-block h3 {
  margin: 1.5rem 0 0.15rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--burgundy);
}
.sheet-bio {
  margin-top: 0.7rem;
  color: var(--slate);
  font-size: 1.02rem;
  line-height: 1.65;
  white-space: pre-wrap;
}
.sheet-chips, .sheet-events, .sheet-history, .sheet-pubs {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
}
.sheet-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.sheet-chips li {
  padding: 0.28rem 0.7rem;
  border-radius: 0;
  background: var(--champagne);
  color: var(--midnight);
  font-size: 0.85rem;
}
.sheet-tone-forums .sheet-chips li {
  background: transparent;
  color: inherit;
  border: 1px solid color-mix(in srgb, currentColor 45%, transparent);
}
.sheet-events, .sheet-history, .sheet-pubs { margin-top: 0.85rem; }
.sheet-events li, .sheet-history li, .sheet-pubs li {
  margin: 0;
  padding: 0.95rem 0 1.05rem;
  border-top: 1px solid color-mix(in srgb, currentColor 28%, transparent);
}
.sheet-events li:first-child,
.sheet-history li:first-child,
.sheet-pubs li:first-child {
  border-top: 0;
  padding-top: 0.2rem;
}
.sheet-events strong,
.sheet-history strong,
.sheet-pubs li {
  display: block;
  font-family: var(--head);
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--midnight);
  overflow-wrap: anywhere;
}
.sheet-kicker {
  display: block;
  margin-top: 0.28rem;
  color: var(--slate);
  font-size: 0.95rem;
  line-height: 1.4;
}
.sheet-note {
  margin: 0.5rem 0 0;
  color: var(--slate);
  font-size: 0.98rem;
  line-height: 1.6;
}
.sheet-tags {
  margin: 0.45rem 0 0;
  color: var(--navy);
  font-size: 0.9rem;
  line-height: 1.45;
}
.sheet-facts { margin: 0.35rem 0 0; }
.sheet-facts div {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 0.25rem 1.25rem;
  align-items: baseline;
  margin: 0;
  padding: 0.72rem 0;
  border-top: 1px solid color-mix(in srgb, currentColor 28%, transparent);
}
.sheet-facts div:first-child { border-top: 0; }
.sheet-facts dt {
  font-family: var(--head);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--navy);
}
.sheet-facts dd {
  margin: 0;
  color: var(--midnight);
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.sheet-empty { margin-top: 1rem; color: var(--slate); }
.profile-view[data-accent="navy"] { --card: #425772; --card-ink: #f7f3ea; --card-grade: #e8d5a3; }
.profile-view[data-accent="burgundy"] { --card: #8d3c3d; --card-ink: #f7f3ea; --card-grade: #e8d5a3; }
.profile-view[data-accent="olive"] { --card: #576045; --card-ink: #f7f3ea; --card-grade: #e8d5a3; }
.profile-view[data-accent="teal"] { --card: #346470; --card-ink: #f7f3ea; --card-grade: #e8d5a3; }
.profile-view[data-accent="purple"] { --card: #5c3a5b; --card-ink: #f7f3ea; --card-grade: #e8d5a3; }
.profile-view[data-accent="mustard"] { --card: #b99a45; --card-ink: #f4f8ff; --card-grade: #e4eef8; }
.profile-view[data-accent="orange"] { --card: #b4733d; --card-ink: #fff; --card-grade: #f3e6c8; }
.profile-view .sheet-identity,
.profile-view .sheet-tone-forums,
.profile-view .sheet-tone-work,
.profile-view .sheet-tone-contact {
  background: var(--card);
  color: var(--card-ink);
}
.profile-view .sheet-tone-forums,
.profile-view .sheet-tone-work,
.profile-view .sheet-tone-contact {
  padding: 1.4rem 1.5rem 1.5rem;
}
.profile-view .sheet-identity h1,
.profile-view .sheet-identity .sheet-role,
.profile-view .sheet-identity .sheet-meta,
.profile-view .sheet-identity .sheet-place,
.profile-view .sheet-identity .sheet-web,
.profile-view .sheet-identity .sheet-web a,
.profile-view .sheet-tone-forums h2,
.profile-view .sheet-tone-work h2,
.profile-view .sheet-tone-contact h2,
.profile-view .sheet-tone-forums strong,
.profile-view .sheet-tone-work strong,
.profile-view .sheet-tone-contact strong,
.profile-view .sheet-tone-forums .sheet-kicker,
.profile-view .sheet-tone-work .sheet-kicker,
.profile-view .sheet-tone-contact .sheet-kicker,
.profile-view .sheet-tone-forums .sheet-note,
.profile-view .sheet-tone-work .sheet-note,
.profile-view .sheet-tone-contact .sheet-note,
.profile-view .sheet-tone-forums .sheet-tags,
.profile-view .sheet-tone-work .sheet-tags,
.profile-view .sheet-tone-contact .sheet-tags,
.profile-view .sheet-tone-contact .sheet-facts dt,
.profile-view .sheet-tone-contact .sheet-facts dd,
.profile-view .sheet-tone-forums a,
.profile-view .sheet-tone-work a,
.profile-view .sheet-tone-contact a {
  color: var(--card-ink);
}
.profile-view .sheet-identity .sheet-grade { color: var(--card-grade); }
.profile-view .sheet-identity .sheet-web a:hover,
.profile-view .sheet-identity .sheet-web a:focus-visible,
.profile-view .sheet-tone-forums a:hover,
.profile-view .sheet-tone-forums a:focus-visible,
.profile-view .sheet-tone-work a:hover,
.profile-view .sheet-tone-work a:focus-visible,
.profile-view .sheet-tone-contact a:hover,
.profile-view .sheet-tone-contact a:focus-visible {
  color: var(--card-ink);
  text-decoration: underline;
}
.place { position: relative; }
.place-list {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: calc(100% + 0.2rem);
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 0.55rem;
  box-shadow: 0 12px 30px -18px rgba(15, 23, 42, 0.45);
}
.place-list button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--midnight);
  padding: 0.45rem 0.55rem;
  border-radius: 0.4rem;
  cursor: pointer;
}
.place-list button:hover,
.place-list button:focus-visible {
  background: var(--navy);
  color: var(--cream-ink);
}
.place-empty { padding: 0.45rem 0.55rem; color: var(--stone); }
.event-match {
  margin: 0.35rem 0 0;
  color: var(--slate);
  font-size: 0.88rem;
}
.event-match button {
  margin-left: 0.35rem;
  border: 0;
  background: transparent;
  color: var(--deep-blue);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

@media (max-width: 1040px) {
  .sheet-hero { grid-template-columns: 1fr; min-height: 0; }
  .sheet-portrait {
    min-height: 0;
    width: 100%;
    aspect-ratio: 4 / 5;
    max-height: calc(100svh - 25rem);
  }
  .sheet-portrait img { object-position: center 22%; }
  .sheet-identity {
    min-height: 0;
    column-gap: 0.85rem;
    row-gap: 1.05rem;
    padding: 1.35rem 1.15rem;
  }
  .sheet-person { gap: 0.85rem; }
  .sheet-mark-slot { min-height: 0; }
  .sheet-mark { width: 5.5rem; }
  .sheet-identity h1 {
    font-size: clamp(2.1rem, 9vw, 3rem);
    max-width: none;
  }
}

@media (max-width: 720px) {
  #app {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .sheet-facts div { grid-template-columns: 1fr; gap: 0.15rem; }
}
