:root {
  --brand: #a9e6ee;
  --brand-dark: #245d69;
  --brand-rgb: 169, 230, 238;
  --accent: #ffbe98;
  --accent-dark: #8c4d37;
  --accent-rgb: 255, 190, 152;
  --pink: #ffc6d9;
  --pink-dark: #7f3753;
  --lavender: #d8ccff;
  --lavender-dark: #4d418a;
  --sky: #bde3ff;
  --sky-dark: #295f85;
  --mint: #bef0d7;
  --mint-dark: #246a51;
  --butter: #ffe7a3;
  --butter-dark: #6d571a;
  --navy: #123047;
  --ink: #1d2b34;
  --muted: #6f7d88;
  --line: #e4dfee;
  --panel: #ffffff;
  --surface: #fffaf6;
  --soft: #eef8ff;
  --soft-accent: #fff1e8;
  --danger: #ffd1c7;
  --danger-dark: #8f3f35;
  --danger-rgb: 255, 209, 199;
  --danger-soft: #fff1ee;
  --success: #c7f2d6;
  --success-soft: #f0fff6;
  --warning: #ffe7a3;
  --warning-soft: #fff9df;
  --input-bg: #f7f4ff;
  --table-head: #f1ecff;
  --shadow: 0 14px 34px rgba(86, 72, 109, 0.11);
  --font-main: "Microsoft JhengHei", "Noto Sans TC", Arial, sans-serif;
  --font-display: "FancyFreeFont1", "Microsoft JhengHei", "Noto Sans TC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: var(--font-main);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 250, 246, 0.86), rgba(239, 248, 255, 0.82) 45%, rgba(250, 240, 255, 0.86)),
    var(--site-bg, linear-gradient(135deg, #fff6e9, #eef8ff 45%, #f4edff));
  background-size: cover;
  background-position: center;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr);
  align-items: stretch;
  transition: grid-template-columns 0.2s ease;
}

#app.sidebar-collapsed {
  grid-template-columns: 64px minmax(0, 1fr);
}

@media screen and (min-width: 861px) {
  html {
    font-size: 75%;
  }

  body {
    overflow-x: hidden;
  }

  #app {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    grid-template-columns: 222px minmax(0, 1fr);
    zoom: normal;
  }

  #app.sidebar-collapsed {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .sidebar {
    height: 100vh;
    height: 100dvh;
  }
}

.mobile-menu-toggle {
  display: none;
}

.mobile-language-toggle {
  display: none;
}

.mobile-language-toggle.language-toggle {
  display: none;
  position: fixed;
}

.sidebar {
  grid-column: 1;
  grid-row: 1;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.65rem 1.7rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  border-right: 1px solid var(--line);
  box-shadow: 8px 0 30px rgba(31, 83, 96, 0.07);
  backdrop-filter: blur(12px);
}

@media screen and (min-width: 861px) {
  .sidebar {
    height: 100vh;
    min-height: 100vh;
    height: 100dvh;
    min-height: 100dvh;
    overflow-y: auto;
  }

  #app.sidebar-collapsed .sidebar {
    height: 100vh;
    min-height: 100vh;
    height: 100dvh;
    min-height: 100dvh;
  }

  .main {
    min-height: 100vh;
    min-height: 100dvh;
  }
}

.sidebar-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.95rem;
}

.sidebar-toggle {
  display: inline-flex;
  width: 2.55rem;
  min-height: 2.55rem;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--navy);
  background: #fff8ec;
  font-weight: 900;
}

.language-toggle {
  display: inline-flex;
  width: auto;
  min-height: 2.55rem;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0 0.78rem;
  border: 1px solid #d6ecf2;
  border-radius: 999px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 24px rgba(53, 98, 124, 0.1);
  font-weight: 900;
  white-space: nowrap;
}

.language-toggle[hidden],
[data-language-toggle][hidden] {
  display: none !important;
}

.language-toggle:hover,
.language-toggle:focus-visible {
  border-color: var(--brand);
  background: var(--mint);
}

.language-toggle .language-current {
  color: var(--lavender-dark);
}

.language-toggle .language-next {
  color: var(--muted);
}

.language-toggle .language-divider {
  color: #9aaabd;
  font-weight: 700;
}

.sidebar-content {
  transition: opacity 0.18s ease, transform 0.18s ease;
}

#app.sidebar-collapsed .sidebar {
  padding: 0.9rem 0.55rem;
}

#app.sidebar-collapsed .sidebar-toggle {
  margin-inline: auto;
}

#app.sidebar-collapsed .sidebar-topbar {
  justify-content: center;
}

#app.sidebar-collapsed .sidebar-topbar .language-toggle {
  display: none;
}

#app.sidebar-collapsed .sidebar-content {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-1rem);
}

.brand {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.brand-logo {
  display: block;
  max-width: 96px;
  max-height: 96px;
  object-fit: contain;
}

.brand strong {
  display: block;
  color: var(--navy);
  font-family: var(--font-main);
  font-weight: 800;
  font-size: 1.16rem;
  line-height: 1.2;
}

.brand span {
  color: var(--muted);
  font-size: 0.85rem;
}

.home-button,
.shop-button,
.nav-item,
.danger,
.primary,
.secondary {
  width: 100%;
  min-height: 2.75rem;
  border: 0;
  border-radius: 8px;
  font-weight: 850;
}

.sidebar-site-links {
  display: grid;
  gap: 0.55rem;
}

.home-button,
.primary {
  color: var(--navy);
  background: var(--brand);
  border: 1px solid rgba(var(--brand-rgb), 0.75);
  box-shadow: 0 12px 28px rgba(86, 72, 109, 0.12);
}

.home-button:hover,
.primary:hover {
  background: #92dbe6;
}

.shop-button {
  color: var(--lavender-dark);
  background: var(--lavender);
  border: 1px solid rgba(216, 204, 255, 0.78);
}

.shop-button:hover {
  background: #cfc1ff;
}

.nav {
  display: grid;
  gap: 0.65rem;
  padding: 1.55rem 0;
  margin: 1.55rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.nav-item {
  text-align: left;
  padding: 0 0.9rem;
  color: var(--navy);
  background: #fffefa;
  border: 1px solid #f0e5cf;
  font-size: 1.06rem;
}

.nav-item:hover {
  background: #f5f1ff;
  border-color: #ded3ff;
}

.nav-item.active {
  color: var(--lavender-dark);
  border-color: rgba(216, 204, 255, 0.8);
  background: var(--lavender);
}

.account-panel {
  display: grid;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.account-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--navy);
  font-size: 0.95rem;
  font-weight: 900;
}

.account-label::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--pink);
  box-shadow: 0 0 0 4px rgba(255, 198, 217, 0.38);
}

#accountState {
  cursor: pointer;
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem;
  border: 1px solid #eadff8;
  border-radius: 8px;
  background: #fffbff;
}

#accountState:hover,
#accountState:focus-visible {
  outline: none;
  border-color: rgba(216, 204, 255, 0.9);
  background: #f7f3ff;
}

#accountState strong {
  color: var(--navy);
}

#accountState small {
  color: var(--lavender-dark);
  font-weight: 850;
}

.account-status-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 1.65rem;
  align-items: center;
  padding: 0 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.account-status-badge.online {
  color: var(--mint-dark);
  background: var(--success-soft);
}

