/* ==========================================================================
   GALERI CLIENT — EDITORIAL DESIGN SYSTEM
   Palet: Ivory #F6F2EA · Charcoal #2C2A26 · Champagne Gold #B08D57
   Mobile-First · WCAG AA Contrast · Strict CSP Compliant (Zero Inline Styles)
   ========================================================================== */

:root {
  --bg: #F6F2EA;
  --surface: #FDFBF7;
  --surface-2: #EFE9DC;
  --surface-3: #E5DEC9;
  --ink: #2C2A26;
  --ink-muted: #5C564D;      /* Kontras >= 6.2:1 di atas #F6F2EA (WCAG AA) */
  --ink-soft: #756E63;
  --gold: #B08D57;
  --gold-deep: #7B5C2B;      /* Kontras >= 5.7:1 di atas #FDFBF7 (WCAG AA) */
  --gold-tint: rgba(176, 141, 87, 0.14);
  --border: #DFD7C7;
  --border-strong: #C9BFA9;
  --danger: #9E3329;
  --danger-bg: #FCEEEB;
  --success: #2A6242;
  --success-bg: #EBF5EF;
  --heart: #B8424A;
  --heart-bg: rgba(184, 66, 74, 0.13);
  --shadow-sm: 0 2px 8px rgba(44, 42, 38, 0.05);
  --shadow-md: 0 10px 30px rgba(44, 42, 38, 0.09);
  --shadow-lg: 0 20px 50px rgba(20, 19, 17, 0.22);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --font-serif: Georgia, "Times New Roman", Times, serif;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #181715;
    --surface: #22201D;
    --surface-2: #2C2924;
    --surface-3: #38342D;
    --ink: #F5F1E8;
    --ink-muted: #B9B1A3;
    --ink-soft: #968E80;
    --gold: #CCA66B;
    --gold-deep: #E0BE86;
    --gold-tint: rgba(204, 166, 107, 0.16);
    --border: #36322C;
    --border-strong: #4B453C;
    --danger: #F0857B;
    --danger-bg: #3B201E;
    --success: #7BD4A0;
    --success-bg: #1C3326;
    --heart: #EE7880;
    --heart-bg: rgba(238, 120, 128, 0.18);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.28);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.42);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.65);
  }
}

:root[data-theme="dark"] {
  --bg: #181715;
  --surface: #22201D;
  --surface-2: #2C2924;
  --surface-3: #38342D;
  --ink: #F5F1E8;
  --ink-muted: #B9B1A3;
  --ink-soft: #968E80;
  --gold: #CCA66B;
  --gold-deep: #E0BE86;
  --gold-tint: rgba(204, 166, 107, 0.16);
  --border: #36322C;
  --border-strong: #4B453C;
  --danger: #F0857B;
  --danger-bg: #3B201E;
  --success: #7BD4A0;
  --success-bg: #1C3326;
  --heart: #EE7880;
  --heart-bg: rgba(238, 120, 128, 0.18);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.42);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.65);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  color: var(--ink);
  overflow-x: clip;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
}

body.has-bottom-bar {
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 124px);
}

body.modal-open {
  overflow: hidden;
}

