/* Nocturne Halloween Atelier — iOS Glassmorphism Design System */
:root {
  --bg-dark: #09060e;
  --bg-gradient: radial-gradient(circle at 15% 10%, rgba(168, 85, 247, 0.18), transparent 45%),
                 radial-gradient(circle at 85% 20%, rgba(255, 122, 24, 0.15), transparent 40%),
                 radial-gradient(circle at 50% 80%, rgba(139, 92, 246, 0.12), transparent 50%),
                 #09060e;
  --glass-base: rgba(22, 14, 30, 0.65);
  --glass-card: rgba(28, 18, 38, 0.55);
  --glass-card-hover: rgba(38, 25, 52, 0.7);
  --glass-elevated: rgba(35, 22, 48, 0.75);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-subtle: rgba(255, 255, 255, 0.07);
  --glass-border-glow: rgba(255, 138, 36, 0.45);
  --glass-highlight: inset 0 1px 1px 0 rgba(255, 255, 255, 0.22);
  --glass-blur: blur(28px) saturate(190%);
  --glass-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.65), 0 0 20px -5px rgba(255, 122, 24, 0.08);

  --pumpkin: #ff7a18;
  --pumpkin-glow: #ff9f43;
  --purple: #a855f7;
  --purple-glow: #c084fc;
  --gold: #fbd38d;
  --ink: #fdfaf6;
  --muted: #b9a7c4;
  --line: rgba(255, 255, 255, 0.1);
  --success: #34d399;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--ink);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* iOS Ambient Floating Orbs */
.ios-ambient-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
  animation: orbFloat 18s ease-in-out infinite alternate;
}
.g1 {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, #ff7a18 0%, rgba(255, 122, 24, 0) 70%);
  top: -120px;
  right: -80px;
}
.g2 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, #9333ea 0%, rgba(147, 51, 234, 0) 70%);
  bottom: 10%;
  left: -150px;
  animation-duration: 24s;
}
.g3 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, #e11d48 0%, rgba(225, 29, 72, 0) 70%);
  top: 40%;
  right: 25%;
  animation-duration: 20s;
  opacity: 0.25;
}
@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.08); }
  100% { transform: translate(-30px, 50px) scale(0.95); }
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}
button, a, input, select, textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight), 0 4px 12px rgba(0, 0, 0, 0.25);
  border-radius: 14px;
  padding: 10px 18px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--glass-border-glow);
  color: #fff;
  transform: translateY(-1px);
}
button:active {
  transform: scale(0.97);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--pumpkin);
  outline-offset: 3px;
}
[hidden] { display: none !important; }

/* Header — iOS Glass Nav Bar */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%;
  background: rgba(16, 10, 24, 0.75);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), var(--glass-highlight);
}
.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 2px;
  font: 700 20px -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
}
.brand small {
  display: block;
  font: 600 9px/1.8 -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 2.5px;
  color: var(--pumpkin-glow);
}
.sigil {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 122, 24, 0.25), rgba(168, 85, 247, 0.25));
  border: 1px solid rgba(255, 158, 67, 0.35);
  box-shadow: var(--glass-highlight), 0 0 16px rgba(255, 122, 24, 0.25);
  display: grid;
  place-items: center;
  font-size: 24px;
  transition: transform 0.3s;
}
.brand:hover .sigil {
  transform: rotate(-10deg) scale(1.08);
}
.head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.micro {
  font-size: 10px;
  letter-spacing: 1.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
  backdrop-filter: blur(8px);
}
.key {
  color: var(--pumpkin-glow);
  border-color: rgba(255, 122, 24, 0.35);
  background: linear-gradient(135deg, rgba(255, 122, 24, 0.15), rgba(168, 85, 247, 0.15));
}
.key:hover {
  border-color: var(--pumpkin);
  color: #fff;
  box-shadow: 0 0 18px rgba(255, 122, 24, 0.35);
}
#count {
  padding: 2px 7px;
  background: rgba(255, 122, 24, 0.25);
  border: 1px solid rgba(255, 122, 24, 0.35);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  margin-left: 6px;
}

main {
  max-width: 1480px;
  padding: 0 5%;
  margin: auto;
  position: relative;
  z-index: 1;
}

