/* ════════════════════════════════════════════════════════════════
   GPTI App V12 — Single-Screen Design System
   ════════════════════════════════════════════════════════════════ */

/* ─── Design tokens ─── */
/* ─── Design tokens (default = dark theme) ─── */
:root,
:root[data-theme="dark"] {
  /* Brand (constant across themes) */
  --navy: #0A1628;
  --navy-2: #132038;
  --navy-3: #1A2B45;
  --gold: #C8A24E;
  --gold-2: #E4C76B;
  --gold-3: #B8902F;

  /* DARK theme surfaces */
  --bg: #0A1628;
  --bg-2: #132038;
  --surface: rgba(255,255,255,0.04);
  --surface-2: rgba(255,255,255,0.07);
  --surface-3: rgba(255,255,255,0.10);
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.14);
  --gold-soft: rgba(200,162,78,0.12);
  --gold-mid: rgba(200,162,78,0.25);

  /* DARK text */
  --text: #ffffff;
  --text-2: #C8D1DC;
  --text-3: #8B95A5;
  --text-mute: #5C6877;

  /* Sheet/topbar background */
  --topbar-bg: rgba(10, 22, 40, 0.92);
  --sheet-bg: var(--navy-2);

  /* Background overlay (for video) */
  --overlay-1: rgba(10,22,40,0.45);
  --overlay-2: rgba(10,22,40,0.55);
  --overlay-3: rgba(10,22,40,0.70);

  /* States */
  --success: #5BB0D8;
  --success-2: #7FB299;
  --warn: #E4C76B;
  --danger: #E63946;

  /* Layout */
  --topbar-h: 56px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
  --max-w: 480px;
  --radius: 14px;
  --radius-lg: 20px;

  /* Type */
  --font: 'Tajawal', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Playfair Display', 'Tajawal', serif;

  /* Motion */
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --t: 0.25s var(--ease);
}

/* ════════════════════════════════════════════════════════════════
   LIGHT THEME — applied when html[data-theme="light"]
   ════════════════════════════════════════════════════════════════ */
:root[data-theme="light"] {
  --bg: #F5F7FB;
  --bg-2: #ffffff;
  --surface: rgba(10, 22, 40, 0.04);
  --surface-2: rgba(10, 22, 40, 0.07);
  --surface-3: rgba(10, 22, 40, 0.10);
  --border: rgba(10, 22, 40, 0.10);
  --border-strong: rgba(10, 22, 40, 0.18);
  --gold-soft: rgba(200, 162, 78, 0.18);
  --gold-mid: rgba(200, 162, 78, 0.40);

  --text: #0A1628;
  --text-2: #2D3E54;
  --text-3: #5C6877;
  --text-mute: #95A0AE;

  --topbar-bg: rgba(255, 255, 255, 0.92);
  --sheet-bg: #ffffff;

  /* Lighter overlay so video shows through */
  --overlay-1: rgba(245, 247, 251, 0.30);
  --overlay-2: rgba(245, 247, 251, 0.50);
  --overlay-3: rgba(245, 247, 251, 0.65);
}

/* ════════════════════════════════════════════════════════════════
   LTR mode — applied when html[dir="ltr"] (English)
   ════════════════════════════════════════════════════════════════ */
:root[dir="ltr"] body { direction: ltr; }
:root[dir="ltr"] .menu-arrow { transform: scaleX(-1); }

/* ─── Reset ─── */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--bg); height: 100%; transition: background-color 0.3s var(--ease); }
body {
  font-family: var(--font);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: color 0.3s var(--ease);
}

/* ════════════════════════════════════════════════════════════════
   BACKGROUND VIDEO
   iOS PWA fix: negative z-index on position:fixed elements doesn't
   work in standalone mode — the video disappears behind the body.
   Solution: keep video at z-index:0, wrap content in a layer that
   stacks above it, and use a transparent body background.
   ════════════════════════════════════════════════════════════════ */
.bg-video {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: 0;
  opacity: 0.65;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
  /* Solid dark fallback while video loads (or if it never loads) —
     prevents broken/missing video from showing white. */
  background: var(--navy);
}
.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  /* Lighter overlay reveals more of the video */
  background:
    radial-gradient(ellipse at top, var(--overlay-1), transparent 65%),
    linear-gradient(180deg, var(--overlay-2) 0%, var(--overlay-3) 100%);
  transition: background 0.4s var(--ease);
}