.account-status-badge.offline {
  color: var(--danger-dark);
  background: var(--danger-soft);
}

.danger {
  color: var(--danger-dark);
  background: var(--danger);
  border: 1px solid rgba(var(--danger-rgb), 0.9);
}

.danger:hover {
  background: #ffc1b4;
}

.secondary {
  color: var(--navy);
  background: #fbf7ff;
  border: 1px solid #ded3ff;
}

.secondary:hover {
  background: #f1ecff;
}

.main {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  padding: 1.5rem clamp(1rem, 3vw, 2.5rem);
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.main,
.page,
.page.active,
.grid,
.cards,
.card,
.panel,
form,
.table-scroll,
.admin-layout,
.preview-grid,
.admin-panel-head,
.admin-panel-head-tools,
.admin-data-toolbar,
.admin-add-grid,
.hierarchy-wrap,
.hierarchy-toolbar,
.registration-contact-panel,
.registration-unit-panel,
.registration-entry-card,
.entry-participants,
.entry-participant,
.confirmation-event-card,
.confirmation-summary-card,
.confirmation-roster-card,
.admin-registration-summary-card,
.unit-tree,
.unit-tree-unit,
.athlete-roster-columns,
.athlete-roster-unit,
.rules-editor,
.rules-panel {
  min-width: 0;
  max-width: 100%;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 240px;
  display: grid;
  align-content: end;
  padding: 2.1rem;
  border: 1px solid rgba(18, 48, 71, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(12, 21, 33, 0.32), rgba(12, 21, 33, 0.78)),
    var(--hero-bg, linear-gradient(135deg, #bde3ff, #d8ccff 55%, #ffbe98));
  background-size: cover;
  background-position: center;
  color: #ffffff;
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 0;
  font-family: var(--font-main);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.home-heading {
  display: grid;
  gap: 0.65rem;
  margin: 0 0 1.4rem;
  padding: clamp(1.2rem, 3vw, 2rem) 0 0.2rem;
  color: var(--navy);
}

.home-heading h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 6vw, 5.8rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.home-heading div {
  color: var(--brand-dark);
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  font-weight: 900;
}

.section-title {
  margin: 1.5rem 0 1rem;
  padding-left: 0.85rem;
  border-left: 4px solid var(--accent);
  color: var(--navy);
  font-size: 1.55rem;
  font-weight: 900;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.85rem;
  margin: 1.5rem 0 1rem;
  flex-wrap: wrap;
}

.section-title-row .section-title {
  margin: 0;
}

.section-title-select {
  width: min(100%, 22rem);
  min-height: 2.8rem;
  padding: 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.9);
  font-weight: 900;
  box-shadow: var(--shadow);
}

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

.cards {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card,
.panel,
form {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.card,
.panel {
  padding: 1.2rem;
}

.event-card {
  background: rgba(255, 255, 255, 0.68);
  border-color: rgba(255, 255, 255, 0.58);
  border-top: 4px solid var(--brand);
  box-shadow: 0 18px 42px rgba(49, 68, 88, 0.13);
  backdrop-filter: blur(14px) saturate(1.16);
  -webkit-backdrop-filter: blur(14px) saturate(1.16);
}

.event-card:nth-child(6n + 1) {
  border-top-color: var(--brand);
}

.event-card:nth-child(6n + 2) {
  border-top-color: var(--accent);
}

.event-card:nth-child(6n + 3) {
  border-top-color: var(--lavender);
}

.event-card:nth-child(6n + 4) {
  border-top-color: var(--mint);
}

.event-card:nth-child(6n + 5) {
  border-top-color: var(--butter);
}

.event-card:nth-child(6n) {
  border-top-color: var(--pink);
}

.event-card h3 {
  margin: 0.7rem 0 1rem;
  color: var(--navy);
  font-size: 1.35rem;
}

.meta-row {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-top: 1px solid #edf0f4;
}

.meta-row span:first-child {
  color: var(--muted);
}

.badge {
  display: inline-flex;
  width: fit-content;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  color: var(--pink-dark);
  background: var(--pink);
  font-size: 0.82rem;
  font-weight: 900;
}

.event-card-headline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.status-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 2rem;
  align-items: center;
  padding: 0 0.7rem;
  border-radius: 999px;
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 900;
}

.status-badge.open {
  background: var(--success);
}

.status-badge.ending {
  color: var(--butter-dark);
  background: var(--warning);
}

.status-badge.closed {
  color: #515a66;
  background: #e3e7ee;
}

.status-badge.pending {
  color: var(--sky-dark);
  background: var(--sky);
}

.status-detail {
  color: var(--muted);
  font-weight: 850;
}

form {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--navy);
  font-weight: 760;
}

.field-hint {
  display: block;
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 760;
  line-height: 1.5;
}

.visual-upload-hint {
  padding-left: 0.1rem;
}

input,
textarea,
select {
  width: 100%;
  min-height: 2.6rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--ink);
}

textarea {
  min-height: 6rem;
  resize: vertical;
}

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

.form-row.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wide-form {
  margin-bottom: 1rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.actions button {
  width: auto;
  padding: 0 1.1rem;
}

.hidden {
  display: none !important;
}

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

.notice {
  padding: 0.9rem 1rem;
  border: 1px solid #f1d98f;
  border-radius: 8px;
  background: var(--warning-soft);
  color: var(--butter-dark);
}

.error {
  padding: 0.9rem 1rem;
  border: 1px solid #ffc5b8;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger-dark);
}

.success {
  padding: 0.9rem 1rem;
  border: 1px solid #b5eacb;
  border-radius: 8px;
  background: var(--success-soft);
  color: var(--mint-dark);
}

.autosave-indicator {
  justify-self: start;
  min-height: 1.85rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #f7fbfb;
  font-size: 0.82rem;
  font-weight: 850;
}

.autosave-indicator.error {
  border-color: #f4c4bc;
  color: var(--danger-dark);
  background: var(--danger-soft);
}

.toast-container {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 2000;
  display: grid;
  gap: 0.65rem;
  width: min(92vw, 360px);
  pointer-events: none;
}

.toast {
  padding: 0.95rem 1rem;
  border: 1px solid #b5eacb;
  border-left: 5px solid var(--mint);
  border-radius: 8px;
  color: var(--navy);
  background: #fbfff7;
  box-shadow: 0 18px 42px rgba(86, 72, 109, 0.16);
  font-weight: 900;
  opacity: 0;
  transform: translateY(0.65rem);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  border-color: #ffc5b8;
  border-left-color: var(--danger);
  color: var(--danger-dark);
  background: var(--danger-soft);
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab {
  width: auto;
  min-height: 2.5rem;
  padding: 0 1rem;
  color: var(--navy);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 850;
}

.tab.active {
  color: var(--lavender-dark);
  background: var(--lavender);
  border-color: var(--lavender);
}

.login-panel {
  display: grid;
  gap: 1rem;
}

.google-login-button {
  min-height: 3.2rem;
}

.other-login-methods {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.other-login-methods summary {
  cursor: pointer;
  padding: 0.9rem 1rem;
  color: var(--navy);
  font-weight: 900;
}

.other-login-methods .tabs {
  padding: 0 1rem;
}

.compact-auth-form {
  margin: 0 1rem 1rem;
  box-shadow: none;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  border-radius: 8px;
  -webkit-overflow-scrolling: touch;
}

th,
td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--navy);
  background: var(--table-head);
}

.registration-row-new {
  background: rgba(255, 205, 210, 0.46);
}

.registration-row-new:hover {
  background: rgba(255, 205, 210, 0.62);
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.table-actions button {
  width: auto;
  min-height: 2.15rem;
  padding: 0 0.7rem;
}

.selected-row td {
  background: #fff4ec;
}

.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfefd;
  color: var(--ink);
  line-height: 1.5;
}

.consent-check input {
  width: 1.15rem;
  min-height: 1.15rem;
  margin-top: 0.2rem;
  flex: 0 0 auto;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0 0 1rem;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.admin-tab {
  width: auto;
  min-height: 2.5rem;
  padding: 0 1rem;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--navy);
  background: #fff8ec;
  font-weight: 900;
}

.admin-tab.active {
  color: var(--sky-dark);
  background: var(--sky);
  box-shadow: 0 10px 22px rgba(86, 72, 109, 0.12);
}

.admin-panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.admin-panel-head h3 {
  margin: 0 0 0.3rem;
  color: var(--navy);
  font-size: 1.25rem;
}

.admin-panel-head p {
  margin: 0;
}

.admin-panel-head > button,
.event-picker {
  width: min(100%, 280px);
}

.admin-panel-head-tools {
  display: grid;
  grid-template-columns: minmax(220px, 340px) auto;
  gap: 0.75rem;
  align-items: end;
  min-width: min(100%, 720px);
}

.admin-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

.admin-panel-actions button {
  width: auto;
  min-width: 10rem;
  padding: 0 1rem;
}

.event-picker {
  display: grid;
  gap: 0.35rem;
}

.event-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.event-summary h2 {
  margin: 0 0 0.25rem;
  color: var(--navy);
  font-size: clamp(1.65rem, 3vw, 2.4rem);
}

.event-summary button {
  width: auto;
  padding: 0 1.2rem;
}

.registration-contact-panel,
.registration-unit-panel {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.registration-contact-panel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.registration-unit-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 0.75rem;
  align-items: end;
}

.field-with-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: end;
}

.field-with-button label {
  min-width: 0;
}

.picker-open-button {
  width: auto;
  min-width: 7.25rem;
  min-height: 3.5rem;
  padding: 0 1rem;
}

.registration-contact-panel div,
.registration-unit-field {
  display: grid;
  gap: 0.25rem;
}

.registration-contact-panel span,
.registration-unit-field {
  color: var(--muted);
  font-size: 0.9rem;
}

.registration-contact-panel strong,
.registration-unit-field input,
.registration-unit-field select {
  color: var(--navy);
  font-size: 1.08rem;
}

.pending-registration-panel,
.confirmation-event-card,
.confirmation-summary-card,
.confirmation-roster-card,
.admin-registration-summary-card {
  display: grid;
  gap: 1rem;
}

.pending-registration-head,
.confirmation-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.pending-registration-section {
  display: grid;
  gap: 0.75rem;
}

.pending-registration-section + .pending-registration-section {
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.pending-registration-head h3,
.confirmation-summary-card h3,
.confirmation-roster-card h3 {
  margin: 0;
  color: var(--navy);
}

.compact-summary-stats,
.registration-summary-grid,
.confirmation-total-stats,
.confirmation-item-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.confirmation-item-breakdown {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.45rem;
}

.compact-summary-stats div,
.registration-summary-grid div,
.confirmation-total-stats div,
.confirmation-item-breakdown div {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.compact-summary-stats span,
.registration-summary-grid span,
.confirmation-total-stats span,
.confirmation-item-breakdown span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
}

.compact-summary-stats strong,
.registration-summary-grid strong,
.confirmation-total-stats strong,
.confirmation-item-breakdown strong {
  color: var(--accent-dark);
  font-size: 1.2rem;
}

.confirmation-event-card {
  text-align: center;
}

.confirmation-event-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.2rem;
  color: var(--muted);
  font-weight: 850;
}

.confirmation-payment-info {
  justify-self: center;
  width: min(100%, 42rem);
  display: grid;
  gap: 0.35rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 190, 118, 0.55);
  border-radius: 10px;
  background: rgba(255, 247, 226, 0.82);
  color: var(--navy);
  text-align: left;
  box-shadow: 0 10px 24px rgba(255, 190, 118, 0.12);
}

.confirmation-payment-info span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
}

