/* ==========================================================================
   EVERSTILL GALLERY — LUXURY MINIMALIST STYLESHEET
   ========================================================================== */

:root {
  --bg-main: #0c0d0f;
  --bg-surface: #141518;
  --bg-surface-elevated: #1a1b20;
  --bg-input: #1f2026;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(255, 255, 255, 0.25);
  --border-gold: rgba(212, 175, 55, 0.3);

  --text-main: #f4f4f6;
  --text-secondary: #a0a2aa;
  --text-tertiary: #6b6d76;

  --accent-gold: #d4af37;
  --accent-gold-light: #e5c158;
  --accent-heart: #fb7185;
  --accent-heart-bg: rgba(251, 113, 133, 0.15);

  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  --ease-editorial: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

/* Background Atmosphere */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

.glow-1 {
  top: -150px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.15), transparent 70%);
}

.glow-2 {
  bottom: -200px;
  left: -150px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(120, 130, 150, 0.12), transparent 70%);
}

/* Views Management */
.view {
  display: none;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  opacity: 0;
  transition: opacity 0.4s var(--ease-editorial);
}

.view.active {
  display: block;
  opacity: 1;
}

/* ==========================================================================
   BUTTONS & CONTROLS
   ========================================================================== */

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

.btn-primary {
  background: #ffffff;
  color: #0c0d0f;
  border: none;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s var(--ease-editorial);
}

.btn-primary:hover {
  background: #e4e4e7;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255, 255, 255, 0.12);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  font-weight: 500;
  font-size: 13px;
  padding: 11px 20px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s var(--ease-editorial);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-focus);
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.btn-text:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.btn-pill {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-pill:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-danger-outline {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: #ef4444;
}

/* ==========================================================================
   VIEW 1: LANDING & MFA PORTAL
   ========================================================================== */

.portal-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 48px;
  position: relative;
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
}

.logo-text {
  font-family: var(--font-serif);
  font-size: 20px;
  letter-spacing: 6px;
  font-weight: 400;
  color: var(--text-main);
}

.admin-lock-btn {
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.admin-lock-btn:hover {
  color: var(--text-main);
}

/* Flex column pinned to the dynamic viewport height so nav + hero + footer
   fill exactly what is visible; 100vh alone is taller than a phone viewport
   with the URL bar shown and made the portal scroll for no reason. */
#landingView.active {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.portal-hero {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.portal-card {
  width: 100%;
  max-width: 520px;
  background: rgba(20, 21, 24, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 48px 40px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.03);
  text-align: center;
  position: relative;
}

.portal-card-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 22px;
  cursor: pointer;
  user-select: none;
}

.portal-card-logo .logo-mark {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
}

.portal-card-logo .logo-text {
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: 6px;
  font-weight: 400;
  color: var(--text-main);
}

.card-eyebrow {
  display: none;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 400;
  letter-spacing: 2px;
  color: var(--text-main);
  margin-bottom: 12px;
}

.card-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 36px;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

/* Auth Steps */
.auth-step {
  display: none;
  animation: fadeInStep 0.4s var(--ease-editorial);
}

.auth-step.active {
  display: block;
}

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

/* Step 1 Code Input */
.input-group label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
  text-align: left;
}

.input-wrap {
  display: flex;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 6px;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.input-wrap:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.input-wrap input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  padding: 10px 14px;
  font-size: 17px;
  letter-spacing: 2px;
  color: var(--text-main);
  text-transform: uppercase;
  outline: none;
}

.input-wrap .btn-primary {
  flex-shrink: 0;
  white-space: nowrap;
}

.portal-hint {
  margin-top: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.hint-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-gold);
}

/* Step 2 MFA */
.mfa-header {
  display: flex;
  align-items: center;
  gap: 20px;
  text-align: left;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.timer-badge {
  position: relative;
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 2.8;
}

.timer-stroke {
  fill: none;
  stroke: var(--accent-gold);
  stroke-width: 2.8;
  stroke-linecap: round;
  transition: stroke-dasharray 1s linear, stroke 0.3s;
}

.timer-stroke.urgent {
  stroke: #ef4444;
}

#mfaTimerText {
  font-size: 13px;
  font-weight: 700;
  font-family: monospace;
  color: var(--text-main);
}

.mfa-info h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.mfa-info p {
  font-size: 13px;
  color: var(--text-secondary);
}

.mfa-input-main {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 16px;
  font-family: monospace;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 16px;
  text-align: center;
  color: #ffffff;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 28px;
}

