/* ============================================
   DESIGN PROMPT GENERATOR
   Modern, Bright & Colorful Design System
   ============================================ */

:root {
  /* ── Dark sidebar ── */
  --sidebar-width: 260px;
  --sidebar-bg: #0b0b18;
  --sidebar-hover: rgba(255, 255, 255, 0.05);
  --sidebar-active: rgba(139, 92, 246, 0.15);
  --sidebar-text: #8e8ea0;
  --sidebar-text-active: #ffffff;
  --sidebar-brand: #8b5cf6;
  --sidebar-border: rgba(255, 255, 255, 0.06);

  /* ── Bright main area ── */
  --bg-base: #f4f5f9;
  --bg-surface: #ffffff;
  --bg-subtle: #f8f9fb;
  --bg-input: #f1f2f6;

  /* ── Glass overlays ── */
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(0, 0, 0, 0.06);

  /* ── Text colors ── */
  --text-headline: #1a1a2e;
  --text-body: #3d3d56;
  --text-muted: #8e8ea0;
  --text-placeholder: #b0b0c0;

  /* ── Vibrant brand palette ── */
  --brand-400: #fb923c;
  --brand-500: #f97316;
  --brand-600: #ea580c;

  --accent-violet: #8b5cf6;
  --accent-violet-light: rgba(139, 92, 246, 0.10);
  --accent-rose: #f43f5e;
  --accent-emerald: #10b981;
  --accent-emerald-light: rgba(16, 185, 129, 0.10);

  /* ── State colors ── */
  --status-success-dot: #10b981;
  --status-error-dot: #f43f5e;
  --status-loading-dot: #8b5cf6;

  /* ── Borders ── */
  --border-light: rgba(0, 0, 0, 0.06);
  --border-medium: rgba(0, 0, 0, 0.10);
  --border-focus: #8b5cf6;

  /* ── Shadow tokens ── */
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.10), 0 8px 20px rgba(0, 0, 0, 0.06);
  --shadow-brand: 0 8px 28px rgba(249, 115, 22, 0.28);

  /* ── Radius tokens ── */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;

  /* ── Typography ── */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, menlo, monospace;

  /* ── Motion ── */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 120ms;
  --dur-normal: 220ms;
  --dur-slow: 350ms;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--text-body);
  background: var(--bg-base);
  display: flex;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   SIDEBAR NAVIGATION (Bootstrap-style)
   ======================================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: linear-gradient(180deg, #0a1628 0%, #050d1a 40%, #000000 100%);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform var(--dur-normal) var(--ease-smooth);
  border-right: 1px solid var(--sidebar-border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 22px;
  text-decoration: none;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand .logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--brand-500), var(--accent-rose));
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.25);
  color: white;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.04em;
  flex-shrink: 0;
}

.sidebar-brand .brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.sidebar-brand .brand-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--sidebar-text-active);
  line-height: 1.2;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.sidebar-brand .brand-subtitle {
  margin: 0;
  color: var(--sidebar-text);
  font-size: 11px;
  line-height: 1.3;
  font-weight: 500;
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-text);
  padding: 12px 12px 8px;
  opacity: 0.6;
}

.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 550;
  transition: all var(--dur-fast) var(--ease-smooth);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.sidebar-nav .nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
}

.sidebar-nav .nav-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-brand);
}

.sidebar-nav .nav-item .nav-icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-nav .nav-item .nav-badge {
  margin-left: auto;
  background: var(--accent-violet);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  line-height: 1.4;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--sidebar-border);
}

.sidebar-footer .nav-item.logout {
  color: var(--accent-rose);
}

.sidebar-footer .nav-item.logout:hover {
  background: rgba(244, 63, 94, 0.10);
}

/* ── Sidebar overlay (mobile) ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1035;
  backdrop-filter: blur(4px);
}

/* ── Hamburger toggle ── */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1045;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0;
}

.sidebar-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-headline);
  border-radius: 2px;
  transition: all var(--dur-fast) var(--ease-smooth);
}

.sidebar-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.sidebar-toggle.active span:nth-child(2) {
  opacity: 0;
}

.sidebar-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Main content area ── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  width: 100%;
  transition: margin-left var(--dur-normal) var(--ease-smooth);
}

/* ── Ambient glow behind app card (desktop only) ── */
.app-wrapper {
  position: relative;
  min-height: 100vh;
  background: radial-gradient(ellipse at 20% 10%, rgba(139, 92, 246, 0.05), transparent 55%),
              radial-gradient(ellipse at 80% 90%, rgba(249, 115, 22, 0.04), transparent 55%);
}

