/* ============================================================
   EventNook Exhibitor Scan — Design System
   Mobile-first, no framework. Shared by index.html & home.html
   ============================================================ */

:root {
  /* Brand */
  --brand: #007aff;
  --brand-2: #0040dd;
  --brand-deep: #0b4db9;
  --brand-grad: linear-gradient(135deg, #2f8bff 0%, #0040dd 100%);
  --brand-grad-soft: linear-gradient(135deg, #eef4ff 0%, #e3ecff 100%);

  /* Neutrals */
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e6eaf2;
  --bg: #f4f6fb;
  --card: #ffffff;

  /* Status */
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --info: #3b82f6;
  --info-bg: #eff6ff;

  /* Shape */
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 26px;

  /* Elevation */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 6px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 18px 48px rgba(15, 23, 42, 0.18);

  /* Safe areas (iOS notch / home indicator) */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Bar heights */
  --appbar-h: 56px;
  --tabbar-h: 64px;

  /* Max content width (keeps layout app-like on tablet/desktop) */
  --content-max: 560px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.45;
}

input, button, textarea, select { font-family: inherit; }
button { cursor: pointer; }
a { color: var(--brand-deep); }

/* ---------- Animations ---------- */
@keyframes fadeIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes scanline { 0% { top: 6%; } 50% { top: 92%; } 100% { top: 6%; } }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: none;
  border-radius: var(--r);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.95rem 1.25rem;
  min-height: 50px;
  color: var(--ink);
  background: #eef1f6;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; pointer-events: none; }
.btn svg { width: 20px; height: 20px; flex: none; }

.btn-block { width: 100%; }
.btn-lg { padding: 1.05rem 1.4rem; font-size: 1.05rem; min-height: 56px; }

.btn-primary {
  background: var(--brand-grad);
  color: #fff;
  box-shadow: 0 8px 22px rgba(0, 64, 221, 0.28);
}
.btn-primary:active { box-shadow: 0 4px 12px rgba(0, 64, 221, 0.3); }

.btn-outline {
  background: #fff;
  color: var(--brand-deep);
  border: 1.5px solid var(--brand);
}
.btn-outline:active { background: #f0f6ff; }

.btn-soft {
  background: var(--brand-grad-soft);
  color: var(--brand-deep);
}

.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:active { background: rgba(15, 23, 42, 0.05); }

.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }

/* Prominent "Add/Edit Note" action — amber, ties to the yellow note theme */
.btn-note {
  background: linear-gradient(135deg, #ffdd57, #f6b100);
  color: #4a3800;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(246, 177, 0, 0.30);
}
.btn-note:active { background: linear-gradient(135deg, #ffd633, #e8a800); }

/* Icon-only round button */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  transition: background 0.2s, transform 0.12s;
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.on-light { background: #fff; color: var(--ink-2); box-shadow: var(--shadow-sm); }

/* ============================================================
   App shell (home.html)
   ============================================================ */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.app-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  height: calc(var(--appbar-h) + var(--safe-top));
  padding-top: var(--safe-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 1rem;
  padding-right: 0.5rem;
  background: var(--brand-grad);
  color: #fff;
  box-shadow: 0 2px 14px rgba(0, 64, 221, 0.22);
}
.app-bar__title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70vw;
}

.app-content {
  flex: 1;
  padding-top: calc(var(--appbar-h) + var(--safe-top));
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 8px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Bottom tab bar */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: flex;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted-2);
  font-size: 0.72rem;
  font-weight: 600;
  border: none;
  background: none;
  transition: color 0.18s;
}
.tabbar__item svg { width: 24px; height: 24px; }
.tabbar__item.active { color: var(--brand); }
.tabbar__item.active svg { transform: translateY(-1px); }

/* ============================================================
   Generic layout helpers (only what's used)
   ============================================================ */
.page { padding: 1.1rem 1rem 1.5rem; animation: fadeIn 0.4s; max-width: var(--content-max); margin: 0 auto; }
.section-title { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 1rem; }
.stack { display: grid; gap: 0.75rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.hidden { display: none !important; }

/* ============================================================
   Cards & list
   ============================================================ */
.card {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-pad { padding: 1.1rem 1.15rem; }

.contact-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 0.85rem 0.95rem;
  transition: transform 0.12s, box-shadow 0.2s, border-color 0.2s;
}
.contact-card:active { transform: scale(0.985); box-shadow: var(--shadow); border-color: #cdd9ee; }
.contact-card__avatar {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--brand-deep);
  background: var(--brand-grad-soft);
}
.contact-card__body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.contact-card__name {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contact-card__meta {
  font-size: 0.86rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contact-card__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex: none;
}
.contact-card__note { color: #f0a500; flex: none; }
.contact-card__ago { font-size: 0.72rem; color: var(--muted-2); white-space: nowrap; }
.contact-card__chev { color: var(--muted-2); flex: none; }

/* Sort segmented control */
.sort-toggle {
  display: inline-flex;
  gap: 2px;
  background: #eef1f6;
  border-radius: 999px;
  padding: 3px;
  margin-bottom: 1rem;
}
.sort-toggle button {
  border: none;
  background: none;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.sort-toggle button.active {
  background: #fff;
  color: var(--brand-deep);
  box-shadow: var(--shadow-sm);
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
}
.empty svg { width: 56px; height: 56px; color: var(--muted-2); margin-bottom: 0.75rem; }

/* ---------- Search field ---------- */
.search {
  position: relative;
  margin-bottom: 1rem;
}
.search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--muted-2);
}
.search input {
  width: 100%;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: var(--r);
  padding: 0.85rem 1rem 0.85rem 2.6rem;
  font-size: 1rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12); }

/* ---------- Skeleton ---------- */
.skeleton {
  border-radius: var(--r);
  background: linear-gradient(100deg, #eef1f6 30%, #f7f9fc 50%, #eef1f6 70%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ============================================================
   Home tab
   ============================================================ */
.home-hero {
  background: var(--brand-grad);
  color: #fff;
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  padding: 0.4rem 1.15rem 1.6rem;
  margin: 0 0 1.3rem;
}
.home-hero__inner { max-width: var(--content-max); margin: 0 auto; }
.home-hero__eyebrow { font-size: 0.78rem; font-weight: 600; opacity: 0.85; letter-spacing: 0.04em; text-transform: uppercase; }
.home-hero__name { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; line-height: 1.2; }

/* Home tab fills the area between the app bar and tab bar */
.home-tab {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - var(--appbar-h) - var(--safe-top) - var(--tabbar-h) - var(--safe-bottom) - 8px);
}

/* Embedded event landing banner (kiosk exhibitor page) — full width (iPad-friendly) */
.home-banner {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 240px;
  background: var(--brand-grad-soft);
  overflow: hidden;
}
.home-banner__loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  background: var(--brand-grad-soft);
  color: var(--brand-deep);
  font-weight: 600;
  font-size: 0.9rem;
}
.home-banner__spinner {
  width: 34px;
  height: 34px;
  border: 4px solid rgba(0, 64, 221, 0.2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.home-banner iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: transparent;
}

/* Compact action buttons under the banner */
.home-actions {
  flex: none;
  display: grid;
  gap: 0.85rem;
  padding: 1rem 1rem 0.7rem;
}
.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  border: none;
  border-radius: var(--r);
  padding: 0.78rem 1rem;
  min-height: 52px;
  font-weight: 700;
  font-size: 1.05rem;
  background: #eef1f6;
  color: var(--ink);
  transition: transform 0.12s, box-shadow 0.2s;
}
.action-btn:active { transform: scale(0.985); }
.action-btn svg { width: 20px; height: 20px; flex: none; }
.action-btn--primary { background: var(--brand-grad); color: #fff; box-shadow: 0 6px 18px rgba(0, 64, 221, 0.25); }
/* Shared secondary style for View Contacts + Dashboard */
.action-btn--secondary {
  background: #fff;
  color: var(--brand-deep);
  border: 1.5px solid #dbe3f0;
  box-shadow: var(--shadow-sm);
}
.action-btn--secondary:active { background: #f5f8ff; }

/* Contacts header with total count */
.contacts-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1rem; }
.contacts-head .section-title { margin: 0; }
.count-pill {
  background: var(--brand-grad-soft);
  color: var(--brand-deep);
  font-weight: 800;
  font-size: 0.9rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  min-width: 30px;
  text-align: center;
}

/* Home action cards */
.home-action {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--r-lg);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s, box-shadow 0.2s;
}
.home-action:active { transform: scale(0.985); box-shadow: var(--shadow); }
.home-action__icon {
  flex: none;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-grad-soft);
  color: var(--brand-deep);
}
.home-action__icon svg { width: 26px; height: 26px; }
.home-action__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.home-action__title { font-weight: 800; font-size: 1.1rem; letter-spacing: -0.01em; }
.home-action__sub { color: var(--muted); font-size: 0.86rem; }
.home-action__chev { color: var(--muted-2); flex: none; }
.home-action.primary {
  border: none;
  background: var(--brand-grad);
  color: #fff;
  box-shadow: 0 10px 26px rgba(0, 64, 221, 0.28);
}
.home-action.primary .home-action__sub { color: rgba(255, 255, 255, 0.85); }
.home-action.primary .home-action__icon { background: rgba(255, 255, 255, 0.2); color: #fff; }
.home-action.primary .home-action__chev { color: rgba(255, 255, 255, 0.8); }

/* ============================================================
   QR scan tab
   ============================================================ */
.scanner {
  position: relative;
  background: #000;
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  overflow: hidden;
  min-height: 56vh;
  max-width: var(--content-max);
  margin: 0 auto;
}
.scan-panel { max-width: var(--content-max); margin: 0 auto; }
#qr-reader {
  width: 100% !important;
  border: 0;
}
#qr-reader video { width: 100% !important; height: auto !important; display: block; object-fit: cover; }
#qr-reader img[alt="Info icon"], #qr-reader__dashboard_section_csr { display: none !important; }

.scan-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}
.scan-frame__box {
  position: relative;
  width: 70vw;
  max-width: 300px;
  aspect-ratio: 1;
}
.scan-frame__box::before,
.scan-frame__box::after,
.scan-frame__box > i::before,
.scan-frame__box > i::after {
  content: "";
  position: absolute;
  width: 34px;
  height: 34px;
  border: 4px solid #fff;
  border-radius: 6px;
}
.scan-frame__box::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.scan-frame__box::after { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.scan-frame__box > i::before { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.scan-frame__box > i::after { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.scan-frame__line {
  position: absolute;
  left: 6%;
  right: 6%;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, #36d1ff, transparent);
  box-shadow: 0 0 12px #36d1ff;
  animation: scanline 2.4s ease-in-out infinite;
}

.scan-tools {
  position: absolute;
  top: calc(0.75rem + var(--safe-top));
  right: 0.75rem;
  z-index: 6;
}

/* Status step indicator (Scanning -> Scanned -> Processing) */
.scan-steps {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  white-space: nowrap;
}
.scan-step {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.45);
  transition: color 0.2s;
}
.scan-step.active { color: #fff; }
.scan-step.done { color: #36d1ff; }
.scan-step__sep {
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.28);
  transition: background 0.2s;
}
.scan-step__sep.done { background: #36d1ff; }

/* Overlay shown when the camera feed isn't useful (starting/scanned/processing) */
.scan-status {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
}
.scan-status__spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}
.scan-status__check { width: 50px; height: 50px; color: #36d1ff; animation: fadeIn 0.2s; }

.scan-panel {
  padding: 1.1rem 1rem 1.4rem;
  text-align: center;
}
.scan-panel h2 { font-size: 1.25rem; font-weight: 800; margin: 0.2rem 0; }
.scan-code {
  font-size: 0.8rem;
  color: var(--muted);
  word-break: break-all;
  margin-bottom: 0.6rem;
}

/* ============================================================
   Alert toast
   ============================================================ */
.toast-wrap {
  position: fixed;
  top: calc(var(--safe-top) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  width: min(92vw, 460px);
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-radius: var(--r);
  background: #fff;
  box-shadow: var(--shadow-lg);
  border-left: 5px solid var(--info);
  animation: fadeIn 0.3s;
  font-weight: 600;
  font-size: 0.95rem;
}
.toast__msg { flex: 1; }
.toast__close {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  padding: 0 0.2rem;
}
.toast.is-danger, .toast.is-error { border-left-color: var(--danger); background: var(--danger-bg); color: #991b1b; }
.toast.is-success { border-left-color: var(--success); background: var(--success-bg); color: #065f46; }
.toast.is-warning { border-left-color: var(--warning); background: var(--warning-bg); color: #92400e; }
.toast.is-info { border-left-color: var(--info); background: var(--info-bg); color: #1e40af; }

/* ============================================================
   Modals / sheets
   ============================================================ */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(8, 17, 38, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: backdropIn 0.25s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* Bottom sheet (settings) */
.sheet {
  background: var(--bg);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 0.6rem 1rem calc(1rem + var(--safe-bottom));
  animation: sheetUp 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  max-height: 88vh;
  overflow-y: auto;
}
.sheet__grabber {
  width: 42px;
  height: 5px;
  border-radius: 5px;
  background: #cbd5e1;
  margin: 0.3rem auto 0.9rem;
}
.sheet__title { font-size: 1.15rem; font-weight: 800; margin: 0 0 0.8rem; padding: 0 0.25rem; }

.menu-list {
  background: #fff;
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 0.9rem;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 1rem 1.1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: #f1f5f9; }
.menu-item svg { width: 22px; height: 22px; color: var(--muted); }
.menu-item.is-danger { color: var(--danger); }
.menu-item.is-danger svg { color: var(--danger); }

/* Full-screen sheet (attendee details, dashboard) */
.fullsheet {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  animation: sheetUp 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.fullsheet__bar {
  flex: none;
  height: calc(var(--appbar-h) + var(--safe-top));
  padding-top: var(--safe-top);
  padding-left: 1rem;
  padding-right: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.fullsheet__title { font-size: 1.1rem; font-weight: 800; }
.fullsheet__body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.fullsheet__body.is-frame { display: flex; }
.fullsheet__footer {
  flex: none;
  padding: 0.8rem 1rem calc(0.8rem + var(--safe-bottom));
  background: #fff;
  border-top: 1px solid var(--line);
}

/* Attendee detail fields */
.detail-head {
  background: var(--brand-grad);
  color: #fff;
  padding: 1.4rem 1.2rem 1.5rem;
  text-align: center;
}
.detail-head__avatar {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 auto 0.7rem;
}
.detail-head__name { font-size: 1.3rem; font-weight: 800; }
.detail-head__sub { opacity: 0.9; font-size: 0.92rem; }

/* Scan result confirmation banner */
.result-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1rem 1rem 0;
  padding: 0.85rem 1rem;
  border-radius: var(--r);
  font-weight: 700;
  font-size: 0.95rem;
}
.result-banner svg { width: 24px; height: 24px; flex: none; }
.result-banner.is-success { background: var(--success-bg); color: #065f46; }
.result-banner.is-warning { background: var(--warning-bg); color: #92400e; }

/* Notes block (kept near the top of the attendee sheet) */
.notes-block { padding: 1rem 1rem 0; }
.notes-block__label { margin: 0 0 0.4rem 0.25rem; }
.notes-block__view { margin: 0 0 0.6rem; }
.notes-block__actions { display: flex; gap: 0.6rem; margin-top: 0.7rem; }
.notes-block__actions .btn { flex: 1; }

.field-list { padding: 1rem; display: grid; gap: 0.55rem; }
.field-row {
  background: #fff;
  border-radius: var(--r);
  padding: 0.8rem 1rem;
  box-shadow: var(--shadow-sm);
}
.field-row.is-highlight {
  background: var(--info-bg);
  box-shadow: inset 0 0 0 1.5px rgba(59, 130, 246, 0.35);
}
.field-row__label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}
.field-row__value { color: var(--ink); word-break: break-word; }
.field-row__value a { color: var(--brand-deep); }

.note-box {
  background: #fff8d6;
  border: 1px solid #fbe98a;
  border-radius: var(--r);
  padding: 0.9rem 1rem;
  margin: 0 1rem;
}
.note-box pre {
  margin: 0;
  font-family: inherit;
  white-space: pre-wrap;
  word-break: break-word;
  color: #5b4b00;
}
.note-edit { padding: 0 1rem; }
.note-edit textarea,
.notes-block textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  padding: 0.85rem 1rem;
  font-size: 1rem;
  min-height: 110px;
  outline: none;
  resize: vertical;
}
.note-edit textarea:focus,
.notes-block textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12); }

.invalid-card {
  background: var(--danger-bg);
  color: #991b1b;
  border-radius: var(--r);
  padding: 1rem;
  margin: 0 auto 0.8rem;
  max-width: 360px;
  font-weight: 600;
}

/* Session expired overlay */
.session-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(8, 17, 38, 0.6);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: backdropIn 0.25s;
}
.session-modal {
  background: #fff;
  border-radius: var(--r-xl);
  padding: 1.9rem 1.5rem 1.5rem;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.3s;
}
.session-modal svg { width: 46px; height: 46px; color: var(--brand); margin-bottom: 0.7rem; }
.session-modal h3 { font-size: 1.3rem; font-weight: 800; margin: 0 0 0.4rem; color: var(--ink); }
.session-modal p { color: var(--muted); margin: 0 0 1.3rem; }

/* Login notice (e.g. "session expired") */
.auth-notice {
  background: var(--warning-bg);
  color: #92400e;
  border: 1px solid #fcd9a3;
  border-radius: var(--r);
  padding: 0.7rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1.1rem;
}

/* ============================================================
   Login / splash (index.html)
   ============================================================ */
.auth-bg {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background:
    radial-gradient(ellipse at 50% -10%, #ffffff 0%, #6aa3ff 22%, rgba(0, 122, 255, 0.22) 65%),
    radial-gradient(circle at 18% 40%, #8db8ff 0%, #4784f5 26%, transparent 48%),
    #eaf1ff;
}

.splash { text-align: center; color: #fff; animation: fadeIn 0.8s; }
.splash__title { font-size: 2.8rem; font-weight: 800; letter-spacing: -0.03em; margin: 0; }
.splash__subtitle {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 0.25rem;
  background: linear-gradient(90deg, #ffffff, #d9e8ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.splash__spinner {
  width: 46px;
  height: 46px;
  border: 5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  margin: 1.6rem auto 0.8rem;
  animation: spin 0.9s linear infinite;
}
.splash__hint { color: #fff; opacity: 0.85; font-size: 1rem; }

.auth-card {
  width: 100%;
  max-width: 410px;
  background: #fff;
  border-radius: var(--r-xl);
  box-shadow: 0 20px 60px rgba(11, 77, 185, 0.22);
  padding: 2rem 1.6rem 1.6rem;
  text-align: center;
  animation: fadeIn 0.6s;
}
.auth-title {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #0b4db9, #6a3df0 55%, #00b4d8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}
.auth-desc { color: var(--muted); font-size: 0.92rem; margin: 0.35rem 0 1.6rem; }

.field { position: relative; margin-bottom: 0.85rem; }
.field input {
  width: 100%;
  border: 1.5px solid #d7e3f5;
  background: #f8fafc;
  border-radius: var(--r);
  padding: 1rem 1.1rem;
  font-size: 1.05rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.field input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.14); }
.field--password input { padding-right: 3rem; }
.field__toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0.4rem;
  color: var(--brand-deep);
  display: flex;
}

.auth-error { color: var(--danger); font-weight: 600; font-size: 0.9rem; margin: 0.5rem 0 0; }

.divider {
  display: flex;
  align-items: center;
  margin: 1.3rem 0 1rem;
  color: var(--muted-2);
  font-size: 0.82rem;
  font-weight: 600;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.divider span { padding: 0 0.8rem; }

.auth-logo { width: 120px; height: auto; margin-top: 1.4rem; opacity: 0.9; }

/* QR login scanner overlay (index.html) */
.qr-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(8, 17, 38, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: backdropIn 0.25s;
}
.qr-login-modal {
  background: #fff;
  border-radius: var(--r-xl);
  padding: 1.4rem 1.2rem 1.2rem;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.3s;
}
.qr-login-modal h4 { font-size: 1.3rem; font-weight: 800; color: var(--brand-deep); margin: 0 0 0.2rem; }
.qr-login-modal .sub { color: var(--muted); font-size: 0.9rem; margin: 0 0 1rem; }
#qr-reader-login { width: 100%; border-radius: var(--r); overflow: hidden; background: #000; }
#qr-reader-login img[alt="Info icon"] { display: none; }

/* ---------- Small screens ---------- */
@media (max-width: 360px) {
  .home-hero__name { font-size: 1.35rem; }
  .auth-card { padding: 1.6rem 1.2rem 1.3rem; }
}