/* Hero Section */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.9fr;
  min-height: 350px;
  padding: 48px 0 32px;
  gap: 32px;
  align-items: center;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--pumpkin-glow);
  margin: 0 0 12px;
  text-transform: uppercase;
}
.hero h1 {
  font: 700 clamp(38px, 4.2vw, 62px)/1.08 -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  margin: 12px 0 18px;
  letter-spacing: -1.5px;
  color: #fff;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--pumpkin-glow) 0%, #f43f5e 50%, var(--purple-glow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}
.intro {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  max-width: 540px;
}
.hero-foot {
  display: flex;
  gap: 24px;
  font-size: 9px;
  letter-spacing: 1.8px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
  margin-top: 26px;
}

/* Hero Art - Right Side Banner */
.hero-art {
  position: relative;
  min-height: 290px;
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow), var(--glass-highlight);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 26px;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.hero-art:hover .hero-banner-img {
  transform: scale(1.03);
}
.hero-art:after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 26px;
  box-shadow: inset 0 0 32px rgba(13, 8, 20, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.22);
  pointer-events: none;
}
.moon {
  position: absolute;
  right: 18%;
  top: 28px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff2d6, #f59e0b 60%, #b45309);
  box-shadow: 0 0 60px rgba(245, 158, 11, 0.45), inset 2px 2px 6px rgba(255, 255, 255, 0.8);
}
.moon:after {
  content: "";
  position: absolute;
  inset: 5% -10% -2% 20%;
  border-radius: 50%;
  background: rgba(22, 14, 30, 0.88);
  backdrop-filter: blur(2px);
}
.bat {
  position: absolute;
  font-size: 26px;
  opacity: 0.85;
  animation: batFlutter 6s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
}
.b1 { top: 28px; left: 16%; animation-delay: 0s; }
.b2 { top: 70px; left: 34%; font-size: 20px; animation-delay: 2.5s; }
@keyframes batFlutter {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) translateX(10px) rotate(8deg); }
}
.clay-spark {
  position: absolute;
  color: var(--gold);
  text-shadow: 0 0 12px var(--pumpkin);
}
.s1 { left: 12%; top: 40px; font-size: 24px; }
.s2 { right: 8%; bottom: 50px; font-size: 20px; color: var(--purple-glow); }

.clay-pumpkin {
  position: absolute;
  width: 150px;
  height: 125px;
  bottom: 38px;
  left: 18%;
  border-radius: 46% 46% 42% 42%;
  background: linear-gradient(135deg, #ff9f43 0%, #ff7a18 45%, #c2410c 100%);
  box-shadow: 0 16px 26px rgba(0, 0, 0, 0.6), inset 4px 4px 6px rgba(255, 240, 200, 0.6), inset -5px -6px 10px rgba(130, 30, 0, 0.6);
  transform: rotate(-5deg);
}
.clay-pumpkin:before {
  content: '';
  position: absolute;
  left: 42px;
  right: 42px;
  top: 0;
  bottom: 0;
  border-radius: 50%;
  box-shadow: -3px 0 6px rgba(100, 25, 0, 0.35), 3px 0 6px rgba(255, 220, 160, 0.4);
}
.clay-pumpkin:after {
  content: '';
  position: absolute;
  left: 64px;
  top: -20px;
  width: 20px;
  height: 28px;
  background: linear-gradient(120deg, #84cc16, #4d7c0f);
  border-radius: 8px 10px 4px 4px;
  transform: rotate(14deg);
  box-shadow: inset 1px 1px 3px rgba(255, 255, 255, 0.4);
}
.clay-pumpkin span:before, .clay-pumpkin span:after {
  content: '';
  position: absolute;
  top: 40px;
  width: 17px;
  height: 20px;
  border-radius: 50% 50% 35% 35%;
  background: #2b1126;
  box-shadow: inset 1px 2px 4px rgba(0, 0, 0, 0.8), 0 0 8px rgba(255, 215, 0, 0.4);
}
.clay-pumpkin span:before { left: 34px; }
.clay-pumpkin span:after { right: 34px; }
.clay-pumpkin i {
  position: absolute;
  width: 44px;
  height: 20px;
  left: 53px;
  top: 72px;
  border-radius: 4px 4px 26px 26px;
  background: #2b1126;
  box-shadow: inset 1px 2px 4px rgba(0, 0, 0, 0.8), 0 0 8px rgba(255, 215, 0, 0.4);
}
.clay-ghost {
  position: absolute;
  width: 95px;
  height: 118px;
  right: 22%;
  bottom: 48px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(220, 205, 245, 0.8));
  border-radius: 52% 52% 24% 24%;
  box-shadow: 0 16px 24px rgba(0, 0, 0, 0.45), 0 0 28px rgba(168, 85, 247, 0.35), inset 3px 4px 6px #fff;
  transform: rotate(8deg);
  animation: ghostSway 5s ease-in-out infinite alternate;
}
@keyframes ghostSway {
  0% { transform: translateY(0) rotate(8deg); }
  100% { transform: translateY(-8px) rotate(4deg); }
}
.clay-ghost:before, .clay-ghost:after {
  content: '';
  position: absolute;
  top: 40px;
  width: 11px;
  height: 16px;
  border-radius: 50%;
  background: #3b1d4a;
}
.clay-ghost:before { left: 25px; }
.clay-ghost:after { right: 25px; }
.clay-ghost i {
  position: absolute;
  left: 41px;
  top: 65px;
  width: 14px;
  height: 16px;
  border-radius: 50%;
  background: #3b1d4a;
}
.candle {
  position: absolute;
  width: 12px;
  height: 55px;
  bottom: 22px;
  left: 10%;
  background: linear-gradient(90deg, #451a03, #d97706, #78350f);
  border-radius: 3px 3px 0 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}
.candle:before {
  content: "";
  position: absolute;
  width: 7px;
  height: 16px;
  background: #fef08a;
  border-radius: 90% 10% 80% 20%;
  top: -20px;
  left: 2px;
  box-shadow: 0 0 14px #ff7a18, 0 0 35px #f59e0b;
  animation: candleFlicker 3s ease-in-out infinite alternate;
}
.c2 { left: 88%; height: 75px; }
.c3 { left: 93%; height: 42px; }
@keyframes candleFlicker {
  0%, 100% { transform: scale(1) rotate(-2deg); opacity: 1; }
  50% { transform: scale(0.9, 1.1) rotate(3deg); opacity: 0.85; }
}
.art-label {
  position: absolute;
  bottom: 12px;
  width: 100%;
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--pumpkin-glow);
}
.art-label small {
  display: block;
  font-size: 11px;
  font-style: italic;
  font-weight: normal;
  letter-spacing: 0.5px;
  color: var(--muted);
}

/* iOS Segmented Navigation Bar */
nav#tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(18, 12, 26, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 6px;
  gap: 6px;
  margin: 16px 0 36px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow), var(--glass-highlight);
}
nav#tabs button {
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  border-radius: 15px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
nav#tabs button span {
  float: left;
  color: rgba(255, 255, 255, 0.35);
  font: 700 20px -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  margin-right: 14px;
  transition: color 0.2s;
}
nav#tabs button small {
  display: block;
  font-size: 11px;
  font-weight: normal;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 2px;
}
nav#tabs button:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  transform: none;
}
nav#tabs button.active {
  background: linear-gradient(135deg, rgba(255, 122, 24, 0.25), rgba(168, 85, 247, 0.25));
  border: 1px solid rgba(255, 158, 67, 0.4);
  box-shadow: var(--glass-highlight), 0 4px 16px rgba(255, 122, 24, 0.25);
  color: #fff;
}
nav#tabs button.active span {
  color: var(--pumpkin-glow);
}
nav#tabs button.active small {
  color: var(--gold);
}

