:root {
  --ios-bg: #f2f2f7;
  --ios-card: #ffffff;
  --ios-text: #1c1c1e;
  --ios-secondary: #8e8e93;
  --ios-blue: #007aff;
  --ios-blue-light: #5ac8fa;
  --ios-purple: #5856d6;
  --ios-green: #34c759;
  --ios-orange: #ff9500;
  --ios-separator: rgba(60, 60, 67, 0.12);
  --hero-top: #020807;
  --hero-mid: #041612;
  --hero-deep: #062820;
  --hero-accent: #1cbfa3;
  --hero-teal: #1cbfa3;
  --hero-teal-light: #2ee6c8;
  --hero-teal-dark: #0a6b5c;
  --hero-cyan: #5ff5d8;
  --hero-violet: #0d8f7a;
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --dock-h: 72px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  background: var(--ios-bg);
  color: var(--ios-text);
  -webkit-font-smoothing: antialiased;
}

#app {
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.screen {
  display: none;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--dock-h) + var(--safe-bottom) + 16px);
}

.screen.active { display: block; }

/* ── HERO ── */
.hero {
  position: relative;
  padding: calc(12px + var(--safe-top)) 20px 28px;
  text-align: center;
  min-height: 380px;
  overflow: hidden;
  background: linear-gradient(
    180deg,
    #010605 0%,
    #020807 22%,
    #041612 48%,
    #062820 72%,
    var(--ios-bg) 100%
  );
}

.hero-fx {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.62;
}

.hero-grid {
  position: absolute;
  inset: -20% -10% 30%;
  background-image:
    linear-gradient(rgba(28, 191, 163, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 191, 163, 0.14) 1px, transparent 1px);
  background-size: 32px 32px;
  transform: perspective(500px) rotateX(58deg);
  transform-origin: center top;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, transparent 85%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, transparent 85%);
  animation: grid-drift 18s linear infinite;
}

@keyframes grid-drift {
  from { background-position: 0 0; }
  to { background-position: 0 64px; }
}

.hero-aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.45;
  mix-blend-mode: screen;
}

.hero-aurora--1 {
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, #1cbfa3 0%, transparent 68%);
  top: 8%;
  left: -12%;
  animation: aurora-float 9s ease-in-out infinite;
}

.hero-aurora--2 {
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, #0a6b5c 0%, transparent 70%);
  top: 22%;
  right: -10%;
  animation: aurora-float 11s ease-in-out infinite reverse;
}

.hero-aurora--3 {
  width: 280px;
  height: 160px;
  background: radial-gradient(ellipse, rgba(46, 230, 200, 0.45) 0%, transparent 72%);
  bottom: 26%;
  left: 50%;
  transform: translateX(-50%);
  animation: aurora-pulse 6s ease-in-out infinite;
}

@keyframes aurora-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(18px, -14px) scale(1.08); }
}

@keyframes aurora-pulse {
  0%, 100% { opacity: 0.35; transform: translateX(-50%) scale(1); }
  50% { opacity: 0.6; transform: translateX(-50%) scale(1.12); }
}

.hero-content {
  position: relative;
  z-index: 2;
}

