:root {
  /* Dark Luxury Palette — Velvet Onyx & Champagne Gold */
  --bg: #060608;
  --bg-panel: #0c0c10;
  --bg-card: #121217;
  --bg-card-hover: #17171e;
  --bg-input: #08080c;

  --border: rgba(212, 175, 55, 0.14);
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(212, 175, 55, 0.34);
  --inner-highlight: inset 0 1px 0 rgba(243, 218, 138, 0.08);

  --text: #faf7f0;
  --text-secondary: #d7d0c2;
  --text-muted: #938c7e;
  --text-dim: #625d53;

  --gold-light: #f3da8a;
  --gold: #d4af37;
  --gold-deep: #9f791d;
  --gold-ink: #0a0907;

  --primary: #d4af37;
  --primary-hover: #e5c357;
  --flow: #e8c766;
  --success: #34d399;
  --warning: #eab308;
  --danger: #f87171;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-panel: 0 28px 70px rgba(0, 0, 0, 0.65);
  --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.38);
  --shadow-gold: 0 10px 30px rgba(212, 175, 55, 0.22);

  --font-serif: "Playfair Display", Georgia, serif;
  --font-display: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.56;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Luxury Thin Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.24);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.45);
}

a {
  color: var(--gold-light);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code,
kbd {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.24);
  border-radius: 5px;
  padding: 1px 6px;
  color: #f6e7bc;
}

.hidden {
  display: none !important;
}

.mt-8 {
  margin-top: 8px;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.muted {
  color: var(--text-muted);
}

.kicker {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 5px;
}

/* Champagne Dot Grid & Velvet Gold Ambient Glows */
.canvas-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(rgba(212, 175, 55, 0.13) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 85% 85% at 50% 18%, #000 32%, transparent 100%);
}

.bg-glow {
  position: fixed;
  border-radius: 999px;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.16;
}

.bg-glow-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #d4af37 0%, transparent 70%);
  top: -260px;
  left: -140px;
}

.bg-glow-2 {
  width: 540px;
  height: 540px;
  background: radial-gradient(circle, #8c6618 0%, transparent 70%);
  bottom: -220px;
  right: -120px;
}

/* =========================================================
   FLOATING GLASS TOP BAR (DARK LUXURY)
   ========================================================= */
.topbar {
  position: sticky;
  top: 12px;
  z-index: 40;
  padding: 0 22px;
  pointer-events: none;
}

.topbar-inner {
  pointer-events: auto;
  max-width: 1476px;
  margin: 0 auto;
  padding: 8px 14px 8px 18px;
  min-height: 58px;
  border-radius: 999px;
  background: rgba(12, 12, 16, 0.82);
  backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid rgba(212, 175, 55, 0.24);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(243, 218, 138, 0.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

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

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f3da8a 0%, #d4af37 55%, #9b731b 100%);
  display: grid;
  place-items: center;
  color: var(--gold-ink);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.28s ease;
}

.brand:hover .brand-icon {
  transform: rotate(-8deg) scale(1.06);
  box-shadow: 0 10px 28px rgba(212, 175, 55, 0.5);
}

.brand-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #fffdf7 20%, #f3da8a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge-beta {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.14);
  color: var(--gold-light);
  -webkit-text-fill-color: var(--gold-light);
  border: 1px solid rgba(212, 175, 55, 0.36);
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

/* Segmented Connection Status Pill */
.status-cluster {
  display: inline-flex;
  align-items: center;
  background: rgba(6, 6, 8, 0.78);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  box-shadow: var(--inner-highlight);
}

.status-sep {
  width: 1px;
  height: 15px;
  background: rgba(212, 175, 55, 0.22);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.status-pill:hover {
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold-light);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  flex-shrink: 0;
}

.status-offline .status-dot {
  background: var(--gold);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.65);
}

.status-online .status-dot {
  background: var(--success);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.85);
  animation: statusBeacon 2.2s ease-in-out infinite;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.topbar-actions .btn {
  border-radius: 999px;
}

.count-chip {
  background: rgba(212, 175, 55, 0.18);
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 0 6px;
  min-width: 19px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--gold-light);
}