/* ── Page container (centered app card) ── */
.page {
  position: relative;
  width: min(860px, calc(100% - 48px));
  margin: 0 auto;
  padding: 32px 0 48px;
  z-index: 1;
}

/* ========================================
   TOP BAR
   ======================================== */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
}

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

.logo {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--brand-500), var(--accent-rose));
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.25);
  color: white;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.04em;
  flex-shrink: 0;
  transition: transform var(--dur-normal) var(--ease-spring);
}

.logo:hover {
  transform: rotate(-6deg) scale(1.06);
}

.brand-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--text-headline);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.35;
  font-weight: 500;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border-light);
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  color: var(--text-muted);
  border-radius: var(--radius-full);
  padding: 8px 15px;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
}

/* ========================================
   HERO CARD
   ======================================== */
.hero-card {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl);
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  padding: clamp(28px, 5vw, 44px);
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 25px;
  background: linear-gradient(90deg, var(--accent-violet), var(--brand-500), var(--accent-rose), var(--accent-emerald));
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent-violet);
  background: var(--accent-violet-light);
  border: 1px solid rgba(139, 92, 246, 0.15);
  padding: 7px 13px;
  border-radius: var(--radius-full);
  font-size: 12px;
  margin-bottom: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.eyebrow span:first-child {
  font-size: 14px;
}

h1 {
  margin: 0;
  font-size: clamp(26px, 5.2vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.045em;
  color: var(--text-headline);
  font-weight: 800;
}

h1 .gradient-word {
  background: linear-gradient(135deg, var(--brand-500), var(--accent-rose));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-copy {
  margin: 14px 0 0;
  color: var(--text-body);
  font-size: 15.5px;
  line-height: 1.68;
  max-width: 640px;
  font-weight: 450;
}

.hero-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  object-fit: contain;
  box-shadow: var(--shadow-md);
  transition: transform var(--dur-normal) var(--ease-spring);
}

.hero-image:hover {
  transform: scale(1.02);
}

/* Hero card two-column layout */
.hero-card {
  display: flex;
  align-items: center;
  gap: 32px;
}

.hero-content {
  flex: 3;
  order: 1;
}

.hero-image-wrap {
  flex: 1;
  order: 2;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-card h1 {
  margin-top: 14px;
}

/* ========================================
   STEP TABS
   ======================================== */
.steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 24px;
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  padding: 6px;
}

.step-tab {
  border: 0;
  padding: 15px 18px;
  color: var(--text-muted);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--dur-normal) var(--ease-smooth);
  font-weight: 500;
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  min-height: 56px;
  justify-content: center;
}

.step-tab:hover:not([aria-selected="true"]) {
  background: var(--bg-surface);
  color: var(--text-body);
}

.step-tab[aria-selected="true"] {
  color: var(--text-headline);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  font-weight: 650;
}

.step-tab small {
  display: block;
  color: inherit;
  opacity: 0.7;
  margin-bottom: 3px;
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: normal;
  line-height: 1.3;
}

.step-tab strong {
  display: block;
  font-size: 14px;
  letter-spacing: -0.01em;
  white-space: normal;
  line-height: 1.35;
  font-weight: 650;
}

/* ========================================
   CARD
   ======================================== */
.card {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  padding: clamp(22px, 3.5vw, 34px);
}

/* ========================================
   PANELS
   ======================================== */
.panel {
  display: none;
  animation: fadeSlideIn var(--dur-slow) var(--ease-smooth) both;
}

.panel.active {
  display: block;
}

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

/* ========================================
   FORM ELEMENTS
   ======================================== */
label {
  display: block;
  margin: 0 0 10px;
  color: var(--text-headline);
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -0.005em;
}

.hint {
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.6;
  margin: 9px 0 0;
  font-weight: 450;
}

textarea,
select {
  width: 100%;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-headline);
  padding: 14px 16px;
  font: inherit;
  outline: none;
  transition: all var(--dur-fast) var(--ease-smooth);
  font-size: 14px;
}

textarea:hover,
select:hover {
  border-color: var(--border-medium);
  background: var(--bg-surface);
}

textarea:focus,
select:focus {
  border-color: var(--border-focus);
  background: var(--bg-surface);
  box-shadow: 0 0 0 4px var(--accent-violet-light);
}