.pro-pill {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 3;
  border: none;
  background: rgba(28, 191, 163, 0.22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(28, 191, 163, 0.35);
  box-shadow: 0 4px 24px rgba(28, 191, 163, 0.35);
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.2s, box-shadow 0.2s, background 0.2s;
}

.pro-pill.active {
  opacity: 1;
  background: rgba(88, 86, 214, 0.45);
  border-color: rgba(88, 86, 214, 0.55);
  box-shadow: 0 4px 24px rgba(88, 86, 214, 0.45);
}

/* ── ORB (replaces logo) ── */
.orb-stage {
  width: 110px;
  height: 110px;
  margin: 4px auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orb {
  position: relative;
  width: 88px;
  height: 88px;
  animation: orb-float 5s ease-in-out infinite;
}

@keyframes orb-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.orb-glow {
  position: absolute;
  inset: -24px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(28, 191, 163, 0.55) 0%,
    rgba(10, 107, 92, 0.25) 42%,
    transparent 72%
  );
  animation: orb-glow-pulse 3s ease-in-out infinite;
}

@keyframes orb-glow-pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

.orb-core {
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 38% 32%,
    #2ee6c8 0%,
    #1cbfa3 28%,
    #0a6b5c 58%,
    #020807 100%
  );
  box-shadow:
    0 0 36px rgba(28, 191, 163, 0.65),
    0 0 72px rgba(10, 107, 92, 0.35),
    inset 0 0 24px rgba(95, 245, 216, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  overflow: hidden;
}

.orb-core::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(95, 245, 216, 0.35) 60deg,
    transparent 120deg,
    rgba(28, 191, 163, 0.2) 200deg,
    transparent 280deg
  );
  animation: orb-shimmer 5s linear infinite;
}

@keyframes orb-shimmer {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.orb-letter {
  position: relative;
  z-index: 1;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -1px;
  color: #fff;
  text-shadow:
    0 0 20px rgba(28, 191, 163, 0.9),
    0 0 40px rgba(46, 230, 200, 0.45);
}

.orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid transparent;
}

.orb-ring--1 {
  border-top-color: rgba(28, 191, 163, 0.85);
  border-right-color: rgba(46, 230, 200, 0.35);
  animation: orb-spin 4s linear infinite;
}

.orb-ring--2 {
  inset: -6px;
  border-bottom-color: rgba(10, 107, 92, 0.75);
  border-left-color: rgba(95, 245, 216, 0.25);
  animation: orb-spin 7s linear infinite reverse;
}

.orb-ring--3 {
  inset: -12px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  animation: orb-spin 12s linear infinite;
}

@keyframes orb-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.orb-particle {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--hero-teal-light);
  box-shadow: 0 0 10px var(--hero-teal);
}

.orb-particle--1 {
  top: 8px;
  left: 50%;
  animation: particle-orbit 3s linear infinite;
}

.orb-particle--2 {
  bottom: 12px;
  right: 8px;
  background: var(--hero-teal);
  box-shadow: 0 0 10px var(--hero-teal-light);
  animation: particle-orbit 4.5s linear infinite reverse;
}

.orb-particle--3 {
  top: 50%;
  left: 4px;
  width: 4px;
  height: 4px;
  animation: particle-orbit 6s linear infinite;
}

@keyframes particle-orbit {
  from { transform: rotate(0deg) translateX(42px) rotate(0deg); }
  to { transform: rotate(360deg) translateX(42px) rotate(-360deg); }
}

.hero-title {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.4px;
  margin-bottom: 18px;
  text-shadow: 0 2px 28px rgba(28, 191, 163, 0.45);
}

/* ── SEARCH ZONE (tech backdrop) ── */
.search-zone {
  position: relative;
  margin-bottom: 12px;
}

.search-zone-glow {
  position: absolute;
  inset: -18px -10px;
  border-radius: 28px;
  background: radial-gradient(
    ellipse at center,
    rgba(28, 191, 163, 0.42) 0%,
    rgba(10, 107, 92, 0.2) 42%,
    transparent 78%
  );
  filter: blur(10px);
  animation: search-glow 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes search-glow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.03); }
}

.search-form {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-pill);
  padding: 4px 6px 4px 18px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 48px rgba(28, 191, 163, 0.18);
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 16px;
  color: #fff;
  outline: none;
  padding: 12px 0;
  min-width: 0;
}

.search-input::placeholder { color: rgba(255, 255, 255, 0.45); }

.search-send {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, transform 0.1s, box-shadow 0.15s;
}

.search-send:active { transform: scale(0.94); }