h1, h2, h3, h4, .serif {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: var(--gold-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.sr-only,
.hp-field {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.hidden {
  display: none !important;
}

/* ==================== LAYOUT & TOPBAR ==================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .container {
    padding: 0 28px;
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top, 0px);
}

.topbar-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-decoration: none;
  color: var(--ink);
}

.brand-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold-deep);
  font-weight: 600;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 19px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ==================== BUTTONS & INPUTS (>=44px Touch Target) ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
  touch-action: manipulation;
}

.btn:hover:not(:disabled) {
  background: var(--surface-2);
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.btn-primary:hover:not(:disabled) {
  background: var(--gold-deep);
  border-color: var(--gold-deep);
  color: #FDFBF7;
}

.btn-gold {
  background: var(--gold);
  color: #191816;
  border-color: var(--gold);
  font-weight: 600;
}

.btn-gold:hover:not(:disabled) {
  filter: brightness(1.06);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
}

.btn-icon {
  padding: 0;
  width: 44px;
}

.btn-sm {
  min-height: 40px;
  padding: 0 12px;
  font-size: 13px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field label,
.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.field-hint {
  font-size: 12.5px;
  color: var(--ink-muted);
  line-height: 1.45;
}

.input,
.textarea,
.select {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.15s ease;
}

.textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.5;
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-tint);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  min-height: 44px;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--gold-deep);
  flex-shrink: 0;
}

/* ==================== HERO & BANNERS ==================== */
.hero {
  padding: 26px 0 18px;
}

.hero-eyebrow {
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 600;
  margin-bottom: 6px;
}

.hero-title {
  font-size: clamp(24px, 5vw, 36px);
  margin-bottom: 8px;
}

.hero-subtitle {
  color: var(--ink-muted);
  max-width: 660px;
  font-size: 15px;
  line-height: 1.6;
}

.banner {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
}

.banner-gold {
  background: var(--gold-tint);
  border-color: var(--gold);
}

.banner-warn {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
}

.banner-success {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
}

.offline-bar {
  background: #4A3820;
  color: #FDFBF7;
  text-align: center;
  font-size: 13px;
  padding: 8px 16px;
}

/* ==================== BADGES ==================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--border);
}

.badge-gold {
  background: var(--gold-tint);
  color: var(--gold-deep);
  border-color: var(--gold);
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger);
}

/* ==================== STICKY FILTER BAR ==================== */
.toolbar-sticky {
  position: sticky;
  top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  z-index: 35;
  background: var(--bg);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.filter-pills::-webkit-scrollbar {
  display: none;
}

.pill {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  touch-action: manipulation;
}

.pill:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}

.pill.is-active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 200px;
  max-width: 100%;
}

@media (min-width: 820px) {
  .search-wrap {
    max-width: 280px;
  }
}

/* ==================== PHOTO GRID ==================== */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 0 24px;
}

@media (min-width: 640px) {
  .photo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (min-width: 1024px) {
  .photo-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
  }
}

.photo-card {
  position: relative;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.photo-card.is-picked {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold);
}

.photo-thumb-btn {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  background: var(--surface-2);
  cursor: pointer;
  overflow: hidden;
}

.photo-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.28s ease, opacity 0.25s ease;
}

.photo-thumb-btn:hover img {
  transform: scale(1.025);
}

/* Tombol aksi sudut kartu >=44x44px agar aman dari salah tekan saat scroll */
.card-pick-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.88);
  background: rgba(28, 26, 23, 0.56);
  color: #FDFBF7;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: transform 0.16s ease, background-color 0.16s ease;
  touch-action: manipulation;
}

.card-pick-btn.is-active {
  background: var(--gold);
  border-color: #FDFBF7;
  color: #191816;
}

.card-pick-btn.pop {
  transform: scale(1.14);
}

.card-fav-btn {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 3;
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: rgba(28, 26, 23, 0.52);
  color: #FDFBF7;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  touch-action: manipulation;
}

.card-fav-btn.is-active {
  background: #B8424A;
  border-color: #F9D2D5;
  color: #FFFFFF;
}

.card-badges-bottom {
  position: absolute;
  left: 8px;
  bottom: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  pointer-events: none;
}

.chip-overlay {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(25, 24, 22, 0.74);
  color: #FDFBF7;
}

.chip-cover {
  background: var(--gold);
  color: #191816;
}

.photo-meta {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
}

.photo-filename {
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-submeta {
  color: var(--ink-muted);
  font-size: 11.5px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Skeleton Shimmer */
.skeleton-card {
  aspect-ratio: 4 / 3.4;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==================== STICKY ALBUM PROGRESS BAR (PENGANTIN) ==================== */
.album-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  background: var(--surface);
  border-top: 1px solid var(--border-strong);
  box-shadow: 0 -6px 24px rgba(25, 24, 22, 0.12);
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px));
}

.album-bar-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 768px) {
  .album-bar-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
  }
}

.album-progress-info {
  flex: 1;
  min-width: 0;
}

.album-progress-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 13.5px;
}

.save-status {
  font-size: 12px;
  color: var(--success);
  font-weight: 500;
}

.save-status.is-saving {
  color: var(--gold-deep);
}

