:root {
  color-scheme: light;
  --ink: #14161f;
  --muted: #626b7a;
  --line: #dde3ea;
  --paper: #ffffff;
  --surface: #f6f7f9;
  --surface-strong: #edf2f6;
  --accent: #c93f57;
  --accent-dark: #9e2c40;
  --teal: #16847d;
  --amber: #c57a1b;
  --good: #1e8c58;
  --bad: #b73535;
  --shadow: 0 18px 42px rgba(38, 45, 58, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family:
    Inter, "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  min-height: 88px;
  padding: 18px clamp(16px, 4vw, 48px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.identity-login-details {
  position: relative;
}

.identity-login-details > summary {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.identity-login-details > summary::-webkit-details-marker {
  display: none;
}

.identity-login-details[open] > summary {
  border-color: rgba(201, 63, 87, 0.45);
  background: #fff8fa;
}

.identity-login-details[open] .identity-login-form {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 420px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.identity-login-form {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.identity-switcher {
  min-width: 128px;
}

.identity-login-field {
  width: 132px;
}

.identity-switcher select,
.identity-login-form input {
  min-height: 38px;
}

.identity-login-form .secondary-action {
  min-height: 38px;
  padding: 0 12px;
}

.identity-caption {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

body:not(.admin-signed-in) .identity-caption,
body:not(.admin-signed-in) .tab-button[data-view="admin"] {
  display: none;
}

body:not(.admin-signed-in) .mode-tabs {
  grid-template-columns: repeat(2, minmax(92px, 1fr));
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1;
}

h2 {
  font-size: 24px;
  line-height: 1.15;
}

h3 {
  font-size: 17px;
  line-height: 1.2;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.muted,
.meta-line {
  color: var(--muted);
  line-height: 1.7;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.mode-tabs {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.tab-button {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.tab-button.is-active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 8px rgba(38, 45, 58, 0.1);
}

.tab-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

main {
  padding: clamp(16px, 3vw, 36px);
}

.app-view {
  display: none;
}

.app-view.is-active {
  display: block;
}

.event-shell {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(360px, 1.5fr) minmax(300px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.event-list-panel,
.event-detail-panel,
.checkout-panel,
.scanner-panel,
.stats-panel,
.event-day-check-panel,
.publish-check-panel,
.operations-panel,
.event-builder-panel,
.participant-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.event-list-panel,
.checkout-panel,
.scanner-panel,
.stats-panel,
.event-day-check-panel,
.publish-check-panel,
.operations-panel,
.event-builder-panel,
.participant-panel {
  padding: 18px;
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading.compact {
  margin-bottom: 12px;
}

.event-list {
  display: grid;
  gap: 10px;
}

.event-card {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 14px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.event-card.is-active {
  border-color: rgba(201, 63, 87, 0.55);
  background: #fff8fa;
}

.event-card.is-paused,
.organizer-event.is-paused {
  border-style: dashed;
  background: #f8fafb;
}

.event-card strong {
  line-height: 1.3;
}

.event-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.event-detail-panel {
  overflow: hidden;
}

.event-art {
  position: relative;
  min-height: 196px;
  overflow: hidden;
  background:
    radial-gradient(circle at 24% 20%, rgba(255, 255, 255, 0.76), transparent 14%),
    linear-gradient(135deg, #1f2530 0%, #513049 42%, #0d625c 100%);
}

.event-art::before,
.event-art::after {
  position: absolute;
  content: "";
  bottom: 28px;
  width: 28%;
  height: 80%;
  border-radius: 50% 50% 4px 4px;
  background: rgba(255, 255, 255, 0.14);
  transform-origin: bottom center;
}

.event-art::before {
  left: 22%;
  transform: rotate(-19deg);
}

.event-art::after {
  right: 18%;
  transform: rotate(17deg);
}

.spotlight {
  position: absolute;
  inset: 18px 14% auto;
  height: 48px;
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.stage-lines {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 52px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.14) 0 1px, transparent 1px 52px);
}

.event-summary,
.ticket-types {
  padding: 20px;
}

.event-summary h2 {
  margin-bottom: 10px;
  font-size: clamp(26px, 4vw, 44px);
}

.event-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-top: 16px;
}

.event-summary-actions .muted {
  font-size: 13px;
}

.event-notice {
  display: grid;
  gap: 6px;
  margin: 0 20px 20px;
  padding: 14px;
  border: 1px solid rgba(197, 122, 27, 0.26);
  border-radius: 8px;
  background: #fffaf0;
}

.event-notice.is-canceled {
  border-color: rgba(183, 53, 53, 0.28);
  background: #fff7f7;
}

.event-notice strong {
  font-size: 15px;
}

.event-notice p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.event-info-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 20px 20px;
}

.event-info-card {
  display: grid;
  gap: 6px;
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.event-info-card strong {
  font-size: 14px;
}

.event-info-card p {
  color: var(--muted);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-block: 1px solid var(--line);
  background: #fbfcfd;
}

.info-grid div {
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
}

.info-grid div:last-child {
  border-right: 0;
}

.label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ticket-type-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ticket-type {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.ticket-type .price {
  font-size: 22px;
  font-weight: 900;
}

.ticket-type .stock {
  color: var(--muted);
  font-size: 13px;
}

.checkout-form,
.manual-scan-form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(22, 132, 125, 0.18);
  border-color: var(--teal);
}

textarea {
  min-height: 94px;
  padding: 10px 12px;
  line-height: 1.45;
  resize: vertical;
}

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

.primary-action,
.secondary-action {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 6px;
  font-weight: 850;
}

.primary-action {
  border: 1px solid var(--accent-dark);
  background: var(--accent);
  color: white;
}

.secondary-action {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}

.secondary-action.is-active {
  border-color: rgba(22, 132, 125, 0.5);
  background: rgba(22, 132, 125, 0.1);
  color: var(--teal);
}

.checkout-result,
.scan-result {
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
  background: #f5faf8;
  border: 1px solid rgba(30, 140, 88, 0.22);
}

.checkout-result.is-error {
  background: #fff7f7;
  border-color: rgba(183, 53, 53, 0.28);
}

.checkout-result.is-success {
  background: #f4fbf7;
  border-color: rgba(30, 140, 88, 0.28);
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.ticket-wallet {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.wallet-profile-panel {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(260px, 0.9fr);
  gap: 14px;
  margin-bottom: 18px;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.wallet-profile-form,
.ticket-lookup-form,
.ticket-recovery-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.wallet-profile-form > div,
.ticket-lookup-form > div,
.ticket-recovery-form > div {
  grid-column: 1 / -1;
}

.wallet-profile-panel .checkout-result {
  grid-column: 1 / -1;
  margin-top: 0;
}

.ticket-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.ticket-card canvas {
  width: 220px;
  height: 220px;
  image-rendering: pixelated;
  border: 8px solid white;
  box-shadow: 0 0 0 1px var(--line);
}

.ticket-card h3 {
  margin-bottom: 8px;
  font-size: 20px;
}

.ticket-code {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--surface-strong);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  font-weight: 900;
}

.order-badge {
  display: inline-block;
  margin-top: 10px;
  margin-right: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(38, 64, 110, 0.1);
  color: #26406e;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  font-weight: 900;
}

.serial-badge {
  display: inline-block;
  margin-top: 10px;
  margin-right: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(22, 132, 125, 0.12);
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
}

.ticket-status {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(197, 122, 27, 0.15);
  color: #7f4a07;
  font-size: 12px;
  font-weight: 850;
}

.ticket-status.is-checked {
  background: rgba(30, 140, 88, 0.14);
  color: var(--good);
}

.ticket-status.is-voided,
.status-pill.is-voided {
  background: rgba(183, 53, 53, 0.12);
  color: var(--bad);
}

.ticket-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ticket-actions .secondary-action {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.nomination-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.nomination-editor .secondary-action {
  min-height: 42px;
}

.nomination-note {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.transfer-panel {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.transfer-panel strong {
  display: block;
  margin-bottom: 4px;
}

.transfer-qr-payment {
  display: grid;
  justify-items: start;
  gap: 6px;
  margin: 10px 0;
}

.transfer-qr-payment span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.transfer-qr-payment img {
  width: min(220px, 100%);
  height: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.transfer-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.transfer-info-grid div {
  padding: 8px;
  border-radius: 6px;
  background: var(--surface-strong);
}

.transfer-info-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.transfer-info-grid b {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.transfer-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr));
  gap: 10px;
  align-items: end;
  margin-top: 10px;
}

.transfer-form label {
  min-width: 0;
}

.transfer-form .secondary-action {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 42px;
}

.empty-state {
  padding: 32px;
  text-align: center;
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
}

.active-event-control {
  min-width: min(360px, 100%);
}

.manual-issue-form {
  display: grid;
  gap: 12px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(280px, 0.75fr);
  gap: 18px;
  margin-bottom: 18px;
}

.event-builder-panel,
.manual-issue-panel,
.event-day-check-panel,
.publish-check-panel,
.operations-panel,
.transfer-settings-panel,
.transfer-reconcile-panel,
.transfer-overdue-panel {
  margin-bottom: 18px;
}

.event-day-check-panel,
.publish-check-panel {
  padding: 18px;
}

.event-day-check-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.event-day-check-summary strong {
  font-size: 17px;
}

.event-day-check-summary span {
  color: var(--muted);
  font-weight: 800;
}

.event-day-check-summary.is-ok {
  border-color: rgba(30, 140, 88, 0.35);
  background: #f1fbf6;
}

.event-day-check-summary.is-warn {
  border-color: rgba(197, 122, 27, 0.35);
  background: #fff8ec;
}

.event-day-check-summary.is-bad {
  border-color: rgba(183, 53, 53, 0.35);
  background: #fff3f3;
}

.event-day-check-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.event-day-check-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.event-day-check-badge {
  min-width: 48px;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.event-day-check-item strong {
  display: block;
  margin-bottom: 4px;
}

.event-day-check-item p {
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.event-day-check-item.is-ok .event-day-check-badge {
  background: #e6f6ef;
  color: var(--good);
}

.event-day-check-item.is-warn .event-day-check-badge {
  background: #fff0d8;
  color: var(--amber);
}

.event-day-check-item.is-bad .event-day-check-badge {
  background: #ffe2e2;
  color: var(--bad);
}

.operations-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.operations-list li {
  display: grid;
  grid-template-columns: minmax(110px, 0.28fr) minmax(0, 1fr);
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.operations-list strong {
  color: var(--ink);
  font-size: 15px;
}

.operations-list span {
  color: var(--muted);
  line-height: 1.65;
}

.order-panel,
.audit-panel {
  margin-bottom: 18px;
}

.transfer-reconcile-list,
.transfer-overdue-list,
.order-list {
  display: grid;
  gap: 12px;
}

.audit-log-list {
  display: grid;
  gap: 10px;
}

.audit-log-item {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.audit-log-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.audit-log-heading strong {
  line-height: 1.35;
}

.audit-log-meta {
  color: var(--muted);
  font-size: 13px;
}

.order-item {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.transfer-reconcile-item {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(18, 115, 105, 0.22);
  border-radius: 8px;
  background: rgba(18, 115, 105, 0.06);
}

.transfer-overdue-item {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(183, 53, 53, 0.22);
  border-radius: 8px;
  background: rgba(183, 53, 53, 0.06);
}

.transfer-overdue-item .transfer-reconcile-grid div {
  border-color: rgba(183, 53, 53, 0.14);
}

.order-item-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.order-item-heading > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.order-item-heading strong,
.order-item-heading small {
  overflow-wrap: anywhere;
}

.order-item-heading small {
  color: var(--muted);
}

.order-item-metrics,
.order-ticket-lines,
.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.transfer-reconcile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.transfer-reconcile-grid div {
  padding: 8px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid rgba(18, 115, 105, 0.12);
}

.transfer-reconcile-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.transfer-reconcile-grid strong {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.order-item-metrics span {
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.transfer-summary {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(18, 115, 105, 0.08);
  color: var(--ink);
  font-size: 13px;
}

.transfer-summary span {
  color: var(--muted);
}

.builder-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.event-builder-form,
.transfer-settings-form {
  display: grid;
  gap: 12px;
}

.transfer-qr-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.transfer-qr-field > input[type="hidden"] {
  display: none;
}

.transfer-qr-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 78px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--muted);
  font-size: 13px;
  grid-column: 1 / -1;
}

.transfer-qr-preview img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.transfer-qr-preview.is-empty {
  min-height: 52px;
}

.transfer-settings-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.transfer-settings-status strong {
  display: block;
  margin-bottom: 4px;
}

.transfer-settings-status p {
  margin: 0;
  color: var(--muted);
}

.transfer-settings-status span {
  color: var(--ink);
  font-weight: 850;
  white-space: nowrap;
}

.transfer-settings-status ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.transfer-settings-status.is-ok {
  border-color: rgba(30, 140, 88, 0.35);
  background: #f1fbf6;
}

.transfer-settings-status.is-bad {
  border-color: rgba(183, 53, 53, 0.35);
  background: #fff3f3;
}

.form-actions,
.organizer-event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.form-actions .primary-action,
.form-actions .secondary-action,
.organizer-event-actions .secondary-action {
  min-height: 38px;
  padding: 0 12px;
  font-size: 13px;
}

.builder-preview {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(22, 132, 125, 0.22);
  border-radius: 8px;
  background: #f5faf8;
}

.builder-preview.is-error {
  border-color: rgba(183, 53, 53, 0.28);
  background: #fff7f7;
}

.preview-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-lines span {
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.organizer-event-list {
  display: grid;
  gap: 10px;
}

.organizer-event {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.organizer-event.is-active {
  border-color: rgba(201, 63, 87, 0.55);
  background: #fff8fa;
}

.organizer-event strong {
  line-height: 1.3;
}

.organizer-event span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

#scanner-video {
  width: 100%;
  max-height: 320px;
  margin-bottom: 14px;
  border-radius: 8px;
  background: #111;
}

.scanner-start-action {
  width: 100%;
  margin-bottom: 12px;
}

.scan-helper {
  margin-top: 10px;
  font-size: 13px;
}

.stats-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.metric {
  display: grid;
  gap: 8px;
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.metric span {
  color: var(--muted);
  font-weight: 800;
}

.metric strong {
  font-size: 34px;
}

.nomination-board {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.report-board {
  display: grid;
  gap: 10px;
  align-content: start;
}

.report-line {
  display: grid;
  grid-template-columns: minmax(112px, 1fr) auto;
  gap: 8px 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.report-line span,
.report-line small {
  color: var(--muted);
}

.report-line small {
  grid-column: 1 / -1;
}

.rank-line {
  display: grid;
  grid-template-columns: minmax(112px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.rank-line span {
  color: var(--muted);
}

.participant-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(150px, 0.8fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.filter-summary {
  grid-column: 1 / -1;
  align-self: center;
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}

.ticket-detail-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid rgba(22, 132, 125, 0.22);
  border-radius: 8px;
  background: #f5faf8;
}

.ticket-detail-panel.is-empty {
  border-style: dashed;
  background: #fbfcfd;
}

.ticket-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ticket-detail-heading h3 {
  margin-top: 3px;
}

.ticket-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.ticket-detail-grid div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.ticket-detail-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.ticket-detail-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ticket-detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

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

table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td {
  line-height: 1.45;
}

tbody tr.is-selected {
  background: #f5faf8;
}

.table-action {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.danger-action {
  border-color: rgba(183, 53, 53, 0.32);
  color: var(--bad);
}

.status-pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(197, 122, 27, 0.15);
  color: #7f4a07;
  font-size: 12px;
  font-weight: 850;
}

.status-pill.is-checked {
  background: rgba(30, 140, 88, 0.14);
  color: var(--good);
}

.scan-result.is-error {
  background: #fff7f7;
  border-color: rgba(183, 53, 53, 0.28);
}

.scan-result.is-success {
  background: #f4fbf7;
  border-color: rgba(30, 140, 88, 0.28);
}

.scan-result.is-payment {
  background: #fffaf0;
  border-color: rgba(197, 122, 27, 0.28);
}

.scan-inline-action {
  margin-top: 12px;
}

.checkin-focus main {
  padding: clamp(8px, 2vw, 18px);
}

.checkin-focus .topbar {
  position: static;
  min-height: auto;
  padding: 8px clamp(10px, 3vw, 18px);
}

.checkin-focus.admin-signed-in .topbar {
  display: none;
}

.checkin-focus .topbar h1,
.checkin-focus .mode-tabs,
.checkin-focus .identity-caption {
  display: none;
}

.checkin-focus .topbar-actions,
.checkin-focus .identity-login-form {
  width: 100%;
}

.checkin-focus .identity-login-form {
  justify-content: stretch;
}

.checkin-focus .identity-switcher,
.checkin-focus .identity-login-field,
.checkin-focus .identity-login-form .secondary-action {
  flex: 1 1 120px;
}

.checkin-focus .workspace-header {
  align-items: stretch;
  margin-bottom: 8px;
}

.checkin-focus .workspace-header > div:first-child {
  display: none;
}

.checkin-focus .admin-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  width: 100%;
  gap: 8px;
  align-items: end;
}

.checkin-focus .active-event-control {
  min-width: 0;
}

.checkin-focus .scanner-panel {
  padding: clamp(10px, 3vw, 16px);
}

.checkin-focus #scanner-video:not([hidden]) {
  display: block;
  height: min(62dvh, 560px);
  max-height: none;
  object-fit: cover;
  object-position: center;
}

.checkin-focus .event-builder-panel,
.checkin-focus .event-day-check-panel,
.checkin-focus .publish-check-panel,
.checkin-focus .operations-panel,
.checkin-focus .order-panel,
.checkin-focus .participant-panel,
.checkin-focus .nomination-board,
.checkin-focus .report-board {
  display: none;
}

.checkin-focus #admin-view .operations-panel {
  display: none;
}

.checkin-focus .admin-layout {
  grid-template-columns: minmax(0, 1fr);
  max-width: 760px;
  margin-inline: auto;
}

.checkin-focus #manual-token {
  min-height: 54px;
  font-size: 20px;
  text-transform: uppercase;
}

.checkin-focus .manual-scan-form .primary-action,
.checkin-focus #start-camera {
  min-height: 54px;
  font-size: 17px;
}

.checkin-focus .stats-panel {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 760px;
  margin-inline: auto;
}

@media (max-width: 720px) {
  .transfer-qr-field {
    grid-template-columns: minmax(0, 1fr);
  }

  .transfer-settings-status {
    grid-template-columns: minmax(0, 1fr);
  }

  .transfer-settings-status span {
    white-space: normal;
  }

  .checkin-focus .topbar {
    padding-block: 6px;
  }

  .checkin-focus .identity-login-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .checkin-focus .identity-login-field,
  .checkin-focus .identity-login-form .secondary-action {
    width: 100%;
  }

  .checkin-focus .admin-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .checkin-focus #scanner-video:not([hidden]) {
    height: min(68dvh, 620px);
    margin-bottom: 8px;
  }

  .checkin-focus .scanner-panel {
    padding: 10px;
  }

  .checkin-focus .scanner-panel .muted {
    line-height: 1.45;
  }

  .checkin-focus .stats-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .event-shell,
  .admin-layout,
  .builder-grid,
  .event-day-check-list,
  .wallet-profile-panel {
    grid-template-columns: 1fr;
  }

  .event-list {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar,
  .workspace-header {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    min-height: 0;
    gap: 10px;
    padding: 12px 16px;
  }

  .topbar > div:first-child .eyebrow {
    display: none;
  }

  .topbar h1 {
    font-size: 26px;
  }

  .topbar-actions {
    align-items: stretch;
    justify-content: stretch;
    gap: 8px;
  }

  .identity-login-details {
    width: 100%;
  }

  .identity-login-details > summary {
    justify-content: center;
    width: 100%;
  }

  .identity-login-details[open] .identity-login-form {
    position: static;
    min-width: 0;
    margin-top: 8px;
  }

  .mode-tabs {
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .info-grid,
  .ticket-type-list,
  .form-row,
  .stats-panel,
    .ticket-detail-grid,
    .participant-toolbar,
    .nomination-editor,
    .event-info-list,
    .operations-list li,
    .transfer-reconcile-grid,
    .transfer-info-grid,
    .transfer-form,
    .ticket-card,
    .wallet-profile-form,
    .ticket-lookup-form,
    .ticket-recovery-form {
    grid-template-columns: 1fr;
  }

  .ticket-detail-heading {
    flex-direction: column;
  }

  .order-item-heading {
    flex-direction: column;
  }

  .info-grid div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .info-grid div:last-child {
    border-bottom: 0;
  }

  .ticket-card canvas {
    width: 220px;
    height: 220px;
  }
}