.search-form:focus-within .search-send,
.search-send.has-text {
  background: linear-gradient(135deg, var(--hero-teal-light), var(--hero-teal));
  color: #020807;
  box-shadow: 0 0 24px rgba(28, 191, 163, 0.55);
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.hero-btn:active { transform: scale(0.98); }
.hero-btn-icon { font-size: 18px; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 4px;
}

.hero-btn--ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

/* ── CONTENT ── */
.content {
  padding: 4px 16px 0;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin: 8px 0 12px;
  padding-left: 4px;
}

.feature-list {
  background: var(--ios-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  margin-bottom: 24px;
}

.feature-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  border: none;
  background: var(--ios-card);
  text-align: left;
  padding: 16px;
  cursor: pointer;
  color: inherit;
  transition: background 0.12s;
}

.feature-row:active { background: #f9f9fb; }
.feature-row + .feature-row { border-top: 1px solid var(--ios-separator); }

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: #f2f2f7;
}

.feature-body { flex: 1; min-width: 0; }

.feature-title {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.feature-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--ios-blue);
  background: rgba(0, 122, 255, 0.12);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.feature-desc {
  font-size: 13px;
  color: var(--ios-secondary);
  line-height: 1.35;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.chip {
  border: none;
  background: var(--ios-card);
  color: var(--ios-text);
  font-size: 14px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  cursor: pointer;
}

.chip:active { background: #ebebf0; }

/* ── GENERATION ── */
.screen-head {
  padding: calc(12px + var(--safe-top)) 20px 8px;
}

.screen-head--row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.screen-back {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--ios-card);
  color: var(--ios-blue);
  font-size: 28px;
  line-height: 1;
  padding: 0 0 2px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.screen-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.screen-desc {
  font-size: 15px;
  color: var(--ios-secondary);
  margin-top: 4px;
}

.gen-scroll { padding: 0 16px; }

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

.gen-card {
  border: none;
  background: var(--ios-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-align: left;
  color: inherit;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.12s;
}

.gen-card:active { transform: scale(0.97); }

.gen-preview {
  aspect-ratio: 1;
  background: linear-gradient(135deg, #e8f0ff, #f5f0ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  overflow: hidden;
}

.gen-preview img { width: 100%; height: 100%; object-fit: cover; }

.gen-info { padding: 10px 12px 12px; }
.gen-title { font-size: 14px; font-weight: 600; line-height: 1.25; }
.gen-desc { font-size: 11px; color: var(--ios-secondary); margin-top: 3px; line-height: 1.3; }

.custom-sheet {
  margin-top: 16px;
  background: var(--ios-card);
  border-radius: var(--radius-xl);
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.custom-sheet label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ios-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.custom-sheet textarea {
  width: 100%;
  border: 1px solid var(--ios-separator);
  border-radius: 12px;
  padding: 12px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 12px;
  outline: none;
}

.custom-sheet textarea:focus { border-color: var(--ios-blue); }

/* ── VIDEO ── */
#screen-video,
#screen-photo {
  background: var(--ios-bg);
}

#photo-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.62;
}

.orb-core--photo {
  background: linear-gradient(145deg, #1a3d5c 0%, #4a9fd4 42%, #0d2840 100%);
}

.photo-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.photo-preset-chip {
  appearance: none;
  border: 1px solid rgba(28, 191, 163, 0.22);
  background: rgba(28, 191, 163, 0.08);
  color: var(--ios-text);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-align: left;
  line-height: 1.25;
  transition: background 0.15s, border-color 0.15s;
}

.photo-preset-chip.selected {
  background: rgba(28, 191, 163, 0.22);
  border-color: rgba(28, 191, 163, 0.55);
  color: #0a6b5c;
}

.photo-source-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.photo-source-drop {
  min-height: 120px;
}

.video-hero {
  min-height: 300px;
  padding-bottom: 24px;
}

.video-hero-content {
  padding-top: 4px;
}

.video-hero-title {
  font-size: 26px;
  margin-top: 4px;
}

.video-hero-desc {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.62);
  margin-top: 6px;
  line-height: 1.35;
}

#video-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.62;
}

.video-ideas-float {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.video-idea-tag {
  position: absolute;
  pointer-events: none;
  user-select: none;
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  color: rgba(255, 255, 255, 0.34);
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(28, 191, 163, 0.16);
  background: rgba(4, 22, 18, 0.28);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: video-idea-drift linear infinite;
}

@keyframes video-idea-drift {
  0% {
    transform: translate(0, 0);
    opacity: 0;
  }
  15% {
    opacity: 0.42;
  }
  70% {
    opacity: 0.28;
  }
  100% {
    transform: translate(var(--dx, 20px), var(--dy, -40px));
    opacity: 0;
  }
}

.orb-stage--video {
  height: 120px;
  margin-bottom: -4px;
  animation: orb-float 5s ease-in-out infinite;
}

.orb--video {
  transform: scale(0.78);
}

.orb-core--video {
  background: linear-gradient(145deg, #0d4a40 0%, #1cbfa3 42%, #065a4d 100%);
}

.orb-letter--emoji {
  font-size: 28px;
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.25));
}

.video-scroll {
  position: relative;
  z-index: 2;
  margin-top: -8px;
  padding: 0 16px calc(24px + var(--safe-bottom));
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: var(--ios-bg);
}

.video-guide {
  background: var(--ios-card);
  border-radius: var(--radius-xl);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.video-guide-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.video-guide-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.14), rgba(88, 86, 214, 0.14));
  border-radius: 10px;
}

.video-guide-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin: 0;
}

