:root {
  --ink: #00294b;
  --muted: #566b80;
  --green: #2563eb;
  --lime: #22c55e;
  --cream: #f8fafc;
  --line: #dde6f0;
  --white: #fff;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --transition-fast: 150ms var(--ease);
  --transition: 250ms var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition: 0ms;
  }
  *, *::before, *::after {
    animation-duration: 0ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0ms !important;
    scroll-behavior: auto !important;
  }
}
@keyframes fade-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-scale {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  min-height: 100vh;
}
body.has-kiosk-background {
  background-image: linear-gradient(rgba(243, 247, 250, var(--background-tint)), rgba(243, 247, 250, var(--background-tint))), var(--kiosk-background);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}
.has-kiosk-background .page {
  background: transparent;
}
h1,
h2,
strong,
.brand {
  font-family: Manrope, sans-serif;
}
.topbar {
  height: 86px;
  padding: 0 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(243, 247, 250, 0.94);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.brand img {
  display: block;
  width: auto;
  max-width: 170px;
  max-height: 42px;
  height: auto;
}
.company-logos { gap: 20px; }
.org-name-fallback {
  font-weight: 700;
  color: var(--ink);
}
.topbar-right {
  font-size: 13px;
  color: var(--muted);
}
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 3px #7ee82f28;
  margin-right: 8px;
}
.page {
  min-height: calc(100vh - 126px);
}
footer {
  height: 40px;
  padding: 0 5vw;
  color: #718498;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.home-page {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
}
.kiosk-home .topbar,
.kiosk-home > footer {
  display: none;
}
.production-style-home {
  display: block;
  min-height: 100vh;
}
.kiosk-welcome {
  min-height: 100vh;
  padding: 48px 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  animation: fade-rise 500ms var(--ease) both;
}
.welcome-logos {
  width: min(760px, 90vw);
  min-height: 92px;
  margin-bottom: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 5vw, 58px);
}
.welcome-logos img {
  width: auto;
  max-width: 220px;
  max-height: 82px;
  object-fit: contain;
}
.welcome-logos .org-name-fallback {
  font-size: 22px;
}
.welcome-label {
  color: var(--green);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.7px;
  text-transform: uppercase;
  margin: 0 0 12px;
}
.kiosk-welcome h1 {
  color: var(--ink);
  font-size: clamp(44px, 6vw, 70px);
  letter-spacing: -2.8px;
  line-height: 1.05;
  margin: 0 0 16px;
}
.welcome-copy {
  color: var(--muted);
  font-size: 20px;
  margin: 0 0 48px;
}
.kiosk-actions {
  width: min(680px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.kiosk-action {
  min-height: 230px;
  padding: 38px 24px;
  border: 1px solid #00294b10;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  box-shadow: 0 20px 60px -15px #00294b40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition);
}
.kiosk-action:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 65px -15px #00294b52;
}
.kiosk-action.primary {
  background: var(--green);
  color: white;
}
.kiosk-icon {
  font-size: 56px;
  line-height: 1;
}
.kiosk-action strong {
  font-size: 25px;
}
.staff-link {
  margin-top: 38px;
  font-size: 14px;
  text-decoration: none;
}
.button.secondary.staff-link {
  color: var(--ink);
}
.staff-link:hover {
  text-decoration: underline;
}
.hero {
  padding: 9vh 8vw 7vh;
}
.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.8px;
  color: var(--green);
}
.hero .eyebrow span {
  display: inline-block;
  width: 28px;
  height: 2px;
  background: var(--lime);
  vertical-align: middle;
  margin-right: 10px;
}
.hero h1 {
  font-size: clamp(48px, 6vw, 84px);
  line-height: 0.98;
  letter-spacing: -4px;
  margin: 26px 0;
  color: var(--ink);
}
.hero > p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
  max-width: 570px;
}
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 50px;
}
.action-card {
  min-height: 155px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 26px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 17px;
  text-decoration: none;
  color: var(--ink);
  transition: 0.2s;
}
.action-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px #00294b1c;
}
.action-card.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.action-icon {
  font-size: 24px;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #eaf5fc;
  display: grid;
  place-items: center;
  color: var(--green);
}
.primary .action-icon {
  background: #ffffff20;
  color: var(--lime);
}
.action-card strong,
.action-card small {
  display: block;
}
.action-card strong {
  font-size: 20px;
  margin-bottom: 6px;
}
.action-card small {
  opacity: 0.72;
}
.action-card b {
  font-size: 24px;
}
.visual-panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #00294b, #0787d9);
  margin: 24px 24px 24px 0;
  border-radius: 28px;
  min-height: 600px;
}
.visual-copy {
  position: absolute;
  z-index: 2;
  left: 50px;
  bottom: 55px;
  color: white;
}
.visual-copy span {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--lime);
}
.visual-copy h2 {
  font-size: 38px;
  line-height: 1.12;
  margin: 14px 0;
}
.grid-art {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(#ffffff17 1px, transparent 1px),
    linear-gradient(90deg, #ffffff17 1px, transparent 1px);
  background-size: 44px 44px;
  transform: perspective(500px) rotateX(55deg) scale(1.6);
  transform-origin: center bottom;
}
.grid-art:after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  border: 2px solid var(--lime);
  border-radius: 50%;
  left: 30%;
  top: 25%;
  box-shadow: 0 0 90px #7ee82f66;
}
.form-shell {
  max-width: 1050px;
  margin: 0 auto;
  padding: 45px 28px 70px;
}
.form-shell.narrow {
  max-width: 820px;
}
.back {
  color: var(--green);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.form-heading {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin: 35px 0;
}
.form-heading h1,
.admin-head h1 {
  font-size: 38px;
  letter-spacing: -1.5px;
  margin: 0 0 7px;
}
.form-heading p,
.admin-head p {
  margin: 0;
  color: var(--muted);
}
.step {
  width: 42px;
  height: 42px;
  border: 1px solid var(--green);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--green);
  font-weight: 700;
  font-size: 12px;
}
.visitor-form,
.login-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px;
  animation: fade-scale 400ms var(--ease) both;
}
.fields.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.company-picker { border: 0; padding: 0; margin: 0 0 22px; }
.company-picker legend { font-weight: 600; font-size: 13px; margin-bottom: 9px; }
.company-picker legend em { color: #b44; font-style: normal; }
.company-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 220px)); justify-content: center; gap: 12px; }
.company-options label { margin: 0; cursor: pointer; }
.company-options input { position: absolute; opacity: 0; pointer-events: none; }
.company-options span { min-height: 82px; padding: 10px; border: 1px solid #cbd9e3; border-radius: 12px; background: #f9fbfc; display: flex; align-items: center; justify-content: center; gap: 10px; text-align: center; transition: border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast); }
.company-options img { width: auto; max-width: 110px; max-height: 42px; object-fit: contain; }
.company-options b { font-weight: 600; }
.company-options input:checked + span { border-color: var(--green); background: #eaf5fc; box-shadow: 0 0 0 3px #2563eb18; }
.company-options input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }
label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 22px;
}
label em {
  color: #b44;
  font-style: normal;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  margin-top: 9px;
  border: 1px solid #cbd9e3;
  background: #f9fbfc;
  border-radius: 11px;
  padding: 15px 16px;
  font: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px #2563eb18;
}
textarea {
  resize: vertical;
  min-height: 95px;
}
.capture-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin: 10px 0 22px;
}
.capture-box {
  border: 1px dashed #b4c8d7;
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.capture-box strong,
.capture-box small {
  display: block;
}
.capture-box small {
  color: var(--muted);
  margin-top: 3px;
}
.capture-box video,
.capture-box #photo-canvas {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 1;
  height: auto;
  object-fit: cover;
  border-radius: 10px;
  align-self: center;
}
.signature {
  width: 100%;
  height: 150px;
  border-radius: 10px;
  background: #f7fafc;
  border: 1px solid var(--line);
  touch-action: none;
}
.consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.5;
}
.consent input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
}
.sms-confirmation {
  color: #167044;
  font-weight: 600;
}
.sms-notice {
  color: #8a5a00;
  font-weight: 600;
}
.button {
  border: 0;
  border-radius: 11px;
  padding: 14px 20px;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 25px;
  font: 600 14px "DM Sans";
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast), opacity var(--transition-fast);
}
.button:hover {
  transform: translateY(-1px);
}
.button:active {
  transform: translateY(0);
}
.button:disabled {
  opacity: 0.65;
  cursor: default;
  transform: none;
}
.button.primary {
  background: var(--green);
  color: white;
}
.button.primary:hover {
  box-shadow: 0 10px 24px -8px #2563eb66;
}
.button.secondary {
  background: #e7f4fc;
  color: var(--green);
}
.button.secondary:hover {
  background: #d9edfb;
}
.button.ghost {
  background: transparent;
  color: var(--muted);
}
.button.ghost:hover {
  background: #edf1f4;
}
.button.wide {
  width: 100%;
  font-size: 16px;
  padding: 18px;
}
.text-button {
  border: 0;
  background: none;
  color: var(--green);
  padding: 0;
  text-align: left;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}