/* =========================================================
   FLOATING PILL NAVIGATION DOCK (BOTTOM CENTER)
   ========================================================= */
.floating-pill-nav {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(12, 12, 16, 0.88);
  backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid rgba(212, 175, 55, 0.34);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.72), 0 0 32px rgba(212, 175, 55, 0.1), inset 0 1px 0 rgba(243, 218, 138, 0.18);
  animation: dockFloatIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes dockFloatIn {
  from {
    opacity: 0;
    transform: translate(-50%, 18px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

.pill-nav-item {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.18s ease, background 0.2s ease, border-color 0.2s ease, transform 0.16s ease;
}

.pill-nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.pill-nav-item.active {
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.16);
  border-color: rgba(212, 175, 55, 0.42);
  box-shadow: inset 0 1px 0 rgba(243, 218, 138, 0.22);
}

.pill-nav-divider {
  width: 1px;
  height: 20px;
  margin: 0 4px;
  background: rgba(212, 175, 55, 0.24);
}

.pill-nav-icon {
  position: relative;
  overflow: hidden;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.16s ease;
}

.pill-nav-icon:hover {
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.12);
  border-color: rgba(212, 175, 55, 0.28);
  transform: translateY(-1px);
}

.pill-nav-cta {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 15px;
  margin-left: 2px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #f3da8a 0%, #d4af37 55%, #a47c1e 100%);
  color: var(--gold-ink);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.18s ease;
}

.pill-nav-cta:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.pill-nav-cta:active {
  transform: translateY(1px) scale(0.97);
}

/* =========================================================
   STUDIO SPLIT-PANE WORKSPACE
   ========================================================= */
.workspace {
  position: relative;
  z-index: 1;
  max-width: 1520px;
  margin: 0 auto;
  padding: 26px 22px 104px;
  display: grid;
  grid-template-columns: 448px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.panel {
  background: rgba(12, 12, 16, 0.92);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel), var(--inner-highlight);
}

/* Left Sidebar: Sticky + Internal Scroll + Pinned Footer */
.panel-input {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 156px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.panel-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 22px 20px 18px;
}

.panel-footer {
  padding: 13px 20px;
  background: rgba(8, 8, 12, 0.95);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 9px;
  align-items: center;
}

.panel-footer .btn-primary {
  flex: 1;
}

.panel-header h1 {
  font-family: var(--font-serif);
  margin: 0 0 5px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fffdf8;
}

.panel-header p {
  margin: 0 0 15px;
  font-size: 12.5px;
}

/* Presets */
.preset-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.08), rgba(212, 175, 55, 0.03));
  border: 1px solid rgba(212, 175, 55, 0.22);
}

.preset-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold-light);
}

.preset-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  position: relative;
  overflow: hidden;
  background: rgba(8, 8, 12, 0.92);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.chip:hover {
  color: var(--gold-light);
  border-color: rgba(212, 175, 55, 0.5);
  background: rgba(212, 175, 55, 0.12);
}

.chip.preset-active {
  border-color: var(--gold-light);
  background: linear-gradient(135deg, rgba(243, 218, 138, 0.22), rgba(212, 175, 55, 0.16));
  color: #fff9e6;
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.24);
}

/* Structured Numbered Form Sections */
.form-sections {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-section {
  background: rgba(18, 18, 24, 0.68);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  box-shadow: var(--inner-highlight);
  transition: border-color 0.2s ease;
}

.form-section:focus-within {
  border-color: rgba(212, 175, 55, 0.32);
}

.section-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.section-num {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 1px 7px;
  border-radius: 999px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
}

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

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

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

.field label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.req {
  color: var(--gold-light);
}

.opt {
  font-weight: 400;
  color: var(--text-dim);
  font-size: 11px;
}

input[type="text"],
input[type="url"],
input[type="password"],
select,
textarea {
  width: 100%;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8.5px 11px;
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-dim);
}