.video-guide-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.video-guide-steps li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ios-text);
}

.video-step-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ios-blue);
  background: rgba(0, 122, 255, 0.1);
  border-radius: 50%;
}

.video-step-text strong {
  font-weight: 600;
  color: var(--ios-blue);
}

.video-block {
  margin-bottom: 20px;
}

.video-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding: 0 4px;
}

.video-block-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.1px;
  text-transform: uppercase;
  color: var(--ios-secondary);
  margin: 0 0 10px;
  padding: 0 4px;
}

.video-block-head .video-block-title {
  margin-bottom: 0;
}

.video-block-sub {
  font-size: 12px;
  color: var(--ios-secondary);
  font-weight: 500;
}

/* Prompt bar — iOS search style */
.video-prompt-bar {
  width: 100%;
}

.video-prompt-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 6px 6px 6px 14px;
  background: var(--ios-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--ios-separator);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.video-prompt-bar:focus-within .video-prompt-field {
  border-color: rgba(0, 122, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1), 0 2px 12px rgba(0, 0, 0, 0.04);
}

.video-prompt-search {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--ios-secondary);
}

.video-prompt-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font-size: 16px;
  line-height: 22px;
  font-family: inherit;
  color: var(--ios-text);
  min-height: 22px;
  max-height: 88px;
  padding: 8px 0;
  margin: 0;
  vertical-align: middle;
}

.video-prompt-input::placeholder {
  color: var(--ios-secondary);
}

.video-prompt-send {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(120, 120, 128, 0.16);
  color: rgba(60, 60, 67, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.12s;
}

.video-prompt-send.has-text {
  background: var(--ios-blue);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.35);
}

.video-prompt-send:active {
  transform: scale(0.94);
}

/* Frame pickers */
.video-frames-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.video-frame-card {
  min-width: 0;
}

.video-frame-label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  padding-left: 2px;
  color: var(--ios-text);
}

.video-frame-input {
  display: none;
}

.video-frame-drop {
  width: 100%;
  min-height: 108px;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--ios-card);
  padding: 12px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  outline: 1.5px dashed rgba(120, 120, 128, 0.35);
  outline-offset: -1.5px;
}

.video-frame-drop.has-image {
  outline: none;
  padding: 0;
  box-shadow: 0 2px 12px rgba(0, 122, 255, 0.15);
}

