:root {
  --ink: #243447;
  --muted: #66768a;
  --line: #d6dee7;
  --bg: #c8d2dc;
  --panel: #ffffff;
  --accent: #f0d81f;
  --accent-strong: #f6e65f;
  --warm: #f0d81f;
  --alert: #6f5a1f;
  --shadow: 0 18px 36px rgba(31, 52, 73, 0.08);
  --font-body: "Roboto", "Helvetica Neue", "Segoe UI", sans-serif;
  --font-heading: "Roboto", "Helvetica Neue", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  letter-spacing: 0.01em;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(240, 216, 31, 0.06), transparent 18rem),
    radial-gradient(circle at top right, rgba(83, 104, 124, 0.12), transparent 18rem),
    linear-gradient(180deg, #d7dfe7 0%, var(--bg) 100%);
}

.dev-banner {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 10px 16px;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(90deg, #9f1212 0%, #d62828 100%);
  box-shadow: 0 8px 20px rgba(120, 15, 15, 0.25);
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(240, 216, 31, 0.35);
  outline-offset: 3px;
}

.shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding: 12px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #173f73, #1d4b86);
  border: 1px solid rgba(240, 216, 31, 0.18);
  box-shadow: 0 14px 28px rgba(23, 63, 115, 0.14);
}

.top-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-heading);
  text-decoration: none;
  letter-spacing: 0.04em;
  color: var(--accent-strong);
  background: rgba(255, 255, 255, 0.08);
  text-transform: uppercase;
}

.top-nav-logo {
  width: auto;
  max-width: 100%;
  max-height: 117px;
  height: auto;
  flex: 0 0 auto;
  object-fit: contain;
}

.top-nav-brand-logo-only {
  padding: 0 8px;
}

.top-nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  flex: 1 1 auto;
}

.top-nav-utilities {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-left: auto;
}

.public-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin-bottom: 24px;
  padding: 8px 0 18px;
  border-bottom: 1px solid rgba(36, 52, 71, 0.12);
}

.public-header h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #173f73;
}

.public-header-title {
  text-align: center;
}

.public-header-logo {
  width: auto;
  max-width: 100%;
  max-height: 117px;
  height: auto;
  flex: 0 0 auto;
  object-fit: contain;
}

.login-shell {
  min-height: calc(100vh - 88px);
}

.login-home-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 24px;
}

.login-layout {
  display: flex;
  justify-content: center;
}

.login-panel {
  width: min(100%, 520px);
}

.login-panel-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.login-panel-logo {
  max-height: 96px;
}

.admin-dashboard-title {
  margin-bottom: 12px;
}

.admin-dashboard-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-dashboard-title h1 {
  margin: 0;
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #173f73;
}

.report-filter-menu {
  position: relative;
}

.report-filter-row {
  display: flex;
  justify-content: flex-end;
}

.report-filter-row-page {
  margin: 8px 0 18px;
}

.report-filter-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 4px 0 12px;
  border-radius: 0;
  background: transparent;
  border: 0;
  color: #173f73;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  box-shadow: none;
}

.report-filter-menu summary::-webkit-details-marker {
  display: none;
}

.report-filter-menu summary::after {
  content: "▾";
  margin-left: 8px;
  font-size: 0.82rem;
}

.report-filter-menu[open] summary::after {
  content: "▴";
}

.report-filter-form {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 25;
  width: min(280px, calc(100vw - 40px));
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(102, 118, 138, 0.18);
  background: #ffffff;
  box-shadow: 0 18px 36px rgba(31, 52, 73, 0.08);
}

.report-filter-form .field {
  margin-bottom: 14px;
}

.report-year-banner {
  margin: -4px 0 24px;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #66768a;
}

.verification-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 160px;
  margin-bottom: 16px;
}

.verify-card {
  background: #f6f8fa;
  border-color: rgba(102, 118, 138, 0.16);
  color: var(--ink);
}

.verification-copy {
  margin: 0 0 16px;
  font-weight: 700;
  color: #66768a;
}

.remember-device-option {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-weight: 700;
}

.remember-device-option input {
  width: auto;
}

.toast {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 60;
  width: min(420px, calc(100vw - 32px));
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(23, 63, 115, 0.12);
  box-shadow: 0 20px 40px rgba(31, 52, 73, 0.18);
  background: rgba(255, 255, 255, 0.98);
  color: var(--ink);
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-heading);
  font-size: 0.98rem;
  letter-spacing: 0.01em;
}