textarea {
  resize: vertical;
  min-height: 58px;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(212, 175, 55, 0.28);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* Dropzone */
.dropzone {
  border: 1.5px dashed rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-sm);
  padding: 13px;
  background: var(--bg-input);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--gold-light);
  background: rgba(212, 175, 55, 0.06);
}

.dropzone.dragover {
  transform: scale(1.012);
}

.dropzone.upload-success {
  border-style: solid;
  border-color: rgba(212, 175, 55, 0.55);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.dropzone-empty {
  text-align: center;
  padding: 4px 6px;
}

.dropzone-icon {
  width: 38px;
  height: 38px;
  margin: 0 auto 7px;
  border-radius: 10px;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.24);
  color: var(--gold-light);
  display: grid;
  place-items: center;
}

.dropzone.dragover .dropzone-icon {
  animation: floatGentle 0.8s ease-in-out infinite;
}

.dropzone-title {
  font-weight: 600;
  font-size: 12.5px;
  color: var(--text);
}

.dropzone-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.image-preview-wrap {
  display: flex;
  align-items: center;
  gap: 11px;
}

.image-preview-wrap:not(.hidden) {
  animation: popSpring 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.image-preview-wrap img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  flex-shrink: 0;
}

.image-preview-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.image-meta-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.image-meta-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-light);
}

.helper-banner {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

/* =========================================================
   LUXURY BUTTON SYSTEM
   ========================================================= */
.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12.5px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
  white-space: nowrap;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.18s ease, border-color 0.18s ease, box-shadow 0.2s ease, filter 0.18s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.985);
}

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

.btn-lg {
  padding: 11px 18px;
  font-size: 13.5px;
  border-radius: 11px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-xs {
  padding: 5px 10px;
  font-size: 11.5px;
  border-radius: 7px;
}

/* Brushed Champagne Gold Primary & Flow CTAs */
.btn-primary,
.btn-flow {
  background: linear-gradient(135deg, #f3da8a 0%, #d4af37 52%, #a67c1e 100%);
  color: var(--gold-ink);
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.btn-primary:hover:not(:disabled),
.btn-flow:hover:not(:disabled) {
  filter: brightness(1.07);
  box-shadow: 0 12px 30px rgba(212, 175, 55, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.btn-primary::before,
.btn-flow::before,
.pill-nav-cta::before {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  transform: skewX(-22deg);
  transition: left 0.58s ease;
  pointer-events: none;
}

.btn-primary:hover::before,
.btn-flow:hover::before,
.pill-nav-cta:hover::before {
  left: 145%;
}

.btn-secondary {
  background: rgba(212, 175, 55, 0.08);
  color: var(--gold-light);
  border-color: rgba(212, 175, 55, 0.28);
  box-shadow: var(--inner-highlight);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(212, 175, 55, 0.16);
  border-color: rgba(212, 175, 55, 0.48);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-subtle);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--gold-light);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(212, 175, 55, 0.3);
}

.btn-danger-ghost {
  background: transparent;
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.32);
}

.btn-danger-ghost:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.14);
}

.btn-copied {
  background: rgba(52, 211, 153, 0.18) !important;
  color: #6ee7b7 !important;
  border-color: rgba(52, 211, 153, 0.55) !important;
  box-shadow: 0 0 18px rgba(52, 211, 153, 0.24) !important;
}

.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(10, 9, 7, 0.28);
  border-top-color: var(--gold-ink);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

/* =========================================================
   RIGHT CANVAS: LUXURY STUDIO OUTPUT
   ========================================================= */
.panel-output {
  padding: 26px;
  min-height: calc(100vh - 156px);
}

