
  /* ---------- Brand tokens (CPVC Brand Guide + Typography) ---------- */
  :root {
    --color-dark-rgb: 13, 29, 48;
    --navy: #0D1D30;          /* brand navy: headlines, primary buttons */
    --slate: #3A4A5E;         /* body copy (navy, softened) */
    --muted: #85878E;         /* logo gray: hints, secondary text */
    --teal: #6DE1D7;          /* brand teal */
    --teal-mid: #62CAC4;      /* logo diamond, middle layer */
    --teal-deep: #52ABA9;     /* logo diamond, inner layer */
    --teal-wash: #E4F9F7;     /* teal tint for selected states */
    --line: #DCDCDE;          /* logo rule gray: borders */
    --white: #FFFFFF;
    --error: #D23B3B;
    --ok: #1E8F73;
    --radius-card: 32px;
    --radius-btn: 14px;
    --radius-input: 12px;
    /* Typography: Unbounded for display, headers and subheaders; Manrope for body */
    --hero: "Unbounded", "Arial Black", "Helvetica Neue", Arial, sans-serif;
    --display: "Unbounded", "Helvetica Neue", Arial, sans-serif;
    --body: "Manrope", "Segoe UI", system-ui, sans-serif;
    --track-display: -0.1em;   /* -100 tracking */
    --track-head: -0.05em;     /* -50 tracking */
    --track-body: -0.02em;     /* -20 tracking */
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; }
  body {
    min-height: 100vh;
    color: var(--slate);
    font: 16px/1.25 var(--body);   /* Manrope Regular, 12/15 ratio */
    letter-spacing: var(--track-body);
    background-color: var(--white);
    background-image:
      linear-gradient(rgba(var(--color-dark-rgb), 0.02) 1px, transparent 1px),
      linear-gradient(90deg, rgba(var(--color-dark-rgb), 0.02) 1px, transparent 1px);
    background-size: 48px 48px;
  }

  /* ---------- Floating nav pill ---------- */
  .nav-wrap { padding: 18px clamp(12px, 4vw, 48px) 0; position: sticky; top: 0; z-index: 10; }
  .nav {
    max-width: 1160px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(var(--color-dark-rgb), 0.06);
    padding: 10px 12px 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }
  .logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
  .logo img { height: 56px; width: auto; display: block; }
  .nav-btn {
    background: var(--navy);
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    border-radius: var(--radius-btn);
    padding: 12px 20px;
    white-space: nowrap;
  }
  .nav-btn:hover { background: #1A2F48; }

  /* ---------- Hero ---------- */
  .hero {
    position: relative;
    max-width: 1160px;
    margin: 0 auto;
    padding: clamp(40px, 7vw, 88px) clamp(18px, 4vw, 48px) clamp(28px, 4vw, 48px);
    overflow: hidden;
  }
  .hero .kicker { font-size: clamp(1.1rem, 2vw, 1.4rem); font-weight: 500; color: var(--slate); margin: 0 0 18px; }
  .hero h1 {
    position: relative;
    z-index: 1;
    font-family: var(--hero);
    font-weight: 900;
    text-transform: uppercase;
    color: var(--navy);
    font-size: clamp(2rem, 7vw, 5.6rem);
    line-height: 0.95;
    letter-spacing: var(--track-display);
    margin: 0;
  }
  .hero .sub {
    position: relative;
    z-index: 1;
    max-width: 44ch;
    margin: 28px 0 0 auto;
    text-align: right;
    font-size: clamp(1.05rem, 1.6vw, 1.3rem);
    font-weight: 500;
  }
  .orbits {
    position: absolute;
    z-index: 0;
    right: 8%;
    top: 50%;
    width: min(520px, 70vw);
    transform: translateY(-50%);
    pointer-events: none;
  }
  .orbits .spin { transform-origin: 260px 260px; animation: spin 60s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
  @media (prefers-reduced-motion: reduce) { .orbits .spin { animation: none; } }

  /* ---------- Main ---------- */
  main { max-width: 1160px; margin: 0 auto; padding: 24px clamp(18px, 4vw, 48px) 72px; display: flex; justify-content: center; }
  .panel { width: 100%; max-width: 680px; }
  .view[hidden] { display: none; }
  h2 {
    font-family: var(--display);
    font-weight: 500;
    color: var(--navy);
    font-size: clamp(1.6rem, 3.6vw, 2.3rem);
    line-height: 1.05;
    letter-spacing: var(--track-head);
    margin: 0 0 12px;
  }
  .lead { margin: 0 0 28px; font-size: 1.05rem; }

  .card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    padding: clamp(24px, 4.5vw, 44px);
    box-shadow: 0 1px 0 rgba(var(--color-dark-rgb), 0.02), 0 18px 40px rgba(var(--color-dark-rgb), 0.04);
  }
  .stack .field + .field { margin-top: 18px; }
  .stack .field:last-of-type { margin-bottom: 22px; }

  /* Sections of the registration form sit on a navy timeline, like the site's member section */
  fieldset {
    border: 0;
    margin: 0;
    padding: 0 0 36px 28px;
    border-left: 1.5px solid var(--navy);
    position: relative;
  }
  fieldset::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--navy);
  }
  fieldset:last-of-type { padding-bottom: 28px; }
  legend {
    font-family: var(--display);
    font-weight: 400;
    color: var(--navy);
    font-size: 1.3rem;
    letter-spacing: var(--track-head);
    line-height: 1.15;
    padding: 0;
    float: left;
    width: 100%;
    margin-bottom: 6px;
  }
  legend + * { clear: both; }
  .opt { font-family: var(--body); font-weight: 500; font-size: 0.9rem; letter-spacing: var(--track-body); color: var(--muted); }
  .legend-note { margin: 0 0 18px; }

  .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 18px; }
  .full { grid-column: 1 / -1; }
  .field { display: flex; flex-direction: column; gap: 6px; }
  .field[hidden] { display: none; }
  label, .group-label { font-weight: 600; font-size: 0.95rem; color: var(--navy); }
  input, select, textarea {
    font: inherit;
    color: var(--navy);
    background: var(--white);
    border: 1px solid #CED6DF;
    border-radius: var(--radius-input);
    padding: 12px 14px;
    width: 100%;
  }
  input::placeholder, textarea::placeholder { color: #98A4B2; }
  select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--slate) 50%), linear-gradient(135deg, var(--slate) 50%, transparent 50%);
    background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%;
    background-size: 5px 5px;
    background-repeat: no-repeat;
    padding-right: 36px;
  }
  textarea { resize: vertical; min-height: 96px; }
  input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: none;
    border-color: var(--teal-deep);
    box-shadow: 0 0 0 4px rgba(109, 225, 215, 0.45);
  }
  button:focus-visible, .nav-btn:focus-visible, .logo:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; box-shadow: 0 0 0 7px rgba(109, 225, 215, 0.55); }
  .field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--error); }
  .field-error { color: var(--error); font-size: 0.86rem; font-weight: 600; }
  .field-error:empty { display: none; }
  .hint { color: var(--muted); font-size: 0.85rem; }
  .counter { text-align: right; }

  .chips { display: flex; flex-wrap: wrap; gap: 8px; }
  .chip { position: relative; }
  .chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
  .chip span {
    display: inline-block;
    border: 1px solid #CED6DF;
    background: var(--white);
    color: var(--slate);
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
  }
  .chip span:hover { border-color: var(--teal-deep); }
  .chip input:checked + span { background: var(--teal-wash); border-color: var(--teal-deep); color: var(--navy); font-weight: 700; }
  .chip input:focus-visible + span { outline: 3px solid var(--teal); outline-offset: 2px; }

  .actions { display: flex; flex-direction: column; gap: 12px; }
  .btn {
    font: 600 1.05rem/1 var(--body);
    border-radius: var(--radius-btn);
    padding: 17px 24px;
    cursor: pointer;
    border: 1px solid var(--navy);
  }
  .btn-primary { background: var(--navy); color: var(--white); box-shadow: 0 8px 20px rgba(var(--color-dark-rgb), 0.18); }
  .btn-primary:hover { background: #1A2F48; }
  .btn-secondary { background: var(--white); color: var(--navy); }
  .btn-secondary:hover { background: var(--teal-wash); }
  .btn:disabled { opacity: 0.6; cursor: progress; }

  .form-error { color: var(--error); font-weight: 700; margin: 0; min-height: 1.5em; }
  .notice { color: var(--ok); font-weight: 700; margin: 0 0 16px; }
  .divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.9rem; }
  .divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

  /* ---------- Footer ---------- */
  footer { border-top: 1px solid var(--line); background: rgba(255, 255, 255, 0.7); }
  .foot {
    max-width: 1160px; margin: 0 auto;
    padding: 32px clamp(18px, 4vw, 48px);
    display: flex; flex-wrap: wrap; gap: 14px 48px;
    font-size: 0.92rem;
  }
  .foot strong { color: var(--navy); display: block; font-family: var(--display); font-weight: 500; font-size: 0.95rem; letter-spacing: var(--track-head); margin-bottom: 4px; }
  .foot a { color: var(--navy); }
  .foot .copy { flex-basis: 100%; color: var(--muted); }

  @media (max-width: 720px) {
    .nav { padding-left: 16px; }
    .logo img { height: 44px; }
    .nav-btn { padding: 10px 14px; font-size: 0.92rem; }
    .grid { grid-template-columns: 1fr; }
    .hero .sub { text-align: left; margin-left: 0; }
    .orbits { right: -20%; opacity: 0.6; }
    fieldset { padding-left: 20px; }
  }

  /* ---------- Registration page additions ---------- */
  .nav-right { display: flex; align-items: center; gap: 14px; }
  .who { font-weight: 600; color: var(--navy); font-size: 0.95rem; }
  .nav-right .nav-btn { border: 0; font: 600 1rem var(--body); cursor: pointer; }
  .hero.compact { padding-bottom: 8px; }
  .hero.compact h1 { font-size: clamp(1.9rem, 5.4vw, 4.2rem); }
  #loadingView { text-align: center; }

  .scale { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 8px; }
  .scale label {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid #CED6DF;
    border-radius: var(--radius-input);
    padding: 12px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.86rem;
    line-height: 1.3;
    color: var(--slate);
    background: var(--white);
  }
  .scale label:hover { border-color: var(--teal-deep); }
  .scale input { position: absolute; opacity: 0; width: 1px; height: 1px; }
  .scale .num { font: 700 1.5rem/1 var(--hero); color: var(--navy); letter-spacing: var(--track-head); }
  .scale label:has(input:checked) { border-color: var(--teal-deep); background: var(--teal-wash); box-shadow: 0 0 0 1px var(--teal-deep); color: var(--navy); }
  .scale label:has(input:focus-visible) { outline: 3px solid var(--teal); outline-offset: 2px; }
  .field.invalid .scale label { border-color: var(--error); }

  .sub-block { margin-top: 20px; }
  .sub-block[hidden] { display: none; }
  .mate-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
  .mate-list:empty { display: none; }
  .mate-list li { background: var(--teal-wash); border: 1px solid var(--teal-deep); color: var(--navy); border-radius: 999px; padding: 6px 14px; font-size: 0.92rem; font-weight: 600; }

  .check { display: flex; gap: 12px; align-items: flex-start; font-weight: 500; color: var(--slate); cursor: pointer; }
  .check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--navy); }
  .field.invalid .check input { outline: 2px solid var(--error); outline-offset: 2px; }

  .btn-small { padding: 11px 18px; font-size: 0.95rem; }
  .btn-danger { background: var(--white); color: var(--error); border-color: var(--error); }
  .btn-danger:hover { background: #FDF1F1; }
  .btn-danger-solid { background: var(--error); color: var(--white); border-color: var(--error); }
  .btn-danger-solid:hover { background: #B32F2F; }
  .danger-zone { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
  .danger-zone[hidden] { display: none; }

  dialog {
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: clamp(22px, 4vw, 36px);
    width: calc(100% - 32px);
    max-width: 540px;
    color: var(--slate);
    background: var(--white);
    box-shadow: 0 30px 80px rgba(var(--color-dark-rgb), 0.25);
  }
  dialog::backdrop { background: rgba(var(--color-dark-rgb), 0.45); }
  .dialog-title { font-size: clamp(1.5rem, 3.6vw, 2rem); margin-bottom: 12px; }
  .dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 24px; }
  .dialog-actions .btn { padding: 14px 20px; }
  .mates-inputs { display: flex; flex-direction: column; gap: 14px; }

  .facts, .summary { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; }
  .facts { margin-top: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; }
  .facts dt, .summary dt { font-weight: 700; color: var(--navy); }
  .facts dd, .summary dd { margin: 0; }
  .summary { margin-bottom: 26px; }

  @media (max-width: 720px) {
    .who { display: none; }
    .facts, .summary { grid-template-columns: 1fr; gap: 2px 0; }
    .facts dd, .summary dd { margin-bottom: 10px; }
  }

  /* ---------- Home page ---------- */
  .home-main { max-width: 1160px; margin: 0 auto; padding: 24px clamp(18px, 4vw, 48px) 72px; display: block; min-height: 45vh; }
  .home-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px; align-items: start; }
  .home-grid > section { min-width: 0; }
  .section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
  .section-head h2 { margin: 0; }
  .pill { display: inline-block; border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 0.9rem; border: 1px solid; }
  .pill-on { background: var(--teal-wash); border-color: var(--teal-deep); color: var(--navy); }
  .pill-off { background: #F3F5F7; border-color: #CED6DF; color: var(--slate); }
  .blurb { margin: 0 0 18px; }
  .subhead { font-family: var(--display); font-weight: 400; color: var(--navy); font-size: 1.15rem; letter-spacing: var(--track-head); margin: 28px 0 12px; }
  .info { margin: 0; display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 12px 22px; }
  .info dt { font-weight: 700; color: var(--navy); }
  .info dd { margin: 0; overflow-wrap: anywhere; }
  .tags { display: flex; flex-wrap: wrap; gap: 6px; }
  .tag { background: #F3F5F7; border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; font-size: 0.88rem; }
  .tag-teal { background: var(--teal-wash); border-color: var(--teal-deep); color: var(--navy); }
  .note { color: var(--muted); font-size: 0.9rem; margin: 6px 0 0; }
  .card-actions { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px; }
  .card-actions .btn { padding: 15px 22px; }
  .private { font-size: 0.82rem; color: var(--muted); font-weight: 500; }
  .empty { color: var(--muted); margin: 0; }
  .divider-line { border: 0; border-top: 1px solid var(--line); margin: 26px 0 0; }

  @media (max-width: 900px) {
    .home-grid { grid-template-columns: 1fr; }
  }
  @media (max-width: 520px) {
    .info { grid-template-columns: 1fr; gap: 2px 0; }
    .info dd { margin-bottom: 12px; }
  }

  /* ---------- Single-page layout ---------- */
  main { display: block; max-width: 1160px; margin: 0 auto; padding: 24px clamp(18px, 4vw, 48px) 72px; min-height: 45vh; }
  .panel { margin: 0 auto; }
  .hero.compact .orbits, .hero.compact .sub { display: none; }
  .card-actions .btn { padding: 15px 22px; }
  #profileNote { margin: -4px 0 16px; }
  .home-notice { color: var(--ok); font-weight: 700; margin: 0 0 18px; }
  .nav-link { color: var(--white); }
  [hidden] { display: none !important; }
  .forgot-row { display: flex; justify-content: flex-end; }

  /* Visiting team members */
  .member-rows { display: flex; flex-direction: column; gap: 8px; }
  .member-row { display: grid; grid-template-columns: 1fr 1.2fr auto; gap: 8px; align-items: center; }
  @media (max-width: 560px) { .member-row { grid-template-columns: 1fr; } }

  /* Waitlist and confirmation */
  .callout { background: var(--teal-wash); border: 1px solid var(--teal-deep); border-radius: 16px; padding: 14px 16px; color: var(--navy); font-weight: 600; margin: 22px 0 0; }
  .confirm-panel { margin-top: 22px; border: 1.5px solid var(--teal-deep); border-radius: 22px; padding: clamp(18px, 3vw, 26px); background: linear-gradient(180deg, var(--teal-wash), var(--white) 70%); }
  .confirm-panel .subhead { margin-top: 0; }
  .confirm-panel .note { margin-bottom: 14px; }
  #confirmForm .field + .field, #confirmForm #cfMemberShirts + .field, #cfMemberShirts .field { margin-top: 16px; }
  #confirmForm .form-error { margin-top: 8px; }
  .check-ok, .check-bad { margin: 0 0 10px; font-weight: 600; }
  .check-ok { color: var(--ok); }
  .check-bad { color: var(--error); }
  .roster-list { margin: 0 0 16px; padding-left: 18px; color: var(--slate); }

  /* Teammate picker */
  .pick-list, .results, .invite-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
  .pick-list li, .invite-list li {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    border: 1px solid var(--line); border-radius: var(--radius-input); padding: 10px 12px; background: var(--white);
  }
  .who-line { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .who-line strong { color: var(--navy); font-weight: 700; overflow-wrap: anywhere; }
  .who-line span { color: var(--muted); font-size: 0.86rem; overflow-wrap: anywhere; }
  .kind { font-size: 0.78rem; font-weight: 700; border-radius: 999px; padding: 2px 9px; white-space: nowrap; border: 1px solid var(--line); color: var(--slate); background: #F5F6F7; }
  .kind-member { background: var(--teal-wash); border-color: var(--teal-deep); color: var(--navy); }
  .results:empty { display: none; }
  .results button {
    width: 100%; text-align: left; font: inherit; letter-spacing: inherit; cursor: pointer;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    border: 1px solid var(--line); border-radius: var(--radius-input); padding: 10px 12px; background: var(--white);
  }
  .results button:hover { border-color: var(--teal-deep); background: var(--teal-wash); }
  .add-label { color: var(--navy); font-weight: 700; font-size: 0.9rem; white-space: nowrap; }
  .inline-add { display: flex; gap: 8px; }
  .inline-add input { flex: 1; min-width: 0; }
  .link-btn { background: none; border: 0; padding: 4px 2px; font: inherit; font-weight: 700; color: var(--navy); text-decoration: underline; cursor: pointer; }
  .link-btn:hover { color: var(--teal-deep); }
  .team-name-edit { margin-left: 6px; }
  #matesDialog .field + .field { margin-top: 18px; }
  #matesDialog { max-width: 580px; }

  /* Resume */
  .file-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
  .file-name { color: var(--slate); overflow-wrap: anywhere; }

  /* Invitations on home */
  .invites-card { margin-bottom: 24px; }
  .invites-title { font-size: clamp(1.3rem, 2.6vw, 1.7rem); margin-bottom: 16px; }
  .invite-list li { flex-wrap: wrap; }
  .invite-actions { display: flex; gap: 8px; flex-wrap: wrap; }
  .invite-actions .btn { padding: 11px 16px; font-size: 0.95rem; }
  .status-tag { font-size: 0.8rem; font-weight: 700; border-radius: 999px; padding: 2px 9px; margin-left: 6px; border: 1px solid var(--line); color: var(--slate); background: #F5F6F7; white-space: nowrap; }
  .status-ok { background: var(--teal-wash); border-color: var(--teal-deep); color: var(--navy); }
  .status-no { background: #FDF1F1; border-color: #F0C4C4; color: #9B2C2C; }
  .team-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 6px; }

