/*
 * O-Earth Movement 2026 — public registration site.
 *
 * Served from the application's own origin: no CDN, no web fonts. Some delegates connect from
 * Mainland China, where those do not resolve. The type stack is system-only and covers Latin and
 * Simplified Chinese on every common device.
 *
 * Colours follow the client's banner and brochure: deep navy, warm cream, orange for the call to
 * action, sage for the Extended Pass, and the logo's rainbow as a thin accent.
 */

:root {
  --navy: #0b0b3b;
  --navy-soft: #23235a;
  --ink: #1a1a36;
  --ink-muted: #56566c;
  --paper: #fbf7f0;
  --surface: #ffffff;
  --orange: #f47b20;
  --orange-soft: #fff1e4;
  --orange-text: #a84a0b;
  --sage: #6aae6c;
  --sage-soft: #e7f1e4;
  --rule: #e6dfd2;
  /* WCAG 1.4.11: a field's border is a component boundary and needs 3:1 on white. */
  --field-border: #807a6c;
  --alert: #a3321c;
  --alert-soft: #fcebe6;
  --focus: #2b55d6;

  --radius: 10px;
  --radius-small: 6px;
  --measure: 46rem;
  --wide: 75rem;

  --font-sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC",
    sans-serif;

  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(244, 123, 32, 0.25);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--navy);
  text-underline-offset: 0.15em;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* The UA's [hidden] is display:none at the lowest priority; any author display rule beats it. */
[hidden] {
  display: none !important;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 20;
  background: var(--navy);
  color: #fff;
  padding: 0.75rem 1rem;
}

.skip-link:focus {
  left: 0;
}

/* ---------- Bilingual text ---------- */

/* English first, Chinese beneath it — the way the client's form sets every label. */
.bi {
  display: inline-block;
  vertical-align: top;
}

.bi__en,
.bi__zh {
  display: block;
}

.bi__zh {
  font-size: 0.94em;
  color: var(--ink-muted);
}

.bi--inline,
.bi--inline .bi__en,
.bi--inline .bi__zh {
  display: inline;
}

.bi--inline .bi__zh {
  margin-left: 0.4em;
}

/* On dark or coloured grounds the Chinese line takes the ground's own colour. */
.button .bi__zh,
.package .bi__zh,
.site-header .bi__zh {
  color: inherit;
  opacity: 0.88;
}

/* ---------- Header, banner, footer ---------- */

.site-header {
  background: var(--navy);
  color: #fff;
}

.site-header__bar {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0.625rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  flex-wrap: wrap;
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: #fff;
  text-decoration: none;
}

.site-header__brand img {
  width: 2rem;
  height: 2rem;
}