.confirmation-payment-info div {
  white-space: pre-line;
  font-weight: 850;
  line-height: 1.55;
}

.confirmation-event-card h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(1.7rem, 4vw, 2.6rem);
}

.confirmation-event-card .back-events {
  justify-self: center;
  width: auto;
  padding: 0 1.2rem;
}

.confirm-registration-actions {
  justify-content: center;
}

.confirm-registration-actions .primary {
  width: min(100%, 24rem);
  min-height: 3.8rem;
  font-size: 1.18rem;
}

.section-subtitle {
  margin: 1rem 0 0.5rem;
  color: var(--navy);
  font-size: 1.15rem;
  font-weight: 950;
}

.my-registration-event-section {
  display: grid;
  gap: 1rem;
}

.my-registration-event-section + .my-registration-event-section {
  margin-top: 1.35rem;
}

.registration-unit-field input,
.registration-unit-field select {
  margin-top: 0.35rem;
}

.role-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2.2rem;
  padding: 0 0.8rem;
  border: 1px solid #dde9fb;
  border-radius: 8px;
  color: var(--navy);
  background: #eff8ff;
  font-weight: 850;
}

.amount-preview {
  padding: 0.85rem 1rem;
  border: 1px solid #ffd4c8;
  border-radius: 8px;
  color: var(--accent-dark);
  background: var(--soft-accent);
  font-weight: 900;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.metric {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.metric span {
  color: var(--muted);
  font-size: 0.9rem;
}

.metric strong {
  color: var(--navy);
  font-size: 1.6rem;
}

.event-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.event-stat-card {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--lavender);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.event-stat-card h3 {
  margin: 0;
  color: var(--navy);
}

.event-stat-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.event-stat-values div {
  display: grid;
  gap: 0.25rem;
  padding: 0.8rem;
  border-radius: 8px;
  background: #fff8ec;
}

.event-stat-values span {
  color: var(--muted);
  font-size: 0.88rem;
}

.event-stat-values strong {
  color: var(--navy);
  font-size: 1.35rem;
}

.admin-data-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(280px, 1fr);
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.admin-data-toolbar.single {
  grid-template-columns: minmax(0, 1fr);
}

.admin-item-count-card {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.item-count-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 0.7rem;
}

.item-count-card {
  display: grid;
  gap: 0.35rem;
  min-height: 7rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffafd;
  color: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.item-count-card:hover,
.item-count-card:focus-visible,
.item-count-card.active {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 12px 26px rgba(20, 116, 135, 0.12);
  outline: none;
}

.item-count-card:nth-child(6n + 1) {
  background: #f0fbff;
  border-color: #cfedf7;
}

.item-count-card:nth-child(6n + 2) {
  background: #fff4ec;
  border-color: #ffd7bd;
}

.item-count-card:nth-child(6n + 3) {
  background: #f5f1ff;
  border-color: #dcd2ff;
}

.item-count-card:nth-child(6n + 4) {
  background: #f1fff7;
  border-color: #c9efd8;
}

.item-count-card:nth-child(6n + 5) {
  background: #fff9e6;
  border-color: #f5df9f;
}

.item-count-card:nth-child(6n) {
  background: #fff2f7;
  border-color: #ffd1df;
}

.item-count-card span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 850;
}

.item-count-card strong {
  color: var(--navy);
  font-size: 1rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.item-count-card b {
  align-self: end;
  color: var(--accent-dark);
  font-size: 1.45rem;
}

.item-roster-panel {
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.item-breakdown-tree {
  display: grid;
  gap: 0.75rem;
}

.item-breakdown-group {
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem;
  border: 1px solid #e6def5;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.item-breakdown-group h5 {
  margin: 0;
  color: var(--navy);
  font-size: 1rem;
}

.item-breakdown-levels {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
}

.item-breakdown-level {
  min-width: 0;
  min-height: 3.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.item-breakdown-level:hover,
.item-breakdown-level:focus-visible,
.item-breakdown-level.active {
  border-color: var(--accent);
  box-shadow: 0 8px 18px rgba(20, 116, 135, 0.12);
  outline: none;
  transform: translateY(-1px);
}

.item-breakdown-level span {
  min-width: 0;
  color: var(--navy);
  font-weight: 850;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.item-breakdown-level strong {
  flex: 0 0 auto;
  color: var(--accent-dark);
}

.item-breakdown-level.is-solo {
  border-color: #ff9f80;
  background: #fff0e8;
  box-shadow: 0 0 0 2px rgba(255, 190, 152, 0.28);
}

.item-breakdown-level.is-solo strong {
  color: #b6422a;
}

.item-breakdown-level-detail {
  display: grid;
  gap: 0.65rem;
  padding: 0.75rem;
  border: 1px solid #d8ccff;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.item-breakdown-level-detail h5 {
  margin: 0;
}

.admin-add-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.admin-add-box {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.admin-add-box[open] {
  grid-column: 1 / -1;
}

.admin-add-box summary {
  cursor: pointer;
  padding: 0.85rem 1rem;
  color: var(--navy);
  font-weight: 900;
  list-style-position: inside;
}

.admin-add-box.compact {
  width: min(100%, 24rem);
  box-shadow: none;
}

.admin-add-box.compact[open] {
  width: 100%;
}

.admin-staff-form,
.admin-registration-add-form {
  display: grid;
  gap: 0.7rem;
  padding: 0.85rem;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.admin-staff-form {
  grid-template-columns: minmax(16rem, 2fr) minmax(11rem, 1fr) minmax(7.5rem, 9rem) minmax(6.5rem, 8rem) minmax(6.5rem, 8rem);
  align-items: end;
}

.admin-registration-add-form {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
}

.admin-staff-form button,
.admin-registration-add-form button {
  width: 100%;
  min-width: 0;
  padding: 0 0.85rem;
}

.admin-staff-form:not(.editing) {
  grid-template-columns: minmax(16rem, 2fr) minmax(11rem, 1fr) minmax(7.5rem, 9rem) minmax(6.5rem, 8rem);
}

.admin-data-units {
  display: grid;
  gap: 1rem;
}

.admin-data-unit {
  display: block;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.admin-data-unit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 1rem;
  cursor: pointer;
  list-style: none;
}

.admin-data-unit-head::-webkit-details-marker {
  display: none;
}

.admin-data-unit[open] .admin-data-unit-head {
  border-bottom: 1px solid var(--line);
}

.admin-data-unit-head span {
  color: var(--muted);
  font-weight: 800;
}

.admin-data-unit-head h3 {
  margin: 0.25rem 0 0;
  color: var(--navy);
  font-size: 1.35rem;
}

.admin-data-unit-counts {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-weight: 800;
}

.admin-data-toggle-text {
  flex: 0 0 auto;
  color: var(--red);
  font-size: 0.95rem;
}

.admin-data-unit-body {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.admin-data-section {
  display: grid;
  gap: 0.7rem;
  overflow-x: auto;
}

.admin-data-section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.admin-data-section-head h4 {
  margin: 0;
  color: var(--navy);
  font-size: 1.08rem;
}

.admin-data-section-head .admin-add-box[open] {
  flex-basis: 100%;
}

.admin-data-table {
  margin: 0;
}

.team-athlete-cell {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0.2rem 0.4rem;
  min-width: 14rem;
  font-weight: 900;
  color: var(--navy);
  white-space: nowrap;
}

.team-athlete-cell-compact {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
  white-space: normal;
}

.team-athlete-cell-compact span {
  white-space: nowrap;
}

.team-athlete-divider {
  color: var(--muted);
  font-weight: 800;
}

.admin-data-table,
.unit-tree table {
  min-width: 680px;
}

.compact-notice {
  margin: 0;
  box-shadow: none;
}

.picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(12, 21, 33, 0.46);
}

.picker-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(720px, 96vw);
  max-height: min(720px, 86vh);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(12, 21, 33, 0.24);
}

.picker-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.picker-dialog-head h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1.25rem;
}

.picker-dialog-head button {
  width: auto;
  min-height: 2.4rem;
  padding: 0 0.95rem;
}

.picker-dialog-list {
  display: grid;
  gap: 0.6rem;
  padding: 1rem;
  overflow: auto;
}

.consent-dialog {
  width: min(760px, 96vw);
  grid-template-rows: auto minmax(0, 1fr);
}

.consent-dialog-body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 1rem;
  padding: 1rem;
  min-height: 0;
}

.consent-dialog-body p {
  margin: 0.35rem 0 0;
  line-height: 1.6;
}

.consent-event-name {
  color: var(--navy);
  font-weight: 900;
}

.consent-policy {
  display: grid;
  gap: 0.9rem;
  min-height: 0;
  max-height: min(52vh, 520px);
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefd;
}

.consent-policy h4 {
  margin: 0 0 0.35rem;
  color: var(--navy);
  font-size: 1rem;
}

.consent-policy p {
  color: var(--ink);
}

.consent-policy ul {
  display: grid;
  gap: 0.35rem;
  margin: 0.55rem 0 0;
  padding-left: 1.35rem;
  line-height: 1.6;
}

.consent-scroll-status {
  padding: 0.75rem 0.9rem;
  border: 1px solid #f0d59a;
  border-radius: 8px;
  background: #fff8df;
  color: #856404;
  font-weight: 900;
  line-height: 1.5;
}

.consent-scroll-status.ready {
  border-color: #bce4cb;
  background: #eefcf3;
  color: #17623a;
}

.picker-row {
  display: grid;
  gap: 0.25rem;
  width: 100%;
  min-height: 3.65rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfefd;
  color: var(--navy);
  text-align: left;
  box-shadow: none;
}

.picker-row:hover,
.picker-row:focus-visible {
  border-color: #d8ccff;
  background: #f5f1ff;
}

.picker-row strong {
  font-size: 1.05rem;
}

.picker-row span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
}

.admin-layout,
.preview-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  gap: 1rem;
  align-items: start;
}

.highlight-form {
  border-color: #d8ccff;
  background: #faf7ff;
}

.hierarchy-wrap {
  display: grid;
  gap: 0.85rem;
}

.hierarchy-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 520px);
  gap: 1rem;
  align-items: start;
}

.hierarchy-toolbar > * {
  min-width: 0;
}

.hierarchy-toolbar p,
.muted {
  overflow-wrap: break-word;
  word-break: keep-all;
}

.hierarchy-toolbar h3,
.panel h3,
form h3 {
  margin: 0 0 0.55rem;
  color: var(--navy);
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.55rem;
  align-items: end;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.inline-form button {
  width: auto;
  min-width: 8.5rem;
  padding: 0 0.9rem;
}

.add-item-form {
  grid-template-columns: minmax(0, 2fr) minmax(6rem, 1fr) auto;
}

.add-item-form input[name="amount"] {
  min-width: 0;
}

.compact-textarea {
  min-height: 5rem;
  resize: vertical;
}

.selected-event-form {
  margin-bottom: 1rem;
}

.rules-editor {
  display: grid;
  gap: 0.85rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfefd;
}

.rules-editor textarea {
  min-height: 12rem;
  resize: vertical;
}

.rules-image-admin-preview {
  display: grid;
  gap: 0.7rem;
}

.rules-image-admin-preview img {
  width: min(100%, 760px);
  max-height: 280px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.rules-event-summary {
  align-items: center;
}

.rules-event-summary > div {
  flex: 1;
  text-align: center;
}

.rules-panel {
  display: grid;
  gap: 1rem;
}

.rules-main-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(320px, 1.05fr);
  gap: 1rem;
  align-items: stretch;
  min-height: min(64vh, 720px);
}

.rules-media-column,
.rules-text-column {
  min-width: 0;
}

.rules-text-column {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
}

.rules-panel h3 {
  margin: 0;
  color: var(--navy);
}

.rules-image {
  height: 100%;
  margin: 0;
}

.rules-image img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 520px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.rules-content {
  display: grid;
  gap: 0.75rem;
  height: 100%;
  overflow: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  line-height: 1.75;
  white-space: normal;
}

.rules-content .notice {
  margin: 1rem;
}

.rules-content p {
  margin: 0;
}

.rules-pdf-preview {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 520px;
  border: 0;
  background: #ffffff;
}

.rules-panel > .actions {
  justify-content: center;
}

.continue-registration-from-rules {
  width: min(100%, 42rem);
  min-height: 8.25rem;
  font-size: clamp(2rem, 4vw, 3rem);
}

.rules-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.registration-entry-list {
  display: grid;
  gap: 0.85rem;
}

.athlete-card,
.registration-partner-list {
  display: grid;
  gap: 0.85rem;
}

.athlete-card {
  padding: 1rem;
  border: 1px solid #d8ecf6;
  border-left: 4px solid var(--sky);
  border-radius: 8px;
  background: #f6fcff;
}

.athlete-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.athlete-card-head strong {
  color: var(--navy);
  font-size: 1.08rem;
}

.athlete-card-head span {
  color: var(--muted);
  font-weight: 850;
}

.registration-entry-card {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid #e6def5;
  border-left: 4px solid var(--lavender);
  border-radius: 8px;
  background: #fffafd;
}

.registration-entry-card:nth-child(6n + 1) {
  border-left-color: var(--lavender);
}

.registration-entry-card:nth-child(6n + 2) {
  border-left-color: var(--sky);
}

.registration-entry-card:nth-child(6n + 3) {
  border-left-color: var(--mint);
}

.registration-entry-card:nth-child(6n + 4) {
  border-left-color: var(--accent);
}

.registration-entry-card:nth-child(6n + 5) {
  border-left-color: var(--pink);
}

.registration-entry-card:nth-child(6n) {
  border-left-color: var(--butter);
}

.entry-participants {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid #e6def5;
  border-radius: 8px;
  background: #ffffff;
}

.entry-participants-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--navy);
}