/* Empty State Studio Welcome */
.empty-state {
  min-height: calc(100vh - 210px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 36px 24px;
}

.empty-orbit {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.05));
  border: 1px solid rgba(212, 175, 55, 0.42);
  color: var(--gold-light);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  box-shadow: 0 16px 40px rgba(212, 175, 55, 0.16), inset 0 1px 0 rgba(243, 218, 138, 0.25);
  animation: floatGentle 3.6s ease-in-out infinite;
}

.empty-state h2 {
  font-family: var(--font-serif);
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.015em;
  background: linear-gradient(135deg, #fffdf8 25%, #f3da8a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.empty-desc {
  margin: 0 0 30px;
  color: var(--text-muted);
  max-width: 540px;
  font-size: 13.5px;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: 100%;
  max-width: 740px;
  margin-bottom: 30px;
  text-align: left;
}

.wf-step {
  background: linear-gradient(160deg, rgba(22, 22, 29, 0.9), rgba(14, 14, 19, 0.96));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--inner-highlight);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.wf-step:hover {
  transform: translateY(-3px);
  border-color: rgba(212, 175, 55, 0.48);
  box-shadow: 0 14px 32px rgba(212, 175, 55, 0.1);
}

.wf-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
}

.wf-step strong {
  font-family: var(--font-display);
  font-size: 13.5px;
  color: var(--text);
}

.wf-step small {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Result Layout */
.result-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.result-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.result-title-block h2 {
  font-family: var(--font-serif);
  margin: 8px 0 0;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fffdf8;
}

.result-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2.5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.tag-accent {
  background: rgba(212, 175, 55, 0.14);
  color: var(--gold-light);
  border-color: rgba(212, 175, 55, 0.34);
}

.tag-success {
  background: rgba(52, 211, 153, 0.14);
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.36);
}

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

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-card), var(--inner-highlight);
}

/* Hero Master 1-Prompt Card — Gold Velvet Accent */
.master-card {
  background: linear-gradient(150deg, rgba(212, 175, 55, 0.11) 0%, rgba(26, 22, 14, 0.62) 40%, rgba(18, 18, 23, 0.98) 100%);
  border: 1px solid rgba(212, 175, 55, 0.38);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.45), 0 0 36px rgba(212, 175, 55, 0.08), inset 0 1px 0 rgba(243, 218, 138, 0.16);
}

.master-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.master-header h3 {
  font-family: var(--font-serif);
  margin: 8px 0 3px;
  font-size: 18px;
  font-weight: 700;
  color: #fffdf8;
}

.master-photo-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(6, 6, 8, 0.82);
  border: 1px solid rgba(212, 175, 55, 0.42);
  border-radius: 11px;
  padding: 6px 10px;
  max-width: 230px;
}

.master-photo-chip img {
  width: 40px;
  height: 40px;
  border-radius: 7px;
  object-fit: cover;
  border: 1px solid rgba(212, 175, 55, 0.45);
}

.master-photo-chip strong {
  display: block;
  font-size: 11px;
  color: var(--gold-light);
}

.master-photo-chip small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  max-width: 150px;
}

.master-textarea {
  min-height: 170px;
  border-color: rgba(212, 175, 55, 0.26);
}

.master-actions {
  margin-top: 13px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.master-actions .btn-flow {
  flex: 1;
}

/* Progress Rail */
.progress-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 13px 16px;
  box-shadow: var(--inner-highlight);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.progress-card.progress-complete {
  border-color: rgba(212, 175, 55, 0.55);
  box-shadow: 0 0 28px rgba(212, 175, 55, 0.14);
}

.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  font-size: 12.5px;
}

.progress-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.progress-pct {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--gold-light);
}

.progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #a67c1e, #f3da8a, #d4af37, #a67c1e);
  background-size: 200% 100%;
  animation: progressSheen 2.6s linear infinite;
  transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Segmented Tabs */
.card-head-row {
  margin-bottom: 14px;
}

.tabs {
  display: inline-flex;
  gap: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  flex-wrap: wrap;
}

.tab-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.16);
  border-color: rgba(212, 175, 55, 0.42);
  box-shadow: var(--inner-highlight);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeSlideUp 0.22s ease;
}

