:root {
    --cp-css: "v94";
  --cp-header-row: 54px;
  --cp-header-shift: 7px;
  --cp-header-shell: calc(env(safe-area-inset-top, 0px) + var(--cp-header-shift) + var(--cp-header-row));
  --bg: #f4efe8;
  --ink: #2b2140;
  --muted: #6d6478;
  --card: #fffdf9;
  --primary: #5c3d8a;
  --primary-2: #3f2a61;
  --accent: #d76b4c;
  --success: #2d6a4f;
  --warning: #9a6b12;
  --danger: #9b2226;
  --line: #e4d9cc;
  --shadow: 0 10px 30px rgba(43, 33, 64, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  background-color: #3f2a61;
  min-height: 100%;
}
body {
  font-family: "Segoe UI", "Avenir Next", system-ui, sans-serif;
  background-color: #3f2a61;
  color: var(--ink);
  min-height: 100vh;
  min-height: 100svh;
  line-height: 1.45;
}
body.admin-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  background-color: #3f2a61;
}
.admin-shell .page {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  background-color: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
h1, h2 { margin: 0 0 .6rem; line-height: 1.2; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.15rem; margin-top: 1.5rem; }

.shell-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  background: #3f2a61;
  background-color: #3f2a61;
  color: #fff;
  opacity: 1;
  filter: none;
  transform: none;
}
.admin-shell .shell-head .topbar {
  padding: 0;
  background: #3f2a61;
  background-color: #3f2a61;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  background: #3f2a61;
  background-color: #3f2a61;
  color: #fff;
  opacity: 1;
  filter: none;
  transform: none;
}
.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}
.brand,
.topbar-access,
.topbar-actions .linkish {
  color: #fff;
  opacity: 1;
  filter: none;
  transform: none;
  text-shadow: none;
}
.brand {
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  line-height: 20px;
}
.topbar-nav { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; }
.topbar-nav a, .linkish, .admin-nav a, .admin-nav .linkish {
  color: #f4e9ff;
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  padding: .35rem .15rem;
}
.admin-nav {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: nowrap;
}
.admin-nav a {
  padding: .4rem .55rem;
  border-radius: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.admin-nav a.is-active {
  background: rgba(255, 255, 255, .14);
}
.nav-label-short { display: none; }
.header-inscriptions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 .4rem;
  border-radius: 12px;
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
  flex: 0 0 auto;
  text-decoration: none;
}
.header-inscriptions.is-active { background: rgba(255, 255, 255, .18); }
@media (max-width: 359px) {
  .header-inscriptions .nav-label-full { display: none; }
  .header-inscriptions .nav-label-short { display: inline; }
}
.inline-confirm { margin-top: .35rem; }
.inline-confirm summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.inline-confirm summary::-webkit-details-marker { display: none; }
.inline-confirm form { margin-top: .45rem; }
.registration-actions { display: flex; flex-wrap: wrap; gap: .45rem; align-items: flex-start; }
.inscription-board { width: min(720px, 100%); margin-inline: auto; min-width: 0; }
.inscription-top { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: .6rem; }
.inscription-top h1 { margin: 0; min-width: 0; }
.inscription-top:has(.inscription-info[open]) h1 { padding-right: 52px; }
.inscription-subtitle { margin: .2rem 0 .35rem; }
.inscription-count { margin: 0 0 .75rem; font-weight: 700; }
.inscription-info summary {
  list-style: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  background: #efe7f8;
  cursor: pointer;
}
.inscription-info summary::-webkit-details-marker { display: none; }
.inscription-info[open] { grid-column: 1 / -1; grid-row: 2; margin-top: .55rem; }
.inscription-info[open] summary { position: absolute; top: 0; right: 0; }
.inscription-info-panel {
  margin: 0;
  padding: .75rem .9rem .75rem 1.35rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: .92rem;
}
.inscription-info-panel ul { margin: 0; }
.inscription-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .4rem;
  margin: 0 0 1rem;
}
.inscription-tabs a {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 999px;
  background: #efe7f8;
  color: var(--primary);
  font-weight: 700;
  padding: .4rem .55rem;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.inscription-tabs a.is-active { background: var(--primary); color: #fff; }
.inscription-list { display: grid; gap: .7rem; list-style: none; margin: 0; padding: 0; min-width: 0; }
.inscription-card {
  background: var(--card);
  border-radius: 16px;
  padding: .85rem;
  box-shadow: var(--shadow);
  min-width: 0;
}
.inscription-card-head { display: flex; align-items: flex-start; gap: .65rem; min-width: 0; }
.inscription-avatar {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #efe7f8;
  color: var(--primary);
}
.inscription-identity { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.inscription-identity strong { line-height: 1.25; }
.inscription-email { display: block; color: var(--muted); overflow-wrap: anywhere; }
.inscription-card .badge { flex: 0 0 auto; margin-top: .15rem; }
.badge-blocked { background: #f4d6d7; color: var(--danger); }
.badge-refused { background: #fff3d6; color: #7a4b00; }
.inscription-when { margin: .55rem 0 0; color: var(--muted); font-size: .88rem; }
.inscription-actions { display: grid; grid-template-columns: 1fr; gap: .45rem; margin-top: .75rem; }
.inscription-actions .inline-confirm { margin: 0; min-width: 0; }
.inscription-actions .inline-confirm summary,
.inscription-actions .btn { width: 100%; }
.inscription-actions .inline-confirm form p { margin: .35rem 0; }
.inscription-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .45rem;
  text-align: center;
  background: var(--card);
  border-radius: 16px;
  padding: 1.4rem 1rem;
  color: var(--muted);
}
.inscription-empty svg { color: var(--primary); }
.blocked-toolbar { margin: 0 0 .75rem; }
.blocked-select-tools { display: grid; gap: .45rem; }
.blocked-select-count { margin: 0; font-weight: 700; }
.blocked-select-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.blocked-select-actions .btn { flex: 1 1 8rem; }
.blocked-select-scope { margin: 0; font-size: .88rem; }
.blocked-toolbar [hidden],
.blocked-select-actions [hidden],
.blocked-delete-bar[hidden] { display: none !important; }
.inscription-board.is-selecting [data-blocked-card] { touch-action: pan-y; }
.blocked-check {
  display: none;
  align-items: center;
  gap: .4rem;
  min-height: 44px;
  margin-bottom: .35rem;
  color: var(--primary);
  font-weight: 700;
}
.inscription-board.is-selecting .blocked-check { display: inline-flex; }
.blocked-check input { width: 1.35rem; height: 1.35rem; accent-color: var(--primary); }
.blocked-mark {
  display: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}
.inscription-card.is-selected {
  outline: 3px solid var(--primary);
  outline-offset: 0;
}
.inscription-card.is-selected .blocked-mark { display: inline-flex; }
.blocked-delete-bar {
  position: fixed;
  z-index: 14;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 1.2rem));
  bottom: .75rem;
  display: flex;
  padding: .55rem;
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.blocked-delete-bar .btn { width: 100%; }
.inscription-board.is-selecting { padding-bottom: 4.8rem; }
.blocked-delete-dialog {
  width: min(440px, calc(100% - 1.5rem));
  border: 0;
  border-radius: 16px;
  padding: 1rem;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.blocked-delete-dialog h2 { margin: 0 0 .4rem; font-size: 1.15rem; }
.blocked-dialog-actions { display: grid; gap: .45rem; }
.card-manage-actions { display: grid; gap: .6rem; margin-top: .9rem; }
.card-action-dialog {
  width: min(32rem, calc(100vw - 1.25rem));
  max-width: calc(100vw - 1.25rem);
  max-height: min(92vh, 44rem);
  max-height: min(92svh, 44rem);
  overflow: auto;
  overflow-x: hidden;
  border: 0;
  border-radius: 16px;
  padding: 1rem;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.card-action-dialog::backdrop { background: rgba(43, 33, 64, .45); }
.card-action-dialog h2,
.card-action-dialog h3 { margin-top: 0; }
.card-action-dialog input,
.card-action-dialog textarea,
.card-action-dialog select { width: 100%; max-width: 100%; }
.card-action-dialog .file-dl,
.card-action-dialog p { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .card-action-dialog {
    width: calc(100vw - 1rem);
    max-height: calc(100vh - 1.5rem);
    max-height: calc(100svh - 1.5rem);
    padding: .85rem;
  }
}
@media (max-width: 739px) {
  .blocked-delete-bar { bottom: calc(7.2rem + env(safe-area-inset-bottom)); }
  .inscription-board.is-selecting { padding-bottom: 5.2rem; }
}
@media (max-width: 359px) {
  .inscription-card-head { flex-wrap: wrap; }
  .inscription-card .badge { margin-left: 46px; }
}
@media (min-width: 480px) {
  .inscription-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .inscription-actions.single { grid-template-columns: minmax(0, 220px); }
}
.nav-scan {
  background: rgba(255, 255, 255, .18);
  font-weight: 800;
  padding: .45rem .9rem;
}
.nav-scan.is-active {
  background: #fff;
  color: var(--primary-2);
}
.nav-camera {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  margin: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(43, 33, 64, .3);
  padding: 0;
}
.nav-camera-icon { display: flex; }
.nav-camera-icon svg {
  width: 26px;
  height: 26px;
}
.nav-camera.is-active {
  background: #1f1630;
  box-shadow: 0 2px 8px rgba(20, 12, 32, .35);
}
.admin-nav-cluster { display: contents; }
.topbar-actions { display: none; }
body.platform-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  max-width: 100%;
  overflow-x: clip;
}
body.platform-shell .page {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  padding-bottom: calc(3rem + env(safe-area-inset-bottom, 0px));
}
.platform-topbar,
.platform-topbar .topbar-inner {
  max-width: 100%;
  min-width: 0;
}
.platform-topbar .topbar-actions {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
  margin-left: auto;
  min-width: 0;
}
.platform-menu-button {
  display: none;
  margin-left: auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0 .85rem;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.platform-page { width: min(460px, 100%); margin-inline: auto; min-width: 0; max-width: 100%; }
.platform-danger { margin-top: 20px; }
.platform-section { margin-top: 1.5rem; }
.platform-section h2 { margin-top: 0; }
.platform-url-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; min-width: 0; max-width: 100%; }
.platform-url { margin: 0; min-width: 0; max-width: 100%; overflow-wrap: anywhere; word-break: break-word; font-family: ui-monospace, Consolas, monospace; font-size: .92rem; }
.platform-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: .9rem 1rem;
  margin-top: .85rem;
  min-width: 0;
  max-width: 100%;
}
.platform-card h2 { margin: 0 0 .7rem; font-size: 1rem; }
.school-back { margin: 0 0 .35rem; }
.school-head { margin: 0 0 .2rem; min-width: 0; }
.school-head h1 { margin: 0; font-size: 1.45rem; min-width: 0; overflow-wrap: anywhere; }
.school-head-title { display: flex; align-items: center; justify-content: space-between; gap: .6rem; min-width: 0; }
.school-status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: .2rem .6rem;
  background: #e6f4ec;
  color: var(--success);
  font-size: .78rem;
  font-weight: 800;
}
.school-status.is-off { background: #f4d6d7; color: var(--danger); }
.school-created { margin: .35rem 0 0; font-size: .85rem; }
.platform-access-line { min-width: 0; max-width: 100%; margin: 0 0 .75rem; }
.platform-access-line p { margin: 0 0 .2rem; }
.platform-note { margin: .2rem 0 0; font-size: .85rem; }
.platform-summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin-top: .35rem;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
}
.platform-fold { min-width: 0; }
.platform-fold[open] .platform-summary { margin-bottom: .7rem; }
.platform-person strong, .platform-person span { display: block; overflow-wrap: anywhere; }
.platform-count { color: var(--muted); font-weight: 700; }
.platform-admin { padding: .65rem 0; border-top: 1px solid var(--line); min-width: 0; }
.platform-admin strong, .platform-admin span { display: block; overflow-wrap: anywhere; }
.platform-danger-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-top: .85rem; min-width: 0; }
.platform-danger-row p { margin: .15rem 0 0; }
.platform-danger-row .btn { flex: 0 0 auto; }
.platform-danger.platform-card { border-color: #f0c7c8; }
body.platform-shell input,
body.platform-shell textarea,
body.platform-shell select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
body.platform-shell .stack,
body.platform-shell label,
body.platform-shell .password-field { min-width: 0; max-width: 100%; }
.platform-handoff pre { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }
.platform-reset { margin-top: 20px; }
.platform-access { background: var(--card); border-radius: 16px; padding: 1rem; margin: 0 0 1.2rem; }
.platform-access h2 { margin-top: 0; }
.platform-handoff { margin-top: 16px; }
.platform-delete { margin-top: 20px; }
.platform-delete-panel { margin-top: 16px; }
.platform-board { width: min(820px, 100%); margin-inline: auto; }
.platform-stats { display: flex; gap: .6rem; flex-wrap: wrap; margin: 0 0 1rem; }
.platform-stat { background: var(--card); border-radius: 14px; padding: .7rem .9rem; min-width: 6.5rem; display: flex; flex-direction: column; }
.platform-stat span { color: var(--muted); font-size: .85rem; }
.platform-search { margin: 1rem 0; }
.admin-shell .brand { overflow: visible; text-overflow: clip; flex: 0 0 auto; }
.admin-shell .topbar,
.admin-shell .topbar-inner { max-width: 100%; min-width: 0; }
.admin-shell { overflow-x: clip; }
.admin-menu-button {
  margin-left: 0;
  min-width: 44px;
  min-height: 44px;
  padding: 0 .85rem;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.admin-shell .admin-menu[hidden] {
  display: none !important;
}
.admin-shell .admin-menu:not([hidden]) {
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 40;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: .2rem 16px .7rem;
  background: #3f2a61;
  box-shadow: 0 16px 28px rgba(20, 12, 32, .28);
}
.admin-menu a,
.admin-menu .linkish {
  color: #fff;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 .2rem;
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
}
.admin-shell .topbar-inner { flex-wrap: nowrap; }
@media (max-width: 739px) {
  .admin-shell .admin-own-password { display: none; }
  .platform-board .list li { flex-direction: column; align-items: stretch; }
}
.platform-page .stack > .btn { width: 100%; }
.platform-danger-row .btn { width: auto; min-height: 44px; }
.platform-page .list li > div { min-width: 0; }
@media (max-width: 739px) {
  .platform-topbar .topbar-inner { flex-wrap: wrap; align-items: center; }
  .platform-topbar .brand { overflow: visible; text-overflow: clip; flex: 0 1 auto; }
  .platform-menu-button { display: inline-flex; align-items: center; justify-content: center; }
  .platform-topbar .platform-nav {
    display: none;
    flex: 1 0 100%;
    flex-direction: column;
    align-items: stretch;
    margin: .35rem 0 0;
    padding-top: .35rem;
    border-top: 1px solid rgba(255, 255, 255, .18);
  }
  .platform-topbar.is-open .platform-nav { display: flex; }
  .platform-topbar .platform-nav .topbar-access,
  .platform-topbar .platform-nav .linkish { min-height: 44px; }
  .platform-page .list li { align-items: stretch; }
  .platform-page .list li .btn { flex: 0 0 auto; }
  .platform-danger-row { flex-direction: column; align-items: stretch; }
  .platform-danger-row .btn { width: 100%; }
}
@media (min-width: 740px) {
  .platform-topbar .topbar-actions { flex-wrap: nowrap; }
  .platform-menu-button { display: none; }
}
.topbar-access {
  color: #f4e9ff;
  font-weight: 600;
  padding: .45rem .4rem;
  border-radius: 10px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.topbar-access.is-active {
  background: rgba(255, 255, 255, .14);
}
.scanner-dock {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.scanner-dock-side {
  font-weight: 800;
  font-size: .88rem;
}
.scanner-dock-quit { margin-left: auto; }
form.admin-quit-mobile { display: none; }
.inline-form { display: inline; }
.logout-form { margin-top: 2rem; text-align: center; }
.logout-quiet {
  background: none;
  border: 0;
  padding: .4rem;
  font: inherit;
  font-size: .9rem;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: .2em;
}

.page {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 1rem max(.75rem, calc((100% - 820px) / 2)) 3rem;
  background-color: var(--bg);
}
.narrow { width: min(460px, 100%); margin-inline: auto; }
.stack { display: flex; flex-direction: column; gap: .85rem; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.row-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.center { text-align: center; }
.muted { color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; color: var(--muted); margin: 0 0 .3rem; }
.lead { font-size: 1.05rem; color: var(--muted); }
.hello { font-size: 1.15rem; font-weight: 700; margin: 0 0 .15rem; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.hidden { display: none !important; }

label { display: flex; flex-direction: column; gap: .35rem; font-weight: 600; }
input, textarea, select {
  font: inherit;
  padding: .85rem .9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  min-height: 52px;
}
textarea { min-height: 96px; }
.check { flex-direction: row; align-items: center; font-weight: 500; }
.check input { min-height: auto; width: 1.2rem; }
.choice-list {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .75rem 1rem 1rem;
  margin: 0;
}
.choice-list legend { font-weight: 700; padding: 0 .25rem; }
.visit-cancelled { opacity: .72; }
.code-input { letter-spacing: .35em; font-size: 1.4rem; text-align: center; }
.password-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: visible;
}
.password-field input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  min-height: 50px;
  margin: 0;
  border: 0;
  background: transparent;
  padding: .85rem .35rem .85rem .9rem;
  -webkit-appearance: none;
  appearance: none;
  z-index: 0;
}
.password-field:focus-within {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.password-field input:focus,
.password-field input:focus-visible {
  outline: none;
}
.password-field input::-webkit-credentials-auto-fill-button,
.password-field input::-webkit-contacts-auto-fill-button,
.password-field input::-ms-reveal,
.password-field input::-ms-clear {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
  width: 0;
  height: 0;
  margin: 0;
}
.password-toggle {
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin: 0 .15rem 0 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 10px;
  padding: 0;
  z-index: 2;
}
.password-toggle svg {
  width: 20px;
  height: 20px;
  display: block;
  flex: 0 0 auto;
}
.password-toggle .icon-hide { display: none; }
.password-field.is-revealed .icon-show { display: none; }
.password-field.is-revealed .icon-hide { display: block; }
.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--ink);
}
.field-error { color: var(--danger); font-size: .9rem; }

.btn, .btn:link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 52px;
  padding: .8rem 1.1rem;
  border-radius: 14px;
  border: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  color: #fff;
  background: var(--primary);
}
.btn-primary { background: var(--primary); }
.btn-secondary { background: #3d6b78; color: #fff; }
a.btn:link,
a.btn:visited,
a.btn:hover,
a.btn:active,
a.btn:focus {
  color: #fff;
  background: var(--primary);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
a.btn:focus:not(:focus-visible),
button.btn:focus:not(:focus-visible) {
  outline: none;
}
.btn-ghost, a.btn-ghost:link, a.btn-ghost:visited { background: transparent; color: var(--primary); border: 1px solid var(--line); }
.btn-danger-ghost, a.btn-danger-ghost:link { background: transparent; color: var(--danger); border: 1px solid #f0c7c8; }
.btn-danger, a.btn-danger:link {
  background: var(--danger);
  color: #fff;
  border: 1px solid var(--danger);
}
.btn-small,
.btn-compact {
  min-height: 44px;
  padding: .4rem .85rem;
  width: auto;
  border-radius: 12px;
  font-size: .92rem;
}
.badge-inactive {
  display: inline-block;
  margin-left: .4rem;
  padding: .1rem .5rem;
  border-radius: 999px;
  background: #f4d6d7;
  color: var(--danger);
  font-size: .75rem;
  font-weight: 800;
}
.danger-zone { border: 1px solid #f0c7c8; }
.danger-card { border: 1px solid #f0c7c8; }
.btn-block { width: 100%; }
.btn-xl { width: 100%; min-height: 64px; font-size: 1.15rem; margin: .4rem 0; }
.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.resend { margin: 1.4rem 0 1rem; }
.resend .muted { margin: 0 0 .55rem; }

.hero-card, .pass-card, .sheet {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
.stats article, .stat-card {
  background: var(--card);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: var(--shadow);
  color: inherit;
  display: block;
  min-height: 88px;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.stat-card:hover, .stat-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(43, 33, 64, 0.14);
  background: #fff;
}
.stat-card:active { transform: scale(.98); }
.stats strong { display: block; font-size: 1.7rem; }
.quick-actions { display: flex; flex-direction: column; gap: .65rem; margin: 1.1rem 0; }
.search-bar {
  display: block;
  margin: 1rem 0 .45rem;
  min-width: 0;
  max-width: 100%;
}
.search-bar input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.people-sort {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: .4rem 0 .75rem;
  min-width: 0;
  max-width: 100%;
}
.people-sort label {
  flex: 0 0 auto;
  font-size: .86rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.people-sort select {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .65rem; }
.list li, .timeline li {
  background: var(--card);
  border-radius: 16px;
  padding: .9rem 1rem;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
}
.list li > div, .timeline li { display: flex; flex-direction: column; align-items: flex-start; }
.list li { flex-direction: row; }
.timeline { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .65rem; }
.row-btn {
  width: 100%;
  background: none;
  border: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  padding: .2rem 0;
  cursor: pointer;
}

.banner { padding: .85rem 1rem; border-radius: 12px; margin-bottom: .9rem; }
.banner-success { background: #e6f4ec; color: var(--success); }
#confirmation { scroll-margin-top: .75rem; }
.banner-error { background: #fde8e8; color: var(--danger); }
.banner-warning { background: #fff4d6; color: var(--warning); }
.dev-note { background: #fff4d6; padding: .8rem 1rem; border-radius: 12px; }

.card-progress { margin: .4rem 0 1rem; }
.progress-label { font-size: 1.8rem; font-weight: 800; }
.dots { display: flex; gap: .4rem; flex-wrap: wrap; margin: .6rem 0; }
.dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: #ddd3c7; box-shadow: inset 0 0 0 2px #c9bbaa;
}
.dot.filled { background: var(--primary); box-shadow: none; }
.reward-text { color: var(--accent); font-weight: 700; }
.pill, .badge, .plan-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: .12rem .5rem;
  font-size: .75rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .01em;
  white-space: nowrap;
}
.pill {
  background: #efe7f8;
  color: var(--primary);
  margin-right: .3rem;
}
.badge-time { background: #efe7f8; color: var(--primary); }
.badge-present { background: #e6f4ec; color: var(--success); }
.badge-cancelled { background: #f4d6d7; color: var(--danger); }
.badge-free { background: #fff3d6; color: #7a4b00; }
.pay-paid { color: var(--success); font-weight: 700; }
.pay-unpaid { color: var(--danger); font-weight: 700; }
.pay-free { color: var(--accent); font-weight: 700; }

.qr-screen { text-align: center; }
.qr-frame, .qr-mini {
  background: #fff;
  border-radius: 20px;
  padding: 1rem;
  box-shadow: var(--shadow);
  margin: 1rem auto;
  width: fit-content;
}
.qr-frame img, .qr-mini img { display: block; width: min(72vw, 280px); height: auto; }

.scanner { display: flex; flex-direction: column; gap: .7rem; }
.scan-actions { display: flex; flex-direction: column; gap: .45rem; }
.course-picker {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
  min-height: 34px;
}
.course-picker-label {
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
  color: var(--ink);
}
.course-pill {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: .22rem .7rem;
  font: inherit;
  font-size: .8rem;
  font-weight: 800;
  min-height: 40px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.course-pill.is-active {
  background: var(--primary-2);
  color: #fff;
  border-color: var(--primary-2);
}
.course-picker.is-required {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 12px;
  padding: .2rem .25rem;
}
.course-live {
  color: #fff;
  font-size: .82rem;
  font-weight: 800;
  margin: 0 0 .4rem;
}
.scan-mismatch {
  font-weight: 800;
  margin: .15rem 0 .1rem;
}
.scanner-admin .scan-actions { margin: 0; }
.scanner-admin .btn-xl { margin: 0; }
.scanner-admin .stats { margin: 0; }
.scanner-head { background: var(--card); border-radius: 16px; padding: 1rem; box-shadow: var(--shadow); }
.present-count { font-size: 1.05rem; }
.reader-wrap {
  position: relative;
  background: #111;
  border-radius: 22px;
  padding: 0;
  overflow: hidden;
  height: calc(clamp(128px, 22vh, 168px) + .9rem);
}
.scan-stage {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.scan-stage .course-picker {
  justify-content: center;
  gap: .45rem;
}
.scan-stage .course-pill {
  min-width: 7.4rem;
  min-height: 42px;
  font-size: .92rem;
  box-shadow: var(--shadow);
}
.scan-hint {
  position: absolute;
  left: 50%;
  bottom: .55rem;
  transform: translateX(-50%);
  margin: 0;
  z-index: 2;
  background: rgba(20, 12, 32, .72);
  color: #fff;
  font-size: .82rem;
  font-weight: 700;
  border-radius: 999px;
  padding: .28rem .8rem;
  pointer-events: none;
  white-space: nowrap;
}
.scanner.is-live .stats { display: none; }
#reader {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #000;
  border-radius: inherit;
  overflow: hidden;
}
#scanVideo, #reader video {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  width: auto;
  height: auto;
  min-width: 100%;
  min-height: 100%;
  max-width: none;
  max-height: none;
  transform: translate(-50%, -50%);
  object-fit: cover;
  object-position: center;
  -webkit-object-fit: cover;
  background: transparent;
}
#scanCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}
.scan-reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: min(64%, 156px);
  aspect-ratio: 1;
  height: auto;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 40px);
  transform: translate(-50%, -50%);
  border: 2px solid rgba(90, 220, 130, .7);
  border-radius: 12px;
  pointer-events: none;
  box-sizing: border-box;
}
.scan-reticle.is-hit { box-shadow: 0 0 0 3px rgba(90, 220, 130, .45); }
.engine-error { color: #fff; text-align: center; font-weight: 700; margin: .6rem 0 .3rem; }
.flash {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem;
  padding: 1rem; border-radius: 14px; text-align: center; font-weight: 700;
  z-index: 20;
  white-space: pre-line;
}
.flash-success { background: var(--success); color: #fff; }
.flash-error { background: var(--danger); color: #fff; }
.flash-warning { background: #f0c14b; color: #3a2a00; }
.flash-quiet { background: var(--ink); color: #fff; }

body.scan-mode .topbar-nav a:not(.brand) { display: none; }

.stats-3 { grid-template-columns: 1fr 1fr 1fr; }
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1rem 0;
}
.filters select, .filters input { min-height: 48px; flex: 1; min-width: 140px; }
.plan-filters,
.status-filters {
  display: flex;
  gap: .3rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: .15rem 0 .45rem;
  padding: .05rem 0 .2rem;
}
.plan-filters::-webkit-scrollbar,
.status-filters::-webkit-scrollbar { display: none; }
.status-filters { flex-wrap: wrap; overflow-x: visible; }
.plan-filter,
.status-filter {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  gap: .28rem;
  min-height: 32px;
  padding: .28rem .7rem;
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  box-shadow: var(--shadow);
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}
.plan-filter span,
.status-filter span {
  font-size: .72rem;
  font-weight: 800;
  color: inherit;
  opacity: .72;
}
.plan-filter.is-active,
.status-filter.is-active {
  background: var(--primary);
  color: #fff;
}
.plan-filter.is-active span,
.status-filter.is-active span { opacity: .85; }
.origin-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: .05rem .45rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .01em;
  background: #efe7f8;
  color: var(--primary);
  white-space: nowrap;
}
.origin-newsale { background: #e8f6ee; color: var(--success); }
.origin-physicalconversion { background: #fff3d6; color: var(--warning); }
.origin-complimentary { background: #efe7f8; color: var(--primary); }
.origin-unknown { background: #eeeaf2; color: var(--muted); }
.origin-picker {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.origin-picker legend {
  font-weight: 800;
  padding: 0;
  margin-bottom: .15rem;
}
.origin-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 64px;
  margin: 0;
  padding: .85rem 1rem;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  box-sizing: border-box;
}
.origin-option input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.origin-mark {
  flex: 0 0 1.7rem;
  width: 1.7rem;
  height: 1.7rem;
  border: 2px solid #cbbfd8;
  border-radius: 8px;
  background: #fff;
  display: grid;
  place-items: center;
}
.origin-mark::before {
  content: "";
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
}
.origin-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}
.origin-option:has(input:checked),
.origin-option.is-selected {
  border-color: var(--primary);
  background: #efe7f8;
  color: var(--primary);
}
.origin-option:has(input:checked) .origin-mark,
.origin-option.is-selected .origin-mark {
  border-color: var(--primary);
  background: var(--primary);
}
.origin-option:has(input:checked) .origin-mark::before,
.origin-option.is-selected .origin-mark::before {
  content: "✓";
}
.origin-option:has(input:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.origin-purchase {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.origin-purchase.is-hidden { display: none; }
.capacity-heading { margin: .8rem 0 .35rem; font-weight: 800; }
.capacity-choice {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin: .2rem 0 .4rem;
}
.capacity-choice input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.capacity-switch {
  flex: 0 0 auto;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #d9d0e4;
  position: relative;
  margin-top: .15rem;
}
.capacity-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(43, 33, 64, .25);
}
.capacity-choice input:checked + .capacity-switch {
  background: var(--primary);
}
.capacity-choice input:checked + .capacity-switch::after {
  left: 23px;
}
.capacity-choice input:focus-visible + .capacity-switch {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.capacity-copy { display: flex; flex-direction: column; gap: .15rem; }
.capacity-copy strong { font-size: 1rem; }
.capacity-copy small { color: var(--muted); font-size: .85rem; line-height: 1.35; }
.course-fields.is-custom input {
  opacity: .55;
  background: #f3efe8;
}
.sales-summary {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .9rem 1rem 1rem;
  margin: .7rem 0 1rem;
}
.sales-summary h2 { margin: 0 0 .45rem; font-size: 1.05rem; }
.sales-summary h3 { margin: 0 0 .2rem; font-size: .92rem; }
.sales-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
}
.sales-grid article { min-width: 0; }
.sales-grid ul { list-style: none; padding: 0; margin: .25rem 0 0; font-size: .82rem; color: var(--muted); }
.sales-total { font-size: 1.25rem; font-weight: 800; margin: 0; }
.sales-custom,
.custom-period-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: .55rem;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: .2rem 0 .7rem;
}
.sales-custom label,
.custom-period-fields label,
.date-field {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.date-field-control {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 54px;
  box-sizing: border-box;
  overflow: hidden;
}
.date-field-face {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 54px;
  padding: 0 .9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  box-sizing: border-box;
  pointer-events: none;
}
.date-field-face::after {
  content: "▾";
  margin-left: auto;
  padding-left: .75rem;
  color: var(--muted);
  font-size: 1.05rem;
}
.date-field-control input[type="date"] {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: auto;
  height: auto;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  max-height: 100%;
  min-inline-size: 0;
  max-inline-size: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  overflow: hidden;
  box-sizing: border-box;
  cursor: pointer;
  font-size: 16px;
  -webkit-appearance: none;
  appearance: none;
}
.sales-custom .btn,
.sales-custom button[type="submit"],
.custom-period-fields .btn,
.custom-period-fields button[type="submit"] {
  grid-column: 1;
  width: 100%;
  max-width: 100%;
}
.acct-entry {
  margin: .75rem 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.acct-page,
.acct-period-form,
.acct-export {
  min-width: 0;
  max-width: 100%;
}
.acct-period-form { margin: 0 0 .7rem; }
.acct-period-label {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-weight: 700;
  margin: 0 0 .55rem;
}
.acct-period-label select {
  min-height: 44px;
  width: 100%;
  max-width: 22rem;
}
.acct-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .65rem .9rem;
  align-items: flex-start;
  margin-bottom: .35rem;
}
.acct-period { margin: 0; font-weight: 700; }
.acct-export { display: flex; flex-wrap: wrap; gap: .4rem; }
.acct-export a.is-busy { opacity: .72; pointer-events: none; }
.acct-total {
  margin: .55rem 0 .15rem;
  font-size: 1.02rem;
}
.acct-total strong {
  display: block;
  font-size: 1.55rem;
  line-height: 1.2;
}
.acct-visits, .acct-ops { margin-top: 1rem; }
.acct-visits ul, .acct-ops ul { list-style: none; padding: 0; margin: .35rem 0 0; }
.acct-visits li { display: flex; justify-content: space-between; gap: .75rem; padding: .18rem 0; }
.acct-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.acct-table th, .acct-table td {
  text-align: left;
  padding: .4rem .35rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.acct-table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.acct-cards { display: none; }
.acct-cards li {
  background: #f7f2ea;
  border-radius: 12px;
  padding: .55rem .7rem;
  display: flex;
  flex-direction: column;
  gap: .12rem;
  margin-bottom: .45rem;
}
@media (max-width: 739px) {
  .sales-grid { grid-template-columns: 1fr; }
  .acct-table { display: none; }
  .acct-cards { display: block; }
  .acct-total strong { font-size: 1.35rem; }
}
.scan-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .45rem; }
.scan-list > li { margin: 0; padding: 0; list-style: none; }
.scan-card {
  background: var(--card);
  border-radius: 14px;
  padding: .6rem .85rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .28rem .4rem;
  color: inherit;
  min-height: 52px;
  transition: transform .12s ease, box-shadow .12s ease;
}
a.scan-card:hover, a.scan-card:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(43, 33, 64, 0.1);
}
a.scan-card:active { transform: scale(.99); }
.scan-card strong {
  flex: 1 1 7.5rem;
  font-size: 1rem;
  line-height: 1.25;
  min-width: 0;
  order: 1;
}
.scan-card .plan-tag { order: 2; }
.scan-card time {
  order: 4;
  margin-left: auto;
  font-size: .75rem;
  font-weight: 800;
  line-height: 1.2;
  background: #efe7f8;
  color: var(--primary);
  border-radius: 999px;
  padding: .12rem .5rem;
  white-space: nowrap;
}
.scan-card .pay { display: none; }
.scan-card .pay-free,
.scan-card .pay-used {
  display: inline-flex;
  align-items: center;
  order: 3;
  background: #fff3d6;
  color: #7a4b00;
  border-radius: 999px;
  padding: .12rem .5rem;
  font-size: .75rem;
  font-weight: 800;
  line-height: 1.2;
}
.scan-card.scan-ticket {
  background: #fffaf3;
  border: 1px solid #e6d3b0;
  align-items: flex-start;
}
.plan-ticket { background: #f3e6cf; color: #6a4314; }
.scan-card .scan-event,
.scan-card .scan-meta {
  flex: 1 1 100%;
  min-width: 0;
  order: 5;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.scan-card .scan-meta { font-weight: 700; color: var(--ink); }
.scan-reset { order: 6; margin-top: .15rem; }
.scan-card .scan-reset-confirm { flex: 1 1 100%; order: 7; }
@media (max-width: 640px) {
  .scan-card.scan-ticket .scan-reset,
  .scan-reset-confirm .btn,
  .ticket-reset .btn {
    width: 100%;
    min-height: 44px;
  }
}
.scan-card.scan-free {
  background: var(--card);
  box-shadow: var(--shadow);
}
.plan-tag {
  background: #efe7f8;
  color: var(--primary);
}
.plan-regular10plus1 { background: #ece6ff; color: #3d2d78; }
.plan-partner10 { background: #dff4ea; color: #145c3a; }
.plan-complimentary { background: #fff3d6; color: #7a4b00; }
@media (min-width: 740px) {
  .quick-actions { flex-direction: row; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .stats-3 { grid-template-columns: repeat(3, 1fr); }
  h1 { font-size: 2rem; }
}

.free-banner {
  background: linear-gradient(180deg, #ffe566 0%, #f5b942 100%);
  color: #3a2200;
  border: 4px solid #c47a00;
  border-radius: 18px;
  padding: 1.15rem 1rem;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.35;
  box-shadow: 0 0 0 6px #fff4c2, 0 10px 28px rgba(196, 122, 0, .28);
  margin: .6rem 0 1rem;
}
.free-banner p { margin: .25rem 0; }
.no-card-banner, .completed-banner {
  border-radius: 16px;
  padding: 1rem;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 800;
  margin: .5rem 0 1rem;
}
.no-card-banner {
  background: #fff4d6;
  color: #7a4a00;
  border: 3px solid #e0b34d;
}
.completed-banner {
  background: #efe7f8;
  color: var(--primary-2);
  border: 3px solid var(--primary);
}
.recognized-label {
  margin: 0 0 .2rem;
  color: var(--success);
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: .78rem;
}
.recognized-name {
  margin: 0 0 .75rem;
  font-size: 1.85rem;
  line-height: 1.15;
}
.scan-free {
  background: #fff6d8;
  box-shadow: 0 0 0 2px #f5b942, var(--shadow);
}
.pay-regular { color: var(--muted); font-weight: 700; }
.dot.free { box-shadow: inset 0 0 0 2px #c47a00; background: #ffe566; }
.plain { padding-left: 1.1rem; }
.assign-card { background: #fff7ef; border-radius: 16px; padding: 1rem; margin: .6rem 0; }
.card-choice {
  flex-direction: column;
  gap: .2rem;
  min-height: 88px;
  line-height: 1.25;
}
.card-choice span {
  font-weight: 600;
  font-size: 1rem;
  opacity: .92;
}

.filter-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: .45rem;
  margin: .85rem 0 .2rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tabs a {
  flex: 0 0 auto;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: .35rem .85rem;
  border-radius: 999px;
  background: #efe7f8;
  color: var(--primary);
  font-weight: 700;
  font-size: .92rem;
  white-space: nowrap;
}
.filter-tabs a.is-active {
  background: var(--primary);
  color: #fff;
}

.people-list li { padding: 0; }
.person-link {
  display: flex;
  width: 100%;
  color: inherit;
  padding: .9rem 1rem;
  min-height: 64px;
  border-radius: 16px;
  align-items: center;
}
.person-link:hover, .person-link:focus-visible {
  background: #fff8f0;
}
.person-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .15rem;
}

@media (max-width: 739px) {
  .admin-shell .shell-head {
    display: block;
    position: static;
    padding: 0;
    background: #3f2a61;
    background-color: #3f2a61;
    z-index: auto;
  }
  .admin-shell .shell-head .topbar,
  .admin-shell .topbar {
    padding: 8px 12px;
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
    min-height: 52px;
    background: #3f2a61;
    background-color: #3f2a61;
    opacity: 1;
    filter: none;
    transform: none;
  }
  .brand {
    font-size: 16px;
    line-height: 20px;
    letter-spacing: 0;
  }
  form.admin-quit-mobile { display: inline; }
  .admin-shell .topbar {
    position: relative;
  }
  .admin-shell .topbar-actions:not(.admin-menu) {
    display: flex;
    align-items: center;
    gap: .55rem;
    flex: 0 0 auto;
    margin-left: auto;
  }
  .admin-shell .admin-nav .nav-access { display: none; }
  .admin-shell .admin-nav {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 15;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 0;
    width: 100%;
    height: auto;
    margin: 0;
    flex: none;
    padding: .55rem .4rem calc(.45rem + env(safe-area-inset-bottom));
    overflow: visible;
    background: var(--primary-2);
    box-shadow: 0 -8px 24px rgba(43, 33, 64, .2);
  }
  .admin-shell .admin-nav-cluster {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    align-items: flex-end;
    justify-content: space-evenly;
    gap: .55rem;
  }
  .admin-shell .admin-nav-cluster a {
    flex: 0 1 auto;
    min-width: 0;
  }
  .admin-shell .admin-nav-left {
    justify-content: space-evenly;
    padding-right: 2.55rem;
  }
  .admin-shell .admin-nav-right {
    justify-content: space-evenly;
    padding-left: 2.55rem;
  }
  .admin-shell .admin-nav .nav-quit { display: none; }
  .admin-shell .admin-nav a {
    min-height: 48px;
    justify-content: center;
    text-align: center;
    font-size: .78rem;
    padding: .35rem .2rem;
    line-height: 1.15;
    white-space: nowrap;
  }
  .admin-shell .admin-nav .nav-scan {
    font-size: .78rem;
    font-weight: 800;
    background: transparent;
    color: #f4e9ff;
  }
  .admin-shell .admin-nav .nav-scan.is-active {
    background: rgba(255, 255, 255, .16);
    color: #fff;
  }
  .admin-shell .admin-nav .nav-camera {
    position: absolute;
    left: 50%;
    bottom: calc(.45rem + env(safe-area-inset-bottom));
    width: 76px;
    height: 76px;
    margin: 0;
    transform: translate(-50%, -20px);
    z-index: 16;
  }
  .admin-shell .admin-nav .nav-camera .nav-camera-icon svg {
    width: 36px;
    height: 36px;
  }
  .admin-shell .admin-nav .nav-camera.is-active {
    transform: translate(-50%, -14px) scale(.96);
  }
  .admin-shell .flash {
    bottom: calc(5.4rem + env(safe-area-inset-bottom));
  }
  .admin-shell .page {
    margin-top: 0;
    margin-bottom: 0;
    padding-bottom: calc(6.4rem + env(safe-area-inset-bottom));
    overflow-x: clip;
  }
  .admin-shell .file,
  .admin-shell .narrow,
  .admin-shell form,
  .admin-shell .search-bar,
  .admin-shell .people-sort,
  .admin-shell .list,
  .admin-shell .person-link,
  .admin-shell .person-main {
    max-width: 100%;
    min-width: 0;
  }
  .admin-shell input,
  .admin-shell select,
  .admin-shell textarea,
  .admin-shell .btn {
    max-width: 100%;
  }
  .admin-shell .person-main,
  .admin-shell .compact-row-title,
  .admin-shell h1,
  .admin-shell h2 {
    overflow-wrap: anywhere;
  }
  .admin-shell .scanner-admin { gap: .5rem; }
  .admin-shell .page:has(.scanner-admin) { margin-top: 0; }
  .admin-shell h1 { font-size: 1.28rem; }
  .admin-shell h2 { margin-top: .85rem; }
  .scanner-admin h2 { margin-top: .55rem; margin-bottom: .2rem; font-size: 1rem; }
  .file-panel .no-card-banner {
    padding: .7rem .85rem;
    font-size: 1rem;
    margin: .25rem 0 .55rem;
  }
  .stats-3 { gap: .45rem; }
  .stat-card {
    padding: .7rem .45rem;
    min-height: 78px;
    text-align: center;
  }
  .stats strong { font-size: 1.35rem; }
  .stat-card span { font-size: .72rem; line-height: 1.2; display: block; }
  .btn-xl { min-height: 68px; font-size: 1.12rem; margin: 0; }
  .scanner-shell .scanner-dock {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 15;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
    height: auto;
    margin: 0;
    flex: none;
    padding: .55rem .8rem calc(.45rem + env(safe-area-inset-bottom));
    background: var(--primary-2);
    color: #fff;
    box-shadow: 0 -8px 24px rgba(43, 33, 64, .2);
    overflow: visible;
  }
  .scanner-shell .scanner-dock-side {
    font-size: .78rem;
    min-height: 48px;
    padding: 0 .15rem .15rem;
    display: inline-flex;
    align-items: center;
  }
  .scanner-shell .scanner-dock-quit {
    display: inline-flex;
    margin: 0;
    z-index: 16;
  }
  .scanner-shell .scanner-dock-quit .linkish {
    min-height: 48px;
    min-width: 48px;
    padding: .35rem .5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: .78rem;
  }
  .scanner-shell .scanner-dock .nav-camera {
    position: absolute;
    left: 50%;
    bottom: calc(.45rem + env(safe-area-inset-bottom));
    width: 76px;
    height: 76px;
    margin: 0;
    transform: translate(-50%, -20px);
  }
  .scanner-shell .scanner-dock .nav-camera .nav-camera-icon svg {
    width: 36px;
    height: 36px;
  }
  .scanner-shell .scanner-dock .nav-camera.is-active {
    transform: translate(-50%, -14px) scale(.96);
  }
  .scanner-shell .page {
    padding-bottom: calc(6.4rem + env(safe-area-inset-bottom));
  }
  .scanner-shell .flash {
    bottom: calc(5.4rem + env(safe-area-inset-bottom));
  }
  html.keyboard-open .admin-shell .admin-nav,
  html.keyboard-open .scanner-shell .scanner-dock {
    display: none;
  }
  html.keyboard-open .admin-shell .page,
  html.keyboard-open .scanner-shell .page {
    padding-bottom: .75rem;
  }
  html.keyboard-open .admin-shell .flash,
  html.keyboard-open .scanner-shell .flash {
    bottom: .75rem;
  }
}

.file { width: 100%; }
.file-head {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem;
}
.file-who {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.file-who h1 { margin: 0; font-size: 1.45rem; }
.status-dot {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-weight: 800;
  font-size: .92rem;
  white-space: nowrap;
}
.status-dot::before {
  content: "";
  width: .7rem;
  height: .7rem;
  border-radius: 50%;
  background: var(--muted);
}
.status-dot.is-on { color: var(--success); }
.status-dot.is-on::before { background: var(--success); }
.status-dot.is-off { color: var(--danger); }
.status-dot.is-off::before { background: var(--danger); }
.file-contact {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  margin: .55rem 0 .4rem;
  color: var(--muted);
}
.file-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  padding: 0;
  margin: 0 0 .75rem;
}
.file-chips li {
  background: #efe7f8;
  color: var(--primary);
  border-radius: 999px;
  padding: .25rem .7rem;
  font-size: .82rem;
  font-weight: 800;
  white-space: nowrap;
}
.file-empty-cards { margin: .2rem 0 .7rem; }
.file-tabs {
  display: flex;
  gap: .3rem;
  overflow: visible;
  margin: .85rem 0 1rem;
  padding: 0;
}
.file-tabs a {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: .5rem .2rem;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  font-size: .95rem;
  white-space: nowrap;
  border: 1px solid var(--line);
}
@media (min-width: 480px) {
  .file-tabs { gap: .4rem; }
  .file-tabs a {
    flex: 0 1 auto;
    padding: .5rem .95rem;
    font-size: 1rem;
  }
}
.file-tabs a[aria-current="page"] {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.file-panel h2:first-child { margin-top: 0; }
.file-panel h2 {
  margin-top: .9rem;
  margin-bottom: .4rem;
  font-size: 1.05rem;
}
.file-panel h3 {
  margin: 0 0 .35rem;
  font-size: .92rem;
  font-weight: 800;
}
.file-dl { display: grid; gap: .85rem; margin: 0; }
.file-dl > div { display: grid; gap: .15rem; }
.file-dl dt { margin: 0; color: var(--muted); font-size: .82rem; font-weight: 800; }
.file-dl dd { margin: 0; font-weight: 800; }
.file-actions { display: flex; flex-direction: column; gap: .65rem; margin-top: .85rem; }
.compact-card { padding: 1rem; }
.compact-card p { margin: .15rem 0; }
.card-summaries { display: flex; flex-direction: column; gap: .65rem; }
.card-stack,
.compact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  padding: 0;
  margin: 0;
}
.card-tile {
  max-width: 100%;
  min-width: 0;
}
.card-row-names {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: .05rem;
}
.card-row-series {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.card-row strong,
.card-tile,
.file-chips li {
  overflow-wrap: anywhere;
  min-width: 0;
}
.card-rename {
  max-width: 100%;
  margin: .15rem 0 .35rem;
}
.card-rename summary {
  cursor: pointer;
  text-align: right;
  font-size: .82rem;
  font-weight: 700;
  color: var(--muted);
}
.card-rename form {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  margin-top: .45rem;
}
.card-rename input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.card-rename-actions {
  display: flex;
  gap: .4rem;
}
.card-rename-actions .btn { flex: 1; }
.qr-series {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
}
.card-row { position: relative; }
.card-row-hit {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}
.card-row-details,
.card-row-action,
.card-rename {
  position: relative;
  z-index: 2;
}
.compact-section,
#qr-carte,
#cartes {
  scroll-margin-top: 1rem;
}
.card-row,
.compact-row {
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: .65rem .85rem;
  display: flex;
  flex-direction: column;
  gap: .12rem;
}
a.compact-row,
a.card-row {
  color: inherit;
  text-decoration: none;
}
a.card-row-qr {
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  cursor: pointer;
}
a.card-row-qr:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.card-row-qr-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  margin: .4rem 0 0;
  padding: .55rem .65rem;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .01em;
  line-height: 1.2;
  text-align: center;
}
.card-row-qr-hint span { min-width: 0; }
.card-row-qr-hint svg {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
}
.compact-row-main {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem;
}
.compact-row-title { font-size: 1rem; line-height: 1.25; font-weight: 800; min-width: 0; }
.compact-row-value {
  font-size: 1.05rem;
  font-weight: 800;
  white-space: nowrap;
}
.compact-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem .4rem;
  color: var(--muted);
  font-size: .82rem;
}
.compact-row-note { margin: .1rem 0 0; font-size: .82rem; line-height: 1.35; }
.compact-row-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-weight: 800;
  font-size: .9rem;
}
.compact-row-actionable {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .45rem .65rem;
}
.compact-row-actionable .btn { flex: 0 0 auto; }
.compact-section { margin: 0 0 .7rem; }
.compact-section h3 { margin-bottom: .35rem; }
.compact-confirm { padding: 1rem; }
.compact-confirm h3 { margin-top: 0; }
.compact-section.danger-zone {
  border: 1px solid #f0c7c8;
  border-radius: 14px;
  padding: .7rem .85rem .85rem;
  background: #fffafa;
}
.card-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem;
}
.card-row-top strong { font-size: 1rem; line-height: 1.25; }
.card-row-used {
  margin: .08rem 0 0;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}
.card-row-rest { margin: 0; font-size: .95rem; line-height: 1.3; }
.card-row-free {
  color: var(--primary);
  font-weight: 800;
  font-size: 1.02rem;
}
.card-row-note { margin: 0; font-size: .82rem; }
.card-row-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  margin-top: .1rem;
}
.card-row-details,
.card-row-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-weight: 800;
}
.card-row-action { margin-top: .05rem; }
@media (max-width: 739px) {
  .btn-assign-card { min-height: 48px; }
}
.file-acc {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  margin: 0 0 .75rem;
  padding: 0 .2rem;
}
.file-acc summary {
  list-style: none;
  cursor: pointer;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  font-weight: 800;
  padding: .75rem 1rem;
}
.file-acc summary::-webkit-details-marker { display: none; }
.file-acc summary::after {
  content: "›";
  font-size: 1.4rem;
  color: var(--muted);
  line-height: 1;
}
.file-acc[open] summary::after { content: "⌃"; font-size: 1rem; }
.file-acc-body { padding: 0 1rem 1rem; display: flex; flex-direction: column; gap: .65rem; }
.qr-mini img { width: min(58vw, 200px); }

.scanner-mode-label {
  margin: 0;
  font-size: .72rem;
  letter-spacing: .14em;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
}
.scanner-limited { gap: .45rem; }
.scanner-limited .scan-actions { margin: 0; }
.scanner-limited .btn-block { min-height: 48px; }
.scanner-limited .compact-row-title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
}
.scanner-limited .scan-result-note,
.scanner-limited .scan-result-ok {
  margin: .15rem 0 .35rem;
  font-size: .92rem;
  line-height: 1.35;
}
.scanner-limited .scan-result-ok { font-weight: 800; color: var(--success); }
.scan-result-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .28rem .35rem;
  margin: .2rem 0 .15rem;
}
.scan-result-badges time {
  font-size: .75rem;
  font-weight: 800;
  line-height: 1.2;
  background: #efe7f8;
  color: var(--primary);
  border-radius: 999px;
  padding: .12rem .5rem;
  white-space: nowrap;
}
.scanner-shell .topbar { background: #3f2a61; background-color: #3f2a61; }
@media (min-width: 740px) {
  .scanner-shell .page { padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)); }
}
.scanner-result.sheet {
  padding: .75rem .85rem;
  border-radius: 14px;
}
.compact-scan-result p { margin: .2rem 0; }
.scan-outcome {
  text-align: center;
  padding: 1.15rem 1rem 1.2rem;
  border-radius: 22px;
  color: #fff;
  box-shadow: none;
}
.scan-outcome-accepted { background: #16a34a; }
.scan-outcome-confirm { background: #ca8a04; }
.scan-outcome-refused { background: #e11d48; }
.scan-outcome-confirm .scan-outcome-title {
  font-size: clamp(1.35rem, 5.8vw, 1.85rem);
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: .15rem 0 .4rem;
}
.scan-outcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  justify-content: center;
  margin: .85rem 0 0;
}
.scan-outcome-actions .btn {
  flex: 1 1 8.4rem;
  min-height: 48px;
  font-weight: 800;
}
.scan-outcome-refused .scan-outcome-title {
  font-size: clamp(1.45rem, 6.2vw, 1.95rem);
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: .15rem 0 .4rem;
}
.scan-outcome-refused .scan-outcome-detail {
  font-size: clamp(1.05rem, 3.8vw, 1.28rem);
  font-weight: 700;
}
.scan-outcome-mark {
  margin: 0;
  font-size: clamp(2.6rem, 10vw, 3.6rem);
  line-height: 1;
  font-weight: 800;
}
.scan-outcome-name {
  margin: .1rem 0 .35rem;
  font-size: clamp(1.45rem, 6.2vw, 1.95rem);
  font-weight: 800;
  line-height: 1.15;
}
.scan-outcome-title {
  margin: 0 0 .2rem;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
}
.scan-outcome-course,
.scan-outcome-used,
.scan-outcome-rest,
.scan-outcome-detail {
  margin: 0 0 .35rem;
  font-size: 1.02rem;
  line-height: 1.35;
  font-weight: 650;
}
.scan-outcome-used { font-weight: 800; margin-top: .45rem; }
.scan-outcome-meter {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .32);
  overflow: hidden;
  margin: .15rem auto .55rem;
  max-width: 16rem;
}
.scan-outcome-meter > span {
  display: block;
  height: 100%;
  background: #fff;
  border-radius: 999px;
}
.scan-outcome-rest { margin: .15rem 0 0; }
.scan-outcome-next {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, .88);
  min-height: 48px;
  font-weight: 800;
}

@media (min-width: 740px) {
  .sales-custom,
  .custom-period-fields {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  }
  .sales-custom .btn,
  .sales-custom button[type="submit"],
  .custom-period-fields .btn,
  .custom-period-fields button[type="submit"] {
    grid-column: auto;
    width: auto;
  }
  .file-who h1 { font-size: 1.85rem; }
  .card-summaries { display: grid; grid-template-columns: 1fr 1fr; }
  .file-actions { flex-direction: row; }
  .file-actions .btn { width: auto; min-width: 220px; }
  .card-row,
  .compact-row { padding: .7rem 1rem; }
  .card-row-used { font-size: 1.5rem; }
  .compact-row-actionable { flex-wrap: nowrap; }
}

body.participant .topbar {
  flex-wrap: nowrap;
  gap: 8px;
  padding: 8px 12px;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
  min-height: 48px;
}
body.participant .brand {
  font-size: 16px;
  line-height: 20px;
  min-width: 0;
}
body.participant .topbar-nav {
  flex-wrap: nowrap;
  flex-shrink: 0;
  gap: .45rem;
}
body.participant .topbar-nav a,
body.participant .topbar-nav .linkish {
  padding: .3rem .15rem;
  font-size: .88rem;
  white-space: nowrap;
}
body.participant .page {
  width: 100%;
  margin: 0 auto;
  padding: .65rem max(.6rem, calc((100% - 820px) / 2)) calc(1.1rem + env(safe-area-inset-bottom));
}
.participant-home h1 {
  font-size: 1.12rem;
  margin: 0 0 .45rem;
}
.participant-home h2 {
  font-size: 1.02rem;
  margin: .85rem 0 .35rem;
}
.participant-home .card-stack { gap: .4rem; }
@font-face {
  font-family: "Rye";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/rye-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Alfa Slab One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/alfa-slab-one-latin.woff2") format("woff2");
}
.pass-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  width: 100%;
  max-width: 40rem;
  min-width: 0;
}
.pass-ticket {
  display: block;
  max-width: 100%;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
a.pass-ticket:focus-visible {
  outline: 2px solid #e7c27a;
  outline-offset: 3px;
  border-radius: 18px;
}
.pass-detail { max-width: 40rem; margin: 0 auto; min-width: 0; }
.ticket-face {
  position: relative;
  display: grid;
  grid-template-columns: minmax(4.4rem, 26%) minmax(0, 1fr);
  grid-template-rows: minmax(11rem, 1fr) auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 232px;
  border-radius: 18px;
  overflow: hidden;
  color: #f8f1e4;
  background-color: #2a1810;
  background-image: url("../images/ticket-country-bg.jpg");
  background-size: cover;
  background-position: center center;
  box-shadow:
    inset 0 0 0 1px rgba(240, 210, 160, .28),
    0 14px 28px rgba(42, 24, 10, .3);
}
.ticket-face-has-photo { background-image: none; }
.ticket-face-photo {
  grid-column: 1 / -1;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  background-color: #2a1810;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
  pointer-events: none;
  z-index: 0;
}
.ticket-face-brand,
.ticket-face-body,
.ticket-face-stub { min-width: 0; }
.ticket-face-brand {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .7rem .4rem .85rem;
  text-align: center;
  color: #f6ead4;
  background: linear-gradient(90deg, rgba(18, 10, 6, .28), rgba(18, 10, 6, .05));
  border-right: 2px dashed rgba(232, 196, 130, .42);
  z-index: 1;
}
.ticket-face-brand::before {
  content: "";
  position: absolute;
  width: min(78%, 5.6rem);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(232, 196, 130, .28);
  box-shadow: inset 0 0 0 6px rgba(232, 196, 130, .05);
  pointer-events: none;
}
.ticket-face-mark {
  position: relative;
  z-index: 1;
  width: min(86%, 5.4rem);
  height: auto;
  filter: drop-shadow(0 2px 0 rgba(20, 10, 4, .35));
}
.ticket-face-logo {
  position: relative;
  z-index: 1;
  display: block;
  width: auto;
  height: auto;
  max-width: 92%;
  max-height: 7.6rem;
  object-fit: contain;
  object-position: center;
}
.school-logo-preview {
  display: block;
  width: auto;
  height: auto;
  max-width: 12rem;
  max-height: 6rem;
  object-fit: contain;
}
.ticket-face-org {
  position: relative;
  z-index: 1;
  font-family: "Rye", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: clamp(.68rem, 2.6vw, .92rem);
  line-height: 1.12;
  letter-spacing: .03em;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(20, 10, 4, .45);
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}
.ticket-face-body {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  padding: .7rem .5rem .6rem;
}
.ticket-face-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  min-width: 0;
  container-type: inline-size;
  --ticket-aside: clamp(5rem, 30%, 8rem);
  padding-right: var(--ticket-aside);
  text-align: center;
}
.ticket-face-price {
  position: absolute;
  top: .7rem;
  right: .55rem;
  z-index: 2;
  width: max-content;
  max-width: 46%;
  background:
    radial-gradient(circle at 28% 16%, #fff, transparent 46%),
    linear-gradient(180deg, #fffaf0 0%, #f3e0bc 100%);
  color: #1c120c;
  border: 2px solid #2c1a0e;
  border-radius: 3px 10px 4px 8px;
  padding: .34rem .42rem .28rem;
  text-align: center;
  transform: rotate(-4deg);
  transform-origin: 100% 0;
  box-shadow:
    inset 0 1px 0 #fff,
    0 3px 0 #2c1a0e,
    0 8px 14px rgba(20, 10, 4, .28);
}
.ticket-face-price strong {
  display: block;
  font-family: "Alfa Slab One", "Arial Black", Impact, sans-serif;
  font-size: clamp(.82rem, 3.5vw, 1.42rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.ticket-face-price span {
  display: block;
  margin-top: .16rem;
  font-family: "Segoe UI", "Avenir Next", system-ui, sans-serif;
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
}
.ticket-face-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  width: 100%;
  margin: 0;
  color: #f8f3e8;
  font-family: "Rye", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: clamp(1rem, 12cqw, 3.15rem);
  font-weight: 400;
  line-height: .96;
  letter-spacing: .02em;
  text-align: center;
  text-transform: uppercase;
  text-wrap: balance;
  overflow-wrap: normal;
  word-break: normal;
  text-shadow:
    0 1px 0 rgba(255, 236, 210, .28),
    0 2px 0 #3a2414,
    0 5px 0 rgba(28, 14, 6, .55),
    0 0 18px rgba(0, 0, 0, .35);
}
.ticket-face-token {
  display: inline-block;
  white-space: nowrap;
  overflow-wrap: normal;
}
body.participant .qr-screen h1.ticket-face-title {
  margin: 0;
  font-family: "Rye", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: clamp(1rem, 12cqw, 3.15rem);
  font-weight: 400;
  line-height: .96;
  letter-spacing: .02em;
  text-align: center;
  text-transform: uppercase;
}
.ticket-face-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  width: fit-content;
  max-width: 100%;
  margin-top: .55rem;
  padding: .32rem .7rem .26rem;
  border-radius: 5px;
  border: 2px solid #5c3a1e;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .5), transparent 40%),
    linear-gradient(180deg, #f8e6c0 0%, #e4c48e 52%, #c9a36a 100%);
  color: #2a1a0c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65), inset 0 -3px 0 rgba(90, 52, 22, .28), 0 3px 0 rgba(36, 18, 8, .32);
  font-family: "Rye", Georgia, serif;
  font-size: clamp(.74rem, 2.9vw, 1.08rem);
  line-height: 1.15;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.ticket-face-type > span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-width: 0;
  text-align: center;
  overflow-wrap: anywhere;
}
.ticket-face-type svg {
  width: .85rem;
  height: .85rem;
  flex: 0 0 auto;
}
.ticket-face-facts {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: .32rem;
  width: calc(100% + var(--ticket-aside, 0px));
  margin-top: .55rem;
  padding: .48rem .68rem;
  max-width: none;
  color: #f7efe2;
  background: linear-gradient(180deg, rgba(16, 9, 6, .88), rgba(16, 9, 6, .74));
  border: 1px solid rgba(232, 196, 130, .28);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, .1), 0 6px 14px rgba(0, 0, 0, .22);
  font-family: "Segoe UI", "Avenir Next", system-ui, sans-serif;
  font-size: clamp(.86rem, 2.65vw, 1.02rem);
  line-height: 1.2;
}
.ticket-face-fact {
  display: grid;
  grid-template-columns: 1.3rem minmax(0, 1fr);
  align-items: center;
  column-gap: .42rem;
  min-width: 0;
  max-width: 100%;
  padding-left: 0;
  border-left: 0;
}
.ticket-face-fact svg {
  width: 1.3rem;
  height: 1.3rem;
  margin-top: 0;
  justify-self: center;
  color: #f0d29a;
}
.ticket-face-fact span,
.ticket-face-place {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
  text-align: left;
}
.ticket-face-time span {
  white-space: pre;
  text-overflow: ellipsis;
}
.ticket-face-stub {
  position: relative;
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
  align-items: center;
  gap: .55rem;
  padding: .58rem .8rem .62rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .45), transparent 28%),
    linear-gradient(180deg, #f8edd8 0%, #ead7b4 100%);
  color: #2a1c12;
  border-top: 2px dashed rgba(92, 58, 32, .55);
  font-family: "Segoe UI", "Avenir Next", system-ui, sans-serif;
  font-size: clamp(.66rem, 2.45vw, .86rem);
  line-height: 1.15;
  z-index: 3;
}
.ticket-face-stub::before,
.ticket-face-stub::after {
  content: "";
  position: absolute;
  top: -11px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 0 0 0 2px rgba(92, 58, 32, .16);
  z-index: 4;
}
.ticket-face-stub::before { left: -11px; }
.ticket-face-stub::after { right: -11px; }
.ticket-face-who {
  display: flex;
  align-items: center;
  gap: .4rem;
  min-width: 0;
}
.ticket-face-who > span { min-width: 0; overflow-wrap: anywhere; }
.ticket-face-who > svg {
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 auto;
  color: #6b4424;
}
.ticket-face-who-end { justify-content: flex-end; text-align: right; }
.ticket-face-split {
  align-self: stretch;
  background: rgba(92, 58, 32, .35);
}
.ticket-face-stub strong {
  display: block;
  margin-top: .08rem;
  font-size: 1.32em;
  font-weight: 800;
  letter-spacing: .01em;
}
.ticket-face-label {
  display: block;
  color: #7a6248;
  font-size: .72em;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
@media (max-width: 520px) {
  .ticket-face-place {
    flex-basis: 100%;
    padding-left: 0;
    border-left: 0;
  }
}
@media (max-width: 420px) {
  .ticket-face { min-height: 208px; }
  .ticket-face-main { --ticket-aside: 5.4rem; }
  .ticket-face-logo { max-height: 4.6rem; }
  .ticket-face-mark { width: min(84%, 3.3rem); }
  .ticket-face-price { top: .45rem; right: .35rem; transform: rotate(-2deg); }
}
@media (max-width: 360px) {
  .ticket-face { grid-template-columns: minmax(3.4rem, 24%) minmax(0, 1fr); }
  .ticket-face-who > svg { display: none; }
  .ticket-face-org { font-size: .52rem; }
  .ticket-face-main { --ticket-aside: 5.6rem; }
  .ticket-face-type { font-size: .62rem; padding: .2rem .34rem .16rem; }
  .ticket-face-price { padding: .18rem .24rem .14rem; }
  .ticket-face-price strong { font-size: .72rem; }
}
@media (max-width: 480px) {
  body.participant .page:has(.ticket-face),
  .admin-shell .page:has(.ticket-face) {
    padding-left: .4rem;
    padding-right: .4rem;
  }
  .ticket-face-body { padding: .5rem .32rem .42rem; }
  .ticket-face-main { --ticket-aside: 5.45rem; }
  .ticket-face-title,
  body.participant .qr-screen h1.ticket-face-title {
    font-size: clamp(1.02rem, 12.5cqw, 2.15rem);
  }
  .ticket-face-facts {
    gap: .24rem;
    margin-top: .4rem;
    padding: .4rem .5rem;
    font-size: .9rem;
    line-height: 1.2;
  }
  .ticket-face-fact {
    grid-template-columns: 1.15rem minmax(0, 1fr);
    column-gap: .35rem;
    align-items: center;
  }
  .ticket-face-fact svg {
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0;
  }
  .ticket-face-stub {
    gap: .4rem;
    padding: .46rem .62rem .48rem;
    font-size: .8rem;
  }
  .ticket-face-label { font-size: .8em; letter-spacing: .045em; }
  .ticket-face-stub strong { font-size: 1.16em; }
  .ticket-face-who > svg { width: 1.15rem; height: 1.15rem; }
}
@media (min-width: 720px) {
  .ticket-face { min-height: 286px; }
}
.ticket-appearance { margin: 1.5rem 0 1.7rem; }
.ticket-appearance h2 { margin-bottom: .35rem; }
.ticket-bg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  padding-top: .35rem;
}
.ticket-bg-label { margin: 0; font-weight: 700; }
.ticket-bg-state { margin: .15rem 0 0; color: var(--muted); }
.ticket-fond-dialog { width: min(42rem, calc(100vw - 1.25rem)); }
.ticket-fond-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.ticket-fond-head h2 { margin: 0; font-size: 1.2rem; }
.ticket-fond-close {
  flex: 0 0 auto;
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.ticket-fond-dialog .ticket-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.ticket-appearance-actions { display: grid; gap: .55rem; margin-top: .8rem; }
@media (max-width: 640px) {
  .ticket-fond-dialog {
    width: calc(100vw - .75rem);
    max-height: calc(100svh - .75rem);
  }
  .ticket-bg-row { flex-direction: column; align-items: stretch; }
}
.ticket-preview { margin-top: 1.15rem; }
.ticket-preview h2,
.ticket-preview h3 {
  margin: 0 0 .55rem;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.ticket-preview .ticket-face { max-width: 28rem; }
.participant-home .card-row { padding: .55rem .75rem; gap: .08rem; }
.participant-home .card-row-used {
  font-size: 1.4rem;
  letter-spacing: -.01em;
}
.participant-home .card-row-rest { font-size: .9rem; }
.participant-home .card-row-free { font-size: 1.05rem; }
.participant-home .no-card-banner {
  margin: .25rem 0;
  padding: .55rem .7rem;
  font-size: 1rem;
}
.qr-home { margin: .55rem 0 .7rem; }
.qr-choose-label {
  margin: 0 0 .35rem;
  font-size: .88rem;
  font-weight: 700;
  color: var(--muted);
}
.qr-plan-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.qr-present {
  margin: .35rem 0 .15rem;
  font-size: .95rem;
}
body.participant .qr-screen h1 {
  font-size: 1.15rem;
  margin: 0 0 .45rem;
}
body.participant .qr-screen .btn-block {
  min-height: 44px;
  margin-top: .7rem;
}
body.participant .qr-frame {
  margin: .55rem auto;
  padding: .7rem;
  border-radius: 16px;
}
body.participant .qr-frame img {
  width: min(72vw, 280px);
  height: auto;
}
@media (max-width: 374px) {
  body.participant .brand { font-size: .9rem; }
  body.participant .topbar-nav a,
  body.participant .topbar-nav .linkish { font-size: .82rem; }
}

.ptr-indicator {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + .4rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  margin: 0;
  padding: .28rem .7rem;
  border-radius: 999px;
  background: #3f2a61;
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(43, 33, 64, .22);
}
.ptr-indicator.is-visible { opacity: 1; }
.ptr-indicator.is-ready { background: #2d1d46; }
.ptr-debug {
  position: fixed;
  left: .5rem;
  right: .5rem;
  bottom: calc(5.6rem + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  margin: 0;
  padding: .25rem .45rem;
  border-radius: 8px;
  background: #1f1630;
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  pointer-events: none;
}

@media (min-width: 740px) {
  .shell-head,
  .topbar {
    position: sticky;
    top: 0;
    z-index: 10;
  }
}

@media (display-mode: standalone) {
  html,
  body,
  body.admin-shell {
    min-height: 100lvh;
    background-color: #3f2a61;
  }
  .shell-head,
  .topbar {
    background: #3f2a61;
    background-color: #3f2a61;
  }
  .page,
  .admin-shell .page {
    background-color: var(--bg);
  }
}

@media (display-mode: standalone) and (max-width: 739px) {
  .admin-shell .shell-head .topbar,
  .admin-shell .topbar,
  .scanner-shell .topbar,
  body.participant .topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 18;
    display: block;
    height: var(--cp-header-shell);
    min-height: var(--cp-header-shell);
    padding: 0;
    box-sizing: border-box;
    background: #3f2a61;
    background-color: #3f2a61;
    opacity: 1;
    filter: none;
    transform: none;
  }
  .admin-shell .shell-head .topbar-inner,
  .admin-shell .topbar-inner,
  .scanner-shell .topbar-inner,
  body.participant .topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    width: 100%;
    height: var(--cp-header-row);
    margin: 0;
    margin-top: calc(env(safe-area-inset-top, 0px) + var(--cp-header-shift));
    padding: 0 12px;
  }
  .admin-shell .page,
  .scanner-shell .page,
  body.participant .page {
    padding-top: calc(var(--cp-header-shell) + .75rem);
  }
  #confirmation {
    scroll-margin-top: calc(var(--cp-header-shell) + .5rem);
  }
}

.ticket-summary {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .7rem .85rem;
  margin: .5rem 0 1rem;
  min-width: 0;
  max-width: 100%;
}
.ticket-summary-counts {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .7rem;
  margin: 0;
}
.ticket-summary-counts span {
  font-size: .92rem;
  line-height: 1.35;
}
.ticket-summary-counts strong {
  font-size: 1.05rem;
  font-weight: 800;
}
.ticket-summary-money {
  margin: .28rem 0 0;
  font-weight: 700;
  line-height: 1.35;
}
.ticket-type {
  padding: .5rem .75rem .55rem;
  margin: 0 0 .6rem;
  box-shadow: 0 2px 8px rgba(43, 33, 64, 0.06);
}
.ticket-type h3 {
  margin: 0 0 .1rem;
  font-size: 1rem;
  line-height: 1.25;
}
.ticket-type p {
  margin: 0;
  font-size: .88rem;
  line-height: 1.35;
}
.ticket-type p + p { margin-top: .08rem; }
.ticket-people {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.ticket-people legend {
  font-weight: 800;
  margin-bottom: .35rem;
}
.ticket-person {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: .65rem;
  min-width: 0;
  max-width: 100%;
  margin: 0 0 .35rem;
  padding: .4rem .7rem;
  min-height: 2.75rem;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  overflow: hidden;
}
.ticket-person input[type="radio"] {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  min-width: 1.15rem;
  min-height: 1.15rem;
  margin: 0;
  padding: 0;
  border-radius: 50%;
}
.ticket-person > span {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: .05rem;
  line-height: 1.25;
}
.ticket-person strong {
  font-size: .95rem;
  font-weight: 700;
}
.ticket-person .muted {
  display: block;
  max-width: 100%;
  overflow: hidden;
  font-size: .78rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.assign-search[hidden],
.assign-picked[hidden],
.ticket-people[hidden],
.assign-fields[hidden] {
  display: none !important;
}
.assign-picked {
  min-width: 0;
  max-width: 100%;
  padding: .7rem .8rem;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}
.assign-picked-label {
  margin: 0;
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
}
.assign-picked-name {
  margin: .15rem 0 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.assign-picked-name::before {
  content: "✓ ";
}
.assign-picked-email {
  margin: 0;
  max-width: 100%;
  overflow: hidden;
  font-size: .8rem;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.assign-change {
  display: inline-block;
  margin-top: .4rem;
  font-size: .9rem;
  font-weight: 700;
}
.assign-fields {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  min-width: 0;
  max-width: 100%;
}
.assign-qty {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  min-width: 0;
  font-weight: 600;
}
.assign-qty-control {
  display: flex;
  align-items: center;
  gap: .5rem;
  max-width: 100%;
}
.assign-step {
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.assign-qty-control input[type="number"] {
  width: 3.5rem;
  min-height: 2.75rem;
  margin: 0;
  padding: .35rem .2rem;
  text-align: center;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.ticket-folds { min-width: 0; max-width: 100%; }
.holder-filters {
  margin: .35rem 0 .55rem;
  flex-wrap: wrap;
  overflow-x: visible;
}
.holder-filters button {
  flex: 0 0 auto;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: .35rem .8rem;
  border: 0;
  border-radius: 999px;
  background: #efe7f8;
  color: var(--primary);
  font: inherit;
  font-weight: 700;
  font-size: .9rem;
  white-space: nowrap;
  cursor: pointer;
}
.holder-filters button.is-active {
  background: var(--primary);
  color: #fff;
}
.filter-label {
  flex: 0 0 auto;
  align-self: center;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
}
.ticket-fold-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .2rem;
  flex: 0 0 auto;
}
.field-hint {
  margin: -.35rem 0 .15rem;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 500;
}
.ticket-swipe {
  position: relative;
  margin: 0 0 .4rem;
  overflow: hidden;
  border-radius: 16px;
  max-width: 100%;
}
.ticket-swipe-action {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 96px;
  margin: 0;
}
.ticket-hide {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: .15rem;
  border: 0;
  border-radius: 0 16px 16px 0;
  background: var(--danger);
  color: #fff;
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
}
.ticket-hide svg { width: 18px; height: 18px; fill: currentColor; }
.ticket-swipe .ticket-fold {
  position: relative;
  z-index: 1;
  margin: 0;
  touch-action: pan-y;
}
.ticket-fold {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  margin: 0 0 .4rem;
  min-width: 0;
  max-width: 100%;
}
.ticket-fold summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  min-height: 52px;
  padding: .5rem .75rem;
  cursor: pointer;
  list-style: none;
}
.ticket-fold summary::-webkit-details-marker { display: none; }
.ticket-fold-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.ticket-fold-main strong { overflow-wrap: anywhere; }
.ticket-fold-main span {
  color: var(--muted);
  font-size: .88rem;
  overflow-wrap: anywhere;
}
.ticket-fold .badge { flex: 0 0 auto; }
.ticket-detail {
  padding: 0 .75rem .75rem;
  min-width: 0;
  max-width: 100%;
}
.ticket-detail form { max-width: 100%; }
.ticket-detail .btn {
  width: 100%;
  max-width: 100%;
  white-space: normal;
  box-sizing: border-box;
}
.ticket-confirm {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-top: .45rem;
}
.ticket-reset { margin-top: .75rem; }
.ticket-confirm[hidden],
.ticket-qr[hidden],
[data-ask-revoke][hidden],
[data-ask-reset][hidden],
[data-reset-ticket][hidden] {
  display: none !important;
}
.ticket-qr {
  display: block;
  width: 168px;
  height: 168px;
  max-width: 100%;
  margin: .35rem auto .5rem;
  background: #fff;
  border-radius: 12px;
  padding: .35rem;
  box-sizing: border-box;
}
.ticket-fold.is-filtered-out { display: none; }
.ticket-type-fold {
  margin: 0 0 .9rem;
  max-width: 100%;
  min-width: 0;
}
.ticket-type-fold summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  min-height: 52px;
  padding: .8rem 1.1rem;
  border-radius: 14px;
  background: #3d6b78;
  color: #fff;
  font-weight: 700;
  box-sizing: border-box;
  text-align: center;
}
.ticket-type-fold summary::-webkit-details-marker { display: none; }
.ticket-type-fold:not([open]) > :not(summary) { display: none; }
.ticket-type-fold form {
  margin-top: .75rem;
  max-width: 100%;
  min-width: 0;
}
.ticket-type-fold .btn {
  width: 100%;
  max-width: 100%;
  white-space: normal;
  box-sizing: border-box;
}
.ticket-event-card {
  position: relative;
  padding-right: 3.4rem;
  min-width: 0;
  max-width: 100%;
}
.ticket-event-card h2 { overflow-wrap: anywhere; }
.ticket-event-delete {
  position: absolute;
  top: .55rem;
  right: .55rem;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  padding: 0;
}
.ticket-event-delete:hover,
.ticket-event-delete:focus-visible {
  background: #fde8e8;
}
.ticket-event-card .ticket-confirm { margin-top: .7rem; }
.ticket-history { margin-top: 1.5rem; }
.ticket-history summary {
  list-style: none;
  cursor: pointer;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  font-weight: 800;
  padding: .7rem 0;
  text-align: left;
}
.ticket-history summary::-webkit-details-marker { display: none; }
.ticket-history summary::after {
  content: "›";
  flex: 0 0 auto;
  font-size: 1.4rem;
  color: var(--muted);
  line-height: 1;
}
.ticket-history[open] summary::after { content: "⌃"; font-size: 1rem; }
.ticket-history-body { display: grid; gap: .75rem; padding-bottom: .4rem; }

.admin-shell .page:has(.event-sheet) {
  padding-left: max(.75rem, calc((100% - 1040px) / 2));
  padding-right: max(.75rem, calc((100% - 1040px) / 2));
}
.event-sheet {
  width: min(1040px, 100%);
  margin-inline: auto;
  min-width: 0;
}
.event-back { margin: 0 0 .7rem; }
.event-back a { font-weight: 700; font-size: .92rem; }
.event-head { margin: 0 0 1rem; }
.event-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.event-title-row h1 {
  margin: 0;
  flex: 1 1 12rem;
  min-width: 0;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  overflow-wrap: anywhere;
}
.event-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-height: 44px;
  padding: .35rem .8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  font-weight: 700;
  font-size: .92rem;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(43, 33, 64, 0.04);
}
.event-edit svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex: 0 0 auto;
}
.event-edit-icon {
  width: 44px;
  height: 44px;
  padding: 0;
}
.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .9rem;
  margin: .65rem 0 0;
  color: var(--ink);
  font-weight: 600;
}
.event-meta span {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-width: 0;
}
.event-meta svg {
  width: 16px;
  height: 16px;
  fill: var(--primary);
  flex: 0 0 auto;
}
.event-settings {
  margin: .55rem 0 0;
}
.event-settings a {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 44px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 600;
}
.event-settings svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.event-sheet .ticket-summary {
  background: transparent;
  box-shadow: none;
  padding: 0;
  margin: .1rem 0 .85rem;
}
.event-sheet .ticket-summary-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .15rem;
}
.event-sheet .ticket-summary-counts span {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .12rem;
  min-width: 0;
  padding: .1rem;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--muted);
  font-size: clamp(.58rem, 2.45vw, .74rem);
  font-weight: 700;
  line-height: 1.15;
}
.event-sheet .ticket-summary-counts strong {
  color: var(--ink);
  font-size: clamp(1rem, 4.5vw, 1.35rem);
  font-weight: 800;
  line-height: 1;
}
.event-sheet .ticket-summary-counts small {
  display: block;
  max-width: 100%;
  font-size: inherit;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.ticket-summary-money-row {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem .9rem;
  margin-top: .7rem;
}
.event-sheet .ticket-summary-pay,
.event-sheet .ticket-summary-money {
  margin: .35rem 0 0;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
}
.event-sheet .ticket-summary-pay {
  font-size: .78rem;
}
.event-sheet h2 {
  margin: 0 0 .7rem;
  font-size: 1.05rem;
}
.event-type-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .7rem;
  margin: 0 0 .75rem;
}
.event-sheet .ticket-type {
  position: relative;
  margin: 0;
  padding: .7rem .85rem .75rem;
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(43, 33, 64, 0.05);
}
.ticket-type-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .6rem;
}
.event-sheet .ticket-type h3 {
  margin: .35rem 0 0;
  font-size: .82rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1.3;
}
.ticket-type-price {
  margin: .45rem 0 0;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
}
.ticket-type-sold,
.ticket-type-left {
  margin: .15rem 0 0;
  font-weight: 700;
}
.ticket-type-use {
  margin: .35rem 0 0;
  color: var(--muted);
  font-size: .88rem;
}
.event-sheet .ticket-type-fold summary {
  width: 100%;
  background: var(--primary);
}
.event-panel {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(43, 33, 64, 0.05);
  padding: .95rem 1rem 1rem;
}
.event-work {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1.1rem;
}
.event-sheet .assign-search {
  gap: .65rem;
}
.event-sheet .assign-search .btn {
  width: 100%;
}
.event-sheet .holder-filters {
  gap: .4rem;
}
.event-sheet .ticket-fold summary {
  min-height: 58px;
}
.event-sheet .ticket-fold-number {
  font-family: ui-monospace, Consolas, monospace;
  font-size: .78rem;
  letter-spacing: .02em;
}
.ticket-manage {
  display: grid;
  gap: .7rem;
  margin-top: .2rem;
}
.ticket-manage article {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(43, 33, 64, 0.05);
  padding: .85rem .9rem .95rem;
}
.ticket-manage h3 {
  margin: 0;
  font-size: 1.05rem;
}
.ticket-manage p {
  margin: .25rem 0 .7rem;
  color: var(--muted);
}
.manual-name {
  display: flex;
  align-items: flex-end;
  gap: .4rem;
}
.manual-name label {
  flex: 1 1 auto;
  min-width: 0;
}
.manual-remove {
  width: 44px;
  height: 44px;
  margin-bottom: .15rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1;
}
.ticket-export-list {
  list-style: none;
  margin: 0 0 .8rem;
  padding: 0;
  display: grid;
  gap: .55rem;
}
.ticket-export-list li {
  display: grid;
  gap: .45rem;
  min-width: 0;
  padding: .7rem .8rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.ticket-export-actions,
.share-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
}
#printForm + .share-actions {
  margin-top: 1rem;
}
.ticket-export-actions .btn,
.share-actions .btn {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 52px;
  touch-action: manipulation;
  white-space: nowrap;
}
.ticket-success {
  display: grid;
  gap: .75rem;
}
.ticket-success h1 {
  margin: 0;
  color: var(--success);
  font-size: 1.55rem;
  line-height: 1.15;
}
.ticket-success-name {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
}
.ticket-success-type {
  margin: -.35rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}
.event-sheet button.is-busy {
  opacity: .6;
}
.print-entry { margin: 0 0 .8rem; }
.print-selected { margin: .15rem 0 .7rem; font-weight: 800; }
.print-picks { display: grid; gap: .45rem; margin: 0 0 .8rem; }
.print-pick {
  display: grid;
  grid-template-columns: 1.35rem minmax(0, 1fr);
  gap: .7rem;
  align-items: center;
  min-height: 56px;
  padding: .55rem .75rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.print-pick input { width: 1.25rem; height: 1.25rem; margin: 0; }
.print-pick strong { display: block; overflow-wrap: anywhere; }
.print-pick small { display: block; color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.print-sheet-list { list-style: decimal; padding-left: 1.35rem; }
.print-sheet-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .55rem;
}
.print-sheet-list li span { min-width: 0; overflow-wrap: anywhere; }
.print-note {
  color: var(--muted);
  font-size: .9rem;
}
.login-code-display {
  margin: .2rem 0 .35rem;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-align: center;
  overflow-wrap: anywhere;
}
.share-pdf { gap: .45rem; }
.share-pdf svg { width: 1.15rem; height: 1.15rem; fill: currentColor; flex: 0 0 auto; }
@media (min-width: 768px) {
  .event-type-grid {
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  }
  .event-sheet .ticket-type-fold summary {
    width: fit-content;
    min-width: 12rem;
    max-width: 100%;
  }
  .event-sheet .ticket-type-fold form {
    width: min(28rem, 100%);
  }
  .event-sheet .assign-search {
    flex-direction: row;
    align-items: flex-end;
  }
  .event-sheet .assign-search label {
    flex: 1 1 auto;
  }
  .event-sheet .assign-search .btn {
    width: auto;
    flex: 0 0 auto;
  }
}
@media (min-width: 1024px) {
  .event-work {
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    align-items: start;
  }
}

.school-qr-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: .9rem 1rem 1rem;
  margin-top: .85rem;
  min-width: 0;
  max-width: 100%;
}
.school-qr-card h2 { margin: 0 0 .35rem; font-size: 1rem; }
.school-qr-name {
  margin: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.school-qr-note { margin: .25rem 0 .75rem; }
.school-qr-frame {
  display: block;
  width: min(28rem, 100%);
  max-width: 100%;
  margin: 0 auto .85rem;
  padding: .75rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-sizing: border-box;
}
.school-qr-frame img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  background: #fff;
}
.school-qr-url { margin: 0 0 .75rem; }
.school-qr-actions {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  min-width: 0;
  max-width: 100%;
}
.school-qr-card [hidden] { display: none !important; }
.school-qr-title-form { margin: .75rem 0; }
.school-qr-title-form label { font-weight: 700; }
.school-qr-title-form input {
  width: 100%;
  font-weight: 700;
  text-align: center;
}
.school-qr-zoom {
  display: grid;
  gap: .25rem;
  font-weight: 700;
}
.school-qr-zoom input[type="range"] {
  --qr-thumb: 28px;
  --qr-track: 8px;
  --qr-ratio: 0;
  --qr-fill: calc(var(--qr-thumb) / 2 + var(--qr-ratio) * (100% - var(--qr-thumb)));
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  width: 100%;
  height: var(--qr-thumb);
  min-height: 52px;
  margin: .2rem 0;
  padding: calc((var(--qr-thumb) - var(--qr-track)) / 2) 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--primary);
  touch-action: manipulation;
  cursor: pointer;
}
.school-qr-zoom input[type="range"]:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}
.school-qr-zoom input[type="range"]::-webkit-slider-runnable-track {
  box-sizing: border-box;
  height: var(--qr-track);
  border: 0;
  border-radius: 999px;
  background: linear-gradient(to right, var(--primary) 0, var(--primary) var(--qr-fill), #141018 var(--qr-fill), #141018 100%);
}
.school-qr-zoom input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  width: var(--qr-thumb);
  height: var(--qr-thumb);
  margin-top: calc((var(--qr-track) - var(--qr-thumb)) / 2);
  border: 2px solid var(--primary);
  border-radius: 50%;
  background: #fff;
  box-shadow: none;
}
.school-qr-zoom input[type="range"]::-moz-range-track {
  box-sizing: border-box;
  height: var(--qr-track);
  border: 0;
  border-radius: 999px;
  background: #141018;
}
.school-qr-zoom input[type="range"]::-moz-range-progress {
  height: var(--qr-track);
  border: 0;
  border-radius: 999px;
  background: var(--primary);
}
.school-qr-zoom input[type="range"]::-moz-range-thumb {
  box-sizing: border-box;
  width: var(--qr-thumb);
  height: var(--qr-thumb);
  border: 2px solid var(--primary);
  border-radius: 50%;
  background: #fff;
  box-shadow: none;
}
.school-qr-zoom span { text-align: center; }
.school-qr-dirty {
  margin: .2rem 0 0;
  padding: .55rem .7rem;
  border-radius: 10px;
  background: #fff4d6;
  color: #6a3b00;
  font-weight: 700;
}
.school-qr-title-actions {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin: 0 0 .85rem;
}
.school-qr-title-actions .btn,
.school-qr-title-actions form { width: 100%; }
.school-qr-title-actions .btn { min-height: 52px; }
.school-qr-title-actions form { margin: 0; }
.school-qr-actions .btn {
  width: 100%;
  min-height: 52px;
  text-align: center;
  touch-action: manipulation;
}
.school-qr-share { gap: .45rem; }
.school-qr-share svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
  flex: 0 0 auto;
}
@media (min-width: 740px) {
  .school-qr-actions { flex-direction: row; flex-wrap: wrap; }
  .school-qr-actions .btn { flex: 1 1 9rem; width: auto; }
  .school-qr-title-actions { flex-direction: row; align-items: stretch; }
  .school-qr-title-actions .btn,
  .school-qr-title-actions form { width: auto; flex: 1 1 12rem; }
  .school-qr-title-actions form .btn { width: 100%; }
}