/* When user opens a sheet, dim the video to focus attention */
body:has(.sheet:not([hidden])) .bg-video { opacity: 0.25; }

/* ── All UI must stack ABOVE the video & overlay ── */
.topbar,
.stage,
.sheet-backdrop,
.sheet,
.toast {
  position: relative;
  z-index: 10;
}
/* Re-assert sticky positioning on topbar */
.topbar { position: sticky; }
/* Sheets need higher stacking when active */
.sheet-backdrop { position: fixed; z-index: 90; }
.sheet { position: fixed; z-index: 100; }
.toast { position: fixed; z-index: 200; }

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: var(--gold); text-decoration: none; }
img { max-width: 100%; display: block; }
input, select, textarea {
  font: inherit; color: inherit;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; width: 100%;
  outline: none; transition: border-color var(--t);
}
input:focus, select:focus, textarea:focus { border-color: var(--gold-mid); background: var(--surface-2); }

/* ════════════════════════════════════════════════════════════════
   TOPBAR (sticky, always visible)
   ════════════════════════════════════════════════════════════════ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 6px;
  padding: calc(8px + var(--safe-top)) 10px 8px;
  background: var(--topbar-bg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  height: calc(var(--topbar-h) + var(--safe-top));
}
.tb-btn {
  position: relative;
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  color: var(--text-2);
  transition: var(--t);
  flex-shrink: 0;
}
.tb-btn:hover, .tb-btn:active { background: var(--surface); color: var(--text); }
.tb-btn-accent {
  background: linear-gradient(135deg, var(--gold), var(--gold-3));
  color: var(--navy);
}
.tb-btn-accent:hover { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: var(--navy); }

/* Language pill button — shows current language code (AR / EN / KU) */
.tb-btn-lang {
  width: auto;
  min-width: 38px;
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
  background: var(--surface);
}
.tb-btn-lang:hover {
  background: var(--gold-soft);
  color: var(--gold-2);
  border-color: var(--gold-mid);
}

.tb-brand {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; padding: 4px 8px; border-radius: 10px;
  transition: var(--t);
  flex-shrink: 0;
}
.tb-brand:hover { background: var(--surface); }
.tb-brand-text {
  /* Hide brand text on tight screens; logo + buttons stay */
  display: block;
}
@media (max-width: 380px) {
  .tb-brand-text { display: none; }
}

.tb-spacer { flex: 1; }

.tb-logo {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold), var(--gold-3));
  color: var(--navy);
  border-radius: 11px;
  font-weight: 800; font-size: 1.2rem;
  font-family: var(--font-display);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(200,162,78,0.25);
  flex-shrink: 0;
}
.tb-logo img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 4px;
  background: rgba(255,255,255,0.95);
}
.tb-title { font-size: 1.05rem; font-weight: 800; line-height: 1; }
.tb-sub { font-size: 0.65rem; color: var(--text-3); margin-top: 2px; }

.tb-badge {
  position: absolute; top: 4px; left: 4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--danger); color: #fff;
  font-size: 0.62rem; font-weight: 700;
  border-radius: 8px;
  display: grid; place-items: center;
}

/* ════════════════════════════════════════════════════════════════
   STAGE (the only content area)
   ════════════════════════════════════════════════════════════════ */
.stage {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px 14px calc(40px + var(--safe-bot));
  display: flex; flex-direction: column; gap: 18px;
}