.progress-svg {
  display: block;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
}

.progress-track-bg {
  fill: var(--surface-3);
}

.progress-track-fill {
  fill: var(--gold);
  transition: width 0.25s ease;
}

.album-bar-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.album-bar-buttons .btn {
  flex: 1 1 auto;
}

/* ==================== LIGHTBOX ==================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #141311;
  color: #F5F1E8;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

@media (min-width: 960px) {
  .lightbox.with-panel {
    grid-template-columns: 1fr 370px;
    grid-template-rows: auto 1fr;
  }
  .lightbox.with-panel .lb-topbar {
    grid-column: 1 / 2;
  }
  .lightbox.with-panel .lb-stage {
    grid-column: 1 / 2;
  }
  .lightbox.with-panel .lb-sidebar {
    grid-column: 2 / 3;
    grid-row: 1 / 3;
    border-left: 1px solid #2F2C27;
    max-height: 100dvh;
  }
}

.lb-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 8px;
  background: rgba(20, 19, 17, 0.92);
  border-bottom: 1px solid #2B2824;
  min-width: 0;
}

.lb-title-group {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.lb-filename {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-sub {
  font-size: 12px;
  color: #B8B0A2;
}

.lb-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 220px;
  touch-action: none;
  user-select: none;
}

.lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
}

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(20, 19, 17, 0.65);
  color: #F5F1E8;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
}

.lb-prev { left: 10px; }
.lb-next { right: 10px; }

.lb-sidebar {
  background: #1D1B18;
  color: #F5F1E8;
  border-top: 1px solid #2F2C27;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  max-height: 44dvh;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lb-actions-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lb-btn {
  min-height: 44px;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  border: 1px solid #3E3A33;
  background: #282520;
  color: #F5F1E8;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1 1 auto;
}

.lb-btn.is-picked {
  background: var(--gold);
  border-color: var(--gold);
  color: #191816;
  font-weight: 600;
}

.lb-btn.is-fav {
  background: #B8424A;
  border-color: #DF7B82;
  color: #FFFFFF;
}

.lb-input {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #413C35;
  background: #151412;
  color: #F5F1E8;
  font-size: 13.5px;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment-bubble {
  padding: 9px 12px;
  border-radius: 12px;
  background: #27241F;
  border: 1px solid #36322B;
  font-size: 13.5px;
}

.comment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 12px;
  color: #B8B0A2;
}

.comment-author {
  font-weight: 600;
  color: #F5F1E8;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.comment-body {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
}

.link-btn-inline {
  background: none;
  border: 0;
  color: #E09F98;
  font-size: 12px;
  cursor: pointer;
  min-height: 32px;
  padding: 2px 6px;
  text-decoration: underline;
}

/* ==================== MODALS & DRAWERS ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(18, 17, 15, 0.66);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

@media (min-width: 640px) {
  .modal-backdrop {
    align-items: center;
    padding: 20px;
  }
}

.modal-card {
  width: 100%;
  max-width: 620px;
  max-height: 92dvh;
  overflow-y: auto;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 640px) {
  .modal-card {
    border-radius: var(--radius-lg);
    padding: 26px 28px;
  }
}

.modal-lg {
  max-width: 860px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ==================== TOAST & UNDO ==================== */
.toast-region {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(92vw, 440px);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: #23211D;
  color: #F5F1E8;
  border: 1px solid #4A4338;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
}

.toast-undo-btn {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: #191816;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

/* ==================== ADMIN PANELS & CARDS ==================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 22px;
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.stat-label {
  font-size: 12px;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 26px;
}

.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 40px;
}

.project-row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.metrics-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 12px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.pick-admin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pick-admin-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
}

.pick-admin-thumb {
  width: 64px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-2);
  flex-shrink: 0;
}

.review-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

@media (min-width: 640px) {
  .review-mini-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.qr-box {
  width: 224px;
  height: 224px;
  padding: 12px;
  background: #FDFBF7;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.qr-box svg {
  width: 100%;
  height: 100%;
  display: block;
}

.center-screen {
  min-height: calc(100dvh - var(--header-h) - 40px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-card {
  width: 100%;
  max-width: 430px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-md);
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  margin: 20px 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