textarea::placeholder {
  color: var(--text-placeholder);
  font-weight: 450;
}

textarea {
  min-height: 190px;
  resize: vertical;
  line-height: 1.65;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238e8ea0' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  padding-right: 42px;
}

select option {
  background: var(--bg-surface);
  color: var(--text-headline);
}

/* ========================================
    STYLE GRIDS (Visual Style Selector)
    ======================================== */
.style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.style-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  padding: 16px 10px 12px;
  cursor: pointer;
  transition: all var(--dur-normal) var(--ease-spring);
  position: relative;
}

.style-btn img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: all var(--dur-normal) var(--ease-spring);
  border: 3px solid var(--border-light);
}

.style-btn .style-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.style-btn:hover {
  background: var(--accent-violet-light);
  border-color: var(--accent-violet);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.style-btn:hover img {
  border-color: var(--accent-violet);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15), var(--shadow-sm);
}

.style-btn.selected {
  background: linear-gradient(135deg, var(--accent-violet-light), rgba(249, 115, 22, 0.06));
  border-color: var(--accent-violet);
  box-shadow: 0 0 0 1px var(--accent-violet), var(--shadow-sm);
}

.style-btn.selected img {
  border-color: var(--accent-violet);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2), var(--shadow-md);
  transform: scale(1.08);
}

.style-btn.selected .style-name {
  color: var(--text-headline);
  font-weight: 700;
}

/* ========================================
    TYPE SELECTOR
    ======================================== */
.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.type-btn {
  border: 1.5px solid var(--border-light);
  background: var(--bg-input);
  color: var(--text-body);
  border-radius: var(--radius-md);
  padding: 16px 10px;
  text-align: center;
  cursor: pointer;
  transition: all var(--dur-normal) var(--ease-spring);
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 90px;
}

.type-btn:hover {
  border-color: var(--accent-violet);
  background: var(--accent-violet-light);
  color: var(--text-headline);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.type-btn.selected {
  border-color: var(--accent-violet);
  background: linear-gradient(135deg, var(--accent-violet-light), rgba(249, 115, 22, 0.06));
  color: var(--text-headline);
  box-shadow: 0 0 0 1px var(--accent-violet), var(--shadow-sm);
}

.type-btn .icon {
  font-size: 26px;
  display: block;
  margin-bottom: 8px;
  transition: transform var(--dur-normal) var(--ease-spring);
}

.type-btn:hover .icon {
  transform: scale(1.15) translateY(-2px);
}

.type-btn.selected .icon {
  transform: scale(1.1);
}

.type-btn .label {
  font-size: 13px;
  font-weight: 650;
  display: block;
  letter-spacing: -0.005em;
  white-space: normal;
  line-height: 1.3;
}

.type-btn .meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 0px;
  line-height: 1.35;
  white-space: normal;
  font-weight: 500;
  display: block;
}

/* ========================================
   TOOLBAR & BUTTONS
   ======================================== */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  border: 0;
  border-radius: var(--radius-full);
  padding: 12px 24px;
  font: inherit;
  font-weight: 650;
  font-size: 13.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast) var(--ease-spring);
  min-height: 46px;
  letter-spacing: -0.005em;
  position: relative;
}

button.primary {
  color: white;
  background: linear-gradient(135deg, var(--brand-500) 0%, var(--accent-rose) 100%);
  box-shadow: var(--shadow-brand);
}

button.primary:hover:not(:disabled) {
  box-shadow: 0 12px 36px rgba(249, 115, 22, 0.35);
  transform: translateY(-2px);
}

button.secondary {
  color: var(--text-headline);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-medium);
  box-shadow: var(--shadow-xs);
}

button.secondary:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--text-muted);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

button.ghost {
  color: var(--text-muted);
  background: transparent;
  border: 1.5px solid transparent;
}

button.ghost:hover:not(:disabled) {
  color: var(--text-headline);
  background: var(--bg-subtle);
}

button:active:not(:disabled) {
  transform: translateY(0) scale(0.97);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

/* ========================================
   STATUS BAR
   ======================================== */
.status {
  min-height: 28px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 500;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-placeholder);
  display: inline-block;
  flex-shrink: 0;
  transition: all var(--dur-fast) ease;
}

.status.loading .dot {
  background: var(--status-loading-dot);
  box-shadow: 0 0 0 5px rgba(139, 92, 246, 0.12);
  animation: pulseDot 1.2s ease-in-out infinite;
}