/* ─── Welcome strip ─── */
.welcome {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.welcome-text { flex: 1; min-width: 0; }
.w-greeting {
  font-size: 0.78rem; color: var(--text-3); margin-bottom: 2px;
}
.w-name {
  font-size: 1.15rem; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.w-action {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  background: var(--gold-soft); color: var(--gold-2);
  border: 1px solid var(--gold-mid);
  border-radius: 999px;
  font-size: 0.78rem; font-weight: 700;
  transition: var(--t);
}
.w-action:hover { background: var(--gold-mid); color: var(--text); }

/* ─── Hero card ─── */
.hero-card {
  position: relative;
  background: linear-gradient(135deg, var(--navy-2), var(--navy-3));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 200px;
}
.hc-skeleton {
  height: 200px;
  background: linear-gradient(90deg, transparent, var(--surface-2), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* hero variants */
.hc-image { position: relative; height: 220px; overflow: hidden; }
.hc-image img { width: 100%; height: 100%; object-fit: cover; }
.hc-image::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, var(--navy-2) 0%, transparent 60%);
}
.hc-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 16px;
  z-index: 1;
}
.hc-tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--gold); color: var(--navy);
  font-size: 0.7rem; font-weight: 700;
  border-radius: 6px;
  margin-bottom: 8px;
}
.hc-title {
  font-size: 1.25rem; font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.hc-meta {
  display: flex; gap: 12px;
  font-size: 0.78rem; color: var(--text-2);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.hc-meta span { display: flex; align-items: center; gap: 4px; }
.hc-cta {
  display: block; width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: var(--navy);
  border-radius: 12px;
  font-size: 0.95rem; font-weight: 800;
  text-align: center;
  transition: var(--t);
}
.hc-cta:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(200,162,78,0.3); }

/* hero — logged-in user "my card" preview */
.hc-card {
  padding: 20px;
  background: linear-gradient(135deg, #0F1B30, #1A2B45);
  border-radius: var(--radius-lg);
}
.hc-card-name { font-size: 1.25rem; font-weight: 800; margin-bottom: 4px; }
.hc-card-id { font-size: 0.78rem; color: var(--gold-2); font-family: monospace; margin-bottom: 14px; }
.hc-card-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-bottom: 14px;
}
.hc-stat { text-align: center; padding: 10px 4px; background: var(--surface); border-radius: 10px; }
.hc-stat-n { font-size: 1.2rem; font-weight: 800; color: var(--gold-2); }
.hc-stat-l { font-size: 0.65rem; color: var(--text-3); margin-top: 2px; }

/* ─── Block (section wrapper) ─── */
.block { display: flex; flex-direction: column; gap: 10px; }
.block-head {
  display: flex; align-items: center; justify-content: space-between;
}
.block-head h3 { font-size: 1.02rem; font-weight: 700; color: var(--text); }
.seemore {
  font-size: 0.78rem; color: var(--gold-2); font-weight: 600;
}

/* ─── Horizontal scroll ─── */
.hscroll {
  display: flex; gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  margin: 0 -14px; padding: 4px 14px;
}
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex-shrink: 0; }

/* event cards in hscroll */
.evt {
  width: 230px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--t);
}
.evt:hover { transform: translateY(-2px); border-color: var(--gold-mid); background: var(--surface-2); }
.evt-img {
  height: 110px;
  background: linear-gradient(135deg, var(--navy-2), var(--navy-3));
  background-size: cover; background-position: center;
  position: relative;
}
.evt-tag {
  position: absolute; top: 8px; right: 8px;
  padding: 3px 8px;
  background: var(--gold); color: var(--navy);
  font-size: 0.62rem; font-weight: 700;
  border-radius: 5px;
}
.evt-body { padding: 10px 12px; }
.evt-title {
  font-size: 0.88rem; font-weight: 700;
  margin-bottom: 6px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.evt-meta {
  display: flex; gap: 10px;
  font-size: 0.7rem; color: var(--text-3);
  flex-wrap: wrap;
}
.evt-skel {
  width: 230px; height: 180px;
  background: linear-gradient(90deg, var(--surface), var(--surface-2), var(--surface));
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  border-radius: var(--radius);
  flex-shrink: 0;
}

/* my courses (vertical) */
.my-evt {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer; transition: var(--t);
}
.my-evt:hover { background: var(--surface-2); border-color: var(--gold-mid); }
.my-evt-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--gold-soft);
  border-radius: 10px;
  font-size: 1.4rem;
}
.my-evt-info { flex: 1; min-width: 0; }
.my-evt-title { font-weight: 700; font-size: 0.92rem; margin-bottom: 2px; }
.my-evt-sub { font-size: 0.72rem; color: var(--text-3); }
.my-evt-status {
  font-size: 0.65rem; font-weight: 700;
  padding: 4px 8px; border-radius: 6px;
  white-space: nowrap;
}
.my-evt-status.paid { background: rgba(91,176,216,0.15); color: var(--success); }
.my-evt-status.pending { background: rgba(228,199,107,0.15); color: var(--warn); }