.mfa-input-main:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.mfa-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mfa-actions-right {
  display: flex;
  gap: 10px;
}

.portal-footer {
  margin-top: 40px;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-tertiary);
}

/* ==========================================================================
   VIEW 2: GALLERY EXPERIENCE
   ========================================================================== */

.gallery-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(12, 13, 15, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 40px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.gallery-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.home-btn {
  padding: 6px;
  border-radius: 8px;
}

.home-btn svg {
  display: block;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: 5px;
  font-weight: 500;
  color: var(--text-main);
}

.brand-separator {
  color: var(--border-subtle);
}

.gallery-session-name {
  font-size: 14px;
  color: var(--text-secondary);
}

.tag {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

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

.btn-pill-filter {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s var(--ease-editorial);
}

.btn-pill-filter:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-pill-filter.active {
  background: var(--accent-heart-bg);
  border-color: var(--accent-heart);
  color: var(--accent-heart);
}

.btn-pill-download {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--accent-gold-light);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-pill-download:hover {
  background: rgba(212, 175, 55, 0.25);
  border-color: var(--accent-gold);
}

/* Gallery Hero Banner */
.gallery-hero-banner {
  position: relative;
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 24px;
  overflow: hidden;
}

.hero-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  filter: blur(28px) brightness(0.35);
  transform: scale(1.1);
  transition: background-image 0.5s ease;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(12, 13, 15, 0.5) 0%, rgba(12, 13, 15, 0.95) 100%);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 720px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 400;
  letter-spacing: 2px;
  margin-bottom: 0;
  line-height: 1.2;
}

.gallery-hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.gallery-hero-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent-gold);
}

.gallery-hero-meta-item svg {
  opacity: 0.85;
}

.admin-email-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(201, 168, 106, 0.12);
  border: 1px solid rgba(201, 168, 106, 0.25);
  color: var(--accent-gold);
  font-size: 12px;
  letter-spacing: 0.5px;
}

.admin-email-chip .chip-remove {
  cursor: pointer;
  opacity: 0.7;
  font-size: 14px;
  line-height: 1;
  border: none;
  background: transparent;
  color: inherit;
  padding: 0;
}

.admin-email-chip .chip-remove:hover {
  opacity: 1;
  color: #ef4444;
}

/* Main Gallery Area */
.gallery-main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 40px 80px;
}

.gallery-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 32px;
  font-size: 13px;
  color: var(--text-secondary);
}

.watermark-notice {
  display: flex;
  align-items: center;
  gap: 10px;
}

.watermark-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(212, 175, 55, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.watermark-sub {
  font-size: 12px;
  color: var(--text-tertiary);
}

.grid-cols-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.grid-cols-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-tertiary);
  margin-right: 2px;
}

.col-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.col-btn:hover {
  color: var(--text-main);
  border-color: var(--border-focus);
}

.col-btn.active {
  background: rgba(212, 175, 55, 0.15);
  border-color: rgba(212, 175, 55, 0.4);
  color: var(--accent-gold);
}

.filter-select {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  min-height: 36px;
  max-width: 240px;
}

.system-card {
  max-width: 720px;
}

.settings-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.smtp-status-note {
  font-size: 12px;
  color: var(--text-tertiary);
}

.google-signin-body {
  text-align: center;
}

.google-signin-btn-box {
  display: flex;
  justify-content: center;
  min-height: 44px;
  margin: 6px 0 4px;
}

.portal-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 14px;
  color: var(--text-tertiary);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.portal-divider::before,
.portal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* Square-crop grid; the column count is the client's choice (1-5) via --gallery-cols */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(var(--gallery-cols, 3), minmax(0, 1fr));
  gap: 24px;
}

/* Photo Card */
.photo-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  aspect-ratio: 1 / 1;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.35s var(--ease-editorial), box-shadow 0.35s var(--ease-editorial), border-color 0.35s;
}

/* Hover affordances only where hover exists: on touch the overlay (and the
   filename inside it) must never appear — long-press hearts instead. */
@media (hover: hover) and (pointer: fine) {
  .photo-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 32px rgba(0, 0, 0, 0.6);
    border-color: var(--border-focus);
  }

  .photo-card:hover img {
    transform: scale(1.03);
  }

  .photo-card:hover .photo-overlay {
    opacity: 1;
  }
}

.photo-card:active {
  transform: scale(0.98);
}

.photo-img-wrap {
  width: 100%;
  height: 100%;
  position: relative;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-editorial);
  display: block;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

