.site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  box-sizing: border-box;
}

body {
  padding-top: 78px;
}

html {
  scroll-padding-top: 78px;
}

img,
video,
iframe,
canvas {
  max-width: 100%;
}

button,
input,
select,
textarea {
  max-width: 100%;
}

.page-shell,
.page-shell > *,
.page-heading > *,
.dash-head > *,
.section-heading > * {
  min-width: 0;
}

.site-header {
  height: auto;
  min-height: 78px;
  gap: 14px;
}

.site-header .brand {
  min-width: 0;
  flex: 0 1 auto;
}

.site-header .brand-logo {
  max-width: 100%;
  max-height: 64px;
  object-fit: contain;
}

.site-header nav {
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  row-gap: 8px;
}

.site-header nav a {
  white-space: nowrap;
}

.event-footer {
  grid-template-columns: minmax(0, 1.2fr) minmax(120px, .8fr) minmax(0, 1.5fr);
}

.event-footer-contact p,
.event-footer-contact a {
  min-width: 0;
  overflow-wrap: anywhere;
}

.event-footer-contact .footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.footer-contact-item i {
  flex: 0 0 16px;
  margin-top: 2px;
}

.nav-toggle {
  display: none;
}

.admin-page .login-wrap {
  overflow: hidden;
}

.page-heading,
.dash-head,
.section-heading,
.filter-bar,
.site-footer {
  flex-wrap: wrap;
  gap: 16px;
}