/* ─── Quick actions ─── */
.qactions {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 8px;
}
.qa {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--t);
}
.qa:hover { background: var(--surface-2); border-color: var(--gold-mid); transform: translateY(-1px); }
.qa-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-3));
  color: var(--navy);
  border-color: transparent;
}
.qa-primary:hover { background: linear-gradient(135deg, var(--gold-2), var(--gold)); }
.qa-ic { font-size: 1.4rem; }
.qa-lbl { font-size: 0.78rem; font-weight: 700; }

/* ─── Footer ─── */
.ftr {
  margin-top: 20px; padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.72rem; color: var(--text-3);
}
.ftr-meta { margin-top: 4px; color: var(--text-mute); }

/* ════════════════════════════════════════════════════════════════
   BOTTOM SHEETS
   ════════════════════════════════════════════════════════════════ */
.sheet-backdrop[hidden],
.sheet[hidden] {
  display: none !important;
  pointer-events: none !important;
}

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  animation: fadeIn 0.2s var(--ease) forwards;
}
@keyframes fadeIn { to { opacity: 1; } }

.sheet {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 100;
  max-width: var(--max-w); margin: 0 auto;
  background: var(--sheet-bg);
  border: 1px solid var(--border-strong);
  border-bottom: none;
  border-top-left-radius: 22px; border-top-right-radius: 22px;
  max-height: 92vh;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  animation: slideUp 0.3s var(--ease) forwards;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}
@keyframes slideUp { to { transform: translateY(0); } }

.sheet.closing { animation: slideDown 0.22s var(--ease) forwards; }
@keyframes slideDown { to { transform: translateY(100%); } }

.sheet-grab {
  width: 40px; height: 4px;
  background: var(--text-mute);
  border-radius: 2px;
  margin: 8px auto 0;
  flex-shrink: 0;
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sheet-head h2 {
  font-size: 1.1rem; font-weight: 700;
}
.sheet-x {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 8px;
  color: var(--text-3);
  transition: var(--t);
}
.sheet-x:hover { background: var(--surface); color: var(--text); }
.sheet-body {
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  padding-bottom: calc(20px + var(--safe-bot));
}

/* ─── sheet content blocks ─── */
.menu-list { display: flex; flex-direction: column; gap: 4px; }
.menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 12px;
  background: var(--surface);
  border-radius: 10px;
  transition: var(--t);
  text-align: right; width: 100%;
}
.menu-item:hover { background: var(--surface-2); }
.menu-icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: var(--gold-soft);
  border-radius: 9px;
  font-size: 1.15rem; flex-shrink: 0;
}
.menu-text { flex: 1; }
.menu-title { font-weight: 700; font-size: 0.92rem; }
.menu-sub { font-size: 0.7rem; color: var(--text-3); margin-top: 2px; }
.menu-arrow { color: var(--text-3); }

/* form blocks */
.form-row { margin-bottom: 12px; }
.form-row label {
  display: block;
  font-size: 0.78rem; color: var(--text-2); font-weight: 600;
  margin-bottom: 6px;
}
.form-row .hint { font-size: 0.7rem; color: var(--text-3); margin-top: 4px; }

.btn {
  display: block; width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--gold), var(--gold-3));
  color: var(--navy);
  border-radius: 12px;
  font-size: 0.95rem; font-weight: 800;
  text-align: center;
  transition: var(--t);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(200,162,78,0.3); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger {
  background: linear-gradient(135deg, var(--danger), #C44569);
  color: #fff;
}

/* ─── Photo upload widget (used in registration forms) ─── */
.photo-up {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin-bottom: 4px;
}
.photo-up-preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px dashed var(--border-strong);
  display: grid;
  place-items: center;
  color: var(--text-3);
  transition: var(--t);
  overflow: hidden;
  background-size: cover;
  background-position: center;
}
.photo-up:hover .photo-up-preview {
  border-color: var(--gold-mid);
  background-color: var(--surface-2);
  color: var(--gold-2);
  transform: scale(1.02);
}
.photo-up-hint {
  font-size: 0.72rem;
  color: var(--text-3);
  text-align: center;
}
.photo-up:hover .photo-up-hint { color: var(--gold-2); }