.text-button:hover {
  opacity: 0.7;
}
.search-form {
  display: flex;
  gap: 12px;
  background: white;
  padding: 25px;
  border-radius: 20px;
  border: 1px solid var(--line);
}
.search-form input {
  margin: 0;
}
.matches {
  margin-top: 18px;
}
.match {
  background: white;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.match strong,
.match span {
  display: block;
}
.match span {
  font-size: 13px;
  color: var(--muted);
  margin-top: 5px;
}
.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}
.result-card,
.login-card {
  max-width: 600px;
  margin: 8vh auto;
  text-align: center;
}
.result-card {
  padding: 50px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 28px;
  animation: fade-scale 400ms var(--ease) both;
}
.result-icon {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--lime);
  color: var(--ink);
  font-size: 34px;
  margin: 0 auto 24px;
}
.result-card h1 {
  font-size: 38px;
  margin: 14px 0;
}
.result-card p {
  color: var(--muted);
  line-height: 1.6;
}
.ticket {
  display: grid;
  grid-template-columns: 1fr 1fr;
  text-align: left;
  background: #f1f6f9;
  padding: 18px;
  border-radius: 12px;
  margin: 25px 0;
}
.ticket span {
  color: var(--muted);
  font-size: 12px;
}
.ticket strong {
  text-align: right;
}
.result-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.login-card {
  text-align: left;
}
.login-card h1 {
  font-size: 34px;
  margin-bottom: 5px;
}
.login-card > p {
  color: var(--muted);
  margin-bottom: 28px;
}
.login-card .back {
  display: block;
  text-align: center;
  margin-top: 22px;
}
.admin-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 55px 5vw;
}
.admin-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.admin-actions {
  display: flex;
  gap: 8px;
}
.admin-nav {
  display: flex;
  gap: 4px;
  margin: 28px 0 24px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.admin-nav a {
  padding: 10px 16px;
  border-radius: 9px 9px 0 0;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}
.admin-nav a:hover {
  color: var(--ink);
  background: #f7fafc;
}
.admin-nav a.active {
  color: var(--green);
  border-bottom-color: var(--green);
}
.settings-card.single {
  grid-template-columns: 1fr;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 35px 0;
}
.stats > div {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
}
.stats span,
.stats strong {
  display: block;
}
.stats span {
  color: var(--muted);
  font-size: 13px;
}
.stats strong {
  font-size: 36px;
  margin-top: 8px;
}
.settings-card {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(320px, 1.2fr);
  gap: 36px;
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 24px;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.settings-card:hover {
  box-shadow: 0 12px 32px -18px #00294b30;
  border-color: #c7d5e0;
}
.settings-card h2 {
  margin: 6px 0;
}
.settings-card p,
.colour-form small {
  color: var(--muted);
}
.background-preview {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
  margin-bottom: 16px;
}
.background-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.background-form label {
  margin: 0;
}
.background-form input[type="file"] {
  background: transparent;
  padding: 10px 0;
  border: 0;
}
.background-form input[type="range"] {
  padding: 0;
}
.background-form small {
  color: var(--muted);
}
.background-form .button {
  align-self: flex-start;
}
.background-form + .back {
  display: inline-block;
  margin-top: 14px;
}
.text-button.danger {
  color: #a83232;
  margin-top: 14px;
}
.admin-list {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
}
.admin-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  transition: background-color var(--transition-fast);
  animation: fade-rise 300ms var(--ease) both;
  animation-delay: calc(var(--stagger-index, 0) * 40ms);
}
.admin-list li:hover {
  background-color: #f7fafc;
}
.admin-list li:last-child {
  border-bottom: 0;
}
.admin-list form {
  margin-left: auto;
}
.admin-list .text-button {
  margin: 0;
}
.reset-password-form {
  display: flex;
  align-items: center;
  gap: 8px;
}
.reset-password-form input {
  width: 140px;
  margin: 0;
  padding: 8px 10px;
}
.org-list-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
  background: #f9fbfc;
  border: 1px solid var(--line);
}
.host-list li {
  flex-wrap: wrap;
}
.host-list .host-edit-form {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 0;
  margin-left: 0;
}
.host-list .host-edit-form input {
  margin: 0;
  padding: 8px 10px;
  width: auto;
  flex: 1;
  min-width: 0;
}
.colour-form label {
  margin-bottom: 8px;
}
.colour-control {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 10px;
  align-items: center;
}
.colour-control input {
  margin: 0;
}
.colour-control input[type="color"] {
  height: 48px;
  padding: 4px;
  cursor: pointer;
}
.colour-form small {
  display: block;
  margin-top: 8px;
}
.table-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  text-align: left;
  padding: 17px 20px;
  border-bottom: 1px solid #eaf0f4;
  font-size: 14px;
}
tbody tr {
  transition: background-color var(--transition-fast);
}
tbody tr:hover {
  background-color: #f7fafc;
}
th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  background: #f7fafc;
}
td strong,
td small {
  display: block;
}
td small {
  color: var(--muted);
  margin-top: 4px;
}
.pill {
  background: #edf1f4;
  border-radius: 20px;
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
}
.pill.active {
  background: #e7fbd9;
  color: #356c14;
}
.alert {
  max-width: 900px;
  margin: 18px auto -20px;
  padding: 13px 18px;
  border-radius: 10px;
}
.alert.error {
  background: #fee9e5;
  color: #8c3026;
}
.alert.success {
  background: #e7fbd9;
  color: #356c14;
}
@media (max-width: 850px) {
  .home-page {
    display: block;
  }
  .visual-panel {
    display: none;
  }
  .hero {
    padding: 8vh 7vw;
  }
  .action-grid,
  .fields.two,
  .capture-grid {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: 52px;
  }
  .topbar-right {
    display: none;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .kiosk-actions {
    max-width: 560px;
  }
  .admin-head {
    display: block;
  }
  .settings-card {
    grid-template-columns: 1fr;
  }
  .admin-actions {
    margin-top: 20px;
  }
  th:nth-child(3),
  td:nth-child(3) {
    display: none;
  }
}
@media (max-width: 520px) {
  .kiosk-welcome {
    padding: 32px 18px 22px;
  }
  .welcome-logo {
    margin-bottom: 22px;
  }
  .kiosk-welcome h1 {
    font-size: 42px;
  }
  .welcome-copy {
    font-size: 17px;
    margin-bottom: 28px;
  }
  .kiosk-actions {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .kiosk-action {
    min-height: 150px;
    padding: 24px;
  }
  .kiosk-icon {
    font-size: 38px;
  }
  .action-grid {
    grid-template-columns: 1fr;
  }
  .hero {
    padding-top: 6vh;
  }
  .hero h1 {
    font-size: 44px;
    letter-spacing: -2px;
  }
  .form-shell {
    padding: 30px 16px;
  }
  .visitor-form {
    padding: 20px;
  }
  .search-form {
    display: block;
  }
  .search-form .button {
    width: 100%;
    margin-top: 10px;
  }
  .colour-control {
    grid-template-columns: 52px 1fr;
  }
  .colour-control .button {
    grid-column: 1 / -1;
  }
}

/* One-screen tablet check-in kiosk */
@media (min-width: 700px) and (max-width: 1400px) {
  body:has(.checkin-page) { overflow-x: hidden; overflow-y: auto; }
  body:has(.checkin-page) .topbar { height: 68px; }
  body:has(.checkin-page) .brand img { width: auto; max-width: 145px; max-height: 34px; }
  body:has(.checkin-page) footer { display: none; }
  .checkin-page { min-height: calc(100vh - 68px); overflow: visible; }
  .checkin-page .form-shell { width: 100%; max-width: none; min-height: calc(100vh - 68px); padding: 12px clamp(24px, 4vw, 64px) 24px; display: flex; flex-direction: column; }
  .checkin-page .back { font-size: 12px; }
  .checkin-page .form-heading { margin: 8px 0 10px; gap: 12px; align-items: center; }
  .checkin-page .form-heading h1 { font-size: 25px; letter-spacing: -.8px; margin: 0; }
  .checkin-page .form-heading p { font-size: 12px; }
  .checkin-page .step { width: 32px; height: 32px; }
  .checkin-page .visitor-form { padding: 15px 18px; border-radius: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 15px; min-height: 0; }
  .checkin-page .fields.two { display: contents; }
  .checkin-page .company-picker { grid-column: 1 / -1; margin: 0; }
  .checkin-page .company-picker legend { font-size: 11px; margin-bottom: 5px; }
  .checkin-page .company-options span { min-height: 48px; padding: 5px 9px; }
  .checkin-page .company-options img { max-height: 30px; }
  .checkin-page label { margin: 0; font-size: 11px; }
  .checkin-page input, .checkin-page select, .checkin-page textarea { margin-top: 5px; padding: 9px 11px; border-radius: 8px; font-size: 12px; }
  .checkin-page textarea { min-height: 59px; height: 59px; }
  .checkin-page .visitor-form > label:nth-of-type(1) { grid-column: 1 / -1; }
  .checkin-page .capture-grid { grid-column: 1 / -1; margin: 0; gap: 15px; }
  .checkin-page .capture-box { padding: 10px 12px; gap: 7px; border-radius: 12px; display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .checkin-page .capture-box > div { grid-column: 1; }
  .checkin-page .capture-box .button, .checkin-page .capture-box .text-button { grid-column: 2; grid-row: 1; }
  .checkin-page .capture-box video, .checkin-page .capture-box #photo-canvas, .checkin-page .signature { grid-column: 1 / -1; }
  .checkin-page .photo-capture video, .checkin-page .photo-capture #photo-canvas { width: 190px; height: 190px; justify-self: center; }
  .checkin-page .signature { height: 92px; }
  .checkin-page .capture-box small { font-size: 10px; }
  .checkin-page .capture-box .button { padding: 8px 12px; font-size: 11px; }
  .checkin-page .consent { grid-column: 1; align-self: center; font-size: 11px; line-height: 1.3; }
  .checkin-page .sms-consent { grid-column: 2; }
  .checkin-page .consent input { width: 17px; height: 17px; flex: none; }
  .checkin-page .visitor-form > .button.wide { grid-column: 1 / -1; width: 100%; padding: 11px 18px; font-size: 13px; }
  .checkin-page .alert { position: fixed; z-index: 10; top: 6px; left: 50%; transform: translateX(-50%); margin: 0; box-shadow: 0 5px 20px #00294b24; }
}

@media (min-width: 700px) and (max-width: 850px) {
  .checkin-page .visitor-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .checkin-page .fields.two { display: contents; }
  .checkin-page .visitor-form > label:nth-of-type(1) { grid-column: 1 / -1; }
  .checkin-page .capture-grid { grid-template-columns: 1fr 1fr; }
  .checkin-page .consent { grid-column: 1; }
  .checkin-page .sms-consent { grid-column: 2; }
  .checkin-page .visitor-form > .button.wide { grid-column: 1 / -1; }
  .checkin-page .form-heading p { display: none; }
  .checkin-page .company-options { gap: 8px; }
  .checkin-page .company-options img { max-width: 95px; }
}

@media (min-width: 700px) and (max-height: 700px) {
  .checkin-page .form-shell { display: block; }
  .checkin-page .photo-capture video,
  .checkin-page .photo-capture #photo-canvas { width: 140px; height: 140px; }
  .checkin-page .signature { height: 78px; }
}

/* Comfortable sizing for full-height tablets (iPad and similar). */
@media (min-width: 700px) and (max-width: 1400px) {
  body:has(.checkin-page) .topbar { height: 78px; }
  body:has(.checkin-page) .brand img { max-width: 160px; max-height: 40px; }
  .checkin-page { min-height: calc(100vh - 78px); }
  .checkin-page .form-shell {
    width: 100%;
    max-width: none;
    min-height: calc(100vh - 78px);
    padding: 22px clamp(28px, 4vw, 56px) 34px;
  }
  .checkin-page .back { font-size: 14px; }
  .checkin-page .form-heading { margin: 15px 0 18px; gap: 16px; }
  .checkin-page .form-heading h1 { font-size: 32px; }
  .checkin-page .form-heading p { display: block; font-size: 14px; }
  .checkin-page .step { width: 40px; height: 40px; }
  .checkin-page .visitor-form { padding: 28px; gap: 20px 22px; }
  .checkin-page label,
  .checkin-page .company-picker legend { font-size: 15px; }
  .checkin-page input,
  .checkin-page select,
  .checkin-page textarea { margin-top: 9px; padding: 15px 16px; font-size: 16px; }
  .checkin-page textarea { min-height: 92px; height: 92px; }
  .checkin-page .company-options { gap: 14px; }
  .checkin-page .company-options span { min-height: 88px; padding: 12px 16px; }
  .checkin-page .company-options img { max-width: 150px; max-height: 48px; }
  .checkin-page .capture-grid { gap: 20px; }
  .checkin-page .capture-box { padding: 15px 16px; gap: 10px; }
  .checkin-page .capture-box strong { font-size: 16px; }
  .checkin-page .capture-box small { font-size: 14px; }
  .checkin-page .signature { height: 140px; }
  .checkin-page .consent { font-size: 15px; }
  .checkin-page .visitor-form > .button.wide { padding: 17px 24px; font-size: 17px; }
}

@media (max-width: 699px) {
  .fields.two, .capture-grid { grid-template-columns: 1fr; }
  .company-options { grid-template-columns: 1fr; }
  .company-options span { min-height: 64px; }
  .topbar .company-logos img { max-width: 90px; max-height: 32px; }
  .topbar .company-logos { gap: 8px; }
  .welcome-logos { flex-wrap: wrap; }
}

.badge-page {
  max-width: 420px;
  margin: 6vh auto;
  text-align: center;
}
.badge-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 20px 60px -15px #00294b30;
  animation: fade-scale 400ms var(--ease) both;
}
.badge-org img {
  max-width: 160px;
  max-height: 50px;
  object-fit: contain;
  margin: 0 auto 18px;
}
.badge-org strong {
  display: block;
  margin-bottom: 18px;
  font-size: 15px;
}
.badge-photo {
  width: 160px;
  height: 160px;
  margin: 0 auto 18px;
  border-radius: 16px;
  overflow: hidden;
  background: #f1f6f9;
  border: 1px solid var(--line);
}
.badge-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.badge-photo-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}
.badge-name {
  font-family: Manrope, sans-serif;
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 6px;
}
.badge-meta {
  display: flex;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.badge-host {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  font-size: 14px;
}
.badge-host small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}
.badge-ref {
  color: var(--muted);
  font-size: 12px;
  margin-top: 14px;
}
.badge-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
}

@media print {
  .topbar, footer, .badge-actions {
    display: none;
  }
  body {
    background: white;
  }
  .badge-page {
    margin: 0;
  }
  .badge-card {
    box-shadow: none;
    border: 1px solid #999;
  }
}

.searchable-select {
  position: relative;
}
.searchable-select-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: white;
  border: 1px solid var(--line);
  border-radius: 11px;
  max-height: 240px;
  overflow-y: auto;
  box-shadow: 0 12px 32px -12px #00294b30;
}
.searchable-select-list [role="option"] {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  transition: background-color var(--transition-fast);
}
.searchable-select-list [role="option"]:hover,
.searchable-select-list [role="option"][aria-selected="true"] {
  background: #eaf5fc;
  color: var(--green);
}
.searchable-select-empty {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 14px;
}