/* Workspace Layout */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 32px;
  align-items: start;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
h2 {
  font: 700 26px/1.2 -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  margin: 0;
  letter-spacing: -0.5px;
  color: #fff;
}

/* Style / Look Cards Grid */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.style-card {
  padding: 10px;
  overflow: hidden;
  text-align: left;
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  position: relative;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow), var(--glass-highlight);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.style-card:hover {
  transform: translateY(-4px);
  background: var(--glass-card-hover);
  border-color: rgba(255, 158, 67, 0.35);
  box-shadow: 0 18px 38px -8px rgba(0, 0, 0, 0.7), 0 0 24px rgba(255, 122, 24, 0.2);
}
.style-card.selected {
  border-color: var(--pumpkin);
  background: linear-gradient(145deg, rgba(46, 26, 60, 0.75), rgba(30, 18, 40, 0.85));
  box-shadow: 0 0 0 2px var(--pumpkin), 0 14px 34px -6px rgba(255, 122, 24, 0.35), var(--glass-highlight);
}
.style-card.selected:after {
  content: '✓';
  position: absolute;
  right: 18px;
  top: 18px;
  width: 26px;
  height: 26px;
  text-align: center;
  line-height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pumpkin-glow), var(--pumpkin));
  color: #1a0b1e;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  z-index: 3;
}
.card-media-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1.25;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(10, 6, 14, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.6);
}
.mode-look-grid .card-media-wrap {
  aspect-ratio: 3 / 4; /* Portrait fashion editorial ratio for Makeup & Costumes */
}
.card-blur-bg {
  position: absolute;
  inset: -18px;
  width: calc(100% + 36px);
  height: calc(100% + 36px);
  object-fit: cover;
  filter: blur(20px) brightness(0.48);
  opacity: 0.68;
  pointer-events: none;
  transform: scale(1.1);
  display: block;
}
.card-main-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.style-card:hover .card-main-img {
  transform: scale(1.04);
}
.style-card > img {
  width: 100%;
  aspect-ratio: 1.25;
  object-fit: cover;
  display: block;
  border-radius: 16px;
  background: rgba(10, 6, 14, 0.8);
}
.style-card strong {
  display: block;
  font: 700 16px -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  padding: 12px 6px 4px;
  color: #fff;
}
.style-card small {
  display: block;
  color: var(--muted);
  padding: 0 6px 6px;
  font-size: 11px;
}
.browse-more {
  grid-column: 1 / -1;
  color: var(--pumpkin-glow);
  font-size: 13px;
  font-weight: 600;
  padding: 14px;
  margin: 6px 0 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  backdrop-filter: blur(14px);
}
.browse-more:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--pumpkin);
}

/* Creation Panel — Floating iOS Sheet */
.panel {
  background: var(--glass-elevated);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 26px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow), var(--glass-highlight);
  position: sticky;
  top: 104px;
}
.panel h2 { font-size: 24px; }
.panel .micro { font-size: 9px; }
.hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