/* Photo Overlay Controls */
.photo-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, transparent 40%, rgba(0,0,0,0.7) 100%);
  opacity: 0;
  transition: opacity 0.3s var(--ease-editorial);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  pointer-events: none;
}

/* Long-press hearts a tile; the badge is the only persistent mark of it. */
.hearted-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(20, 21, 24, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--accent-heart);
  pointer-events: none;
  z-index: 3;
}

.photo-card.hearted .hearted-badge {
  display: flex;
}

.card-bottom-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
}

.card-photo-title {
  font-family: var(--font-serif);
  font-size: 16px;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

/* Google Photos shared-album import panel (admin album manager) */
.sd-google-import {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-surface-elevated);
  padding: 16px 18px;
  margin-bottom: 18px;
}

.gi-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}

.gi-linked {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-gold-light);
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 12px;
  padding: 2px 10px;
}

.gi-note {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0 0 12px;
}

.gi-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.gi-input {
  flex: 1 1 260px;
  min-width: 0;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 13px;
  padding: 9px 12px;
}

.gi-input:focus {
  outline: none;
  border-color: var(--accent-gold);
}

.gi-status {
  margin-top: 14px;
}

.gi-progress {
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 8px;
}

.gi-progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent-gold);
  transition: width 0.4s ease;
}

.gi-message {
  font-size: 12px;
  color: var(--text-secondary);
}

.gi-skips {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  font-size: 11px;
  color: var(--text-secondary);
}

.gi-skips li {
  padding: 2px 0;
}

.gi-skips .gi-fail {
  color: #f87171;
}

#btnGoogleImport:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Locked downloads: padlock sits on top of the download arrow */
.dl-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.dl-lock-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: rgba(12, 13, 15, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.55);
  color: var(--accent-gold-light);
}

.btn-pill-download.locked {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--text-secondary);
  cursor: not-allowed;
}

.btn-pill-download.locked:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.16);
}

.lightbox-action-btn.locked {
  cursor: not-allowed;
}

.lightbox-action-btn.locked .dl-icon {
  opacity: 0.28;
}

.lightbox-action-btn.locked:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.08);
}

.lightbox-action-btn.locked .dl-lock-badge {
  width: 24px;
  height: 24px;
}

/* Empty Favorites State */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  max-width: 440px;
  margin: 0 auto;
}

.empty-state svg {
  margin-bottom: 20px;
}

.empty-state h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ==========================================================================
   VIEW 3: LIGHTBOX / MAXIMIZED VIEW
   ========================================================================== */

.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-editorial);
}

.lightbox-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 9, 11, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.lightbox-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 36px;
  background: linear-gradient(180deg, rgba(8, 9, 11, 0.8) 0%, transparent 100%);
}

.lightbox-counter {
  font-family: monospace;
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  gap: 4px;
}

.lightbox-title {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--text-main);
  letter-spacing: 1px;
}

.lightbox-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lightbox-action-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #ffffff;
  transition: all 0.2s var(--ease-spring);
  position: relative;
  padding: 0;
}

.lightbox-action-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: scale(1.08);
}

.lightbox-action-btn.active {
  background: var(--accent-heart);
  border-color: var(--accent-heart);
}

.lightbox-action-btn.active .heart-icon {
  fill: #ffffff;
}

/* Lightbox Stage */
.lightbox-stage {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  overflow: hidden;
}

/* Nav buttons overlay the stage so the photo gets the full viewport width. */
.lb-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(20, 21, 24, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s var(--ease-editorial);
  z-index: 10;
}

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

.lb-nav-btn:hover {
  background: rgba(20, 21, 24, 0.85);
  transform: translateY(-50%) scale(1.1);
}

/* The wrapper owns the whole stage so a maximized proof scales up to fill the
   viewport instead of sitting at its small 480p native size. */
.lightbox-image-wrapper {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.8));
  transition: transform 0.35s var(--ease-editorial), opacity 0.25s ease;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

.lightbox-img.sliding-next {
  animation: slideNext 0.3s var(--ease-editorial);
}

.lightbox-img.sliding-prev {
  animation: slidePrev 0.3s var(--ease-editorial);
}