.small-note {
  margin: 0 0 10px;
  font-size: 12.5px;
}

.hooks-list {
  display: grid;
  gap: 8px;
}

.hook-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 13px;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.hook-item:hover {
  border-color: rgba(212, 175, 55, 0.42);
  transform: translateX(2px);
}

.hook-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.hook-num {
  font-family: var(--font-mono);
  color: var(--gold);
  font-weight: 700;
  margin-right: 8px;
}

.script-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.sub-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  font-size: 12.5px;
}

.prose-box {
  margin: 0;
  white-space: pre-wrap;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 13px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  min-height: 120px;
}

.prompt-box-wrap {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
}

.prompt-code {
  margin: 0;
  padding: 13px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.62;
  white-space: pre-wrap;
  word-break: break-word;
  color: #efe9dc;
}

.prompt-box-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(12, 12, 16, 0.85);
}

/* Storyboard Scene Cards */
.scenes-head {
  padding-top: 6px;
}

.scenes-head h3 {
  font-family: var(--font-serif);
  margin: 2px 0 3px;
  font-size: 18px;
  font-weight: 700;
  color: #fffdf8;
}

.scenes-head p {
  margin: 0;
  font-size: 12.5px;
}

.scenes-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.scene-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid rgba(212, 175, 55, 0.5);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-card), var(--inner-highlight);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.scene-card:hover {
  border-color: rgba(212, 175, 55, 0.34);
  border-left-color: var(--gold-light);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.44), var(--inner-highlight);
}

.scene-card.scene-done {
  border-color: rgba(52, 211, 153, 0.34);
  border-left-color: var(--success);
}

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

.scene-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.scene-index {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f3da8a, #b88e25);
  color: var(--gold-ink);
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 12px;
  display: grid;
  place-items: center;
}

.scene-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14.5px;
}

.scene-meta-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 11px;
}

.meta-pill {
  font-size: 11px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 3px 9px;
}

.scene-mode-switch {
  display: inline-flex;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}

.scene-mode-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.scene-mode-btn.active {
  background: rgba(212, 175, 55, 0.2);
  color: var(--gold-light);
}

.scene-textarea {
  width: 100%;
  min-height: 110px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.62;
  background: var(--bg-input);
  color: #f6f1e6;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 13px;
}

.scene-dialogue {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  background: rgba(212, 175, 55, 0.07);
  border: 1px solid rgba(212, 175, 55, 0.24);
  font-size: 12px;
  color: #f3df9b;
}

.scene-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.scene-check-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.scene-check-label input {
  width: 15px;
  height: 15px;
  accent-color: var(--gold);
}

.scene-btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* =========================================================
   MODALS (DARK LUXURY)
   ========================================================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 65;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 5, 0.82);
  backdrop-filter: blur(10px);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 540px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 36px 80px rgba(0, 0, 0, 0.78), 0 0 40px rgba(212, 175, 55, 0.08), var(--inner-highlight);
  overflow: hidden;
}

.modal-wide {
  max-width: 680px;
}

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

.modal-header h3 {
  font-family: var(--font-serif);
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #fffdf8;
}

.icon-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 14px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: rgba(212, 175, 55, 0.14);
  color: var(--gold-light);
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  padding: 13px 20px;
  background: rgba(7, 7, 10, 0.84);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-footer-right {
  display: flex;
  gap: 8px;
}

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

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

.field-hint {
  margin: 0;
  font-size: 11.5px;
  color: var(--text-muted);
}

.quick-url-chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.setup-steps {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 12.5px;
}

.setup-steps li code {
  word-break: break-all;
}

/* History List */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 14px;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.history-item:hover {
  border-color: rgba(212, 175, 55, 0.36);
  transform: translateY(-1px);
}

.history-meta {
  min-width: 0;
}

.history-meta strong {
  display: block;
  font-size: 13.5px;
}

.history-meta small {
  color: var(--text-muted);
  font-size: 11.5px;
}