/* Upload Dropzones */
.uploads {
  display: flex;
  gap: 10px;
  margin: 16px 0;
}
.uploads.single-mode-upload {
  display: block;
}
.upload {
  position: relative;
  flex: 1;
  min-width: 0;
  border: 1.5px dashed rgba(255, 158, 67, 0.35);
  border-radius: 18px;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(18, 11, 26, 0.55);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  overflow: hidden;
  transition: all 0.25s ease;
}
.upload:hover {
  border-color: var(--pumpkin);
  background: rgba(30, 18, 42, 0.65);
}
.upload.has-file {
  border-style: solid;
  border-color: rgba(255, 158, 67, 0.45);
  background: #09060e;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), inset 0 0 16px rgba(255, 122, 24, 0.08);
  margin: 0 auto;
}
.upload > button:not(.remove) {
  width: 100%;
  border: 0;
  padding: 12px;
  background: transparent;
  box-shadow: none;
  border-radius: 16px;
}
.upload.has-file > button:not(.remove) {
  padding: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-preview-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 16px;
}
.upload-blur-bg {
  position: absolute;
  inset: -15px;
  width: calc(100% + 30px);
  height: calc(100% + 30px);
  object-fit: cover;
  filter: blur(20px) brightness(0.42);
  opacity: 0.75;
  pointer-events: none;
  transform: scale(1.1);
  display: block;
}
.upload-main-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}
.upload span {
  font-size: 24px;
  color: var(--pumpkin-glow);
  font-weight: 300;
}
.upload small {
  font-size: 11px;
  color: var(--muted);
}
.upload:not(.has-file) img {
  width: 100%;
  height: 115px;
  object-fit: cover;
  border-radius: 14px;
}
.upload .remove {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  min-height: 26px !important;
  max-width: 26px !important;
  max-height: 26px !important;
  aspect-ratio: 1 / 1 !important;
  box-sizing: border-box !important;
  padding: 0 !important;
  border-radius: 50% !important;
  background: rgba(22, 12, 34, 0.9) !important;
  border: 1px solid rgba(255, 122, 24, 0.45) !important;
  color: #fff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6) !important;
  z-index: 5 !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}
.upload .remove svg {
  display: block;
  width: 13px;
  height: 13px;
  stroke: #ffbd7a;
  transition: stroke 0.2s, transform 0.2s;
}
.upload .remove:hover {
  background: rgba(220, 38, 38, 0.95) !important;
  border-color: #ef4444 !important;
  transform: scale(1.12);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.6) !important;
}
.upload .remove:hover svg {
  stroke: #fff;
  transform: rotate(90deg);
}

/* Fields & Form Controls */
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
label span {
  color: var(--muted);
  font-weight: normal;
  font-size: 11px;
}
.auto-badge {
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 122, 24, 0.2);
  border: 1px solid rgba(255, 122, 24, 0.4);
  color: var(--pumpkin-glow);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* AI Model Engine Outline Switcher */
.model-picker {
  margin: 14px 0 10px;
}
.picker-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.model-toggle-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.model-toggle-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.model-toggle-btn:hover {
  background: rgba(255, 122, 24, 0.06);
  border-color: rgba(255, 158, 67, 0.35);
  transform: translateY(-1px);
}
.model-toggle-btn.active {
  background: linear-gradient(135deg, rgba(255, 122, 24, 0.16), rgba(168, 85, 247, 0.12));
  border-color: #ff7a18;
  box-shadow: 0 0 0 1px rgba(255, 122, 24, 0.4), 0 4px 18px rgba(255, 122, 24, 0.22);
}
.model-toggle-btn.active .model-name {
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 122, 24, 0.5);
}
.model-toggle-btn.active .model-desc {
  color: var(--gold);
}
.model-sigil {
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.model-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.model-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: rgba(255, 255, 255, 0.9);
}
.model-desc {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Luxury Outline Switch for Keep Environment */
.env-toggle-wrap {
  margin: 14px 0 12px;
}
.env-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.env-toggle-btn:hover {
  background: rgba(255, 122, 24, 0.06);
  border-color: rgba(255, 158, 67, 0.35);
}
.env-toggle-btn.active {
  background: linear-gradient(135deg, rgba(255, 122, 24, 0.14), rgba(168, 85, 247, 0.1));
  border-color: #ff7a18;
  box-shadow: 0 0 16px rgba(255, 122, 24, 0.2);
}
.env-toggle-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.env-icon {
  font-size: 15px;
}
.env-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}
.env-switch-track {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}
.env-switch-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  position: absolute;
  top: 2px;
  left: 3px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s;
}
.env-toggle-btn.active .env-switch-track {
  background: linear-gradient(135deg, #ff7a18, #9333ea);
  border-color: #ff7a18;
  box-shadow: 0 0 10px rgba(255, 122, 24, 0.5);
}
.env-toggle-btn.active .env-switch-thumb {
  transform: translateX(18px);
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

input:not([type=checkbox]), textarea, select {
  width: 100%;
  background: rgba(18, 11, 26, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  color: var(--ink);
  padding: 12px 14px;
  min-width: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: all 0.2s;
}
input:not([type=checkbox]):focus, textarea:focus, select:focus {
  border-color: var(--pumpkin);
  box-shadow: 0 0 0 3px rgba(255, 122, 24, 0.25), inset 0 2px 4px rgba(0, 0, 0, 0.3);
  background: rgba(26, 16, 38, 0.8);
}
textarea {
  resize: vertical;
  font-size: 12px;
  line-height: 1.5;
}
select {
  font-size: 12px;
  cursor: pointer;
  appearance: 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'%3E%3Cpath fill='%23ff9f43' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 32px;
}
select option {
  background: #190e24;
  color: #fff;
}
select:disabled.auto-locked {
  opacity: 0.95;
  cursor: not-allowed;
  background-color: rgba(255, 122, 24, 0.12);
  border-color: rgba(255, 158, 67, 0.45);
  color: var(--pumpkin-glow);
  box-shadow: 0 0 16px rgba(255, 122, 24, 0.18), inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Identity Note */
.identity {
  display: flex;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 16px;
}
.identity > span {
  font-size: 22px;
  color: var(--pumpkin-glow);
}
.identity strong {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}
.identity small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 2px;
}

.prompt-link {
  background: none;
  border: 0;
  box-shadow: none;
  color: var(--pumpkin-glow);
  font-size: 11px;
  font-weight: 600;
  padding: 10px 0 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prompt-link:hover {
  transform: none;
  color: #fff;
}

.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 11px;
  color: var(--muted);
  margin: 16px 0;
  cursor: pointer;
}
.consent input {
  accent-color: var(--pumpkin);
  margin-top: 2px;
}

/* Primary iOS Halloween Action Button */
.primary {
  width: 100%;
  background: linear-gradient(135deg, #ff8c2a 0%, #ea580c 55%, #c026d3 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.3px;
  padding: 15px 20px;
  border-radius: 16px;
  box-shadow: 0 10px 24px -4px rgba(255, 122, 24, 0.45), var(--glass-highlight);
}
.primary:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -4px rgba(255, 122, 24, 0.6), var(--glass-highlight);
  color: #fff;
}
.primary:active {
  transform: scale(0.97);
  box-shadow: 0 4px 12px rgba(255, 122, 24, 0.3);
}
.primary span { margin-left: 8px; }

.outline {
  width: 100%;
  margin-top: 14px;
  color: var(--pumpkin-glow);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 158, 67, 0.35);
}
.outline:hover {
  border-color: var(--pumpkin);
  background: rgba(255, 255, 255, 0.1);
}

.privacy {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.6;
  margin-top: 14px;
}
.centered { text-align: center; }

/* Result Section */
#resultSection {
  margin-top: 50px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}
.result-stage {
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow), var(--glass-highlight);
  text-align: center;
  padding: 24px;
  margin-top: 20px;
}
.result-stage img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 18px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
}

