/* ==========================================================================
   Solara Atelier — Bright Mobile-First Light Design System
   White & Soft-Light Surfaces · Pastel Accents · Android Small-Screen First
   ========================================================================== */

:root {
  --bg-page: #fbfafc;
  --bg-surface: #ffffff;
  --bg-soft: #f5f3fa;
  --bg-soft-rose: #fff3f6;
  --bg-soft-lavender: #f1eefe;
  --bg-soft-mint: #ebf9f3;
  --bg-soft-amber: #fff8eb;
  --bg-soft-sky: #eef6ff;

  --text-primary: #1a1625;
  --text-secondary: #5e5873;
  --text-muted: #8a849c;

  --border-subtle: rgba(26, 22, 37, 0.08);
  --border-strong: rgba(26, 22, 37, 0.16);

  --accent-primary: #e15b86;
  --accent-primary-hover: #cc4571;
  --accent-secondary: #7b61ff;
  --accent-gradient: linear-gradient(135deg, #f27aa0 0%, #8e75ff 100%);
  --accent-soft-gradient: linear-gradient(135deg, #fff0f5 0%, #f1edff 100%);

  --success: #169c69;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #2563eb;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 999px;

  --shadow-xs: 0 1px 3px rgba(26, 22, 37, 0.05);
  --shadow-sm: 0 4px 14px rgba(26, 22, 37, 0.05);
  --shadow-md: 0 10px 28px rgba(26, 22, 37, 0.07);
  --shadow-lg: 0 18px 46px rgba(26, 22, 37, 0.12);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  min-height: 100%;
}

img {
  display: block;
  max-width: 100%;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   Category App Shell (Independent Category Experience — No Website Chrome)
   ========================================================================== */

.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-page);
  padding-bottom: calc(28px + var(--safe-bottom));
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(26, 22, 37, 0.06);
  padding: calc(8px + var(--safe-top)) 14px 8px;
}

.app-header-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.header-title-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.category-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.52rem;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-subtitle {
  margin: 2px 0 0;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: transform 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.icon-btn:hover {
  background: var(--bg-soft-lavender);
  box-shadow: var(--shadow-xs);
}

.icon-btn:active {
  transform: scale(0.94);
}

.app-main {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 12px 28px;
  flex: 1;
}

@media (min-width: 768px) {
  .app-main {
    padding: 20px 24px 44px;
  }
  .category-title {
    font-size: 1.78rem;
  }
  .header-subtitle {
    font-size: 0.8rem;
  }
}

/* ==========================================================================
   Custom Costume Style Selector Banner (Compact Top Collection Action)
   ========================================================================== */

.custom-style-banner {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff6f9 0%, #f5f2ff 62%, #f1f8ff 100%);
  border: 1px solid rgba(225, 91, 134, 0.14);
  box-shadow: 0 2px 10px rgba(123, 97, 255, 0.05);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.custom-style-banner.drag-over {
  border-color: var(--accent-primary);
  background: #fff0f5;
}

.custom-style-banner-text {
  flex: 1;
  min-width: 0;
}

.custom-style-banner-heading {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.custom-style-banner-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.custom-style-banner .custom-style-upload-btn {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 11px;
  gap: 5px;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .custom-style-banner {
    margin-bottom: 14px;
    padding: 10px 16px;
    gap: 16px;
  }
  .custom-style-banner-heading {
    font-size: 0.88rem;
  }
  .custom-style-banner .custom-style-upload-btn {
    min-height: 38px;
    padding: 7px 14px;
    font-size: 0.8rem;
  }
}

/* ==========================================================================
   Editorial Masonry-Inspired Gallery (2 Col Mobile · 3 Tablet · 4 Desktop)
   ========================================================================== */

.masonry-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  align-items: start;
}

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

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

.masonry-col {
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-width: 0;
}

@media (min-width: 640px) {
  .masonry-col {
    gap: 15px;
  }
}

@media (min-width: 960px) {
  .masonry-col {
    gap: 18px;
  }
}

.gallery-card {
  position: relative;
  width: 100%;
  background: var(--bg-surface);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 6px 22px rgba(26, 22, 37, 0.065), 0 1px 4px rgba(26, 22, 37, 0.04);
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  border: 1px solid rgba(26, 22, 37, 0.05);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.24s ease, border-color 0.24s ease;
  -webkit-tap-highlight-color: transparent;
}

.gallery-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(26, 22, 37, 0.1), 0 2px 6px rgba(225, 91, 134, 0.08);
  border-color: rgba(225, 91, 134, 0.22);
}

.gallery-card:active,
.gallery-card.is-selecting {
  transform: scale(0.975);
  box-shadow: 0 4px 14px rgba(225, 91, 134, 0.2);
  border-color: rgba(225, 91, 134, 0.45);
}

.gallery-media {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: linear-gradient(110deg, #f7f4fb 20%, #fdfbfd 48%, #f4f1fa 76%);
  background-size: 220% 100%;
}

.gallery-media.is-loading {
  min-height: 190px;
  animation: skeletonWave 1.35s ease-in-out infinite;
}

.gallery-media.mode-portrait {
  aspect-ratio: 3 / 4;
}

.gallery-media.mode-square {
  aspect-ratio: 1 / 1;
}

.gallery-media.mode-masonry img {
  width: 100%;
  height: auto;
  display: block;
}

.gallery-media.mode-portrait img,
.gallery-media.mode-square img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-media img {
  opacity: 0;
  transition: opacity 0.36s ease, transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-media.is-loaded {
  min-height: 0;
  animation: none;
  background: var(--bg-soft);
}

.gallery-media.is-loaded img {
  opacity: 1;
}

.gallery-card:hover .gallery-media.is-loaded img {
  transform: scale(1.028);
}

.media-fallback {
  width: 100%;
  aspect-ratio: 3 / 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  background: linear-gradient(145deg, #fff5f8 0%, #f3f0fc 100%);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  text-align: center;
}

.gallery-badges {
  position: absolute;
  top: 9px;
  left: 9px;
  right: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
  z-index: 2;
}

.gallery-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(26, 22, 37, 0.12);
}

.gallery-pill.new {
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent-primary);
}

.gallery-pill.featured {
  background: rgba(26, 22, 37, 0.76);
  color: #ffffff;
  margin-left: auto;
}

.gallery-caption {
  padding: 9px 11px 11px;
  background: var(--bg-surface);
}

.gallery-caption-title {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.28;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.discover-more-wrap {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}

.discover-more-btn {
  min-height: 48px;
  min-width: 232px;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid rgba(26, 22, 37, 0.12);
  box-shadow: 0 8px 24px rgba(26, 22, 37, 0.08);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.discover-more-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #fff6fa 0%, #f5f3ff 100%);
  border-color: rgba(225, 91, 134, 0.34);
  box-shadow: 0 12px 28px rgba(225, 91, 134, 0.16);
  transform: translateY(-1px);
}

.discover-more-btn:active:not(:disabled) {
  transform: scale(0.975);
}

.discover-more-btn:disabled {
  opacity: 0.72;
  cursor: wait;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(225, 91, 134, 0.24);
  border-top-color: var(--accent-primary);
  animation: spinRotate 0.75s linear infinite;
}

@keyframes spinRotate {
  to { transform: rotate(360deg); }
}

.discover-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.collection-end-note {
  margin-top: 22px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.skeleton-masonry {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

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

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

.skeleton-card.tall { aspect-ratio: 3 / 4.4; border-radius: 20px; }
.skeleton-card.med { aspect-ratio: 3 / 3.8; border-radius: 20px; }
.skeleton-card.sq { aspect-ratio: 1 / 1.08; border-radius: 20px; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  min-height: 46px;
  padding: 11px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.94rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.14s ease, box-shadow 0.16s ease, opacity 0.16s ease, background-color 0.16s ease;
  text-align: center;
}

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

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(225, 91, 134, 0.28);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 10px 24px rgba(225, 91, 134, 0.36);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-soft);
}

.btn-soft {
  background: var(--bg-soft-lavender);
  color: var(--accent-secondary);
  border: 1px solid rgba(123, 97, 255, 0.18);
}

.btn-soft:hover:not(:disabled) {
  background: #e6e0fe;
}

.btn-danger {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.22);
}

.btn-sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.84rem;
  border-radius: var(--radius-sm);
}

.btn-xs {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 0.76rem;
  border-radius: 9px;
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   Try-On Workflow Screen (Selected Style + Upload Photo)
   ========================================================================== */

.flow-stack {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.surface-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 640px) {
  .surface-card {
    padding: 20px;
  }
}

.section-label {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.selected-style-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.selected-style-thumb {
  width: 68px;
  height: 88px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--bg-soft);
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}

.selected-style-info {
  flex: 1;
  min-width: 0;
}

.selected-style-name {
  margin: 0 0 3px;
  font-size: 1.04rem;
  font-weight: 700;
}

.selected-style-sub {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.upload-heading {
  margin: 0 0 4px;
  font-size: 1.12rem;
  font-weight: 700;
}

.upload-helper {
  margin: 0 0 14px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.upload-dropzone {
  border: 2px dashed rgba(123, 97, 255, 0.28);
  background: var(--accent-soft-gradient);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.upload-dropzone.drag-over {
  border-color: var(--accent-primary);
  background: var(--bg-soft-rose);
}

.upload-icon-circle {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-full);
  background: #ffffff;
  color: var(--accent-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.upload-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: 360px;
}

.upload-formats-note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.photo-preview-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.photo-preview-frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  max-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-preview-frame img {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
}

.photo-preview-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.consent-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.consent-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.87rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.consent-item input[type='checkbox'] {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--accent-primary);
  flex-shrink: 0;
}

.inline-banner {
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 0.88rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.inline-banner.error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.inline-banner.success {
  background: var(--bg-soft-mint);
  color: #0f7651;
  border: 1px solid rgba(22, 156, 105, 0.2);
}

/* ==========================================================================
   Friendly Loading Screen (Zero Technical Jargon)
   ========================================================================== */

.loading-card {
  max-width: 480px;
  margin: 24px auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 32px 22px;
  text-align: center;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.pulse-orb {
  width: 78px;
  height: 78px;
  border-radius: var(--radius-full);
  background: var(--accent-soft-gradient);
  border: 1px solid rgba(225, 91, 134, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  animation: orbPulse 2s ease-in-out infinite;
}

@keyframes orbPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(225, 91, 134, 0.25); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 14px rgba(225, 91, 134, 0); }
}

.loading-title {
  margin: 0;
  font-size: 1.24rem;
  font-weight: 700;
}

.loading-subtitle {
  margin: 0;
  font-size: 0.93rem;
  color: var(--text-secondary);
}

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-soft);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.progress-indeterminate {
  width: 42%;
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  animation: slideShimmer 1.5s ease-in-out infinite;
}

@keyframes slideShimmer {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(260%); }
}

/* ==========================================================================
   Result Screen & Interactive Before / After Comparison Slider
   ========================================================================== */

.result-stack {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.compare-container {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 70vh;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
  touch-action: pan-y;
  user-select: none;
  cursor: ew-resize;
}

.compare-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.compare-layer img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f5f3fa;
  pointer-events: none;
}

.compare-before-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
  clip-path: inset(0 50% 0 0);
}

.compare-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.28);
  transform: translateX(-50%);
  pointer-events: none;
}

.compare-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: #ffffff;
  color: var(--text-primary);
  box-shadow: 0 4px 14px rgba(26, 22, 37, 0.25);
  border: 2px solid var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.compare-badge {
  position: absolute;
  top: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: var(--shadow-xs);
  pointer-events: none;
}

.compare-badge.before { left: 12px; }
.compare-badge.after { right: 12px; }

.result-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ==========================================================================
   Settings Bottom Sheet / Modal
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(26, 22, 37, 0.36);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

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

.sheet-card {
  width: 100%;
  max-width: 520px;
  max-height: 88dvh;
  background: var(--bg-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: var(--safe-bottom);
}

@media (min-width: 640px) {
  .sheet-card {
    border-radius: var(--radius-xl);
  }
}

.sheet-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sheet-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.sheet-body {
  padding: 16px 18px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-item {
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  transition: background-color 0.14s ease;
}

.settings-item:hover {
  background: var(--bg-soft-lavender);
}

.settings-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-item-title {
  font-weight: 600;
  font-size: 0.94rem;
}

.settings-item-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.legal-article {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.62;
}

.legal-article h4 {
  margin: 14px 0 6px;
  color: var(--text-primary);
  font-size: 0.96rem;
}

.legal-article h4:first-child {
  margin-top: 0;
}

.legal-article p {
  margin: 0 0 10px;
  white-space: pre-line;
}

.guest-id-box {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--bg-soft);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  word-break: break-all;
}

/* ==========================================================================
   Empty / Unavailable States & Skeletons
   ========================================================================== */

.state-card {
  max-width: 460px;
  margin: 40px auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 32px 22px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.skeleton-card {
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, #f3f1f8 25%, #faf9fd 50%, #f3f1f8 75%);
  background-size: 200% 100%;
  animation: skeletonWave 1.4s infinite linear;
  aspect-ratio: 3 / 4;
}

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

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 120;
  background: var(--text-primary);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  max-width: calc(100vw - 32px);
  text-align: center;
}

/* ==========================================================================
   Admin Control Center — Bright Modern Professional Dashboard
   ========================================================================== */

.admin-body {
  background: #f6f7fb;
}

.admin-auth-wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(145deg, #fff5f8 0%, #f4f2fc 55%, #eef7ff 100%);
}

.admin-auth-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  box-shadow: var(--shadow-lg);
}

.admin-layout {
  display: flex;
  min-height: 100dvh;
}

.admin-sidebar {
  width: 268px;
  background: #ffffff;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 70;
  transform: translateX(-100%);
  transition: transform 0.22s ease;
}

.admin-sidebar.open {
  transform: translateX(0);
}

@media (min-width: 1024px) {
  .admin-sidebar {
    position: sticky;
    top: 0;
    height: 100dvh;
    transform: none;
    flex-shrink: 0;
  }
}

.admin-sidebar-header {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-brand {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px 20px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.admin-nav-group {
  margin: 12px 8px 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.admin-nav-item {
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: left;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.admin-nav-item:hover {
  background: var(--bg-soft);
  color: var(--text-primary);
}

.admin-nav-item.active {
  background: var(--accent-soft-gradient);
  color: var(--accent-primary);
}

.admin-nav-item-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.admin-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

@media (min-width: 1024px) {
  .admin-topbar {
    padding: 14px 26px;
  }
  .mobile-menu-btn {
    display: none;
  }
}

.admin-main {
  padding: 18px 16px 40px;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
}

@media (min-width: 1024px) {
  .admin-main {
    padding: 24px 28px 56px;
  }
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

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

.kpi-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
}

.kpi-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 1.48rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.kpi-sub {
  margin-top: 4px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.admin-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (min-width: 900px) {
  .admin-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.admin-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-xs);
  margin-bottom: 16px;
}

.admin-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.admin-card-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--text-primary);
  font-size: 0.92rem;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent-secondary);
  box-shadow: 0 0 0 3px rgba(123, 97, 255, 0.14);
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.data-table th {
  text-align: left;
  padding: 10px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-available, .status-healthy, .status-done, .status-active {
  background: var(--bg-soft-mint);
  color: #0f7651;
}

.status-estimated, .status-info, .status-pending, .status-processing {
  background: var(--bg-soft-sky);
  color: #1d4ed8;
}

.status-stale, .status-warning, .status-degraded {
  background: var(--bg-soft-amber);
  color: #b45309;
}

.status-disconnected, .status-unavailable, .status-inactive {
  background: var(--bg-soft);
  color: var(--text-secondary);
}

.status-critical, .status-limit, .status-down, .status-error {
  background: #fef2f2;
  color: #b91c1c;
}

.chart-box {
  width: 100%;
  overflow-x: auto;
}

.quota-bar-track {
  width: 100%;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--bg-soft);
  overflow: hidden;
  margin: 6px 0;
}

.quota-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  transition: width 0.3s ease;
}

.quota-bar-fill.is-safe {
  background: linear-gradient(90deg, #10b981, #059669);
}

.quota-bar-fill.is-info {
  background: linear-gradient(90deg, #3b82f6, #6366f1);
}

.quota-bar-fill.is-warning {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.quota-bar-fill.is-critical {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.free-limits-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

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

.free-limit-card {
  background: #fdfcff;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.free-limit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.free-limit-title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.free-limit-hint {
  margin: 2px 0 0;
  font-size: 0.77rem;
  color: var(--text-secondary);
}

.free-limit-numbers {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.82rem;
}

.free-limit-used {
  font-weight: 700;
  color: var(--text-primary);
}

.free-limit-left {
  font-weight: 600;
  color: var(--text-secondary);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.sidebar-scrim {
  position: fixed;
  inset: 0;
  background: rgba(26, 22, 37, 0.35);
  z-index: 65;
}

/* ==========================================================================
   Centered Popups (Emergency Announcement & Daily Limit Modal)
   ========================================================================== */

.popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 105;
  background: rgba(26, 22, 37, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.popup-card {
  width: 100%;
  max-width: 390px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 26px 22px 22px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: popupSlideIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.popup-icon-badge {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.popup-icon-badge.info {
  background: var(--accent-soft-gradient);
  color: var(--accent-primary);
  border: 1px solid rgba(225, 91, 134, 0.2);
}

.popup-icon-badge.warn {
  background: var(--bg-soft-amber);
  color: var(--warning);
  border: 1px solid rgba(217, 119, 6, 0.22);
}

.popup-title {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.popup-body {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary);
  white-space: pre-line;
}

.popup-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

/* ==========================================================================
   Rewarded Ad Unlock Card (AdMob SSV + Android APK Bridge)
   ========================================================================== */

.ad-gate-wrap-plain {
  flex-shrink: 0;
}

.ad-gate-card {
  flex-shrink: 0;
  margin-top: 2px;
  padding: 9px 11px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #fff6f9 0%, #f5f2ff 100%);
  border: 1px solid rgba(123, 97, 255, 0.2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ad-gate-card.is-unlocked {
  background: linear-gradient(135deg, #ecfaf3 0%, #f1f9ff 100%);
  border-color: rgba(22, 156, 105, 0.3);
}

.ad-gate-header {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ad-gate-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ad-gate-title {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
}

.ad-gate-count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-secondary);
}

.ad-gate-card.is-unlocked .ad-gate-count {
  color: var(--success);
}

.ad-gate-bar-track {
  width: 100%;
  height: 6px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(26, 22, 37, 0.08);
  overflow: hidden;
}

.ad-gate-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.ad-gate-card.is-unlocked .ad-gate-bar-fill {
  background: linear-gradient(135deg, #169c69 0%, #2cb886 100%);
}

.ad-gate-helper {
  margin: 0;
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 5px;
}

.ad-gate-helper.is-unlocked {
  color: #0f7651;
  font-weight: 600;
}

.ad-gate-helper.is-alert {
  color: var(--accent-primary);
  font-weight: 600;
}

.ad-gate-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ad-gate-actions-row .ad-watch-btn {
  flex: 1;
  min-height: 34px;
  font-size: 0.8rem;
}

.ad-gate-actions-row .ad-goadfree-btn {
  flex-shrink: 0;
  min-height: 34px;
}

.ad-gate-apk-note {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 9px;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid rgba(220, 38, 38, 0.16);
  font-size: 0.72rem;
  line-height: 1.25;
}

.ad-gate-apk-note svg {
  flex-shrink: 0;
}

/* ==========================================================================
   Paid Monthly Autopay Plans, Credits Pill & Subscription Tracking
   ========================================================================== */

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

.credits-pill-btn {
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  background: var(--accent-soft-gradient);
  border: 1px solid rgba(225, 91, 134, 0.28);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
  transition: transform 0.16s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.credits-pill-btn:hover {
  border-color: rgba(225, 91, 134, 0.5);
  box-shadow: var(--shadow-sm);
}

.credits-pill-btn:active {
  transform: scale(0.96);
}

.credits-pill-btn.has-credits {
  background: linear-gradient(135deg, #ecfaf3 0%, #f1edff 100%);
  border-color: rgba(22, 156, 105, 0.34);
  color: #0f7651;
}

.credits-pill-btn.has-issue {
  background: var(--bg-soft-amber);
  border-color: rgba(217, 119, 6, 0.36);
  color: #b45309;
}

.sheet-card-wide {
  max-width: 720px;
}

.plan-status-card {
  background: linear-gradient(135deg, #ffffff 0%, #faf8ff 100%);
  border: 1px solid rgba(123, 97, 255, 0.18);
  border-radius: var(--radius-lg);
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-xs);
}

.plan-status-card.is-issue {
  background: linear-gradient(135deg, #fffaf0 0%, #fff4f6 100%);
  border-color: rgba(217, 119, 6, 0.35);
}

.plan-status-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.plan-status-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-primary);
}

.plan-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--bg-soft-mint);
  color: #0f7651;
}

.plan-status-badge.warn {
  background: var(--bg-soft-amber);
  color: #b45309;
}

.plan-status-badge.danger {
  background: #fef2f2;
  color: #b91c1c;
}

.plan-status-badge.neutral {
  background: var(--bg-soft);
  color: var(--text-secondary);
}

.plan-status-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 480px) {
  .plan-status-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.plan-metric-box {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 9px 10px;
}

.plan-metric-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.plan-metric-val {
  margin-top: 2px;
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--text-primary);
}

.plan-expiry-note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

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

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

.plan-card {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 16px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-xs);
  transition: transform 0.18s ease, box-shadow 0.2s ease;
}

.plan-card.is-popular {
  background: linear-gradient(155deg, #fff5f9 0%, #f6f3ff 55%, #ffffff 100%);
  border: 2px solid transparent;
  background-clip: padding-box;
  box-shadow: 0 14px 32px rgba(225, 91, 134, 0.2);
}

.plan-card.is-popular::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--radius-lg) + 1px);
  background: var(--accent-gradient);
  z-index: -1;
}

.plan-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.plan-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--bg-soft);
  color: var(--text-secondary);
}

.plan-tag.popular {
  background: var(--accent-gradient);
  color: #ffffff;
}

.plan-tag.saver {
  background: var(--bg-soft-mint);
  color: #0f7651;
}

.plan-tag.deal {
  background: var(--bg-soft-amber);
  color: #b45309;
}

.plan-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.plan-price-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.plan-price {
  font-size: 1.58rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.plan-period {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.plan-credits-highlight {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(123, 97, 255, 0.08);
  color: #5b3fe0;
  font-size: 0.84rem;
  font-weight: 800;
}

.plan-card.is-popular .plan-credits-highlight {
  background: rgba(225, 91, 134, 0.12);
  color: #be2b5d;
}

.plan-features-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.plan-features-list li {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.38;
}

.plan-features-list li svg {
  color: var(--success);
  flex-shrink: 0;
  margin-top: 2px;
}

.credit-skip-card {
  flex-shrink: 0;
  margin-top: 2px;
  padding: 9px 11px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #ecfaf3 0%, #f3f1ff 100%);
  border: 1px solid rgba(22, 156, 105, 0.28);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.credit-skip-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.credit-skip-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.credit-skip-title {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 800;
  color: #0f7651;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.credit-skip-meta {
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

.upgrade-nudge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--accent-soft-gradient);
  border: 1px solid rgba(225, 91, 134, 0.2);
}

.upgrade-nudge-text {
  font-size: 0.78rem;
  font-weight: 700;
}

/* ==========================================================================
   Non-Scrollable Single-Screen Upload Viewport + Sticky Bottom Generate Bar
   ========================================================================== */

body.is-upload-locked {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

body.is-upload-locked .app-shell {
  height: 100dvh;
  max-height: 100dvh;
  min-height: 100dvh;
  padding-bottom: 0;
  overflow: hidden;
}

body.is-upload-locked .app-header {
  flex-shrink: 0;
  padding: calc(6px + var(--safe-top)) 12px 6px;
}

body.is-upload-locked .app-header-inner {
  min-height: 40px;
}

body.is-upload-locked .app-main {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 8px 12px 0;
  display: flex;
  flex-direction: column;
}

body.is-upload-locked .toast {
  bottom: calc(82px + var(--safe-bottom));
}

.upload-viewport {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.upload-body-area {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  padding-bottom: 8px;
}

.selected-style-card {
  flex-shrink: 0;
  padding: 8px 10px;
}

.selected-style-card .selected-style-row {
  gap: 10px;
}

.selected-style-card .selected-style-thumb {
  width: 46px;
  height: 58px;
  border-radius: 10px;
}

.selected-style-card .section-label {
  margin: 0 0 1px;
  font-size: 0.66rem;
  letter-spacing: 0.05em;
}

.selected-style-card .selected-style-name {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selected-style-card .selected-style-sub {
  margin: 1px 0 0;
  font-size: 0.74rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selected-style-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.upload-card-flex {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 7px;
  padding: 10px 12px;
  overflow: hidden;
}

.upload-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.upload-card-flex .upload-heading {
  margin: 0;
  font-size: 0.96rem;
}

.upload-card-flex .upload-helper {
  margin: 0;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.upload-dropzone-compact {
  flex: 1;
  min-height: 86px;
  padding: 10px 12px;
  gap: 6px;
  justify-content: center;
}

.upload-icon-compact {
  width: 38px;
  height: 38px;
}

.upload-drop-title {
  font-weight: 700;
  font-size: 0.88rem;
}

.upload-dropzone-compact .upload-actions-row {
  gap: 8px;
  max-width: 300px;
}

.upload-dropzone-compact .upload-actions-row .btn {
  min-height: 35px;
  padding: 5px 10px;
  font-size: 0.82rem;
}

.upload-dropzone-compact .upload-formats-note {
  font-size: 0.71rem;
}

.upload-photo-preview {
  flex: 1;
  min-height: 86px;
  gap: 6px;
}

.upload-photo-preview .photo-preview-frame {
  flex: 1;
  min-height: 60px;
  max-height: none;
}

.upload-photo-preview .photo-preview-frame img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}

.upload-photo-preview .photo-preview-actions {
  flex-shrink: 0;
  gap: 8px;
}

.upload-card-flex .consent-list {
  flex-shrink: 0;
  gap: 5px;
  margin-top: 2px;
  padding-top: 7px;
}

.upload-card-flex .consent-item {
  gap: 8px;
  font-size: 0.75rem;
  line-height: 1.26;
}

.upload-card-flex .consent-item input[type='checkbox'] {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
}

.compact-banner {
  padding: 7px 10px;
  font-size: 0.76rem;
  gap: 7px;
  flex-shrink: 0;
}

.upload-sticky-footer {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 25;
  margin: 0 -12px;
  padding: 8px 12px calc(10px + var(--safe-bottom));
  background: rgba(251, 250, 252, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.upload-sticky-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  background: #fff1f5;
  border: 1px solid rgba(225, 91, 134, 0.3);
  color: #b42352;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.28;
}

.upload-sticky-hint svg {
  flex-shrink: 0;
}

#generateBtn.is-pending {
  opacity: 0.88;
  box-shadow: 0 5px 14px rgba(225, 91, 134, 0.2);
}

.needs-attention {
  animation: attentionPulse 0.65s ease-in-out 2;
  border-radius: var(--radius-md);
}

@keyframes attentionPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(225, 91, 134, 0);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(225, 91, 134, 0.38);
  }
}

@media (min-width: 768px) {
  body.is-upload-locked .app-main {
    padding: 12px 24px 0;
  }
  .upload-sticky-footer {
    margin: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border: 1px solid var(--border-subtle);
    border-bottom: none;
  }
}

.result-ad-unlock-card {
  padding: 10px 13px;
  border-radius: var(--radius-md);
  background: var(--accent-soft-gradient);
  border: 1px solid rgba(225, 91, 134, 0.24);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.result-ad-unlock-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.result-ad-unlock-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-primary);
}

.result-ad-unlock-title svg {
  color: var(--accent-primary);
  flex-shrink: 0;
}

.result-ad-unlock-sub {
  margin: 0;
  font-size: 0.77rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.ad-disclosure-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(107, 99, 120, 0.09);
  border: 1px solid rgba(107, 99, 120, 0.22);
  color: var(--text-muted);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.35;
  flex-shrink: 0;
}

.ad-disclosure-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