.history-actions {
  display: flex;
  gap: 7px;
}

/* =========================================================
   CHAMPAGNE SHIMMER SKELETON SCREEN
   ========================================================= */
.skeleton-screen {
  display: flex;
  flex-direction: column;
  gap: 15px;
  animation: fadeSlideUp 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.skeleton-banner {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.12), rgba(212, 175, 55, 0.04));
  border: 1px solid rgba(212, 175, 55, 0.32);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.skeleton-banner-left {
  display: flex;
  align-items: center;
  gap: 13px;
}

.skeleton-banner-left h3 {
  font-family: var(--font-serif);
  margin: 0 0 2px;
  font-size: 15.5px;
  font-weight: 700;
}

.skeleton-banner-left p {
  margin: 0;
  font-size: 12px;
}

.pulse-ring {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 3px solid rgba(212, 175, 55, 0.2);
  border-top-color: var(--gold-light);
  border-right-color: var(--gold);
  animation: spin 0.9s linear infinite;
}

.pulse-ring-sm {
  width: 28px;
  height: 28px;
  border-width: 2.5px;
  flex-shrink: 0;
}

.loading-steps {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.loading-step {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(6, 6, 8, 0.78);
  color: var(--text-dim);
  border: 1px solid var(--border-subtle);
  transition: all 0.26s ease;
}

.loading-step.active {
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.2);
  border-color: rgba(212, 175, 55, 0.52);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.2);
}

.loading-step.done {
  color: #6ee7b7;
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.36);
}

.skel {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(212, 175, 55, 0.07);
}

.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(243, 218, 138, 0.08) 45%,
    rgba(212, 175, 55, 0.18) 55%,
    transparent 100%
  );
  animation: shimmerSweep 1.45s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.skel-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.skel-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 220px;
}

.skel-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.skel-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.skel-pill {
  height: 20px;
  border-radius: 999px;
}

.skel-title {
  height: 24px;
}

.skel-subtitle {
  height: 18px;
}

.skel-btn {
  height: 31px;
  border-radius: 999px;
}

.skel-btn-lg {
  height: 41px;
  border-radius: 10px;
}

.skel-tab {
  height: 30px;
  border-radius: 999px;
}

.skel-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
}

.skel-photo-chip {
  width: 155px;
  height: 50px;
  border-radius: 10px;
}

.skel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 16px;
}

.skel-card-highlight {
  border-color: rgba(212, 175, 55, 0.3);
  background: linear-gradient(155deg, rgba(212, 175, 55, 0.08), var(--bg-card));
}

.skel-textarea-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skel-line {
  height: 11px;
  border-radius: 6px;
}

.skel-hook-row {
  height: 42px;
  width: 100%;
  border-radius: 10px;
}

/* =========================================================
   TOAST NOTIFICATIONS & MICRO-ANIMATIONS
   ========================================================= */
.toast-container {
  position: fixed;
  right: 22px;
  bottom: 84px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}

.toast {
  position: relative;
  overflow: hidden;
  background: rgba(15, 15, 20, 0.96);
  backdrop-filter: blur(16px);
  color: var(--text);
  border: 1px solid rgba(212, 175, 55, 0.32);
  border-left: 3px solid var(--gold);
  border-radius: 12px;
  padding: 11px 14px 13px;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
  animation: toastSlideIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2.5px;
  width: 100%;
  background: var(--gold-light);
  opacity: 0.4;
  transform-origin: left center;
  animation: toastCountdown var(--toast-duration, 3400ms) linear forwards;
}

.toast-success {
  border-left-color: var(--success);
}

.toast-error {
  border-left-color: var(--danger);
}

.toast.toast-leaving {
  animation: toastSlideOut 0.24s ease forwards;
}

.ripple-wave {
  position: absolute;
  border-radius: 999px;
  background: rgba(243, 218, 138, 0.38);
  transform: scale(0);
  pointer-events: none;
  animation: rippleExpand 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.field-shake {
  animation: fieldShake 0.42s ease;
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.24) !important;
}