@keyframes slideNext {
  from { opacity: 0; transform: translateX(40px) scale(0.96); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes slidePrev {
  from { opacity: 0; transform: translateX(-40px) scale(0.96); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

/* ==========================================================================
   VIEW 4: ADMIN PORTAL
   ========================================================================== */

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 36px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-brand-info {
  display: flex;
  flex-direction: column;
}

.admin-badge {
  font-size: 11px;
  color: var(--accent-gold);
}

.admin-container {
  display: flex;
  min-height: calc(100vh - 73px);
}

.admin-sidebar {
  width: 260px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.admin-tabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
  font-weight: 600;
}

.sidebar-stats-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 16px;
}

.stats-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
}

.stat-name {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Admin Main Content */
.admin-main {
  flex: 1;
  padding: 36px 48px;
  overflow-y: auto;
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
  animation: fadeInStep 0.3s var(--ease-editorial);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 32px;
}

.section-header h2 {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 400;
  margin-bottom: 4px;
}

.section-header p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Shoots Grid in Admin */
.shoots-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.shoot-admin-card {
  position: relative;
  height: 320px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.25s, border-color 0.25s;
}

.shoot-admin-card:hover {
  border-color: var(--border-focus);
}

/* The cover fills the whole card and the info panel floats over it as smoked glass. */
.shoot-card-cover {
  position: absolute;
  inset: 0;
  background-color: var(--bg-surface-elevated);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px;
}

.shoot-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.shoot-status-badge.active {
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.shoot-status-badge.inactive {
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.shoot-code-tag {
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--accent-gold);
  border: 1px solid var(--border-gold);
}

.shoot-card-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 20px;
  background: rgba(12, 13, 15, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.shoot-card-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 6px;
}

.shoot-card-client {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.shoot-stats-row {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-tertiary);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

.shoot-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Watermark Management Tab */
.watermark-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.admin-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 28px;
}

.admin-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.watermark-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
}

.watermark-dropzone:hover {
  border-color: var(--accent-gold);
  background: rgba(212, 175, 55, 0.04);
}

.watermark-dropzone svg {
  margin-bottom: 12px;
}

.watermark-dropzone .sub {
  display: block;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 6px;
}

.active-wm-preview-box {
  margin-top: 24px;
}

.active-wm-preview-box .label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.wm-preview-canvas-wrap {
  background: #1e1e24;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
}

.active-wm-img {
  max-height: 80px;
  max-width: 100%;
}

.wm-sim-stage {
  margin-top: 12px;
  height: 200px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2c3e50, #1a252f);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.wm-sim-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.wm-actions-row {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* Shoot Manager Fullscreen Modal */
.shoot-manager-header {
  display: flex;
  align-items: center;
}

.shoot-manager-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-pill-action {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-pill-action:hover {
  background: rgba(255, 255, 255, 0.12);
}

.sd-storage-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface-elevated);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.strip-left {
  display: flex;
  gap: 24px;
}

.strip-stat {
  font-size: 13px;
  color: var(--text-secondary);
}

.strip-stat strong {
  color: var(--text-main);
  margin-left: 4px;
}

.strip-actions {
  display: flex;
  gap: 10px;
}

.admin-upload-zone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 36px;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 32px;
  transition: all 0.25s;
}

.admin-upload-zone:hover {
  border-color: var(--accent-gold);
  background: rgba(212, 175, 55, 0.04);
}

.admin-upload-zone svg {
  margin-bottom: 12px;
}

.upload-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  margin-top: 16px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-gold);
  transition: width 0.2s;
}

.sd-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.sd-photo-card {
  position: relative;
  background: var(--bg-surface-elevated);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.sd-photo-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.sd-photo-card-body {
  padding: 12px;
}

.sd-photo-title {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 8px;
}

.sd-photo-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cover-badge-btn {
  font-size: 11px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: pointer;
}

.cover-badge-btn.is-cover {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: #0c0d0f;
  font-weight: 700;
}

.delete-photo-btn {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 4px;
}

/* ==========================================================================
   MODALS
   ========================================================================== */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-editorial);
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
}

.modal-content {
  position: relative;
  z-index: 2;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
}

.modal-sm { width: 100%; max-width: 440px; }
.modal-md { width: 100%; max-width: 600px; }
.modal-lg { width: 100%; max-width: 800px; }
.modal-xl { width: 95vw; max-width: 1300px; height: 92vh; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--text-tertiary);
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
}

/* Forms in Modals */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 11px 14px;
  font-size: 14px;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--border-focus);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-checkbox-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-secondary);
}

.checkbox-label input {
  accent-color: var(--accent-gold);
}