.entry-participants-head span {
  color: var(--pink-dark);
  font-weight: 900;
}

.entry-participant {
  display: grid;
  gap: 0.7rem;
  padding: 0.8rem;
  border: 1px solid #e6def5;
  border-radius: 8px;
  background: #f7f4ff;
}

.entry-participant-title {
  color: var(--navy);
  font-weight: 900;
}

.entry-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.entry-card-head strong {
  color: var(--navy);
  font-size: 1.06rem;
}

.entry-card-head button,
.add-registration-entry {
  width: auto;
  padding: 0 1rem;
}

.unit-tree {
  display: grid;
  gap: 0.85rem;
}

.athlete-roster-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.85rem;
  align-items: stretch;
}

.athlete-roster-unit {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.athlete-roster-unit h3 {
  margin: 0;
  padding-left: 0.65rem;
  border-left: 4px solid var(--sky);
  color: var(--navy);
}

.roster-unit-scroll {
  margin: 0;
}

.athlete-roster-table {
  min-width: 520px;
}

.hidden-roster-unit-input {
  display: none;
}

.unit-tree-unit {
  display: grid;
  gap: 0.65rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.unit-tree-unit h3,
.unit-tree-role h4 {
  margin: 0;
  color: var(--navy);
}

.unit-tree-unit h3 {
  padding-left: 0.65rem;
  border-left: 4px solid var(--accent);
}

.unit-tree-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.unit-tree-header .danger {
  width: auto;
  min-height: 2.35rem;
  padding: 0 0.9rem;
  background: var(--danger);
}

.unit-tree-roles {
  display: grid;
  gap: 0.65rem;
  margin-left: 1.1rem;
}

.unit-tree-role {
  display: grid;
  grid-template-columns: minmax(4rem, auto) 1fr;
  gap: 0.45rem;
  align-items: start;
  padding-left: 1rem;
  border-left: 3px solid #dbe3ee;
}

.unit-tree-names {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-left: 0;
}

.unit-tree-name {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  width: min(100%, 13.5rem);
  max-width: 100%;
  padding: 0.38rem 0.45rem 0.38rem 0.65rem;
  border: 1px solid #edf0f4;
  border-radius: 8px;
  background: #f8fafc;
}

.unit-tree-name span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unit-tree-name button {
  flex: 0 0 auto;
  width: auto;
  min-height: 1.85rem;
  padding: 0 0.55rem;
  font-size: 0.82rem;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--navy);
  background: #ffffff;
  font-weight: 850;
  text-decoration: none;
}

.pdf-link-editor {
  display: grid;
  gap: 0.65rem;
}

.pdf-link-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--navy);
  font-weight: 850;
}