.video-frame-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 84px;
  color: var(--ios-blue);
  font-size: 13px;
  font-weight: 600;
}

.video-frame-preview {
  width: 100%;
  height: 108px;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-lg);
}

.video-frame-clear {
  margin-top: 6px;
  border: none;
  background: transparent;
  color: var(--ios-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 0 2px;
}

/* Settings group */
.video-settings {
  overflow: hidden;
}

.video-setting-row {
  padding: 12px 16px;
  border-bottom: 1px solid var(--ios-separator);
}

.video-setting-row:last-child {
  border-bottom: none;
}

.video-setting-row--slider {
  padding-bottom: 16px;
}

.video-setting-label {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--ios-text);
  margin-bottom: 8px;
}

.video-setting-control {
  width: 100%;
}

.video-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: rgba(120, 120, 128, 0.08);
  border-radius: 10px;
  padding: 10px 36px 10px 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ios-text);
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238E8E93' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.video-select:focus {
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.video-model-card {
  margin: 0;
  padding: 14px 16px;
  background: rgba(0, 122, 255, 0.05);
  border-bottom: 1px solid var(--ios-separator);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.video-model-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.video-model-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ios-text);
  letter-spacing: -0.2px;
}

.video-model-card-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--ios-blue);
  white-space: nowrap;
}

.video-model-card-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ios-secondary);
}

.video-setting-slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.video-setting-slider-head .video-setting-label {
  margin-bottom: 0;
}

.video-duration-badge {
  font-size: 15px;
  font-weight: 600;
  color: var(--ios-blue);
  font-variant-numeric: tabular-nums;
}

.video-range {
  width: 100%;
  margin: 8px 0 0;
  accent-color: var(--ios-blue);
  height: 28px;
}

.video-create-btn {
  margin-top: 4px;
  border-radius: var(--radius-xl);
  padding: 16px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
  box-shadow: 0 6px 20px rgba(0, 122, 255, 0.28);
}

.video-hint {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--ios-secondary);
  text-align: center;
  line-height: 1.45;
  padding: 0 8px;
}

.btn-ios {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.btn-ios.primary { background: var(--ios-blue); color: #fff; }
.btn-ios.primary:active { opacity: 0.85; }

/* ── PROFILE ── */
.profile-balance-card {
  margin: 0 16px 16px;
  padding: 24px 20px;
  background: linear-gradient(135deg, var(--hero-top), var(--ios-purple));
  border-radius: var(--radius-xl);
  color: #fff;
  text-align: center;
  box-shadow: 0 8px 24px rgba(47, 107, 255, 0.28);
}

.balance-label { font-size: 13px; opacity: 0.85; }
.balance-value { font-size: 36px; font-weight: 700; margin: 4px 0; letter-spacing: -0.5px; }
.balance-mode { font-size: 14px; opacity: 0.9; }

.profile-section {
  padding: 0 16px 20px;
}

.profile-section-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 10px;
  padding-left: 4px;
}

.mode-segment {
  display: flex;
  background: rgba(118, 118, 128, 0.12);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.mode-segment-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--ios-text);
  font-size: 15px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

.mode-segment-btn.active {
  background: var(--ios-card);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.mode-status {
  font-size: 15px;
  font-weight: 600;
  margin-top: 10px;
  padding-left: 4px;
}

.mode-hint {
  font-size: 13px;
  color: var(--ios-secondary);
  margin-top: 4px;
  padding-left: 4px;
}

.tariff-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tariff-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--ios-card);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.tariff-icon { font-size: 20px; }
.tariff-name { font-size: 14px; font-weight: 600; }
.tariff-price { font-size: 13px; color: var(--ios-secondary); }

.tips-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tip-card {
  background: var(--ios-card);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.tip-icon { font-size: 22px; margin-bottom: 6px; }
.tip-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.tip-desc { font-size: 13px; color: var(--ios-secondary); line-height: 1.4; }

.stats-card {
  background: var(--ios-card);
  border-radius: var(--radius-xl);
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.stats-total { font-size: 16px; font-weight: 600; margin-bottom: 10px; }

.stats-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stats-chip {
  font-size: 13px;
  background: var(--ios-bg);
  padding: 6px 10px;
  border-radius: var(--radius-pill);
}

.stats-empty {
  font-size: 13px;
  color: var(--ios-secondary);
}

/* ── PERSONALITY (Mira-style) ── */
.personality-section {
  padding: 0 16px 20px;
}

.personality-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 4px;
}

.personality-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.personality-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.personality-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--ios-secondary);
  padding-left: 4px;
}