.site-header__name {
  display: block;
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-header__name-zh {
  display: block;
  font-size: 0.8125rem;
  opacity: 0.85;
}

.site-header__dates {
  font-size: 0.8125rem;
  opacity: 0.9;
  text-align: right;
}

.site-header__dates [lang] {
  display: block;
}

.rainbow {
  height: 4px;
  background: linear-gradient(90deg, #7b3fa0, #2f6fd0 20%, #2fa36b 40%, #e8c12e 60%, #f47b20 80%, #d9443a);
}

.banner {
  max-width: var(--wide);
  margin: 0 auto;
  background: var(--paper);
}

.banner img {
  width: 100%;
}

.site-main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.site-footer {
  border-top: 1px solid var(--rule);
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.site-footer__inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
}

.site-footer p {
  margin: 0 0 0.5rem;
}

.site-footer a {
  color: inherit;
}

/* ---------- Headings and text ---------- */

h1,
h2,
h3 {
  color: var(--navy);
  line-height: 1.25;
}

h2 {
  font-size: 1.25rem;
  margin: 2rem 0 1rem;
}

.page-title {
  font-size: 1.625rem;
  margin: 0.5rem 0 0.75rem;
}

.page-title .bi__en {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.page-title .bi__zh {
  color: var(--orange-text);
  font-size: 0.8em;
  margin-top: 0.15rem;
}

.lede {
  font-size: 1.0625rem;
  margin: 0 0 1rem;
}

.required-note {
  font-size: 0.875rem;
  color: var(--ink-muted);
  margin: 0 0 1.5rem;
}

.hint,
.fine-print {
  font-size: 0.875rem;
  color: var(--ink-muted);
  margin: 0.25rem 0 0.75rem;
}

.req {
  color: var(--alert);
  margin-left: 0.15em;
  font-weight: 700;
}

.optional {
  display: inline-block;
  margin-left: 0.5em;
  vertical-align: baseline;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--ink-muted);
}

.notice {
  background: var(--orange-soft);
  border-left: 4px solid var(--orange);
  padding: 0.875rem 1rem;
  border-radius: var(--radius-small);
  margin: 1rem 0;
}

.notice--large {
  font-size: 1.125rem;
}

/* ---------- Landing ---------- */

.intro {
  text-align: center;
  padding: 0.5rem 0 1rem;
}

.intro__title {
  font-size: 1.75rem;
  margin: 0.5rem 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.intro__title span {
  display: block;
}

.intro__title-zh {
  text-transform: none;
  letter-spacing: 0.1em;
  color: var(--orange-text);
  font-size: 0.75em;
  margin-top: 0.25rem;
}

.intro__facts {
  color: var(--ink-muted);
  margin: 0 0 1.5rem;
}

.intro__facts > span {
  display: block;
}

.cta-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: stretch;
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3.25rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.3;
}

/* Navy on orange, as the brochure's own button: white on this orange is under 3:1. */
.button--primary {
  background: var(--orange);
  color: var(--navy);
}

.button--primary:hover {
  background: #e86c0f;
}

.button--secondary {
  background: var(--navy);
  color: #fff;
}

.button--secondary:hover {
  background: var(--navy-soft);
}

.button--ghost {
  background: transparent;
  color: var(--navy);
  border: 2px dashed var(--field-border);
  border-radius: var(--radius);
  width: 100%;
  margin: 0.5rem 0 1.5rem;
}

.button--ghost:hover {
  border-color: var(--navy);
  background: var(--surface);
}

.button--block {
  width: 100%;
  margin-top: 0.5rem;
}

.button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.link-button {
  background: none;
  border: 0;
  padding: 0.25rem 0;
  font: inherit;
  font-size: 0.875rem;
  color: var(--alert);
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- Packages ---------- */

.packages {
  display: grid;
  gap: 1rem;
}

.package {
  background: var(--navy);
  color: #fff;
  border-radius: 16px;
  padding: 1.25rem 1.25rem 1rem;
}

.package--alt {
  background: var(--sage);
  color: var(--navy);
}

.package__name {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.package--alt .package__name {
  color: var(--navy);
}

.package__name .bi__zh {
  text-transform: none;
  letter-spacing: 0.04em;
  color: #fff;
  opacity: 1;
}

.package--alt .package__name .bi__zh {
  color: var(--navy);
}

.package__price {
  margin: 0 0 0.75rem;
}

.package__amount {
  display: block;
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.1;
}

.package__tier,
.package__regular {
  display: block;
  font-size: 0.875rem;
}

.package__regular {
  font-weight: 600;
}

.package__inclusions ul {
  margin: 0 0 0.75rem;
  padding-left: 1.2rem;
  font-size: 0.9375rem;
}

.package__inclusions li {
  margin-bottom: 0.2rem;
}

.package__note summary {
  cursor: pointer;
  font-size: 0.875rem;
  text-decoration: underline;
}

.package__note p {
  font-size: 0.875rem;
}

/* ---------- Form shell ---------- */

.form {
  margin-top: 1.5rem;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.25rem 1rem 0.5rem;
  margin: 0 0 1.25rem;
  min-width: 0;
}

/* A fieldset's legend sits on its border; floated, it becomes an ordinary heading. */
.card > legend {
  float: left;
  width: 100%;
  padding: 0;
}

.card > legend + * {
  clear: both;
}

.card__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 1rem;
}

.delegate {
  border-top: 4px solid var(--orange);
}

.delegate__remove {
  position: absolute;
  top: 1.1rem;
  right: 1rem;
}

.group-section h2 {
  margin-top: 1.5rem;
}

/* ---------- Fields ---------- */

.field,
.field-group {
  margin: 0 0 1.25rem;
  min-width: 0;
}

fieldset.field-group {
  border: 0;
  padding: 0;
}

.field > label,
.field-group > legend {
  display: block;
  font-weight: 600;
  margin-bottom: 0.375rem;
  padding: 0;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="number"],
.field select,
.field textarea {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: 0.625rem 0.75rem;
  font: inherit;
  /* 16px keeps iOS from zooming in on focus. */
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--field-border);
  border-radius: var(--radius-small);
}

.field textarea {
  min-height: 7rem;
  resize: vertical;
}

.field .input--short,
.field input.input--short {
  max-width: 14rem;
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border: 2px solid var(--alert);
}

.field--nested {
  margin: 0.5rem 0 0;
}

.error {
  color: var(--alert);
  font-weight: 600;
  font-size: 0.875rem;
  margin: 0.375rem 0 0;
}

.field-group.is-invalid > legend {
  color: var(--alert);
}

.error-summary {
  background: var(--alert-soft);
  border-left: 4px solid var(--alert);
  border-radius: var(--radius-small);
  padding: 0.875rem 1rem;
  margin: 0 0 1.5rem;
  color: var(--alert);
  font-weight: 600;
}

.error-summary p {
  margin: 0;
}

.error-summary__item {
  margin-top: 0.5rem !important;
  color: var(--ink);
}

/* ---------- Choices ---------- */

.options {
  display: grid;
  gap: 0.625rem;
}

.option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  border: 1.5px solid var(--field-border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}

.option:has(input:checked) {
  border-color: var(--orange);
  background: var(--orange-soft);
  box-shadow: inset 0 0 0 1px var(--orange);
}

.option.is-full {
  cursor: not-allowed;
  opacity: 0.65;
}

.option input,
.chip input,
.check input,
.topic__choice input {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  accent-color: var(--navy);
}

.option__title {
  font-weight: 600;
}

.option__price {
  font-weight: 700;
  white-space: nowrap;
  text-align: right;
}

.option__was {
  display: block;
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.375rem 0.875rem;
  border: 1.5px solid var(--field-border);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  white-space: nowrap;
}

.chip:has(input:checked) {
  border-color: var(--orange);
  background: var(--orange-soft);
}

.checks {
  display: grid;
  gap: 0.25rem;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  min-height: 2.75rem;
  padding: 0.5rem 0;
  cursor: pointer;
}

.check input {
  margin-top: 0.15rem;
  flex: none;
}

.check--terms a {
  display: inline-block;
  margin-top: 0.25rem;
}

.badge {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--alert-soft);
  color: var(--alert);
  font-size: 0.8125rem;
  font-weight: 700;
}

/* ---------- Breakout topics ---------- */

.topics {
  display: grid;
  gap: 0.625rem;
}

.topic {
  border: 1.5px solid var(--field-border);
  border-radius: var(--radius);
  background: var(--surface);
}

.topic:has(input:checked) {
  border-color: var(--orange);
  background: var(--orange-soft);
  box-shadow: inset 0 0 0 1px var(--orange);
}

.topic.is-full {
  opacity: 0.65;
}

.topic__choice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem 0.5rem;
  cursor: pointer;
}