.pdf-link-head button {
  width: auto;
  padding: 0 0.9rem;
}

.pdf-link-list {
  display: grid;
  gap: 0.55rem;
}

.pdf-link-row {
  display: grid;
  grid-template-columns: minmax(12rem, 0.65fr) minmax(16rem, 1fr) auto;
  gap: 0.55rem;
}

.pdf-link-row button {
  width: auto;
  padding: 0 0.9rem;
}

.event-pdf-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0.9rem 0;
}

.event-pdf-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.7rem;
  padding: 0 0.95rem;
  border: 1px solid #d9d2fb;
  border-radius: 8px;
  color: var(--lavender-dark);
  background: #f5f1ff;
  font-weight: 900;
  text-decoration: none;
}

.event-pdf-links a:hover {
  border-color: #c9bbfb;
  background: #ede7ff;
}

.event-share-button {
  margin: 0.85rem 0 0.55rem;
  color: var(--navy);
  background: #fbf7ff;
}

.hierarchy-item,
.hierarchy-group {
  position: relative;
  border-radius: 8px;
}

.hierarchy-item {
  overflow: hidden;
  border: 1px solid var(--accent);
  background: var(--soft-accent);
  box-shadow: var(--shadow);
}

.hierarchy-item > summary,
.hierarchy-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}