/* Modals & Dialogs (iOS Frosted Glass Sheet) */
dialog {
  background: rgba(26, 17, 36, 0.88);
  color: var(--ink);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 30px;
  width: min(480px, 92vw);
  max-height: 88vh;
  overflow: auto;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.8), var(--glass-highlight);
}
dialog::backdrop {
  background: rgba(7, 4, 12, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
dialog .section-head button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
  padding: 0;
}
dialog .section-head button:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}
dialog h2 { font-size: 24px; }
dialog .primary { margin-top: 20px; }
.wide { width: min(1040px, 94vw); }

.history {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}
.history article {
  background: linear-gradient(145deg, rgba(24, 15, 36, 0.8), rgba(14, 8, 22, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 14px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.history article:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 122, 24, 0.4);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(255, 122, 24, 0.18);
}
.gallery-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  overflow: hidden;
  background: #09060e;
  cursor: zoom-in;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
}
.gallery-thumb-blur {
  position: absolute;
  inset: -20px;
  width: calc(100% + 40px);
  height: calc(100% + 40px);
  object-fit: cover;
  filter: blur(24px) brightness(0.42);
  opacity: 0.72;
  pointer-events: none;
  transform: scale(1.12);
  display: block;
}
.gallery-thumb-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.history article:hover .gallery-thumb-img {
  transform: scale(1.03);
}
.gallery-card-thumb > img:not(.gallery-thumb-blur):not(.gallery-thumb-img) {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(12, 6, 20, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ff9d42;
  border: 1px solid rgba(255, 122, 24, 0.35);
}
.gallery-card-info {
  margin-top: 10px;
  flex: 1;
}
.gallery-card-info h3 {
  font: 700 15px -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0 0 4px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gallery-card-info p.hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  margin: 0;
}
.gallery-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.gallery-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cfc4d6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}
.gallery-icon-btn svg {
  display: block;
  transition: transform 0.2s ease;
}
.gallery-icon-btn:hover {
  background: rgba(255, 122, 24, 0.18);
  border-color: rgba(255, 122, 24, 0.6);
  color: #ff9d42;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 122, 24, 0.3);
}
.gallery-icon-btn:hover svg {
  transform: scale(1.1);
}
.gallery-icon-btn:active {
  transform: scale(0.94);
}
.gallery-btn-lightbox {
  background: linear-gradient(135deg, rgba(255, 122, 24, 0.2), rgba(217, 70, 239, 0.2));
  border-color: rgba(255, 122, 24, 0.35);
  color: #ffb066;
}
.gallery-btn-lightbox:hover {
  background: linear-gradient(135deg, rgba(255, 122, 24, 0.4), rgba(217, 70, 239, 0.4));
  border-color: #ff7a18;
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 122, 24, 0.45);
}
.gallery-btn-del:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: rgba(239, 68, 68, 0.6) !important;
  color: #f87171 !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3) !important;
}
.gallery-btn-del.confirming {
  background: rgba(239, 68, 68, 0.35) !important;
  border-color: #ef4444 !important;
  color: #fff !important;
  animation: delPulse 1.2s infinite ease-in-out;
}
@keyframes delPulse {
  0%, 100% { box-shadow: 0 0 6px rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 16px rgba(239, 68, 68, 0.8); }
}