.page-heading > p {
  max-width: 100%;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.table-wrap table {
  min-width: 640px;
}

.registration-form,
.settings-form,
.admin-tools,
.confirmation-card,
.transport-page,
.scanner-panel,
.token-form {
  max-width: 100%;
}

.form-grid,
.settings-form,
.manage-bus-fields,
.extra-filters,
.confirm-details {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid > *,
.settings-form > *,
.manage-bus-fields > *,
.extra-filters > *,
.confirm-details > * {
  min-width: 0;
}

@media (max-width: 850px) {
  .site-header {
    padding-right: 4vw;
    padding-left: 4vw;
  }

  .site-header nav {
    display: none;
    position: absolute;
    z-index: 40;
    top: 100%;
    right: 0;
    left: 0;
    width: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 16px 14px;
    border-top: 1px solid rgba(32, 41, 35, .1);
    background: inherit;
    box-shadow: 0 12px 20px rgba(20, 32, 28, .12);
  }

  .site-header.nav-open nav {
    display: flex;
  }

  .site-header nav a {
    display: flex;
    min-height: 48px;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(32, 41, 35, .08);
    font-size: 15px;
  }

  .site-header nav a:last-child {
    border-bottom: 0;
  }

  .site-header .nav-toggle {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    place-content: center;
    gap: 5px;
    padding: 0;
    border: 1px solid currentColor;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    cursor: pointer;
  }

  .nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform .18s ease, opacity .18s ease;
  }

  .site-header.nav-open .nav-toggle span:first-child {
    transform: translateY(7px) rotate(45deg);
  }

  .site-header.nav-open .nav-toggle span:nth-child(2) {
    opacity: 0;
  }

  .site-header.nav-open .nav-toggle span:last-child {
    transform: translateY(-7px) rotate(-45deg);
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-page .login-wrap {
    width: min(980px, 94vw);
    grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
    overflow: hidden;
  }

  .admin-page .login-form {
    min-width: 0;
    padding-right: 30px;
    padding-left: 30px;
  }

  .admin-page .login-intro {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .home-page .testimony-layout {
    flex-direction: column;
  }

  .home-page .testimony-section,
  .home-page .transport-spotlight > * {
    width: 100%;
    min-width: 0;
  }

  .event-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  select,
  textarea {
    font-size: 16px;
  }

  .field input,
  .field select,
  .field textarea,
  .filter-bar select,
  .inline-form select,
  .manage-bus .field input,
  .manage-bus .field select,
  .admin-tools .field input,
  .admin-tools .field select {
    font-size: 16px;
  }

  .field input,
  .field select,
  .field textarea,
  .filter-bar select,
  .inline-form select,
  .manage-bus .field input,
  .manage-bus .field select,
  .admin-tools .field input,
  .admin-tools .field select {
    min-height: 48px;
  }

  button,
  .button,
  .button-small,
  .filter-bar button,
  .text-button,
  .icon-button,
  .transport-bus-button,
  .transport-more-buses > summary,
  .manage-bus .button.button-small,
  .filter-bar .button,
  .admin-tools .button {
    min-height: 44px;
  }

  .table-wrap .text-button,
  .table-wrap .icon-button {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 8px;
  }

  .site-footer a,
  .event-footer a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
  }

  .site-header {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 16px;
  }

  .site-header .brand {
    justify-content: flex-start;
  }

  .site-header .brand-logo {
    width: min(190px, calc(100vw - 96px));
    height: 52px;
  }

  .site-header nav {
    width: auto;
    justify-content: stretch;
  }

  .page-shell {
    padding: 0 16px 42px;
  }

  .home-page .page-shell,
  .bus-page .page-shell {
    padding-right: 0;
    padding-left: 0;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .dash-head {
    align-items: flex-start;
  }

  .dash-actions {
    flex-wrap: wrap;
  }

  .filter-bar > *,
  .extra-filters > * {
    min-width: 0;
  }

  .settings-form,
  .manage-bus-fields,
  .extra-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-form .span-2 {
    grid-column: 1 / -1;
  }

  .manifest-shortcut,
  .quick-edit {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .manifest-shortcut .field,
  .quick-edit .field {
    width: 100%;
  }

  .scanner-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .token-form {
    width: 100%;
  }

  .admin-page .login-wrap {
    width: 100%;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    margin: 24px auto;
    overflow: hidden;
    border-radius: 18px;
    animation: none;
    transform: none;
  }

  .admin-page .login-intro {
    width: auto;
    min-width: 0;
    justify-self: stretch;
    min-height: 270px;
    padding: 26px 18px;
    animation: none;
    transform: none;
  }

  .admin-page .login-form {
    width: 100%;
    min-width: 0;
    min-height: 0;
    padding: 28px 22px;
    border-radius: 0;
    animation: none;
    transform: none;
  }

  .admin-page .login-scene {
    width: 100%;
    max-width: 100%;
    animation: none;
    transform: none;
  }

  .confirmation-wrap {
    width: 100%;
    margin: 24px auto;
  }

  .confirmation-card {
    padding: 26px 22px;
  }

  .confirm-top {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 14px;
  }

  .home-page .transport-spotlight,
  .home-page .testimony-layout {
    padding-right: 16px;
    padding-left: 16px;
  }

  .event-footer {
    gap: 28px 20px;
    padding: 38px 20px 22px;
  }

  .site-footer {
    padding: 20px 16px;
  }
}

@media (max-width: 520px) {
  .admin-page .login-form h1 {
    font-size: 1.75rem;
    line-height: 1.1;
    overflow-wrap: anywhere;
  }

  .site-header nav {
    gap: 0;
  }

  .page-shell {
    padding-right: 14px;
    padding-left: 14px;
  }

  .home-page .page-shell,
  .bus-page .page-shell {
    padding-right: 0;
    padding-left: 0;
  }

  .stat-grid,
  .form-grid,
  .settings-form,
  .manage-bus-fields,
  .extra-filters,
  .confirm-details,
  .event-footer {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-grid .span-2,
  .settings-form .span-2 {
    grid-column: auto;
  }

  .registration-form {
    padding-right: 16px;
    padding-left: 16px;
  }

  .form-submit {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .form-submit .button {
    width: 100%;
  }

  .settings-form {
    padding: 20px 16px;
  }

  .admin-tools {
    padding: 18px 14px;
  }

  .selection-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .confirmation-card {
    padding: 22px 16px;
  }

  .confirm-person {
    align-items: flex-start;
    gap: 14px;
  }

  .confirm-person img {
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
  }

  .confirm-sms {
    padding: 16px 14px;
  }

  .event-meta,
  .event-tags,
  .event-countdown,
  .ticket-countdown {
    flex-wrap: wrap;
  }

  .event-venue {
    width: auto;
    max-width: calc(100% - 32px);
    height: auto;
    padding: 14px 16px;
  }

  .event-footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media print {
  body {
    padding-top: 0;
  }
}

@page confirmationReceipt {
  size: A4;
  margin: 0;
}

@media print {
  body.confirmation-page {
    background: #fff;
    page: confirmationReceipt;
  }

  .confirmation-page .site-header,
  .confirmation-page .site-footer,
  .confirmation-page .notice,
  .confirmation-page .confirm-actions {
    display: none !important;
  }

  .confirmation-page .page-shell {
    min-height: 0;
    padding: 0;
  }

  .confirmation-page .confirmation-wrap {
    width: 100%;
    max-width: 190mm;
    margin: 0 auto;
  }

  .confirmation-page .confirmation-card {
    padding: 10mm;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .confirmation-page .confirm-top {
    padding-bottom: 5mm;
  }

  .confirmation-page .confirm-top h1 {
    font-size: 24px;
  }

  .confirmation-page .confirm-person {
    padding: 5mm 0;
  }

  .confirmation-page .confirm-details {
    gap: 4mm 8mm;
    padding: 5mm 0;
  }

  .confirmation-page .confirm-sms pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 10px;
  }

  .confirmation-page .qr-area {
    gap: 5mm;
    padding: 4mm 0 0;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .confirmation-page .qr-area > div {
    width: 32mm;
    height: 32mm;
    flex: 0 0 32mm;
  }

  .confirmation-page .qr-area img,
  .confirmation-page .qr-area canvas {
    width: 32mm !important;
    height: 32mm !important;
  }
}

.notice.success {
  color: #155c2b;
  background: #e2f5e7;
  border-left: 4px solid #22863a;
  font-size: 15px;
  font-weight: 800;
}

.checkin-result {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  margin: 18px 0;
  padding: 20px;
  border: 1px solid #b7dfc0;
  border-left: 5px solid #22863a;
  background: #fff;
}

.checkin-result > img {
  width: 96px;
  height: 120px;
  border-radius: 6px;
  object-fit: cover;
}

.checkin-person-info .eyebrow {
  margin: 0 0 5px;
  color: #22863a;
}

.checkin-person-info h2 {
  margin: 0 0 12px;
  color: #16372c;
  font: 800 22px Manrope, sans-serif;
}

.checkin-person-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 16px;
}

.checkin-person-facts > div {
  min-width: 0;
}

.checkin-person-facts span,
.checkin-person-facts strong {
  display: block;
  overflow-wrap: anywhere;
}

.checkin-person-facts span {
  margin-bottom: 3px;
  color: #68736b;
  font-size: 9px;
  font-weight: 700;
}

.checkin-person-facts strong {
  color: #202923;
  font-size: 12px;
}

@media (max-width: 560px) {
  .checkin-result {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  .checkin-result > img {
    width: 68px;
    height: 88px;
  }

  .checkin-person-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 12px;
  }
}