.hierarchy-item > summary::-webkit-details-marker,
.hierarchy-group > summary::-webkit-details-marker {
  display: none;
}

.summary-main,
.summary-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.summary-main span:last-child {
  overflow-wrap: break-word;
  word-break: keep-all;
}

.summary-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.drag-source[draggable="true"] {
  position: relative;
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease, outline-color 0.15s ease;
}

.drag-source[draggable="true"]:active {
  cursor: grabbing;
}

.drag-source[draggable="true"]::before {
  content: "⋮⋮";
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  min-height: 1.8rem;
  margin-right: 0.15rem;
  border: 1px solid rgba(18, 48, 71, 0.14);
  border-radius: 8px;
  color: rgba(18, 48, 71, 0.58);
  background: rgba(255, 255, 255, 0.62);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  box-shadow: 0 7px 14px rgba(61, 72, 92, 0.08);
}

.drag-source[draggable="true"]:hover,
.drag-source[draggable="true"]:focus-visible {
  transform: translateY(-1px);
  filter: saturate(1.04);
  outline: 2px solid rgba(169, 230, 238, 0.75);
  outline-offset: 2px;
}

.drag-source[draggable="true"]:hover::before,
.drag-source[draggable="true"]:focus-visible::before {
  color: var(--brand-dark);
  border-color: rgba(var(--brand-rgb), 0.82);
  background: rgba(255, 255, 255, 0.92);
}

.inline-editing {
  flex: 1;
}

.inline-edit-input {
  min-height: 2.15rem;
  max-width: 360px;
  background: #ffffff;
}

.amount-input {
  max-width: 150px;
}

.sortable-row.dragging {
  opacity: 0.7;
  transform: scale(0.992);
  box-shadow: 0 20px 38px rgba(53, 98, 124, 0.18);
}

.sortable-row.drop-target {
  outline: 3px solid rgba(var(--brand-rgb), 0.9);
  outline-offset: 4px;
  box-shadow: 0 0 0 6px rgba(var(--brand-rgb), 0.16), 0 14px 32px rgba(36, 93, 105, 0.16);
}

.sortable-row.drop-target:not(.dragging)::after {
  content: "";
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  top: -0.45rem;
  height: 0.22rem;
  border-radius: 999px;
  background: var(--brand-dark);
}

.hierarchy-item > summary {
  padding: 0.95rem 1rem;
  color: var(--navy);
  background: var(--accent);
}

.hierarchy-group {
  margin-top: 0.85rem;
  border: 1px solid rgba(18, 48, 71, 0.12);
  background: #ffffff;
}

.hierarchy-group > summary {
  padding: 0.85rem 1rem;
  color: var(--navy);
  background: #f5f1ff;
}

.level {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
}

.level-2 {
  margin-left: 1.35rem;
  border-left: 4px solid rgba(23, 50, 77, 0.16);
}

.level-3 {
  margin-left: 1.35rem;
  border-left: 4px solid rgba(23, 50, 77, 0.1);
}

.level-row {
  display: grid;
  position: relative;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.75rem;
  padding: 0.72rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfc;
}

.level-row.drag-source[draggable="true"]::before {
  grid-column: 1;
  margin-top: 0.15rem;
  margin-right: 0;
}

.restriction-form {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr));
  gap: 0.65rem;
  align-items: end;
  padding: 0.75rem;
  border: 1px dashed #d9e0ea;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
}

.restriction-title {
  align-self: center;
  color: var(--navy);
  font-weight: 900;
}

.restriction-form .check-row {
  min-height: 2.7rem;
  padding: 0.6rem 0.7rem;
}

.restriction-form button {
  width: 100%;
}

.indent-note {
  padding-left: 0.4rem;
}

.mini {
  width: auto;
  min-height: 2rem;
  padding: 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff8ec;
  color: var(--navy);
  font-weight: 850;
}

.mini:hover {
  background: #f5f1ff;
}

.danger-mini {
  color: var(--danger-dark);
  border-color: transparent;
  background: rgba(var(--danger-rgb), 0.96);
}

.danger-mini:hover {
  background: #ffc1b4;
}

.preview-image {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.logo-preview {
  max-width: 220px;
  object-fit: contain;
  background: #f7f8fa;
}

select[multiple] {
  min-height: 7.5rem;
}

@media (max-width: 1180px) {
  .hierarchy-toolbar {
    grid-template-columns: 1fr;
  }
}

.permission-search {
  margin-bottom: 1rem;
}

.permission-table {
  width: 100%;
}

.permission-email-cell {
  min-width: 15rem;
  max-width: 24rem;
  overflow-wrap: anywhere;
}

.permission-name-cell {
  min-width: 9.5rem;
  max-width: 14rem;
  color: var(--navy);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.permission-role-cell {
  width: 11.5rem;
  min-width: 11.5rem;
  vertical-align: top;
}

.permission-role {
  width: 100%;
  min-width: 0;
}

.permission-events-cell {
  min-width: min(420px, 34vw);
  vertical-align: top;
}

.permission-save-cell {
  vertical-align: top;
}

.permission-block-cell {
  min-width: 8rem;
  vertical-align: top;
}

.permission-block-label {
  min-height: 2.8rem;
}

.blocked-user-row {
  background: #fff1ee;
}

.multi-select {
  display: block;
  width: 100%;
  min-width: 260px;
}

.multi-select summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--navy);
  background: var(--input-bg);
  font-weight: 850;
  list-style: none;
}

.multi-select summary::-webkit-details-marker {
  display: none;
}

.multi-select summary::after {
  content: "⌄";
  margin-left: auto;
  color: var(--muted);
}

.multi-select[open] summary {
  border-color: rgba(var(--brand-rgb), 0.38);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background: #ffffff;
}

.multi-select[open] summary::after {
  content: "⌃";
}

.multi-select-menu {
  display: grid;
  gap: 0.45rem;
  width: 100%;
  max-height: min(460px, 62vh);
  overflow: auto;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 8px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  background: #ffffff;
  box-shadow: 0 14px 28px rgba(31, 83, 96, 0.1);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.2rem;
  padding: 0.75rem 0.8rem;
  border: 1px solid #e7f0f2;
  border-radius: 8px;
  color: var(--ink);
  background: #fbfefd;
  font-weight: 850;
}

.check-row:hover {
  background: #f5f1ff;
}

.check-row input {
  width: 1.15rem;
  min-height: 1.15rem;
  flex: 0 0 auto;
}

.check-row span {
  line-height: 1.35;
}