.field-box {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: none;
  background: var(--ios-card);
  border-radius: var(--radius-xl);
  font-size: 16px;
  font-weight: 500;
  color: var(--ios-text);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.field-box:active { background: #f9f9fb; }

.field-box .chevron { flex-shrink: 0; }

/* ── PICKER LIST ── */
.picker-scroll { padding: 0 16px 24px; }

.picker-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: none;
  background: var(--ios-card);
  text-align: left;
  padding: 14px 16px;
  cursor: pointer;
  color: inherit;
}

.picker-item + .picker-item { border-top: 1px solid var(--ios-separator); }
.picker-item:active { background: #f9f9fb; }

.picker-item-body { flex: 1; min-width: 0; }
.picker-item-title { font-size: 16px; font-weight: 600; }
.picker-item-sub { font-size: 13px; color: var(--ios-secondary); margin-top: 2px; }

.picker-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #c7c7cc;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
  color: transparent;
}

.picker-item.selected .picker-check {
  border-color: var(--ios-blue);
  background: var(--ios-blue);
  color: #fff;
}

.ios-group {
  margin: 0 16px 16px;
  background: var(--ios-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ios-row, .ios-row-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  width: 100%;
}

.ios-row-btn {
  border: none;
  background: var(--ios-card);
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.ios-row-btn:active { background: #f9f9fb; }
.ios-row-btn + .ios-row-btn { border-top: 1px solid var(--ios-separator); }

.ios-row-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.ios-row-icon.purple { background: rgba(88, 86, 214, 0.12); }
.ios-row-icon.green { background: rgba(52, 199, 89, 0.12); }
.ios-row-icon.orange { background: rgba(255, 149, 0, 0.12); }
.ios-row-icon.blue { background: rgba(0, 122, 255, 0.12); }
.ios-row-icon.teal { background: rgba(90, 200, 250, 0.12); }
.ios-row-icon.red { background: rgba(255, 59, 48, 0.12); }

.ios-row-body { flex: 1; min-width: 0; }
.ios-row-title { font-size: 16px; font-weight: 500; }
.ios-row-sub { font-size: 13px; color: var(--ios-secondary); margin-top: 1px; }

.chevron {
  color: #c7c7cc;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
}

.switch {
  position: relative;
  width: 51px;
  height: 31px;
  flex-shrink: 0;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  inset: 0;
  background: #e9e9ea;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: 0.2s;
}

.slider::before {
  content: "";
  position: absolute;
  width: 27px;
  height: 27px;
  left: 2px;
  bottom: 2px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: 0.2s;
}

input:checked + .slider { background: var(--ios-green); }
input:checked + .slider::before { transform: translateX(20px); }

.tariffs-block { padding: 0 16px 8px; }

.tariffs-card {
  padding: 16px;
  font-size: 14px;
  line-height: 1.55;
}

.tariffs-card b { display: block; margin: 10px 0 4px; font-size: 15px; }
.tariffs-card b:first-child { margin-top: 0; }

.pkg-card {
  background: var(--ios-card);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pkg-title { font-weight: 600; font-size: 15px; }
.pkg-meta { font-size: 13px; color: var(--ios-secondary); margin-top: 3px; }
.pkg-bonus { font-size: 12px; color: var(--ios-green); margin-top: 4px; font-weight: 500; }

/* ── IDEAS TAB ── */
.ideas-head {
  padding: calc(12px + var(--safe-top)) 16px 12px;
}

.ideas-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0 0 12px;
}

.ideas-segment {
  display: flex;
  background: rgba(118, 118, 128, 0.12);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.ideas-segment-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--ios-text);
  font-size: 15px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

.ideas-segment-btn.active {
  background: var(--ios-card);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.ideas-scroll {
  padding: 0 16px 8px;
}

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

.ideas-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border: none;
  padding: 0;
  background: var(--ios-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.15s ease;
}

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

.ideas-card-media-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  background: rgba(118, 118, 128, 0.12);
  overflow: hidden;
}

.ideas-card-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ideas-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  opacity: 0.35;
}

.ideas-card-title {
  display: block;
  padding: 10px 10px 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ios-text);
}

.ideas-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--ios-secondary);
  font-size: 14px;
  padding: 32px 16px;
}