.field-hint {
  display: block;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* Email Preview Modal */
.email-preview-iframe {
  width: 100%;
  height: 500px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: #ffffff;
}

.ep-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #18191e;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 14px 20px;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideToast 0.3s var(--ease-editorial);
}

.toast.success { border-left: 3px solid #22c55e; }
.toast.error { border-left: 3px solid #ef4444; }
.toast.info { border-left: 3px solid var(--accent-gold); }

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

.hidden { display: none !important; }

/* ==================== CLIENT ALBUM LIBRARY ==================== */
.library-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 40px 80px;
}

.library-intro {
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 24px;
}

.library-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 34px;
  font-weight: 400;
  letter-spacing: 1px;
  color: var(--text-primary);
  margin: 0 0 10px;
}

.library-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 300;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.library-count {
  color: var(--accent-gold);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 4px 12px;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.album-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: transform 0.25s, border-color 0.25s;
}

.album-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-gold);
}

.album-card-cover {
  height: 190px;
  background-color: var(--bg-surface-elevated);
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 12px;
}

.album-card-count {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent-gold-light);
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  border-radius: 12px;
  padding: 4px 10px;
}

.album-card-body {
  padding: 16px 18px 18px;
}

.album-card-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 20px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0 0 6px;
  line-height: 1.3;
}

.album-card-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 0 0 12px;
}

.album-card-open {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent-gold);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Admin: client code chip + code field affordance */
.client-code-chip {
  font-family: monospace;
  font-size: 12px;
  color: var(--accent-gold);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 4px 8px;
  white-space: nowrap;
}

.input-with-action {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-with-action input {
  flex: 1;
}

.btn-generate-code {
  flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .portal-nav { padding: 20px; }
  .portal-card { padding: 32px 20px; }
  .gallery-header { padding: 14px 20px; flex-wrap: wrap; }
  .gallery-main { padding: 0 20px 40px; }
  .library-main { padding: 32px 20px 48px; }
  .album-grid { grid-template-columns: 1fr; }
  .admin-container { flex-direction: column; }
  .admin-sidebar { width: 100%; }
  .admin-main { padding: 24px 16px; }
  .watermark-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Admin data tables (clients directory, email logs)
   ========================================================================== */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-surface);
}

.data-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

.data-table thead tr {
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-tertiary);
}

.data-table th {
  padding: 12px 16px;
  font-weight: 600;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}

.data-table tbody tr:last-child {
  border-bottom: none;
}

.data-table td {
  padding: 14px 16px;
}

.td-strong { font-weight: 600; }
.td-muted { color: var(--text-secondary); }
.td-faint { color: var(--text-tertiary); font-size: 12px; }
.td-mono { font-family: monospace; }
.ta-right { text-align: right; }
.td-nowrap { white-space: nowrap; }

/* ==========================================================================
   Touch hygiene: no accidental zoom, no text reflow on rotate
   ========================================================================== */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

button,
a,
input,
select,
textarea,
.tab-btn {
  touch-action: manipulation;
}

/* ==========================================================================
   Portrait handsets: the studio portal is used on-site from a phone
   ========================================================================== */