.topic.is-full .topic__choice {
  cursor: not-allowed;
}

.topic__choice input {
  margin-top: 0.2rem;
}

.topic__body > span {
  display: block;
}

.topic__number {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange-text);
}

.topic__title {
  font-weight: 700;
  color: var(--navy);
}

.topic__title-zh {
  color: var(--ink-muted);
}

.topic__tagline {
  font-size: 0.875rem;
  font-style: italic;
  color: var(--ink-muted);
  margin-top: 0.15rem;
}

.topic__more {
  padding: 0 0.875rem 0.625rem 2.875rem;
  font-size: 0.9375rem;
}

.topic__more summary {
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--navy);
  text-decoration: underline;
  min-height: 2rem;
  display: flex;
  align-items: center;
}

.topic__more p {
  margin: 0.5rem 0;
}

.topic__audience {
  font-size: 0.875rem;
}

/* ---------- Summary and checkout ---------- */

.checkout {
  border-top: 4px solid var(--navy);
  padding-bottom: 1.25rem;
}

.summary {
  margin-bottom: 1rem;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1rem;
  font-size: 0.9375rem;
}

.summary-table td,
.summary-table th {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.summary-table .num {
  text-align: right;
  white-space: nowrap;
  padding-left: 1rem;
}

.summary-table tfoot th,
.summary-table tfoot td {
  border-bottom: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--navy);
}