.ritual {
  font-size: 52px;
  color: var(--pumpkin-glow);
  text-align: center;
  margin: 20px 0 10px;
  animation: ritualPulse 2s infinite ease-in-out;
}
@keyframes ritualPulse {
  0%, 100% { transform: scale(1); opacity: 1; filter: drop-shadow(0 0 12px var(--pumpkin)); }
  50% { transform: scale(1.12); opacity: 0.75; filter: drop-shadow(0 0 28px var(--purple-glow)); }
}

.empty {
  grid-column: 1 / -1;
  padding: 60px 24px;
  text-align: center;
  border: 1.5px dashed var(--glass-border);
  border-radius: 24px;
  background: rgba(18, 11, 26, 0.45);
}
.empty h3 {
  font: 700 24px -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--pumpkin-glow);
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 36px 0;
  margin-top: 48px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
footer i {
  color: var(--pumpkin-glow);
  font-style: normal;
  margin-left: 6px;
}
footer button {
  font-size: 11px;
}

/* Responsive Media Queries */
@media (max-width: 1050px) {
  .workspace {
    grid-template-columns: 1fr 340px;
    gap: 24px;
  }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .head-actions .micro { display: none; }
  .hero h1 { font-size: 46px; }
}

@media (max-width: 768px) {
  header { height: 76px; }
  .brand { font-size: 17px; }
  .sigil { width: 38px; height: 38px; font-size: 20px; }
  .hero {
    grid-template-columns: 1fr;
    padding: 28px 0;
    gap: 20px;
  }
  .hero h1 { font-size: 38px; }
  .workspace { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  nav#tabs {
    border-radius: 16px;
    padding: 4px;
    gap: 4px;
  }
  nav#tabs button {
    padding: 10px 8px;
    font-size: 12px;
    text-align: center;
  }
  nav#tabs button span {
    float: none;
    display: block;
    margin: 0 0 2px;
    font-size: 16px;
  }
  nav#tabs button small { display: none; }
  .panel { position: static; padding: 20px; }
  .history { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .cards { grid-template-columns: 1fr; }
  .history { grid-template-columns: 1fr; }
  .hero-art { min-height: 240px; }
  .moon { width: 68px; height: 68px; }
  .clay-pumpkin { width: 120px; height: 100px; }
  .clay-ghost { width: 75px; height: 95px; }
}

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

/* ==========================================================================
   PROFESSIONAL STUDIO LIGHTBOX & ADVANCED GALLERY
   ========================================================================== */

dialog.studio-lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  background: rgba(7, 4, 12, 0.94);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 0;
  outline: none;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #f5edf7;
  user-select: none;
  -webkit-user-select: none;
}

dialog.studio-lightbox:not([open]) {
  display: none;
}

/* Topbar */
.lb-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: rgba(18, 11, 30, 0.7);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 30;
  gap: 16px;
}

.lb-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.lb-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 122, 24, 0.15);
  color: #ff9d42;
  border: 1px solid rgba(255, 122, 24, 0.3);
  white-space: nowrap;
}

.lb-meta h3 {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.lb-counter {
  font-size: 11px;
  font-weight: 700;
  color: #ff9d42;
  background: rgba(255, 122, 24, 0.12);
  border: 1px solid rgba(255, 122, 24, 0.25);
  padding: 3px 9px;
  border-radius: 12px;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.lb-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.lb-btn-group {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 3px;
  gap: 2px;
}

.lb-btn {
  background: transparent;
  border: none;
  color: #e2d9e6;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lb-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.lb-btn-text {
  min-width: 52px;
  justify-content: center;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.lb-toggle-btn.active {
  background: linear-gradient(135deg, rgba(255, 122, 24, 0.3), rgba(147, 51, 234, 0.3));
  border: 1px solid rgba(255, 122, 24, 0.5);
  color: #ffb066;
}

.lb-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.1);
}

.lb-btn-accent {
  background: linear-gradient(135deg, #ff7a18, #d946ef);
  color: #fff;
  border: none;
  box-shadow: 0 4px 14px rgba(255, 122, 24, 0.35);
}

.lb-btn-accent:hover {
  background: linear-gradient(135deg, #ff8f3d, #e879f9);
  transform: translateY(-1px);
}

.lb-btn-close {
  font-size: 20px;
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.lb-btn-close:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
}

/* Viewport & Pan/Zoom Stage */
.lb-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  touch-action: none;
}

.lb-viewport.can-pan {
  cursor: grab;
}

.lb-viewport.panning {
  cursor: grabbing;
}

.lb-stage {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  will-change: transform;
}

.lb-layer {
  display: block;
  max-width: 90vw;
  max-height: calc(100vh - 210px);
  object-fit: contain;
  pointer-events: none;
  border-radius: 14px;
}

.lb-active-layer {
  position: relative;
  z-index: 1;
}

.lb-next-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity;
}

.lb-next-layer.crossfade-active {
  opacity: 1;
}

/* Synchronized Compare Layer */
.lb-compare-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  border-radius: 14px;
  display: none;
  z-index: 3;
}

.lb-compare-wrapper.active {
  display: block;
}

.lb-compare-wrapper .lb-layer {
  width: 100%;
  height: 100%;
}

/* Split Handle Divider (Anchored at Viewport Level) */
.lb-split-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 44px;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: ew-resize;
  z-index: 29;
  touch-action: none;
  pointer-events: auto;
}