@media (max-width: 640px) {
  .gallery-hero-banner { min-height: 150px; padding: 20px 16px; }
  .hero-title { font-size: 24px; }
  .gallery-controls-bar {
    flex-wrap: wrap;
    gap: 12px;
  }
  .filter-select { max-width: none; width: 100%; }
  .portal-nav { padding: 10px 16px; }
  .portal-card { padding: 18px 16px; }
  .card-eyebrow { font-size: 14px; margin-bottom: 4px; }
  .card-title { font-size: 26px; margin-bottom: 6px; }
  .card-subtitle { font-size: 13px; margin-bottom: 12px; }
  .portal-hint { display: none; }
  .portal-footer { margin-top: 10px; }
  .portal-divider { margin: 12px 0 10px; }
  .portal-google-wrap .google-signin-btn-box { min-height: 32px; }
  .mfa-header { margin-bottom: 18px; padding-bottom: 14px; }
  .photo-grid { gap: 12px; }
  .lb-nav-btn { width: 44px; height: 44px; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }

  /* Row layout cannot fit the code field plus the Continue button at handset
     widths, so stack them into full-width 44px targets instead. */
  .input-wrap {
    flex-direction: column;
    gap: 10px;
    padding: 8px;
  }
  .input-wrap input {
    text-align: center;
    padding: 10px 12px;
  }
  .input-wrap .btn-primary {
    width: 100%;
    min-height: 44px;
  }
  .portal-footer {
    margin-top: 28px;
    text-align: center;
    padding: 0 12px calc(6px + env(safe-area-inset-bottom));
  }

  .admin-topbar {
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  }
  .logo-mark { width: 32px; height: 32px; font-size: 15px; }
  .brand-text { font-size: 13px; letter-spacing: 2px; }
  .admin-badge { font-size: 10px; }
  .admin-user-menu { display: flex; gap: 8px; }
  .admin-user-menu .btn-secondary,
  .admin-user-menu .btn-text { min-height: 40px; padding: 8px 12px; font-size: 12px; }

  .admin-sidebar {
    padding: 10px 12px;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
  .admin-tabs {
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 4px;
  }
  .tab-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 10px 14px;
    min-height: 44px;
    font-size: 13px;
  }
  .sidebar-stats-card { margin-top: 10px; padding: 12px; }
  .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .stat-val { font-size: 16px; }
  .stat-name { font-size: 10px; }

  .admin-main { padding: 16px 12px 48px; }
  .section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 20px;
  }
  .section-header h2 { font-size: 22px; }
  .section-header p { font-size: 12px; }
  .section-header .btn-primary {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .shoots-list-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .shoot-admin-card { height: 260px; }

  /* Modals go full-bleed so nothing is squeezed into a floating card.
     100vw includes the scrollbar width and would clip the right edge, so
     stretch with inset instead of viewport units. */
  .modal { width: auto; height: auto; right: 0; bottom: 0; }
  .modal-content { border-radius: 0; border-left: none; border-right: none; }
  .modal-sm, .modal-md, .modal-lg { max-width: calc(100vw - 20px); }
  .modal-xl, .modal-fullscreen {
    width: auto;
    max-width: none;
    /* A definite height keeps .modal-body as the internal scroller; height:auto lets the
       content outgrow the fixed overlay and pushes the header off-screen, unreachable. */
    height: 100%;
    max-height: 100%;
  }
  .modal-header {
    position: relative;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
  }
  .modal-header h3 { font-size: 18px; padding-right: 44px; }
  .modal-close {
    position: absolute;
    top: 8px;
    right: 10px;
    min-width: 40px;
    min-height: 40px;
  }
  .modal-body { padding: 14px; }

  .shoot-manager-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
  }
  .shoot-manager-header .sub { font-size: 12px; overflow-wrap: anywhere; }
  .shoot-manager-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .shoot-manager-actions .btn-pill-action {
    justify-content: center;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 12px;
  }
  .shoot-manager-actions .btn-pill-action:nth-child(3) { grid-column: 1 / -1; }

  .sd-storage-strip {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px;
  }
  .strip-left {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .strip-stat { font-size: 12px; }
  .strip-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .strip-actions button {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .sd-google-import { padding: 12px; }
  .gi-note { font-size: 11px; }
  .gi-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .gi-input { width: 100%; font-size: 14px; }
  .gi-controls button {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .admin-upload-zone { padding: 20px 14px; }
  .admin-upload-zone svg { width: 28px; height: 28px; }
  .admin-upload-zone p { font-size: 13px; }
  .admin-upload-zone .sub { font-size: 11px; }

  .sd-photos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .sd-photo-card img { height: 110px; }
  .sd-photo-card-body { padding: 8px; }
  .sd-photo-title { font-size: 11px; }

  .data-table { min-width: 520px; }
  .data-table th { padding: 10px 12px; }
  .data-table td { padding: 10px 12px; font-size: 12px; }

  .form-group input,
  .form-group select,
  .form-group textarea { font-size: 16px; }
  .admin-card { padding: 16px 14px; }
}

/* Very short viewports (small phones behind browser chrome): drop decorative
   chrome so the sign-in card always fits without page scroll. */
@media (max-height: 560px) {
  .portal-google-wrap { display: none; }
  .portal-hero { padding: 10px; }
  .portal-card { padding: 18px 14px; }
  .card-eyebrow { display: none; }
  .card-title { font-size: 22px; margin-bottom: 6px; }
  .card-subtitle { font-size: 12px; margin-bottom: 14px; }
  .portal-hint { display: none; }
  .portal-footer { display: none; }
  .mfa-header { margin-bottom: 12px; padding-bottom: 10px; gap: 12px; }
  .input-wrap input { padding: 8px 10px; font-size: 15px; }
  .input-wrap .btn-primary { min-height: 40px; padding: 10px 18px; }
  .mfa-actions { gap: 8px; }
}