.input-flash {
  animation: inputFlash 0.65s ease;
}

.reveal-item {
  opacity: 0;
  animation: fadeSlideUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--stagger-delay, 0ms);
}

.modal:not(.hidden) .modal-backdrop {
  animation: modalFadeIn 0.2s ease;
}

.modal:not(.hidden) .modal-dialog {
  animation: popSpring 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

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

@keyframes shimmerSweep {
  100% {
    transform: translateX(100%);
  }
}

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

@keyframes popSpring {
  0% {
    transform: scale(0.94);
    opacity: 0;
  }
  70% {
    transform: scale(1.015);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes floatGentle {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes statusBeacon {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.35);
    opacity: 0.6;
  }
}

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

@keyframes fieldShake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-6px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(4px);
  }
}

@keyframes inputFlash {
  0% {
    box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.55);
    border-color: var(--gold-light);
  }
  100% {
    box-shadow: 0 0 0 6px rgba(212, 175, 55, 0);
    border-color: var(--border-subtle);
  }
}

@keyframes rippleExpand {
  to {
    transform: scale(3.2);
    opacity: 0;
  }
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes toastSlideOut {
  to {
    opacity: 0;
    transform: translateX(24px) scale(0.96);
  }
}

@keyframes toastCountdown {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

/* =========================================================
   RESPONSIVE BREAKPOINTS
   ========================================================= */
@media (max-width: 1120px) {
  .topbar-inner {
    border-radius: 20px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .panel-input {
    position: static;
    max-height: none;
  }

  .panel-output {
    min-height: 460px;
  }

  .empty-state {
    min-height: 420px;
  }
}

@media (max-width: 760px) {
  .workflow-steps,
  .script-grid {
    grid-template-columns: 1fr;
  }

  .status-cluster {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .floating-pill-nav {
    max-width: calc(100vw - 24px);
    padding: 5px 6px;
    gap: 2px;
  }

  .pill-nav-item {
    padding: 7px 10px;
    font-size: 11.5px;
  }

  .pill-nav-item span {
    display: none;
  }
}

@media (max-width: 600px) {
  .topbar {
    padding: 0 12px;
  }

  .workspace {
    padding: 18px 12px 96px;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .panel-output {
    padding: 16px;
  }
}

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

/* =========================================================
   CRISP DARK LUXURY GLASSMORPHISM + FINE GRAIN TEXTURE
   ========================================================= */

/* Subtle Fine Film-Grain Speckle Texture (zero text blur) */
.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.068;
  mix-blend-mode: overlay;
  background-repeat: repeat;
  background-size: 180px 180px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

/* Richer Warm Backlight Orbs Behind Frosted Glass */
.bg-glow {
  opacity: 0.24;
  filter: blur(125px);
}

.bg-glow-1 {
  width: 640px;
  height: 640px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.85) 0%, rgba(164, 120, 26, 0.28) 45%, transparent 72%);
  top: -210px;
  left: -120px;
}

.bg-glow-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(186, 138, 38, 0.78) 0%, rgba(112, 78, 16, 0.24) 48%, transparent 72%);
  bottom: -180px;
  right: -110px;
}

.bg-glow-3 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(243, 218, 138, 0.42) 0%, rgba(140, 102, 24, 0.14) 50%, transparent 74%);
  top: 34%;
  left: 44%;
  transform: translate(-50%, -50%);
  opacity: 0.2;
}

/* Frosted Glass Panels — High Contrast Scrim + Crisp Specular Rim */
.topbar-inner {
  background: linear-gradient(135deg, rgba(24, 22, 18, 0.62) 0%, rgba(12, 12, 16, 0.74) 100%);
  -webkit-backdrop-filter: blur(26px) saturate(165%);
  backdrop-filter: blur(26px) saturate(165%);
  border: 1px solid rgba(243, 218, 138, 0.24);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 246, 218, 0.2),
    inset 0 -1px 0 rgba(212, 175, 55, 0.08);
}

