.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 12px);
  background: var(--color-ink);
  color: #fff;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-card);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.event-header {
  position: relative;
  aspect-ratio: 782 / 195;
  min-height: 195px;
  border-radius: 0;
  overflow: hidden;
  margin: -32px -40px 0;
  width: calc(100% + 80px);
}

.event-header-art {
  position: absolute;
  inset: 0;
  /* The gradient placeholder classes (.placeholder-art etc.) are also used
     elsewhere with rounded corners, but this full-bleed header is always
     square regardless of which one gets attached as a fallback. */
  border-radius: 0;
}

.event-header-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 12px 40px 15px;
}

.event-header-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.event-header-meta {
  margin-top: 10px;
}

.event-header-meta h1 {
  font-family: var(--font-display);
  font-size: 54px;
  font-weight: 500;
  font-style: normal;
  line-height: 0.96;
  letter-spacing: -0.02em;
  margin: 0 0 11px;
  color: #101010;
  max-width: 520px;
  text-align: left;
}

.event-header-sub {
  color: var(--color-ink);
  font-size: 17px;
  margin-bottom: 2px;
}

.event-header-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.event-header-actions .btn {
  padding: 12px 26px;
  font-size: 14px;
}

.event-header-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(255, 255, 255, 0.9);
  color: var(--color-ink);
  backdrop-filter: blur(3px);
}

.event-header-actions .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.75);
  border-color: #fff;
}

.event-header + .tab-bar {
  background: var(--color-surface);
  border-radius: 0;
  box-shadow: var(--shadow-card);
  padding: 0 40px;
  margin: 0 -40px 24px;
  width: calc(100% + 80px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  color: var(--color-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 4px;
  margin-right: auto;
}

.btn-ghost:hover {
  color: var(--color-ink);
  text-decoration: underline;
}

.recent-checkins {
  display: flex;
  flex-direction: column;
  margin-top: 16px;
}

.recent-checkin-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--color-border);
  font-size: 13px;
}

.recent-checkin-row:last-child {
  border-bottom: none;
}

.recent-checkin-name {
  min-width: 0;
  font-weight: 600;
  color: var(--color-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-checkin-row .badge {
  justify-self: center;
}

.recent-checkin-time {
  color: var(--color-muted);
  white-space: nowrap;
  justify-self: end;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.two-col {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.chart-placeholder {
  width: 100%;
  height: 200px;
}

.chart-axis-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--color-muted);
  margin-top: 8px;
}

.ring-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  justify-content: center;
  padding-top: 8px;
}

.ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: conic-gradient(var(--color-accent) 0% 67%, var(--color-neutral-fill) 67% 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ring-inner {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ring-inner .pct {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
}

.ring-inner .lbl {
  font-size: 11px;
  color: var(--color-muted);
}

.legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.attendees-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.attendees-toolbar .search-input {
  flex: 1;
  min-width: 220px;
}

.checkin-wrap {
  max-width: 1180px;
  margin: 0;
}

.checkin-wrap .event-info-card,
.checkin-wrap .summary-card,
.checkin-wrap .attendee-list-card {
  display: none;
}

/* Arrival summary stacks on top, scanner card (rendered by organizer.js
   into #organizerApp) underneath. */
.checkin-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.checkin-wrap .arrival-summary {
  order: -1;
  display: flex;
  align-items: stretch;
  gap: 16px;
}

.arrival-cards {
  display: flex;
  flex: 1.2;
  gap: 10px;
}

.arrival-card {
  flex: 1;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 14px 8px;
  text-align: center;
}

.arrival-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--color-ink);
}

.arrival-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-accent);
  margin-top: 4px;
}

.arrival-progress-card {
  flex: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 18px 20px;
}

.arrival-progress-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--color-ink);
}

.arrival-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--color-muted);
  margin-bottom: 10px;
}

.checkin-wrap .checkin-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-accent);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 32px;
  margin-top: 4px;
}

.checkin-wrap .checkin-card h2 {
  font-size: 20px;
  margin-bottom: 4px;
}

.checkin-wrap .hint {
  color: var(--color-muted);
  font-size: 13px;
}

.checkin-wrap input[type="text"] {
  font-family: var(--font-body);
  font-size: 14px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-ink);
}

.checkin-wrap input[type="text"]:focus {
  outline: none;
  border-color: var(--color-accent);
}

.checkin-wrap .checkin-row {
  gap: 10px;
}

.checkin-wrap button {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius-pill);
  padding: 12px 26px;
  border: 1px solid var(--color-accent);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  cursor: pointer;
  transition: opacity 0.12s ease;
}

.checkin-wrap button:hover {
  opacity: 0.88;
}

/* #scanQrBtn: secondary outline so it doesn't compete with the primary
   Check In action right above it. */
.checkin-wrap #scanQrBtn {
  display: block;
  width: 100%;
  margin-top: 16px;
  background: var(--color-surface);
  color: var(--color-ink);
  border: 1px solid var(--color-border);
}

.checkin-wrap #scanQrBtn:hover {
  border-color: var(--color-ink);
  opacity: 1;
}

/* #qrReader is created and filled with the live camera feed by organizer.js
   (html5-qrcode) — we only style the container and add a CSS-only caption,
   nothing that depends on its internal markup. Animation replays every time
   it toggles from display:none to block, since that's a fresh render. */