/* ─── Registration type cards (4 types selector) ─── */
.reg-type-list {
  display: flex; flex-direction: column;
  gap: 10px;
}
.reg-type-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: right;
  width: 100%;
  cursor: pointer;
  transition: var(--t);
}
.reg-type-card:hover {
  background: var(--surface-2);
  border-color: var(--gold-mid);
  transform: translateY(-1px);
}
.reg-type-ic {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 14px;
  font-size: 1.6rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.reg-type-body {
  flex: 1;
  min-width: 0;
}
.reg-type-title {
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 2px;
}
.reg-type-sub {
  font-size: 0.75rem;
  color: var(--text-3);
  line-height: 1.4;
}
.reg-type-arrow {
  color: var(--text-3);
  font-size: 1.1rem;
  transition: var(--t);
}
.reg-type-card:hover .reg-type-arrow {
  color: var(--gold-2);
  transform: translateX(-3px);
}

/* ─── Tutorial banner (above hero) ─── */
.tut-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(200,162,78,0.18), rgba(200,162,78,0.06));
  border: 1px solid var(--gold-mid);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--t);
  position: relative;
  overflow: hidden;
}
.tut-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 120px;
  height: 200%;
  background: radial-gradient(ellipse, rgba(228,199,107,0.20), transparent 70%);
  pointer-events: none;
}
.tut-banner:hover {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(200,162,78,0.25), rgba(200,162,78,0.10));
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(200,162,78,0.20);
}
.tut-thumb {
  width: 56px; height: 56px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--navy-2), var(--navy-3));
  display: grid; place-items: center;
  flex-shrink: 0;
  position: relative;
  border: 1px solid var(--gold-mid);
}
.tut-play {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-3));
  color: var(--navy);
  display: grid; place-items: center;
  box-shadow: 0 0 0 0 rgba(200,162,78,0.6);
  animation: tutPulse 2s infinite;
}
@keyframes tutPulse {
  0%   { box-shadow: 0 0 0 0 rgba(200,162,78,0.6); }
  70%  { box-shadow: 0 0 0 10px rgba(200,162,78,0); }
  100% { box-shadow: 0 0 0 0 rgba(200,162,78,0); }
}
.tut-text {
  flex: 1; min-width: 0;
}
.tut-tag {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--gold-2);
  background: var(--gold-soft);
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
}
.tut-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tut-sub {
  font-size: 0.72rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tut-close {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  color: var(--text-3);
  z-index: 1;
  transition: var(--t);
}
.tut-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* Tutorial video player (in sheet) */
.tut-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  position: relative;
}
.tut-player iframe,
.tut-player video {
  width: 100%; height: 100%;
  display: block;
  border: 0;
}
.tut-meta {
  background: var(--surface);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}
.tut-meta-title {
  font-weight: 700;
  margin-bottom: 6px;
}
.tut-meta-desc {
  font-size: 0.85rem;
  color: var(--text-2);
  line-height: 1.6;
}

/* segmented control */
.seg {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px;
  margin-bottom: 16px;
}
.seg button {
  padding: 10px;
  border-radius: 7px;
  font-size: 0.85rem; font-weight: 700;
  color: var(--text-3);
  transition: var(--t);
}
.seg button.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-3));
  color: var(--navy);
}

/* language pills */
.lang-pill {
  padding: 10px 8px;
  border-radius: 7px;
  font-size: 0.78rem; font-weight: 700;
  color: var(--text-3);
  transition: var(--t);
  cursor: pointer;
}
.lang-pill:hover { color: var(--text); }
.lang-pill.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-3));
  color: var(--navy);
}