.panel {
  position: relative;
  background: linear-gradient(160deg, rgba(24, 22, 19, 0.58) 0%, rgba(12, 12, 16, 0.74) 48%, rgba(9, 9, 13, 0.8) 100%);
  -webkit-backdrop-filter: blur(22px) saturate(155%);
  backdrop-filter: blur(22px) saturate(155%);
  border: 1px solid rgba(243, 218, 138, 0.18);
  box-shadow:
    0 28px 72px rgba(0, 0, 0, 0.62),
    inset 0 1px 0 rgba(255, 246, 218, 0.16),
    inset 1px 0 0 rgba(255, 246, 218, 0.05);
}

/* Subtle Sandblasted Glass Grain Inside Panels (sits under text, never blurs text) */
.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  opacity: 0.038;
  background-repeat: repeat;
  background-size: 160px 160px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.05' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23g)'/%3E%3C/svg%3E");
}

.panel > * {
  position: relative;
  z-index: 1;
}

.panel-footer {
  background: rgba(9, 9, 13, 0.78);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border-top: 1px solid rgba(243, 218, 138, 0.16);
}

/* Frosted Glass Inner Cards & Sections */
.form-section,
.card,
.progress-card,
.scene-card,
.wf-step,
.skel-card {
  background: linear-gradient(155deg, rgba(28, 26, 23, 0.52) 0%, rgba(15, 15, 20, 0.7) 100%);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
  backdrop-filter: blur(16px) saturate(145%);
  border-color: rgba(243, 218, 138, 0.15);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 246, 218, 0.14),
    inset 1px 0 0 rgba(255, 246, 218, 0.04);
}

.master-card {
  background: linear-gradient(148deg, rgba(212, 175, 55, 0.16) 0%, rgba(28, 24, 16, 0.62) 42%, rgba(14, 14, 19, 0.78) 100%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(243, 218, 138, 0.38);
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.48),
    0 0 38px rgba(212, 175, 55, 0.1),
    inset 0 1px 0 rgba(255, 246, 218, 0.24);
}

/* Crisp High-Contrast Recessed Surfaces for Sharp Text Legibility */
input[type="text"],
input[type="url"],
input[type="password"],
select,
textarea,
.scene-textarea,
.prose-box,
.prompt-box-wrap,
.hook-item {
  background: rgba(7, 7, 11, 0.82);
  color: #fcfaf4;
  text-shadow: none;
  -webkit-font-smoothing: antialiased;
}

.floating-pill-nav {
  background: linear-gradient(135deg, rgba(26, 24, 20, 0.68) 0%, rgba(11, 11, 15, 0.82) 100%);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  backdrop-filter: blur(26px) saturate(170%);
  border: 1px solid rgba(243, 218, 138, 0.36);
  box-shadow:
    0 22px 58px rgba(0, 0, 0, 0.72),
    0 0 34px rgba(212, 175, 55, 0.12),
    inset 0 1px 0 rgba(255, 246, 218, 0.26);
}

.modal-dialog {
  background: linear-gradient(160deg, rgba(24, 22, 19, 0.78) 0%, rgba(11, 11, 15, 0.9) 100%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  backdrop-filter: blur(26px) saturate(160%);
  border: 1px solid rgba(243, 218, 138, 0.34);
  box-shadow:
    0 36px 85px rgba(0, 0, 0, 0.78),
    0 0 42px rgba(212, 175, 55, 0.12),
    inset 0 1px 0 rgba(255, 246, 218, 0.22);
}

.toast {
  background: linear-gradient(135deg, rgba(26, 24, 20, 0.82) 0%, rgba(12, 12, 16, 0.92) 100%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border-color: rgba(243, 218, 138, 0.32);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 246, 218, 0.18);
}

/* Guarantee Sharp Text Rendering Above Glass Layers */
h1, h2, h3, p, label, button, input, select, textarea, pre, span, strong, small {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