.toast-success {
  border-color: rgba(33, 102, 58, 0.18);
  background: linear-gradient(180deg, rgba(237, 247, 239, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
  color: #1f5632;
}

.toast-error {
  border-color: rgba(159, 47, 47, 0.18);
  background: linear-gradient(180deg, rgba(255, 241, 241, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
  color: #8c2626;
}

.hero {
  display: grid;
  gap: 20px;
  grid-template-columns: 1.2fr 0.8fr;
  margin-bottom: 24px;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(102, 118, 138, 0.16);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.hero-copy,
.hero-status,
.section {
  padding: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: #7a8797;
}

h1, h2, h3 {
  margin: 0 0 12px;
  line-height: 1.05;
  font-family: var(--font-heading);
  font-weight: 800;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 4.4rem);
}

h2, h3 {
  color: #173f73;
}

p {
  margin: 0 0 12px;
  line-height: 1.65;
}

.muted {
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(102, 118, 138, 0.1);
  color: #173f73;
  font-size: 0.85rem;
}

.grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1.1fr 0.9fr;
}

.grid-single-column {
  grid-template-columns: 1fr;
}

.section + .section {
  margin-top: 24px;
}

.grid > .section + .section,
.grid > .panel.section + .panel.section {
  margin-top: 0;
}

.field,
.book-row {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.book-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 6px;
}

.book-row > .field {
  min-width: 0;
  margin-bottom: 0;
}

.book-row > .field:first-child {
  flex: 1 1 auto;
}

.book-row > .field:last-of-type {
  flex: 0 0 96px;
}

.book-row-remove {
  flex: 0 0 32px;
  align-self: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #d9e3ee;
  color: #173f73;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.book-row-remove:hover,
.book-row-remove:focus-visible {
  background: #173f73;
  color: #ffffff;
}

.duplicate-review-backdrop {
  align-items: flex-start;
  padding-top: 60px;
}

.duplicate-review-modal {
  width: min(1100px, 100%);
}

.duplicate-review-table-wrap {
  overflow-x: auto;
}

.duplicate-review-choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  padding: 10px 12px;
  border: 1px solid rgba(102, 118, 138, 0.22);
  border-radius: 12px;
  background: #f6f8fa;
  cursor: pointer;
}

.duplicate-review-choice input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #173f73;
}

.duplicate-review-choice span {
  color: #173f73;
}

.duplicate-review-table td {
  vertical-align: top;
}

.book-row-invalid {
  padding: 12px;
  border: 1px solid rgba(197, 48, 48, 0.3);
  border-radius: 14px;
  background: rgba(255, 241, 241, 0.72);
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  font-weight: 700;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.bulk-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.bulk-action-checkbox {
  min-height: 0;
  font-weight: 700;
}

.bulk-user-checkbox,
.bulk-action-checkbox input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #173f73;
}

.leaderboard-preference-card {
  gap: 10px;
}

.leaderboard-preference-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.leaderboard-preference-backdrop {
  z-index: 150;
}

.leaderboard-preference-modal {
  width: min(640px, 100%);
}

.leaderboard-preference-choice-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.leaderboard-choice-button {
  width: 100%;
  border: 1px solid rgba(23, 63, 115, 0.16);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff7d6 0%, #ffffff 100%);
  color: #12233f;
  font: inherit;
  font-weight: 700;
  text-align: left;
  padding: 16px 18px;
  cursor: pointer;
  box-shadow: 0 16px 32px rgba(16, 24, 39, 0.08);
}

.leaderboard-choice-button:hover,
.leaderboard-choice-button:focus {
  border-color: rgba(23, 63, 115, 0.35);
  outline: none;
}

.leaderboard-choice-button-secondary {
  background: linear-gradient(180deg, #edf3fb 0%, #ffffff 100%);
}

.badge-grid-public {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.badge-tile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(102, 118, 138, 0.18);
  border-radius: 16px;
  background: #ffffff;
}

.badge-tile-pending {
  border-color: rgba(240, 216, 31, 0.4);
  background: linear-gradient(180deg, rgba(255, 250, 215, 0.98) 0%, #ffffff 100%);
}

.badge-tile-locked {
  opacity: 0.5;
}

.badge-tile-locked .badge-tile-image {
  filter: grayscale(1);
}

.badge-tile-image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 88px;
}

.badge-tile-image {
  width: 88px;
  height: 88px;
  object-fit: contain;
  border-radius: 8px;
}

.badge-section-title {
  margin: 12px 0 10px;
  font-family: var(--font-heading);
  font-weight: 800;
  color: #173f73;
}

.badge-section-title-compact {
  margin-top: 0;
}

.badge-track-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(102, 118, 138, 0.14);
  border-radius: 22px;
  background: #ffffff;
}

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

.badge-track-panel-books {
  background:
    linear-gradient(180deg, rgba(54, 111, 177, 0.08), rgba(255, 255, 255, 0.98) 24%);
}

.badge-track-panel-pages {
  background:
    linear-gradient(180deg, rgba(28, 164, 177, 0.08), rgba(255, 255, 255, 0.98) 24%);
}

.badge-track-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(102, 118, 138, 0.14);
}

.badge-track-panel-kicker {
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4c6888;
}

.badge-tier-collapse {
  border: 1px solid rgba(102, 118, 138, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  overflow: hidden;
}

.badge-tier-collapse summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-family: var(--font-heading);
  font-weight: 800;
  color: #173f73;
}

.badge-tier-collapse summary::-webkit-details-marker {
  display: none;
}

.badge-tier-collapse summary::after {
  content: "▾";
  margin-left: auto;
  color: #66768a;
  font-family: var(--font-body);
  transition: transform 0.15s ease;
}

.badge-tier-collapse[open] summary::after {
  transform: rotate(180deg);
}

.badge-tier-collapse-common summary { box-shadow: inset 5px 0 0 #75b9eb; }
.badge-tier-collapse-uncommon summary { box-shadow: inset 5px 0 0 #20a6b2; }
.badge-tier-collapse-rare summary { box-shadow: inset 5px 0 0 #e0a23b; }
.badge-tier-collapse-epic summary { box-shadow: inset 5px 0 0 #6659d4; }
.badge-tier-collapse-elite summary { box-shadow: inset 5px 0 0 #f1ba1c; }

.badge-tier-collapse-body {
  padding: 0 16px 16px;
}

.verified-view-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -4px 0 24px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(23, 63, 115, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(241, 246, 251, 0.98));
  box-shadow: 0 12px 28px rgba(31, 52, 73, 0.08);
}

.verified-view-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(23, 63, 115, 0.14);
  background: #ffffff;
  color: #173f73;
  font-family: var(--font-heading);
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.verified-view-link:hover,
.verified-view-link:focus-visible {
  background: rgba(23, 63, 115, 0.08);
}

.verified-view-link.is-active {
  border-color: rgba(23, 63, 115, 0.2);
  background: linear-gradient(135deg, #173f73, #1d4b86);
  color: #ffffff;
}

.tier-system-display {
  display: grid;
  gap: 18px;
  margin: 0 0 16px;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid rgba(23, 63, 115, 0.12);
  background:
    radial-gradient(circle at top right, rgba(240, 216, 31, 0.12), transparent 15rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(242, 247, 251, 0.98));
  box-shadow: 0 18px 36px rgba(31, 52, 73, 0.08);
}

.tier-system-hero h2,
.tier-display-alt h3,
.tier-tracks-header h3 {
  margin: 0;
  font-family: var(--font-heading);
  color: #173f73;
}

.tier-system-subtitle {
  margin-top: 4px;
  font-size: 1.08rem;
  font-weight: 800;
  color: #28588d;
}

.tier-system-summary {
  margin: 8px 0 0;
  max-width: 58rem;
  color: #44586f;
}

.tier-cards-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.tier-card {
  display: grid;
  gap: 12px;
  position: relative;
  overflow: hidden;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(102, 118, 138, 0.16);
  background: #ffffff;
}

.tier-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: currentColor;
  opacity: 0.9;
}

.tier-card-common {
  color: #63a7d8;
  background: linear-gradient(180deg, #f2fbff 0%, #ffffff 100%);
}

.tier-card-uncommon {
  color: #1695a5;
  background: linear-gradient(180deg, #ecfdff 0%, #ffffff 100%);
}

.tier-card-rare {
  color: #c9881b;
  background: linear-gradient(180deg, #fff7e7 0%, #ffffff 100%);
}

.tier-card-epic {
  color: #6257c7;
  background: linear-gradient(180deg, #f2efff 0%, #ffffff 100%);
}

.tier-card-elite {
  color: #c39313;
  background:
    radial-gradient(circle at top right, rgba(82, 163, 255, 0.14), transparent 8rem),
    linear-gradient(180deg, #fff7db 0%, #ffffff 100%);
}

.tier-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #173f73;
}

.tier-levels {
  font-size: 0.88rem;
  font-weight: 800;
  color: #44586f;
}

.tier-card h3,
.tier-track-card h4,
.badge-gallery-copy h3 {
  margin: 0;
  font-family: var(--font-heading);
  color: #173f73;
}

.tier-card p,
.tier-track-card p {
  margin: 0;
  color: #44586f;
}

.tier-card-power {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.tier-power-label {
  font-size: 0.84rem;
  font-weight: 800;
  color: #44586f;
}

.tier-power-meter {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.tier-power-meter span {
  height: 8px;
  border-radius: 999px;
  background: rgba(102, 118, 138, 0.16);
}

.tier-power-meter span.is-active {
  background: currentColor;
  box-shadow: 0 0 14px rgba(23, 63, 115, 0.14);
}

.tier-display-alt {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(102, 118, 138, 0.14);
  background: rgba(248, 250, 252, 0.92);
}

.tier-display-alt-copy p {
  margin: 8px 0 0;
  color: #44586f;
}

.tier-path {
  display: grid;
  gap: 12px;
}

.tier-path-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(102, 118, 138, 0.12);
  background: #ffffff;
}

.tier-path-step-common { box-shadow: inset 5px 0 0 #75b9eb; }
.tier-path-step-uncommon { box-shadow: inset 5px 0 0 #20a6b2; }
.tier-path-step-rare { box-shadow: inset 5px 0 0 #e0a23b; }
.tier-path-step-epic { box-shadow: inset 5px 0 0 #6659d4; }
.tier-path-step-elite { box-shadow: inset 5px 0 0 #f1ba1c; }

.tier-path-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-weight: 900;
  color: #173f73;
  background: linear-gradient(180deg, #ffffff, #edf2f7);
  border: 1px solid rgba(102, 118, 138, 0.16);
}

.tier-path-body strong {
  display: block;
  margin-bottom: 2px;
  color: #173f73;
}

.tier-tracks {
  display: grid;
  gap: 14px;
}

.tier-track-grid,
.badge-gallery-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.tier-track-card,
.badge-gallery-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(102, 118, 138, 0.14);
  background: #ffffff;
}

.tier-track-card-books {
  background: linear-gradient(180deg, rgba(54, 111, 177, 0.08), #ffffff);
}

.tier-track-card-pages {
  background: linear-gradient(180deg, rgba(28, 164, 177, 0.08), #ffffff);
}

.tier-track-language {
  font-size: 0.92rem;
  font-weight: 700;
  color: #173f73;
}

.tier-system-note {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(23, 63, 115, 0.06);
  color: #44586f;
  font-size: 0.95rem;
}

.badge-gallery-card {
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
}

.badge-gallery-tier-group {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(102, 118, 138, 0.14);
}

.badge-gallery-tier-group:first-of-type {
  margin-top: 8px;
  padding-top: 0;
  border-top: 0;
}

.badge-gallery-tier-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.badge-gallery-image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
}

.badge-gallery-image {
  width: 88px;
  height: 88px;
  object-fit: contain;
}

.badge-gallery-copy {
  display: grid;
  gap: 8px;
}

label {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.form-note {
  color: var(--muted);
  font-size: 0.92rem;
}

.audit-filter-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

.audit-filter-actions {
  justify-content: flex-start;
}

.audit-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: capitalize;
  background: #eef3f8;
  color: #23405f;
}

.audit-status-success {
  background: #edf7ef;
  color: #21663a;
}

.audit-status-rejected,
.audit-status-failed {
  background: #fff1f1;
  color: #9f2f2f;
}

.audit-details summary {
  cursor: pointer;
  color: #173f73;
  font-weight: 700;
}

.audit-details pre {
  margin: 10px 0 0;
  padding: 12px;
  border-radius: 12px;
  background: #f6f8fa;
  color: var(--ink);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

input,
button,
select,
code,
table {
  font: inherit;
}

input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(240, 216, 31, 0.18);
  outline: none;
}

input[readonly],
.readonly-input {
  background: #eef3f8;
  color: #506174;
}

select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
}

button {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  text-decoration: none;
}

.button-link-compact {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
}

.button-primary {
  background: var(--accent);
  color: #243447;
}

.button-secondary {
  background: #4a5563;
  color: #f8fafc;
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.student-card,
.report-card,
.note {
  padding: 16px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(102, 118, 138, 0.14);
  color: var(--ink);
}

.student-card strong,
.report-card strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: 0.01em;
}

.student-meta,
.report-meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.list {
  display: grid;
  gap: 12px;
}

.report-grid {
  display: grid;
  gap: 12px;
}

.report-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.report-card .value {
  font-size: 1.9rem;
  font-weight: 700;
  color: #173f73;
}

.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;
}

.note {
  background: #f6f8fa;
  border-color: rgba(102, 118, 138, 0.14);
  color: #66768a;
}

.note-success {
  background: #f5efe1;
  border-color: rgba(240, 216, 31, 0.22);
  color: #6f5a1f;
}

.note-warning {
  background: #fff4df;
  border-color: rgba(196, 132, 29, 0.28);
  color: #7a4d14;
}

.footer-note {
  margin-top: 24px;
  font-size: 0.95rem;
}

.submission-summary-card {
  margin-top: 24px;
  display: grid;
  gap: 16px;
  background: #f8f3e7;
  border-color: rgba(240, 216, 31, 0.28);
}

.submission-summary-totals {
  display: grid;
  gap: 12px;
}

.history-summary-note {
  margin-top: 12px;
}

.history-entered-heading {
  margin-bottom: 12px;
}

.history-entry-index {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #66768a;
}

.history-pagination {
  margin-top: 12px;
}

.history-pagination-controls {
  margin-top: 12px;
}

.footer-note-list {
  margin: 12px 0 0;
  padding-left: 20px;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 16px;
}

.admin-page-heading {
  margin: 18px 0;
}

.admin-page-heading h1 {
  margin-bottom: 0;
}

.top-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none;
  font-family: var(--font-heading);
  color: var(--accent-strong);
  background: #4a5563;
  font-weight: 800;
  letter-spacing: 0.02em;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.top-nav-link:hover {
  background: #5a6675;
  transform: translateY(-1px);
}

.top-nav-link.is-active {
  background: var(--accent);
  color: #243447;
  box-shadow: 0 10px 20px rgba(240, 216, 31, 0.18);
}

.top-nav-icon-link {
  min-width: 44px;
  padding: 0 12px;
}

.top-nav-group {
  position: relative;
  padding-bottom: 8px;
  margin-bottom: -8px;
}

.top-nav-group summary {
  list-style: none;
  cursor: pointer;
}

.top-nav-group summary::-webkit-details-marker {
  display: none;
}

.top-nav-group summary::after {
  content: "▾";
  margin-left: 8px;
  font-size: 0.82rem;
}

.top-nav-menu {
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  z-index: 30;
  min-width: 220px;
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(102, 118, 138, 0.16);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 18px 36px rgba(31, 52, 73, 0.08);
}

.top-nav-menu .top-nav-link {
  justify-content: flex-start;
  min-height: 40px;
  padding: 0 12px;
}

.public-header-login {
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
}

input.is-invalid {
  border-color: #c53030;
  box-shadow: 0 0 0 4px rgba(197, 48, 48, 0.12);
}

.leaderboard-card {
  border: 1px solid rgba(102, 118, 138, 0.14);
  border-radius: 16px;
  background: #ffffff;
  padding: 0;
}

.leaderboard-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  cursor: pointer;
  padding: 16px;
  font-family: var(--font-heading);
  font-weight: 700;
  color: #173f73;
}

.leaderboard-card summary::-webkit-details-marker {
  display: none;
}

.leaderboard-card summary::after {
  content: "▾";
  margin-left: auto;
  flex: 0 0 auto;
  color: var(--muted);
  font-family: var(--font-body);
  font-weight: 700;
  transition: transform 0.15s ease;
}

.leaderboard-card[open] summary::after {
  transform: rotate(180deg);
}

.leaderboard-details {
  padding: 0 16px 16px;
}

.dashboard-disclosure {
  margin-top: 8px;
}

.dashboard-disclosure summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.dashboard-disclosure summary::-webkit-details-marker {
  display: none;
}

.dashboard-disclosure summary::after {
  content: "▾";
  margin-left: auto;
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 700;
  display: inline-block;
  transition: transform 0.15s ease;
}

.dashboard-disclosure[open] summary::after {
  transform: rotate(180deg);
}

.dashboard-disclosure .list,
.dashboard-disclosure .note {
  margin-top: 14px;
}

.reminder-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(16, 24, 39, 0.58);
}

.reminder-modal-backdrop[hidden] {
  display: none !important;
}

.reminder-modal {
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-shadow: 0 30px 60px rgba(16, 24, 39, 0.25);
}

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

.reminder-modal-close {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: #e8edf3;
  color: #173f73;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.reminder-modal-list {
  margin-top: 18px;
}

.reminder-modal-actions {
  margin-top: 18px;
  justify-content: flex-end;
}

.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-pills-compact {
  margin-bottom: 0;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--accent-strong);
  background: #172845;
  font-weight: 700;
}

.filter-pill.is-active {
  background: var(--accent);
  color: #0a1730;
}

.panel-header-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
  margin-bottom: 16px;
}

.panel-header-inline h2 {
  margin: 0;
  flex: 0 0 auto;
}

.panel-header-inline .filter-pills {
  justify-content: flex-end;
}

.overview-toolbar {
  justify-content: flex-end;
}

.overview-modal {
  width: min(720px, 100%);
}

.overview-sort-modal {
  width: min(860px, 100%);
}

.overview-sort-grid {
  display: grid;
  grid-template-columns: 100px minmax(0, 1.2fr) 140px 160px;
  gap: 12px;
  align-items: end;
  margin-top: 12px;
}

.overview-sort-grid-head {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #66768a;
}

.overview-sort-step-label {
  align-self: center;
  font-family: var(--font-heading);
  font-weight: 700;
  color: #173f73;
}

.overview-sort-step.is-hidden {
  display: none;
}

.overview-sort-actions {
  margin-top: 16px;
  justify-content: flex-start;
}

.overview-sort-add {
  min-width: 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #132744;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.data-table th {
  color: var(--accent-strong);
  font-size: 0.92rem;
}

.table-wrap-light {
  border: 1px solid rgba(102, 118, 138, 0.14);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(31, 52, 73, 0.05);
}

.data-table-light {
  background: #ffffff;
  color: var(--ink);
}

.data-table-light th,
.data-table-light td {
  border-bottom: 1px solid rgba(214, 222, 231, 0.9);
}

.data-table-light th {
  color: #173f73;
  background: #f6f8fa;
}

.data-table-light tbody tr:hover {
  background: #f8fbff;
}

.students-lunch-input {
  min-width: 92px;
  max-width: 112px;
}

.students-status-select {
  min-width: 112px;
}

@media (max-width: 860px) {
  .toast {
    top: 14px;
    right: 16px;
    left: 16px;
    width: auto;
  }

  .top-nav,
  .public-header,
  .hero,
  .admin-shell-header,
  .audit-filter-grid,
  .grid,
  .badge-track-columns,
  .font-compare-grid,
  .verification-grid {
    grid-template-columns: 1fr;
  }

  .book-row > .field:last-of-type {
    flex-basis: 88px;
  }

  .top-nav {
    align-items: stretch;
    flex-direction: column;
    border-radius: 28px;
  }

  .public-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-dashboard-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .top-nav-links {
    justify-content: flex-start;
  }

  .top-nav-utilities {
    width: 100%;
    justify-content: flex-end;
  }

  .top-nav-menu {
    position: static;
    min-width: 0;
    margin-top: 8px;
  }

  .report-filter-form {
    position: static;
    width: min(320px, 100%);
    margin-top: 10px;
  }

  .tier-system-display {
    padding: 16px;
  }

  .tier-path-step,
  .badge-gallery-card {
    grid-template-columns: 1fr;
  }

  .tier-path-marker {
    width: 36px;
    height: 36px;
  }

  .reminder-modal-backdrop {
    padding: 16px;
    align-items: flex-start;
  }

  .panel-header-inline {
    flex-wrap: wrap;
  }
}