@media (max-width: 860px) {
  body {
    padding-top: 3.8rem;
    overflow-x: hidden;
  }

  .item-breakdown-levels {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #app {
    display: block;
  }

  #app.sidebar-collapsed {
    display: block;
  }

  #app.mobile-nav-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(12, 21, 33, 0.46);
  }

  .mobile-menu-toggle {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 1400;
    display: inline-flex;
    width: 2.75rem;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--navy);
    background: #fff8ec;
    box-shadow: var(--shadow);
    font-weight: 900;
  }

  .mobile-language-toggle.language-toggle {
    position: fixed;
    top: 0.75rem;
    left: 3.85rem;
    z-index: 1400;
    display: inline-flex;
    min-height: 2.75rem;
    padding: 0 0.82rem;
    box-shadow: var(--shadow);
  }

  .toast-container {
    right: 0.75rem;
    bottom: 0.75rem;
    width: calc(100vw - 1.5rem);
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1300;
    width: min(82vw, 320px);
    height: 100vh;
    min-height: 100vh;
    height: 100dvh;
    min-height: 100dvh;
    padding: 1.1rem;
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }

  #app.mobile-nav-open .sidebar {
    transform: translateX(0);
  }

  #app.sidebar-collapsed .sidebar {
    padding: 1.1rem;
  }

  #app.sidebar-collapsed .sidebar-content {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .sidebar-topbar {
    margin-bottom: 1rem;
  }

  .sidebar-toggle {
    margin-left: 0;
  }

  .sidebar-topbar .language-toggle {
    margin-left: auto;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-row.three,
  .admin-layout,
  .preview-grid,
  .admin-panel-head-tools,
  .admin-data-toolbar,
  .admin-add-grid,
  .hierarchy-toolbar {
    grid-template-columns: 1fr;
  }

  .admin-staff-form,
  .admin-registration-add-form {
    grid-template-columns: 1fr;
  }

  .admin-staff-form button,
  .admin-registration-add-form button {
    width: 100%;
  }

  .event-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .registration-contact-panel {
    grid-template-columns: 1fr;
  }

  .registration-unit-controls {
    grid-template-columns: 1fr;
  }

  .field-with-button {
    grid-template-columns: 1fr;
  }

  .picker-open-button {
    width: 100%;
  }

  .entry-card-head,
  .unit-tree-header {
    align-items: stretch;
    flex-direction: column;
  }

  .entry-card-head button,
  .add-registration-entry,
  .unit-tree-header button {
    width: 100%;
  }

  .admin-panel-head,
  .admin-data-unit-head,
  .admin-data-section-head,
  .hierarchy-item > summary,
  .hierarchy-group > summary {
    align-items: stretch;
    flex-direction: column;
  }

  .level-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .admin-panel-head > button,
  .admin-panel-actions button,
  .event-picker {
    width: 100%;
  }

  .admin-panel-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .summary-actions {
    justify-content: flex-start;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .pdf-link-head,
  .pdf-link-row {
    grid-template-columns: 1fr;
  }

  .pdf-link-head {
    align-items: stretch;
    flex-direction: column;
  }

  .rules-main-grid {
    grid-template-columns: 1fr;
  }

  .rules-text-column {
    grid-template-rows: auto auto;
  }

  .permission-events-cell {
    min-width: 260px;
  }

  .multi-select {
    min-width: 0;
  }

  .level-2,
  .level-3 {
    margin-left: 0.65rem;
  }
}

@media (max-width: 640px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
  }

  .item-breakdown-levels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main {
    width: 100%;
    max-width: 100vw;
    padding: 1rem 0.7rem 1.5rem;
    overflow-x: hidden;
  }

  .page,
  .grid,
  .cards,
  .card,
  .panel,
  form,
  .wide-form,
  .admin-layout,
  .preview-grid,
  .admin-panel-head-tools,
  .admin-data-toolbar,
  .admin-add-grid,
  .hierarchy-wrap,
  .hierarchy-toolbar,
  .athlete-card,
  .registration-partner-list,
  .registration-entry-list,
  .registration-entry-card,
  .entry-participants,
  .entry-participant,
  .item-roster-panel,
  .pending-registration-panel,
  .confirmation-event-card,
  .confirmation-summary-card,
  .confirmation-roster-card,
  .admin-registration-summary-card,
  .unit-tree,
  .unit-tree-unit,
  .athlete-roster-columns,
  .athlete-roster-unit,
  .section-title-row,
  .rules-editor,
  .rules-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .grid > *,
  .form-row > *,
  .admin-layout > *,
  .preview-grid > *,
  .admin-panel-head-tools > *,
  .admin-data-toolbar > *,
  .admin-add-grid > *,
  .hierarchy-toolbar > *,
  .athlete-card > *,
  .registration-partner-list > *,
  .registration-entry-card > *,
  .entry-participant > *,
  .item-roster-panel > *,
  .unit-tree-unit > *,
  .athlete-roster-unit > *,
  .rules-editor > *,
  .rules-panel > * {
    min-width: 0;
  }

  .hero {
    min-height: 178px;
    padding: 1.2rem;
  }

  .home-hero {
    min-height: calc(100svh - 6.8rem);
    margin: -1rem -0.7rem 1.15rem;
    padding: 4.6rem 1.35rem 2.2rem;
    background-position: center;
  }

  .hero h1 {
    font-size: 2.1rem;
    line-height: 1.08;
    overflow-wrap: anywhere;
  }

  .home-hero h1 {
    max-width: 8ch;
    font-size: clamp(2.9rem, 14vw, 4.6rem);
  }

  .home-hero div {
    font-size: 1rem;
  }

  .home-heading {
    gap: 0.45rem;
    margin-bottom: 1rem;
    padding-top: 0.8rem;
  }

  .home-heading h1 {
    font-size: clamp(2.15rem, 10vw, 3.4rem);
  }

  .home-heading div {
    font-size: 0.98rem;
  }

  .section-title {
    margin: 1.15rem 0 0.75rem;
    font-size: 1.32rem;
  }

  .cards,
  .event-stat-grid,
  .athlete-roster-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .card,
  .panel,
  form,
  .registration-contact-panel,
  .registration-unit-panel,
  .admin-panel-head,
  .admin-data-unit,
  .unit-tree-unit,
  .athlete-roster-unit,
  .registration-entry-card,
  .entry-participants,
  .entry-participant {
    padding: 0.85rem;
  }

  .admin-data-unit {
    padding: 0;
  }

  .admin-data-unit-head,
  .admin-data-unit-body {
    padding: 0.85rem;
  }

  input,
  textarea,
  select,
  button {
    min-width: 0;
    font-size: 16px;
  }

  textarea {
    min-height: 7.5rem;
  }

  .event-card h3,
  .event-summary h2,
  .admin-data-unit-head h3 {
    font-size: 1.35rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .meta-row {
    grid-template-columns: 1fr;
    gap: 0.15rem;
    padding: 0.45rem 0;
  }

  .tabs,
  .admin-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
  }

  .tab,
  .admin-tab,
  .actions button,
  .event-summary button,
  .event-share-button,
  .link-button,
  .rules-downloads a,
  .table-actions button,
  .summary-actions button,
  .mini,
  .danger-mini {
    width: 100%;
    min-width: 0;
  }

  .actions,
  .admin-panel-actions,
  .rules-downloads,
  .table-actions,
  .summary-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .event-summary,
  .admin-panel-head,
  .admin-data-unit-head,
  .admin-data-section-head,
  .entry-card-head,
  .entry-participants-head,
  .unit-tree-header,
  .hierarchy-item > summary,
  .hierarchy-group > summary,
  .pdf-link-head {
    align-items: stretch;
    flex-direction: column;
  }

  .field-with-button,
  .pdf-link-row,
  .inline-form,
  .level-row,
  .add-item-form {
    grid-template-columns: 1fr;
  }

  .add-item-form input[name="amount"],
  .amount-input,
  .inline-edit-input {
    max-width: 100%;
  }

  .registration-unit-field input,
  .registration-unit-field select,
  .registration-contact-panel strong,
  .muted,
  .summary-main span,
  .check-row span {
    overflow-wrap: anywhere;
  }

  .table-scroll,
  .admin-data-section {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table,
  .admin-data-table,
  .unit-tree table {
    min-width: 620px;
  }

  .unit-tree-roles,
  .unit-tree-names {
    margin-left: 0;
  }

  .unit-tree-name {
    align-items: center;
    flex-direction: row;
    width: min(100%, 13.5rem);
  }

  .unit-tree-name button {
    width: auto;
    min-width: 0;
  }

  .unit-tree-role,
  .level-2,
  .level-3 {
    margin-left: 0.25rem;
    padding-left: 0.55rem;
  }

  .hierarchy-item > summary,
  .hierarchy-group > summary {
    gap: 0.65rem;
    padding: 0.8rem;
  }

  .summary-main,
  .summary-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .restriction-form {
    grid-template-columns: 1fr;
    padding: 0.65rem;
  }

  .permission-events-cell {
    min-width: 0;
  }

  .multi-select-menu {
    max-height: 52vh;
  }

  .rules-content {
    max-height: none;
    padding: 0.85rem;
  }

  .rules-image img {
    height: auto;
    max-height: 52vh;
    object-fit: contain;
  }

  .rules-image-admin-preview img,
  .preview-image {
    max-height: 52vh;
    object-fit: contain;
  }

  .pending-registration-head,
  .confirmation-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .compact-summary-stats,
  .registration-summary-grid,
  .confirmation-total-stats,
  .confirmation-item-breakdown {
    grid-template-columns: 1fr;
  }

  .picker-overlay {
    padding: 0.5rem;
  }

  .picker-dialog,
  .consent-dialog {
    width: calc(100vw - 1rem);
    max-height: calc(100vh - 1rem);
  }

  .picker-dialog-head,
  .picker-dialog-list,
  .consent-dialog-body,
  .consent-policy {
    padding: 0.75rem;
  }

  .picker-dialog-head {
    align-items: stretch;
    flex-direction: column;
  }

  .picker-dialog-head button {
    width: 100%;
  }

  .consent-policy {
    max-height: 46vh;
  }

  .rules-pdf-preview {
    min-height: 420px;
    height: 62vh;
  }

  .continue-registration-from-rules {
    min-height: 5.5rem;
    font-size: clamp(1.55rem, 7vw, 2.2rem);
  }
}

@media (max-width: 420px) {
  .main {
    padding-inline: 0.55rem;
  }

  .item-breakdown-levels {
    grid-template-columns: 1fr;
  }

  .sidebar {
    width: min(88vw, 320px);
  }

  .hero {
    min-height: 156px;
    padding: 1rem;
  }

  .home-hero {
    min-height: calc(100svh - 6.4rem);
    margin-inline: -0.55rem;
    padding: 4.2rem 1rem 1.9rem;
  }

  .hero h1 {
    font-size: 1.85rem;
  }

  .home-hero h1 {
    font-size: clamp(2.45rem, 15vw, 3.75rem);
  }

  .home-heading h1 {
    font-size: clamp(1.9rem, 11vw, 2.8rem);
  }

  .card,
  .panel,
  form,
  .registration-entry-card,
  .entry-participants,
  .entry-participant,
  .admin-data-unit,
  .unit-tree-unit {
    padding: 0.75rem;
  }

  .admin-data-unit {
    padding: 0;
  }

  .admin-data-unit-head,
  .admin-data-unit-body {
    padding: 0.75rem;
  }

  .section-title {
    font-size: 1.22rem;
  }

  table,
  .admin-data-table,
  .unit-tree table {
    min-width: 560px;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 6mm;
  }

  body {
    background: #ffffff !important;
    font-size: 10px;
  }

  .sidebar,
  .mobile-menu-toggle,
  .toast-container,
  .confirmation-actions,
  .confirmation-event-card .back-events,
  .section-title,
  .site-background {
    display: none !important;
  }

  .section-title-row,
  .section-title-select {
    display: none !important;
  }

  #app,
  .main,
  .page,
  .page.active {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .page.active {
    display: block !important;
    gap: 0 !important;
  }

  .page:not(.active) {
    display: none !important;
  }

  .panel,
  .confirmation-event-card,
  .confirmation-summary-card,
  .confirmation-roster-card {
    box-shadow: none !important;
    gap: 2.2mm !important;
    padding: 2.6mm !important;
    margin: 0 0 2mm !important;
    border-radius: 3px !important;
    break-inside: auto;
    page-break-inside: auto;
  }

  .confirmation-event-card,
  .confirmation-summary-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .confirmation-roster-card {
    break-inside: auto !important;
    page-break-inside: auto !important;
  }

  .confirmation-event-card {
    text-align: left !important;
  }

  .confirmation-event-card h2 {
    margin: 0 !important;
    font-size: 17px !important;
    line-height: 1.18 !important;
  }

  .confirmation-event-meta {
    justify-content: flex-start !important;
    gap: 1.5mm 6mm !important;
    font-size: 10px !important;
  }

  .confirmation-summary-card h3,
  .confirmation-roster-card h3 {
    font-size: 12px !important;
  }

  .confirmation-total-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 1.8mm !important;
  }

  .confirmation-item-breakdown {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: 1.6mm !important;
  }

  .confirmation-total-stats div,
  .confirmation-item-breakdown div {
    padding: 1.5mm 1.8mm !important;
    gap: 0.6mm !important;
    border-radius: 3px !important;
  }

  .confirmation-total-stats span,
  .confirmation-item-breakdown span {
    font-size: 8.5px !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .confirmation-total-stats strong,
  .confirmation-item-breakdown strong {
    font-size: 10.5px !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
  }

  .admin-data-section-head {
    margin-bottom: 1.5mm !important;
    gap: 1.5mm !important;
  }

  .report-table-scroll,
  .table-scroll {
    overflow: visible !important;
  }

  table {
    min-width: 0 !important;
    font-size: 7.2px !important;
    table-layout: fixed !important;
  }

  th,
  td {
    padding: 1mm 0.75mm !important;
    line-height: 1.18 !important;
    vertical-align: top !important;
  }

  tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .registration-report-table th,
  .registration-report-table td {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .registration-report-table th:nth-child(1),
  .registration-report-table td:nth-child(1) {
    width: 15%;
  }

  .registration-report-table th:nth-child(2),
  .registration-report-table td:nth-child(2) {
    width: 19%;
  }

  .registration-report-table th:nth-child(3),
  .registration-report-table td:nth-child(3) {
    width: 13%;
  }

  .registration-report-table th:nth-child(4),
  .registration-report-table td:nth-child(4) {
    width: 20%;
  }

  .registration-report-table th:nth-child(5),
  .registration-report-table td:nth-child(5) {
    width: 24%;
  }

  .registration-report-table th:nth-child(6),
  .registration-report-table td:nth-child(6) {
    width: 9%;
  }

  .registration-report-table td:nth-child(2) {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  .team-athlete-cell-compact {
    gap: 0.25mm !important;
  }

  .team-athlete-cell-compact span {
    display: block !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}