/* toggle switch */
.toggle {
  width: 44px; height: 26px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 13px;
  position: relative;
  cursor: pointer;
  transition: var(--t);
  flex-shrink: 0;
}
.toggle.on {
  background: linear-gradient(135deg, var(--gold), var(--gold-3));
  border-color: transparent;
}
.toggle-knob {
  position: absolute;
  top: 2px;
  /* In RTL, "off" knob is on right; "on" knob slides to left */
  right: 2px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s var(--ease);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.toggle.on .toggle-knob {
  transform: translateX(-18px);
}
/* LTR: invert knob slide */
:root[dir="ltr"] .toggle-knob { right: auto; left: 2px; }
:root[dir="ltr"] .toggle.on .toggle-knob { transform: translateX(18px); }

/* full event card (in sheet) */
.full-evt {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden; cursor: pointer;
  transition: var(--t);
}
.full-evt:hover { background: var(--surface-2); border-color: var(--gold-mid); }
.full-evt-img {
  height: 100px;
  background: linear-gradient(135deg, var(--navy-2), var(--navy-3));
  background-size: cover; background-position: center;
  position: relative;
}
.full-evt-body { padding: 12px; }
.full-evt-title { font-weight: 700; margin-bottom: 6px; }
.full-evt-meta { display: flex; gap: 10px; font-size: 0.72rem; color: var(--text-3); flex-wrap: wrap; }
.full-evt-cta {
  display: block; margin-top: 10px;
  padding: 10px;
  background: var(--gold-soft); color: var(--gold-2);
  border: 1px solid var(--gold-mid);
  border-radius: 8px;
  font-size: 0.8rem; font-weight: 700;
  text-align: center;
}

/* QR card */
.qr-frame {
  background: #fff; padding: 20px; border-radius: 16px;
  text-align: center;
  margin: 16px auto; max-width: 280px;
}
.qr-frame canvas, .qr-frame img { margin: 0 auto; max-width: 100%; }
.qr-name { color: var(--navy); font-weight: 800; margin-top: 12px; font-size: 1rem; }
.qr-id { color: var(--gold-3); font-family: monospace; font-size: 0.78rem; }

/* scanner */
.scanner-wrap {
  position: relative;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1;
  margin-bottom: 16px;
}
.scanner-wrap video { width: 100%; height: 100%; object-fit: cover; }
.scanner-wrap::before {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 70%; aspect-ratio: 1;
  border: 2px solid var(--gold);
  border-radius: 12px;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
  z-index: 1; pointer-events: none;
}

/* notification list */
.notif {
  padding: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  border-right: 3px solid var(--gold);
}
.notif.unread { background: var(--gold-soft); border-right-color: var(--gold-2); }
.notif-title { font-weight: 700; font-size: 0.88rem; margin-bottom: 4px; }
.notif-body { font-size: 0.78rem; color: var(--text-2); }
.notif-time { font-size: 0.65rem; color: var(--text-mute); margin-top: 4px; }

/* empty state */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-3);
}
.empty-ic { font-size: 3rem; margin-bottom: 12px; opacity: 0.5; }
.empty-t { font-size: 0.95rem; font-weight: 700; margin-bottom: 4px; color: var(--text-2); }
.empty-s { font-size: 0.8rem; }

/* spinner */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--surface-2);
  border-top-color: var(--gold);
  border-radius: 50%;
  margin: 20px auto;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ════════════════════════════════════════════════════════════════
   TOAST
   ════════════════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: calc(20px + var(--safe-bot));
  left: 50%; transform: translateX(-50%) translateY(100%);
  z-index: 200;
  padding: 12px 20px;
  background: var(--navy-3);
  border: 1px solid var(--gold-mid);
  border-radius: 999px;
  color: #fff;
  font-size: 0.85rem; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  max-width: 90%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: transform 0.3s var(--ease);
}
.toast.show {
  transform: translateX(-50%) translateY(0);
}
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE TWEAKS
   ════════════════════════════════════════════════════════════════ */
@media (min-width: 481px) {
  body { background: linear-gradient(180deg, #050B16 0%, #0A1628 100%); }
  .stage { background: var(--bg); border-left: 1px solid var(--border); border-right: 1px solid var(--border); min-height: 100vh; }
  .topbar { max-width: var(--max-w); margin: 0 auto; }
}

/* iOS PWA padding */
@supports (padding-top: env(safe-area-inset-top)) {
  body { padding-top: env(safe-area-inset-top); }
}