.checkin-wrap #qrReader {
  position: relative;
  max-width: 320px;
  aspect-ratio: 1 / 1;
  margin: 20px auto 46px;
  border-radius: 20px;
  overflow: hidden;
  background: var(--color-ink);
  box-shadow: var(--shadow-card);
  animation: qrPopIn 0.35s ease;
}

.checkin-wrap #qrReader video,
.checkin-wrap #qrReader canvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

/* Layered over the live camera feed: the provided QR sample image (its own
   corner brackets are baked into the PNG — none are drawn here in CSS) plus
   the event artwork tinted at low opacity. One background so no extra DOM
   is needed and it survives organizer.js re-rendering #qrReader. */
.checkin-wrap #qrReader::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border-radius: 20px;
  opacity: 0.75;
  background:
    url('checkin-qr-sample.png') calc(50% + 7px) calc(50% + 10px) / 130% auto no-repeat,
    linear-gradient(135deg, rgba(240, 198, 192, 0.18) 0%, rgba(201, 138, 147, 0.18) 45%, rgba(110, 66, 88, 0.18) 100%);
}

.checkin-wrap #qrReader::after {
  content: "Align the QR code within the frame";
  position: absolute;
  z-index: 2;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 12px;
  text-align: center;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--color-muted);
}

@keyframes qrPopIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.checkin-wrap .checkin-message {
  position: relative;
  text-align: center;
  padding: 20px 20px 40px;
  animation: checkinMessageFade 1.6s ease forwards;
}

.checkin-wrap .checkin-message.success::before {
  content: "\2713";
  display: block;
  width: 36px;
  height: 36px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--color-success-text);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 36px;
}

@keyframes checkinMessageFade {
  0% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

.checkin-wrap .dev-panel {
  margin: 28px -32px -32px;
  padding: 20px 32px;
  border: none;
  border-top: 1px solid var(--color-border);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  background: var(--color-bg);
}

.checkin-wrap .dev-panel-label {
  color: var(--color-muted);
  font-size: 11px;
}

.checkin-wrap .dev-scan-btn {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
}

.checkin-wrap .dev-scan-btn:hover {
  border-color: var(--color-ink);
  color: var(--color-ink);
  background: var(--color-surface);
  opacity: 1;
}

.checkin-wrap .checkin-message {
  border-radius: 10px;
}

.checkin-wrap .checkin-message.success {
  background: var(--color-success-bg);
  color: var(--color-success-text);
}

.checkin-wrap .checkin-message.error {
  background: var(--color-error-bg);
  color: var(--color-error-text);
}

.checkin-result-card {
  text-align: center;
  padding: 32px 24px;
}

.checkin-check {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-success-bg);
  color: var(--color-success-text);
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.checkin-preview-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.checkin-preview-card {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 12px;
  font-size: 12px;
}

.danger-zone {
  border: 1px solid var(--color-warning-text);
  background: var(--color-warning-bg);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  margin-top: 24px;
}

.danger-zone h3 {
  font-size: 15px;
  color: var(--color-warning-text);
}

.live-tools-divider {
  margin: 36px 0 20px;
  padding-top: 24px;
  border-top: 1px dashed var(--color-border);
}

.live-tools-divider .live-tag {
  display: inline-block;
  margin-bottom: 12px;
}

/* Settings tab: each section is its own card, laid out in a responsive
   grid; each is static text until its own "Edit" button is clicked
   (see workspace.js toggleSettingsEdit). */
.settings-grid {
  display: grid;
  grid-template-columns: 1.8fr 1.3fr 1.3fr;
  gap: 20px;
  max-width: 1400px;
  align-items: stretch;
}

/* Settings cards' edit forms (Date & location, Event details, etc.) stack
   one field per line, matching the read-only view state's detail-rows
   instead of cramming several fields into a side-by-side row. */
.settings-edit .field-row {
  flex-direction: column;
  gap: 0;
}

@media (max-width: 860px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

/* Intentionally no grid-stacking trick here: in the resting (view) state,
   .settings-grid's default stretch alignment makes each row's cards match
   the tallest one, but clicking "Edit" lets that one card grow/shrink to
   fit its own form instead of staying pinned to the view state's height
   (the [hidden] attribute's default display:none is enough on its own). */

/* Hiding the Edit button while editing (workspace.js) would otherwise
   shrink the header row, since the button is taller than the bare
   title text — keep its space reserved so the header stays put too. */
.settings-toggle-card .settings-edit-btn[hidden] {
  display: inline-flex !important;
  visibility: hidden;
  pointer-events: none;
}

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

.settings-section-header .form-section-title {
  margin-bottom: 0;
}

.settings-edit-btn {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.settings-edit-btn:hover {
  border-color: var(--color-ink);
}

.detail-row {
  padding: 12px 0;
  border-bottom: 1px dashed var(--color-border);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
  margin-bottom: 4px;
}

.detail-value {
  display: block;
  font-size: 14px;
  color: var(--color-ink);
}

.settings-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.share-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.share-link-row input {
  flex: 1 1 100%;
  color: var(--color-muted);
  background: var(--color-bg);
}

@media (max-width: 860px) {
  .two-col {
    grid-template-columns: 1fr;
  }
  .checkin-preview-row {
    grid-template-columns: 1fr;
  }
}