.lb-split-divider.active {
  display: flex;
}

.lb-split-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: linear-gradient(to bottom, rgba(255, 122, 24, 0.2), #ff7a18 15%, #ff7a18 85%, rgba(255, 122, 24, 0.2));
  box-shadow: 0 0 12px rgba(255, 122, 24, 0.95), 0 0 24px rgba(255, 122, 24, 0.5);
  transform: translateX(-50%);
}

.lb-split-handle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff7a18, #9333ea);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7), 0 0 18px rgba(255, 122, 24, 0.75);
  border: 2px solid rgba(255, 255, 255, 0.9);
  z-index: 2;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.lb-split-divider:hover .lb-split-handle,
.lb-split-divider.dragging .lb-split-handle {
  transform: scale(1.15);
  background: #ff9436;
}

/* State Notification Pill */
.lb-state-pill {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  padding: 7px 18px;
  border-radius: 20px;
  background: rgba(18, 12, 28, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 122, 24, 0.4);
  font-size: 12px;
  font-weight: 700;
  color: #ff9d42;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  z-index: 40;
}

.lb-state-pill.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Bottom Action Bar & Unified Floating Gallery Deck */
.lb-bottombar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 24px 16px;
  background: linear-gradient(180deg, transparent 0%, rgba(10, 6, 18, 0.8) 32%, rgba(6, 3, 12, 0.96) 100%);
  z-index: 30;
  gap: 10px;
  position: relative;
}

/* Floating Thumbnail Filmstrip Capsule */
.lb-scroller-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(20, 13, 30, 0.72);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.55), 0 0 22px rgba(255, 122, 24, 0.12);
  max-width: min(88vw, 680px);
  margin: 0 auto;
  transition: all 0.25s ease;
}

.lb-thumb-strip {
  display: flex;
  align-items: center;
  justify-content: safe center;
  gap: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 4px 6px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  max-width: 100%;
}

.lb-thumb-strip::-webkit-scrollbar {
  display: none;
}

.lb-thumb-item {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  overflow: hidden;
  cursor: pointer;
  opacity: 0.6;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
  background: rgba(255, 255, 255, 0.05);
  padding: 0;
  position: relative;
}

.lb-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.lb-thumb-item:hover {
  opacity: 0.95;
  transform: translateY(-2px) scale(1.08);
  border-color: rgba(255, 122, 24, 0.6);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.lb-thumb-item.active {
  opacity: 1;
  border-color: #ff7a18;
  transform: translateY(-3px) scale(1.12);
  box-shadow: 0 0 16px rgba(255, 122, 24, 0.75), 0 8px 22px rgba(0, 0, 0, 0.6);
}

.lb-thumb-item.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ff7a18;
  box-shadow: 0 0 6px #ff7a18;
}

.lb-scroll-arrow {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2d9e6;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.lb-scroll-arrow:hover {
  background: rgba(255, 122, 24, 0.35);
  border-color: #ff7a18;
  color: #fff;
  transform: scale(1.1);
}

.lb-bottom-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
}

.lb-hold-btn {
  background: linear-gradient(135deg, rgba(255, 122, 24, 0.22), rgba(147, 51, 234, 0.32));
  border: 1px solid rgba(255, 122, 24, 0.45);
  border-radius: 24px;
  padding: 8px 22px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(16px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 12px rgba(255, 122, 24, 0.18);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
  touch-action: none;
}

.lb-hold-btn:hover {
  background: linear-gradient(135deg, rgba(255, 122, 24, 0.38), rgba(147, 51, 234, 0.48));
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 122, 24, 0.3);
}

.lb-hold-btn:active,
.lb-hold-btn.holding {
  background: linear-gradient(135deg, #ff7a18, #9333ea);
  transform: scale(0.96);
  box-shadow: 0 0 26px rgba(255, 122, 24, 0.8);
  border-color: #fff;
}

.lb-hold-icon {
  font-size: 16px;
}

.lb-hints {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.02em;
}

/* Lightbox Navigation Prev / Next Floating Arrows */
.lb-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(18, 11, 30, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 28;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.6);
}

.lb-nav-btn:hover {
  background: linear-gradient(135deg, rgba(255, 122, 24, 0.5), rgba(147, 51, 234, 0.5));
  border-color: #ff7a18;
  transform: translateY(-50%) scale(1.12);
  box-shadow: 0 0 25px rgba(255, 122, 24, 0.7);
}

.lb-nav-btn:active {
  transform: translateY(-50%) scale(0.95);
}

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

.lb-layer.lb-fade-out {
  opacity: 0.12 !important;
  transform: scale(0.985);
}

/* Auto-play Active Pulse */
@keyframes lbAutoPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 122, 24, 0.4); }
  50% { box-shadow: 0 0 18px rgba(255, 122, 24, 0.85); }
}

.lb-btn.playing {
  background: linear-gradient(135deg, rgba(255, 122, 24, 0.4), rgba(217, 70, 239, 0.4)) !important;
  border: 1px solid #ff7a18 !important;
  color: #fff !important;
  animation: lbAutoPulse 2s infinite ease-in-out;
}

@media (max-width: 768px) {
  .lb-topbar {
    padding: 10px 14px;
    flex-wrap: wrap;
  }
  .lb-meta {
    width: 100%;
    margin-bottom: 4px;
  }
  .lb-hints {
    display: none;
  }
  .lb-btn-text {
    min-width: 44px;
  }
}