.ideas-hint {
  font-size: 13px;
  color: var(--ios-secondary);
  text-align: center;
  margin: 16px 0 0;
  line-height: 1.4;
}

.ideas-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.admin-hint {
  font-size: 13px;
  color: var(--ios-secondary);
  margin: -4px 0 12px;
  line-height: 1.4;
}

/* ── DOCK (floating tab bar) ── */
.dock {
  position: fixed;
  left: 50%;
  bottom: calc(10px + var(--safe-bottom));
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 448px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-pill);
  padding: 8px 6px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.08),
    0 0 0 0.5px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  z-index: 50;
}

.dock-item {
  flex: 1;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 0;
  cursor: pointer;
  color: var(--ios-secondary);
  transition: color 0.15s;
}

.dock-icon-wrap {
  width: 44px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  transition: background 0.15s;
}

.dock-item.active { color: var(--ios-blue); }
.dock-item.active .dock-icon-wrap {
  background: rgba(0, 122, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dock-icon { font-size: 18px; line-height: 1; }
.dock-label { font-size: 10px; font-weight: 500; letter-spacing: -0.1px; }

/* ── UTILS ── */
.loader {
  position: fixed;
  inset: 0;
  background: rgba(242, 242, 247, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(0, 122, 255, 0.15);
  border-top-color: var(--ios-blue);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

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

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--dock-h) + var(--safe-bottom) + 20px);
  transform: translateX(-50%);
  background: rgba(28, 28, 30, 0.92);
  color: #fff;
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  z-index: 101;
  max-width: 88%;
  text-align: center;
  backdrop-filter: blur(8px);
}

.hidden { display: none !important; }

/* ── ADMIN ── */
.admin-scroll { padding: 0 16px 24px; }

.admin-section-title { margin-top: 20px; }

.admin-form { padding: 14px 16px; margin-bottom: 12px; }

.admin-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ios-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin: 10px 0 6px;
}

.admin-label:first-child { margin-top: 0; }

.admin-input, .admin-textarea {
  width: 100%;
  border: 1px solid var(--ios-separator);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  background: var(--ios-bg);
}

.admin-textarea { resize: vertical; min-height: 80px; }

.admin-card {
  background: var(--ios-card);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

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

.admin-card-title { font-weight: 600; font-size: 15px; }

.admin-row { margin-bottom: 8px; }

.admin-preview {
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  border-radius: 10px;
  margin: 8px 0;
  background: var(--ios-bg);
}

.admin-upload-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.admin-upload-row input[type=file] {
  flex: 1;
  font-size: 13px;
}

.btn-ios.secondary {
  background: var(--ios-card);
  color: var(--ios-text);
  border: 1px solid var(--ios-separator);
  margin-bottom: 12px;
}

.admin-save { margin-top: 20px; margin-bottom: 8px; }

.admin-stats {
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.6;
}

.admin-del {
  border: none;
  background: rgba(255, 59, 48, 0.12);
  color: #ff3b30;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.admin-check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-top: 8px; }