.status.success .dot {
  background: var(--status-success-dot);
  box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.12);
}

.status.error .dot {
  background: var(--status-error-dot);
  box-shadow: 0 0 0 5px rgba(244, 63, 94, 0.12);
}

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

/* ========================================
   JSON OUTPUT
   ======================================== */
.copy-wrap {
  position: relative;
}

#finalJson {
  font-family: var(--font-mono);
  font-size: 12.5px;
  min-height: 380px;
  white-space: pre;
  width: 100%;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-headline);
  padding: 16px;
  outline: none;
  resize: vertical;
  line-height: 1.65;
  transition: all var(--dur-fast) var(--ease-smooth);
}

#finalJson:hover {
  border-color: var(--border-medium);
  background: var(--bg-surface);
}

#finalJson:focus {
  border-color: var(--border-focus);
  background: var(--bg-surface);
  box-shadow: 0 0 0 4px var(--accent-violet-light);
}

.final-actions {
  position: sticky;
  bottom: 16px;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: -56px;
  padding: 0 10px 10px;
  pointer-events: none;
}

.final-actions button {
  pointer-events: all;
  box-shadow: var(--shadow-md);
}

/* ========================================
   TOAST
   ======================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(18px);
  opacity: 0;
  pointer-events: none;
  background: var(--text-headline);
  color: white;
  border-radius: var(--radius-full);
  padding: 11px 22px;
  font-size: 13px;
  font-weight: 600;
  transition: all var(--dur-normal) var(--ease-spring);
  z-index: 50;
  box-shadow: var(--shadow-xl);
  letter-spacing: -0.005em;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========================================
   FOOTER NOTE
   ======================================== */
.footer-note {
  color: var(--text-muted);
  text-align: center;
  font-size: 12.5px;
  margin-top: 26px;
  line-height: 1.65;
  font-weight: 450;
}

/* ========================================
    SETTINGS ROW (Aspek Rasio + Pilih Jenis Desain)
    ======================================== */
.settings-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.settings-col {
  flex: 1;
}

.settings-col label {
  margin-bottom: 8px;
}

.settings-col select {
  width: 100%;
}

/* ========================================
    RESPONSIVE
    ======================================== */
@media (max-width: 960px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.show {
    display: block;
  }
  .sidebar-toggle {
    display: flex;
  }
  .main-content {
    margin-left: 0;
  }

  /* Full-width aspect ratio on mobile */
  .settings-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Larger images for style grid on tablet */
  .style-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 14px;
  }

  .style-btn img {
    width: 64px;
    height: 64px;
  }

  .style-btn .style-name {
    font-size: 11px;
  }
}

@media (max-width: 600px) {
  /* Further adjust for very small screens */
  .type-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .page {
    padding: 24px 0 40px;
  }

  /* Push page content down when topbar exists on mobile */
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding-top: 10px;
  }

  .brand-lockup {
    width: 100%;
  }

  .logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    font-size: 13px;
  }

  .brand-title {
    font-size: 15px;
  }

  .brand-subtitle {
    font-size: 11.5px;
  }

  .pill {
    width: 100%;
    justify-content: flex-start;
    font-size: 11.5px;
    padding: 7px 12px;
  }

  .hero-card {
    padding: 22px;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 5px;
  }

  .step-tab {
    padding: 13px 15px;
  }

  .type-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .btns {
    width: 100%;
    flex-direction: column;
  }

  .btns button {
    width: 100%;
  }

  .final-actions {
    position: static;
    margin-top: 14px;
    padding: 0;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .status {
    justify-content: center;
  }
}

/* ========================================
   ICON STYLES
   ======================================== */
.hero-icon {
  display: inline-block;
  font-size: clamp(26px, 5.2vw, 44px);
  margin-right: 8px;
  vertical-align: middle;
  animation: floatIcon 3s ease-in-out infinite;
}

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

.label-icon {
  display: inline-block;
  margin-right: 6px;
  font-size: 16px;
  vertical-align: middle;
}

.btn-icon {
  display: inline-block;
  margin: 0 4px;
  font-size: 16px;
  vertical-align: middle;
  line-height: 1;
}

button.primary .btn-icon:first-child {
  filter: brightness(1.2);
}

.footer-icon {
  display: inline-block;
  margin: 0 4px;
  font-size: 16px;
  vertical-align: middle;
  animation: spinIcon 8s linear infinite;
}

@keyframes spinIcon {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