.facts {
  margin: 0 0 1rem;
}

.facts dt {
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.facts dd {
  margin: 0 0 0.75rem;
}

.facts__strong {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.03em;
}

.delegate-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.delegate-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.delegate-list span {
  display: block;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.cf-turnstile {
  margin: 0.5rem 0 1rem;
}

/* ---------- Terms ---------- */

.prose h2 {
  font-size: 1.125rem;
  margin: 2rem 0 0.5rem;
}

.prose p,
.prose li {
  max-width: 42rem;
}

/* ---------- Third-party controls, matched to the form ---------- */

.iti {
  width: 100%;
}

.field .iti input[type="tel"] {
  width: 100%;
}

/* Defensive: if the plugin's stylesheet fails to load, an unstyled country list would cover
   the page. */
.iti__country-list {
  font-size: 0.9375rem;
  position: absolute;
  z-index: 5;
  max-height: 15rem;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--field-border);
  border-radius: var(--radius-small);
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: min(22rem, 85vw);
  max-width: min(28rem, 90vw);
  box-shadow: 0 4px 14px rgba(11, 11, 59, 0.15);
}

.iti__country-list.iti__hide {
  display: none;
}

.iti-search-item {
  position: sticky;
  top: 0;
  z-index: 1;
  list-style: none;
  background: var(--surface);
}

.iti-search {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 0.5rem 0.625rem;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
}

.field .select2-container {
  width: 100% !important;
}

.field .select2-container--default .select2-selection--single {
  height: 3rem;
  padding: 0.625rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--field-border);
  border-radius: var(--radius-small);
}

.field .select2-container--default .select2-selection--single .select2-selection__rendered {
  padding: 0;
  line-height: 1.6;
  color: var(--ink);
}

.field .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 100%;
  right: 0.5rem;
}

.field select[aria-invalid="true"] + .select2-container--default .select2-selection--single {
  border: 2px solid var(--alert);
}

