:root {
  --bg: #eaf4fc;
  --panel: rgba(247, 252, 255, 0.9);
  --panel-strong: #f8fcff;
  --ink: #17212b;
  --muted: #526274;
  --line: rgba(52, 92, 132, 0.16);
  --accent: #4b9cd3;
  --accent-strong: #2d6f9f;
  --accent-soft: rgba(75, 156, 211, 0.14);
  --warn: #8b4b1f;
  --warn-soft: rgba(139, 75, 31, 0.12);
  --shadow: 0 20px 60px rgba(36, 74, 116, 0.14);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  font-family: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(75, 156, 211, 0.22), transparent 34%),
    radial-gradient(circle at top right, rgba(179, 221, 247, 0.42), transparent 30%),
    linear-gradient(180deg, #f4fbff 0%, #dcecf8 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(23, 33, 43, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 33, 43, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent);
}

.page-shell {
  position: relative;
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 18px;
}

.hero-copy,
.hero-card,
.panel,
.result-card {
  backdrop-filter: blur(12px);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-copy {
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.hero-card {
  border-radius: var(--radius-lg);
  padding: 28px;
  background: linear-gradient(180deg, rgba(248, 252, 255, 0.98), rgba(228, 241, 251, 0.9));
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  font-weight: 700;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
}

.section-title-emphasis {
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

h1 {
  font-size: clamp(2.5rem, 4vw, 4.25rem);
  line-height: 0.98;
  max-width: 10ch;
  margin-inline: auto;
}

.hero-logo-wrap {
  display: flex;
  justify-content: center;
  margin: 0;
}

.hero-logo {
  display: block;
  width: min(100%, 760px);
  height: auto;
}

.lede {
  max-width: 64ch;
  font-size: 1.08rem;
  line-height: 1.65;
  margin: 14px auto 0;
  color: var(--muted);
}

.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  justify-content: center;
}

.button-nav {
  text-decoration: none;
  text-align: center;
}

.hero-card p,
.hero-card li {
  color: var(--muted);
  line-height: 1.55;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

.panel,
.result-card {
  border-radius: var(--radius-lg);
  padding: 24px;
}

.panel-sticky {
  position: static;
}

.panel-heading {
  display: flex;
  gap: 16px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.button {
  appearance: none;
  border: 1px solid rgba(75, 156, 211, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent-strong);
  font: inherit;
  font-size: 0.96rem;
  padding: 11px 16px;
  cursor: pointer;
  transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.action-error {
  margin: -8px 0 16px;
  color: #b42318;
  font-size: 0.94rem;
  font-weight: 700;
  font-style: italic;
  text-align: right;
}

.button:hover {
  transform: translateY(-1px);
  border-color: rgba(75, 156, 211, 0.42);
}

.button-primary {
  color: #f7f3ea;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field span {
  font-size: 0.92rem;
  font-weight: 600;
}

.field-error {
  color: #b42318;
  font-size: 0.9rem;
  font-weight: 700;
}

.disclosure {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 254, 251, 0.65);
}

.disclosure + .panel-heading {
  margin-top: 24px;
}

.disclosure-summary {
  cursor: pointer;
  list-style: revert;
  padding: 14px 16px;
  font-size: 0.92rem;
  font-weight: 600;
}

.disclosure-body {
  padding: 0 16px 16px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid rgba(48, 53, 41, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 254, 251, 0.92);
  color: var(--ink);
  font: inherit;
  padding: 12px 14px;
}

.checkbox-field input[type="checkbox"] {
  width: auto;
  align-self: flex-start;
  margin-top: 4px;
}

.field textarea {
  resize: vertical;
}

.hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.step-one-grid {
  margin-top: 18px;
  grid-template-columns: 1fr;
}

.step-one-result-stack {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.step-one-grid .field-span-2,
.step-one-result-stack .field-span-2 {
  grid-column: span 1;
}

.step-one-result-stack .selector-grid,
.step-one-result-stack .result-grid {
  grid-template-columns: 1fr;
}

.field-span-2 {
  grid-column: span 2;
}

.status-banner {
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  line-height: 1.5;
}

.upload-status {
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin: 14px 0;
  background: rgba(75, 156, 211, 0.1);
  color: var(--accent-strong);
  line-height: 1.5;
}

.upload-status.warning {
  background: var(--warn-soft);
  color: var(--warn);
}

.status-banner.warning {
  background: var(--warn-soft);
  color: var(--warn);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.data-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 0;
}

.data-list div {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.data-list dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 4px;
}

.data-list dd {
  margin: 0;
  line-height: 1.45;
  white-space: pre-wrap;
}

.plain-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.55;
}

.surety-stack,
.roster-grid {
  display: grid;
  gap: 16px;
}

.selector-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.72);
}

.selector-card-inactive {
  opacity: 0.48;
}

.selector-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.selector-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.table-wrap {
  margin-top: 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.roster-form {
  margin-top: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.72);
}

th,
td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

th {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: rgba(75, 156, 211, 0.08);
}

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

.table-action {
  width: 1%;
  white-space: nowrap;
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.button-danger {
  border-color: rgba(139, 75, 31, 0.28);
  color: var(--warn);
  background: rgba(139, 75, 31, 0.08);
}

.button-danger:hover {
  border-color: rgba(139, 75, 31, 0.42);
}

.button-secondary {
  border-color: rgba(48, 53, 41, 0.18);
  color: var(--muted);
  background: rgba(48, 53, 41, 0.06);
}

.roster-inline-input {
  width: 100%;
  border: 1px solid rgba(48, 53, 41, 0.14);
  border-radius: 10px;
  background: rgba(255, 254, 251, 0.96);
  color: var(--ink);
  font: inherit;
  padding: 9px 10px;
}

.json-output {
  margin: 0;
  padding: 16px;
  border-radius: var(--radius-md);
  background: #17324a;
  color: #eef8ff;
  font-size: 0.88rem;
  line-height: 1.55;
  overflow: auto;
}

@media (max-width: 1100px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 20px 14px 40px;
  }

  .hero-copy,
  .hero-card,
  .panel,
  .result-card {
    padding: 20px;
  }

  .form-grid,
  .result-grid,
  .selector-grid {
    grid-template-columns: 1fr;
  }

  .field-span-2 {
    grid-column: span 1;
  }

  .panel-heading {
    flex-direction: column;
    align-items: stretch;
  }

  .button-row {
    justify-content: stretch;
  }

  .button {
    width: 100%;
  }
}