/* Luxury Busy / Generation Loader Dialog */
dialog.luxury-busy-dialog {
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 28px;
  background: radial-gradient(circle at 50% 20%, rgba(35, 18, 55, 0.95), rgba(12, 7, 20, 0.98));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 50px rgba(168, 85, 247, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(36px) saturate(190%);
  -webkit-backdrop-filter: blur(36px) saturate(190%);
  color: var(--ink);
  width: min(92vw, 420px);
  overflow: hidden;
  text-align: center;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  z-index: 1000;
}

dialog.luxury-busy-dialog::backdrop {
  background: rgba(6, 3, 11, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.luxury-loader {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 40px auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-ambient-glow {
  position: absolute;
  inset: -15px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 122, 24, 0.35) 0%, rgba(168, 85, 247, 0.3) 50%, transparent 75%);
  filter: blur(24px);
  animation: glowPulse 3s ease-in-out infinite alternate;
}

.loader-ring-outer {
  position: absolute;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #ff7a18;
  border-right-color: #a855f7;
  border-bottom-color: rgba(255, 255, 255, 0.15);
  animation: ringRotateOuter 4s linear infinite;
  box-shadow: 0 0 16px rgba(255, 122, 24, 0.4);
}

.loader-ring-inner {
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 2px dashed rgba(251, 211, 141, 0.7);
  animation: ringRotateInner 6s linear infinite reverse;
}

.loader-core {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 122, 24, 0.8), rgba(168, 85, 247, 0.85));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px rgba(255, 122, 24, 0.65), inset 0 1px 2px rgba(255, 255, 255, 0.6);
  animation: coreBreathe 2.4s ease-in-out infinite;
  z-index: 2;
}

.loader-sigil {
  font-size: 22px;
  color: #fff;
  line-height: 1;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
  animation: sigilSpin 8s ease-in-out infinite;
}

@keyframes ringRotateOuter {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes ringRotateInner {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes coreBreathe {
  0%, 100% { transform: scale(0.96); filter: brightness(1); }
  50% { transform: scale(1.06); filter: brightness(1.25); }
}

@keyframes glowPulse {
  0% { transform: scale(0.9); opacity: 0.5; }
  100% { transform: scale(1.15); opacity: 0.85; }
}

@keyframes sigilSpin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(1); }
}

.loader-content {
  padding: 0 28px 36px;
}

.loader-kicker {
  margin: 0 0 6px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #ff9f43;
  font-weight: 700;
}

.loader-headline {
  margin: 0 0 20px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #fff 40%, #e2d4f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.loader-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin: 0 auto 16px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.loader-progress-bar {
  height: 100%;
  width: 12%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff7a18, #c084fc, #ff9f43);
  background-size: 200% 100%;
  box-shadow: 0 0 12px rgba(255, 122, 24, 0.8);
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  animation: barGradientFlow 2.5s linear infinite;
}

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

.loader-status {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  min-height: 20px;
  letter-spacing: 0.01em;
  transition: opacity 0.25s ease;
}

/* Atelier Engine & Resolution Badges */
.engine-preset-badge,
.res-picker {
  margin: 14px 0;
}

.picker-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 7px;
}

.assigned-engine-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15), 0 2px 8px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
}

.engine-spark {
  font-size: 14px;
  color: #ff9f43;
}

.engine-text {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #fff, #fbd38d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Resolution Quality Picker */
.res-toggle-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: rgba(18, 11, 26, 0.6);
  padding: 4px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
}

.res-toggle-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.65);
  transition: all 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: none;
}

.res-toggle-btn .res-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.res-toggle-btn .res-cost {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 2px;
}

.res-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.res-toggle-btn.active {
  background: linear-gradient(135deg, rgba(255, 122, 24, 0.25), rgba(168, 85, 247, 0.35));
  border: 1px solid rgba(255, 122, 24, 0.55);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 122, 24, 0.22), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.res-toggle-btn.active .res-name {
  color: #fff;
}

.res-toggle-btn.active .res-cost {
  color: #fbd38d;
  font-weight: 600;
}

/* iOS Mobile App Enhancements */
@supports (padding-top: env(safe-area-inset-top)) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  
  header {
    padding-top: max(14px, env(safe-area-inset-top));
  }
  
  .lb-topbar {
    padding-top: max(12px, env(safe-area-inset-top));
  }
  
  .lb-bottombar {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 640px) {
  body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: none;
  }
  
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .head-actions {
    width: 100%;
    display: flex;
    justify-content: space-between;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 24px;
  }
  
  .hero h1 {
    font-size: 32px;
    line-height: 1.15;
  }
  
  .hero-foot {
    justify-content: center;
    gap: 12px;
  }
  
  nav#tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    gap: 8px;
    padding-bottom: 6px;
  }
  
  nav#tabs button {
    flex: 0 0 78vw;
    scroll-snap-align: start;
  }
  
  .workspace {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  .panel {
    position: static;
    border-radius: 20px;
    padding: 20px 16px;
  }
  
  .cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .style-card {
    padding: 8px;
  }
  
  .style-card .card-media-wrap {
    height: 140px;
  }
}