.field .select2-container--default.select2-container--focus .select2-selection--single,
.field .select2-container--default.select2-container--open .select2-selection--single {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* Anchored to its own field (see site.js), so the field must be positioned. */
.field:has(.select2-container) {
  position: relative;
}

.select2-dropdown {
  border-color: var(--field-border);
  z-index: 15;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: var(--navy);
}

.select2-search--dropdown .select2-search__field {
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid var(--field-border);
  border-radius: var(--radius-small);
}

/* ---------- Wider screens ---------- */

@media (min-width: 40rem) {
  .cta-row {
    flex-direction: row;
    justify-content: center;
  }

  .options--two {
    grid-template-columns: 1fr 1fr;
  }

  .checks {
    grid-template-columns: 1fr 1fr;
    column-gap: 1.5rem;
  }

  .card {
    padding: 1.5rem 1.5rem 0.75rem;
  }

  .delegate__remove {
    top: 1.4rem;
    right: 1.5rem;
  }

  .site-main {
    padding-top: 2rem;
  }
}

@media (min-width: 56rem) {
  .site-main--wide {
    max-width: 60rem;
  }

  .packages {
    grid-template-columns: 1fr 1fr;
  }

  .intro__title {
    font-size: 2.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}

/* ---------- Order page ---------- */

.delegate-list__no {
  font-weight: 700;
  color: var(--navy) !important;
  letter-spacing: 0.03em;
}

.sim-actions {
  display: grid;
  gap: 0.5rem;
}

.downloads {
  margin: 0 0 1rem;
  padding: 0.875rem 1rem;
  background: var(--sage-soft);
  border-radius: var(--radius-small);
}

.downloads__title {
  margin: 0 0 0.375rem;
  font-weight: 700;
  color: var(--navy);
}

.downloads ul {
  margin: 0;
  padding-left: 1.2rem;
}

.downloads li {
  padding: 0.25rem 0;
}

/* ---------- Group: summary table and the delegate dialog ---------- */

.group-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.group-section__head h2 {
  margin: 1.5rem 0 0.25rem;
}

.button--small {
  min-height: 2.75rem;
  padding: 0.5rem 1.1rem;
}

.delegate-table {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  margin: 0.5rem 0 1.5rem;
  overflow: hidden;
}

.delegate-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.delegate-table th,
.delegate-table td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.delegate-table th {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-muted);
  background: var(--paper);
}

.delegate-table tr:last-child td {
  border-bottom: 0;
}

.delegate-table .num {
  text-align: right;
  white-space: nowrap;
}

.delegate-table .num-col {
  color: var(--ink-muted);
  width: 2rem;
}

.delegate-table .actions-col {
  white-space: nowrap;
  text-align: right;
}

.delegate-table .actions-col .link-button {
  margin-left: 0.75rem;
  min-height: 2.25rem;
}

.link-button--plain {
  color: var(--navy);
}

.delegate-table .is-flagged {
  background: var(--alert-soft);
}

.delegate-table .badge {
  margin-left: 0.4rem;
}

.delegate-table__empty {
  margin: 0;
  padding: 1rem;
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

/* Phones: each delegate a block rather than a squeezed row. */
@media (max-width: 39.99rem) {
  .delegate-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .delegate-table tr {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.15rem 0.75rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--rule);
  }

  .delegate-table td {
    padding: 0;
    border: 0;
  }

  .delegate-table .num-col { grid-row: 1 / span 4; }
  .delegate-table .name-col { grid-column: 2; }
  .delegate-table .actions-col { grid-column: 3; grid-row: 1; }
  .delegate-table td:not(.num-col):not(.name-col):not(.actions-col) {
    grid-column: 2 / span 2;
    font-size: 0.875rem;
    color: var(--ink-muted);
  }
  .delegate-table .num { text-align: left; }
}

.delegate-dialog {
  width: min(44rem, 100%);
  max-height: min(92vh, 60rem);
  padding: 0;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(11, 11, 59, 0.3);
  color: var(--ink);
  background: var(--surface);
}

.delegate-dialog::backdrop {
  background: rgba(11, 11, 59, 0.55);
}

.delegate-dialog__frame {
  display: flex;
  flex-direction: column;
  max-height: inherit;
}

.delegate-dialog__head,
.delegate-dialog__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.delegate-dialog__foot {
  border-top: 1px solid var(--rule);
  border-bottom: 0;
  justify-content: flex-end;
}

.delegate-dialog__title {
  margin: 0;
  font-size: 1.125rem;
}

.delegate-dialog__close {
  background: none;
  border: 0;
  font-size: 1.75rem;
  line-height: 1;
  width: 2.75rem;
  height: 2.75rem;
  cursor: pointer;
  color: var(--ink-muted);
}

.delegate-dialog__body {
  overflow-y: auto;
  padding: 1rem 1.25rem 0.5rem;
  overscroll-behavior: contain;
}

/* The card inside the dialog is the same partial as everywhere; here it needs no frame. */
.delegate-dialog__body .card {
  border: 0;
  padding: 0;
  margin: 0;
}

.check--copy {
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--sage-soft);
  border-radius: var(--radius-small);
}

.button--ghost-inline {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--field-border);
}

/* A phone gets the whole screen, like a native sheet. */
@media (max-width: 39.99rem) {
  .delegate-dialog {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    border-radius: 0;
  }

  .delegate-dialog__frame {
    height: 100%;
  }

  .delegate-dialog__body {
    flex: 1;
  }
}

.delegate-dialog__foot .button {
  white-space: nowrap;
  min-height: 2.75rem;
  padding: 0.5rem 1.1rem;
}

/* ---------- Test mode (internal) ---------- */
.test-mode {
  margin: 0 auto 1.25rem;
  max-width: var(--measure);
  padding: 0.75rem 1rem;
  border: 2px dashed var(--alert);
  background: var(--alert-soft);
  color: var(--alert);
}

.test-mode__exit { float: right; margin: 0 0 0.5rem 1rem; }
.test-mode-wrap:not(:empty) { padding: 1rem 1rem 0; }
.test-mode-wrap .test-mode { margin-bottom: 1rem; }

/* The package notes: one English/Chinese pair per paragraph, a little space between pairs. */
.fine-print--notes p { margin: 0 0 0.6rem; }
.fine-print--notes p:last-child { margin-bottom: 0; }
