/* =========================================================
   Visura — Modern Minimalist Design System (Studio Edition)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Geist+Mono:wght@300;400;500&display=swap');

/* ---- CSS Custom Properties ---- */
:root {
  --bg-root: #080808;
  --bg-surface: #111111;
  --bg-card: rgba(255, 255, 255, 0.02);
  --bg-card-hover: rgba(255, 255, 255, 0.04);
  --bg-input: rgba(255, 255, 255, 0.025);
  --bg-input-focus: rgba(255, 255, 255, 0.04);
  --bg-preview: #0d0d0d;
  --bg-tab-active: rgba(255, 255, 255, 0.06);

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-active: rgba(255, 255, 255, 0.4);
  --border-input-focus: rgba(255, 255, 255, 0.25);

  --accent-mono: #ffffff;
  --accent-dim: rgba(255, 255, 255, 0.1);
  --accent-gray: #e2e8f0;
  
  --accent-primary: #00ff66; /* Default neon green highlight */
  --accent-glow: rgba(0, 255, 102, 0.25);

  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --text-placeholder: #4b5563;
  --text-code: #93c5fd; /* Refined silver-blue highlight for filled values */

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.8);
  --shadow-button: 0 1px 2px rgba(0, 0, 0, 0.05);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;

  --transition-fast: 0.1s ease;
  --transition-base: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.35s cubic-bezier(0.16, 1, 0.3, 1);

  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', 'Fira Code', 'Cascadia Code', monospace;

  --header-height: 64px;
  --nav-height: 52px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-ui);
  background-color: var(--bg-root);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

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

a:hover,
a:focus {
  text-decoration: none;
}

/* =========================================================
   HEADER
   ========================================================= */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(8, 8, 8, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 20px;
}

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

.brand-icon {
  width: 28px;
  height: 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-primary);
}

.brand-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}

.brand-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.brand-tag {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card-hover);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 1px 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.header-divider {
  width: 1px;
  height: 20px;
  background: var(--border-subtle);
  flex-shrink: 0;
}

.header-global-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  max-width: 320px;
}

.global-input-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.global-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
}

.global-input::placeholder {
  color: var(--text-placeholder);
}

.global-input:focus {
  border-color: var(--accent-primary);
  background: var(--bg-input-focus);
}

/* =========================================================
   SLIDE NAVIGATION
   ========================================================= */
.slide-nav {
  position: sticky;
  top: var(--header-height);
  z-index: 99;
  height: var(--nav-height);
  background: rgba(8, 8, 8, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 4px;
}

.slide-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.slide-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.025);
}

.slide-tab.active {
  color: var(--text-primary);
  background: var(--bg-tab-active);
  border-color: var(--border-subtle);
}

/* Redesigned dot indicator to be subtle silver */
.slide-tab .tab-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.3;
  transition: all var(--transition-base);
}

.slide-tab.active .tab-dot {
  opacity: 0.8;
  background: var(--accent-primary);
  box-shadow: 0 0 6px var(--accent-primary);
}

.tab-number {
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
  opacity: 0.4;
  transition: opacity var(--transition-base);
}

.slide-tab.active .tab-number {
  opacity: 0.8;
}

/* =========================================================
   MAIN LAYOUT
   ========================================================= */
.app-main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: calc(100vh - var(--header-height) - var(--nav-height));
}

/* =========================================================
   LEFT COLUMN — FORMS
   ========================================================= */
.forms-column {
  padding: 24px;
  border-right: 1px solid var(--border-subtle);
  overflow-y: auto;
  max-height: calc(100vh - var(--header-height) - var(--nav-height));
  position: sticky;
  top: calc(var(--header-height) + var(--nav-height));
}

/* Custom Minimal Scrollbar */
.forms-column::-webkit-scrollbar,
.preview-output::-webkit-scrollbar {
  width: 3px;
}
.forms-column::-webkit-scrollbar-track,
.preview-output::-webkit-scrollbar-track {
  background: transparent;
}
.forms-column::-webkit-scrollbar-thumb,
.preview-output::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
}
.forms-column::-webkit-scrollbar-thumb:hover,
.preview-output::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

.form-panel {
  display: none;
  animation: fade-in-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-panel.active {
  display: block;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-section-header {
  margin-bottom: 20px;
}

/* Muted modern capsule instead of glowing green */
.form-slide-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 2px 8px;
  margin-bottom: 8px;
}

.form-slide-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.form-slide-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ---- Field Groups ---- */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

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

.field-label {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-label .var-hint {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 400;
}

.field input[type="text"],
.field textarea,
.field select {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-primary);
  outline: none;
  width: 100%;
  transition: all var(--transition-fast);
  resize: vertical;
}

.field input[type="text"]::placeholder,
.field textarea::placeholder {
  color: var(--text-placeholder);
}

.field input[type="text"]:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent-primary);
  background: var(--bg-input-focus);
}

.field textarea {
  min-height: 76px;
  line-height: 1.5;
}

/* ---- Feature Card Grids ---- */
.section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 14px;
}

.section-divider-line {
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.section-divider-text {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

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

.feature-grid-3x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.feature-card-input {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all var(--transition-fast);
}

.feature-card-input:hover {
  border-color: var(--border-medium);
  background: var(--bg-card-hover);
}

.feature-card-num {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.feature-card-input .field {
  gap: 4px;
}

.feature-card-input .field-label {
  font-size: 9px;
}

.feature-card-input input[type="text"],
.feature-card-input textarea {
  background: rgba(255, 255, 255, 0.01);
  border-radius: 4px;
  font-size: 12px;
  padding: 6px 8px;
}

.feature-card-input textarea {
  min-height: 52px;
  resize: none;
}

/* =========================================================
   RIGHT COLUMN — PREVIEW
   ========================================================= */
.preview-column {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: calc(var(--header-height) + var(--nav-height));
  max-height: calc(100vh - var(--header-height) - var(--nav-height));
  overflow: hidden;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.preview-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.preview-label {
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.preview-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.preview-char-count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
}

/* ---- Preview Panel (Clean Editor Style) ---- */
.preview-panel {
  flex: 1;
  background: var(--bg-preview);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  position: relative;
}


.preview-output {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: #9ca3af;
  white-space: pre-wrap;
  word-break: break-word;
  cursor: text;
  user-select: text;
}

/* Modern Minimalist Highlighter states */
.preview-output .ph-filled {
  color: var(--text-code);
  font-weight: 500;
}

.preview-output .ph-empty {
  color: var(--text-placeholder);
  font-weight: 400;
}

/* ---- Action Buttons ---- */
.action-buttons {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
  position: relative;
}

/* High-Contrast Modern Minimalist Button (Solid White) */
.btn-primary {
  background: var(--text-primary);
  color: var(--bg-root);
  border-color: var(--text-primary);
  box-shadow: var(--shadow-button);
  flex: 1;
}

.btn-primary:hover {
  background: #ffffff;
  opacity: 0.92;
}

.btn-primary:active {
  opacity: 0.85;
}

.btn-primary.copied {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border-color: var(--border-subtle);
  flex-shrink: 0;
}

.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
}

.btn-icon {
  font-size: 12px;
}

/* =========================================================
   TOAST NOTIFICATION
   ========================================================= */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #111111;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  z-index: 200;
  opacity: 0;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

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


/* =========================================================
   APP BODY & SIDEBAR NAVIGATION
   ========================================================= */
.app-body {
  display: flex;
  min-height: calc(100vh - var(--header-height));
  position: relative;
}

.app-sidebar {
  width: 220px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 16px;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  flex-shrink: 0;
  z-index: 95;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), padding 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 550;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-base);
  text-align: left;
  width: 100%;
}

.sidebar-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.04);
}

.sidebar-btn.active {
  color: var(--text-primary);
  background: var(--bg-tab-active);
  border-color: var(--border-subtle);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.sidebar-btn.active .btn-icon {
  color: var(--accent-primary);
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.sidebar-btn .btn-icon {
  font-size: 15px;
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-base);
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.sidebar-footer .footer-text {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

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

.app-view {
  display: none;
  width: 100%;
  height: 100%;
  animation: fade-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-view.active {
  display: block;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* =========================================================
   RIWAYAT (HISTORY) SCREEN STYLING
   ========================================================= */
.history-container {
  padding: 32px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.history-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.history-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

.history-search-bar {
  position: relative;
  width: 100%;
}

.history-search-bar .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-placeholder);
  font-size: 14px;
  pointer-events: none;
  transition: color var(--transition-fast);
}

.history-search-bar input {
  width: 100%;
  background: var(--bg-preview);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 16px 14px 44px;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 14px;
  outline: none;
  transition: all var(--transition-base);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.history-search-bar input:focus {
  border-color: var(--border-input-focus);
  background: var(--bg-input-focus);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(255, 255, 255, 0.02);
}

.history-search-bar input:focus + .search-icon {
  color: var(--text-secondary);
}

/* History Cards List Layout */
.history-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
  padding-bottom: 40px;
}

/* History Card Component */
.history-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all var(--transition-slow);
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  animation: fade-in-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.history-card:hover {
  border-color: var(--border-medium);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 1px 1px rgba(255, 255, 255, 0.05) inset;
}

.history-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.history-card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-card-title {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.history-card-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.history-card-delete {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  font-size: 13px;
  outline: none;
}

.history-card-delete:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

/* Glassmorphic prompt text display in card */
.history-card-body {
  position: relative;
  background: var(--bg-preview);
  border: 1px solid rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
  padding: 12px;
  max-height: 140px;
  overflow-y: auto;
}

.history-card-body::-webkit-scrollbar {
  width: 2px;
}
.history-card-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.05);
}

.history-card-text {
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Match highlighter for search query */
.search-match-hl {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  border-radius: 2px;
  padding: 0 2px;
  font-weight: 550;
}

.history-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.02);
  padding-top: 12px;
}

.history-card-creator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
}

.history-card-creator i {
  font-size: 10px;
  color: var(--text-muted);
}

.history-card-creator .creator-name {
  font-weight: 500;
  color: var(--text-secondary);
}

/* History Card Copy Button */
.btn-history-copy {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  outline: none;
  transition: all var(--transition-fast);
}

.btn-history-copy:hover {
  background: var(--text-primary);
  color: var(--bg-root);
  border-color: var(--text-primary);
}

.btn-history-copy.copied {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

/* Empty State Styling */
.history-empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
  background: var(--bg-card);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  gap: 16px;
  width: 100%;
  margin: 20px 0;
  animation: fade-in-up 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.empty-icon-wrap {
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--text-muted);
}

.empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.empty-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.btn-empty-cta {
  margin-top: 4px;
}

/* ---- Sidebar Top Wrapper ---- */
.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

/* ---- Sidebar Bottom Wrapper ---- */
.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* ---- Sidebar Header (Bottom-positioned Collapse Button) ---- */
.sidebar-header-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.sidebar-toggle-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  outline: none;
  font-size: 11px;
}

.sidebar-toggle-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-subtle);
}

.sidebar-toggle-btn i {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Hamburger toggle on Header */
.header-toggle-btn {
  display: none; /* Hidden on desktop */
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  outline: none;
  font-size: 14px;
  flex-shrink: 0;
  margin-left: auto;
}

.header-toggle-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--border-medium);
}

/* Glassmorphic Mobile Drawer Overlay Backdrop */
.sidebar-overlay {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 155;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* =========================================================
   PREMIUM REDESIGN CUSTOM OVERRIDES (STUDIO V2)
   ========================================================= */

/* Root color defaults to matching violet */
:root {
  --accent-primary: #7c3aed;
  --accent-glow: rgba(124, 58, 237, 0.25);
  --text-code: #a78bfa;
  --bg-root: #0d0d0d;
  --bg-surface: #161616;
}

/* 1. Header styling updates */
.app-header {
  background: #0d0d0d;
  border-bottom: 1px solid #1f1f1f;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0 24px;
  height: var(--header-height);
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}

/* header-toggle-btn is hidden by default (line 1177) and shown at <=768px (line 1247) */

/* 2. Sidebar styling updates (uncollapsible, wide, matte background) */
.app-sidebar {
  width: 240px;
  background: #161616;
  border-right: 1px solid #1f1f1f;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-top {
  width: 100%;
  padding: 0;
}

.sidebar-menu {
  width: 100%;
  gap: 0;
}

.sidebar-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 16px 24px;
  background: transparent;
  border: none;
  border-radius: 0;
  color: #9ca3af;
  font-size: 14px;
  font-weight: 600;
  width: 100%;
  transition: all 0.2s ease;
  text-decoration: none;
  text-align: left;
}

.sidebar-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.02);
}

.sidebar-btn.active {
  color: #ffffff;
  background: #7c3aed; /* Premium violet color block spanning full width */
  box-shadow: none;
}

.sidebar-btn .btn-icon {
  display: none !important; /* Hide icons in sidebar menu */
}

/* Sidebar bottom & profile styling */
.sidebar-bottom {
  padding: 24px;
  border-top: 1px solid #1f1f1f;
  background: #161616;
}

.sidebar-profile-section {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  width: 100%;
}

.sidebar-profile-btn {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  width: 100%;
}

.avatar-container {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 50%;
  object-fit: cover;
}

.profile-name {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
}

.profile-title,
.profile-settings-icon,
.status-indicator {
  display: none !important; /* Hide settings icon, online green dot, and title subtitle */
}

/* 3. Slide selector navigation styling */
.slide-nav {
  background: #0d0d0d;
  border-bottom: 1px solid #1f1f1f;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0 24px;
  height: var(--nav-height);
  gap: 8px;
}

.slide-tab {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9999px; /* Pill style */
  padding: 6px 16px;
  color: #9ca3af;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.slide-tab:hover {
  color: #ffffff;
}

.slide-tab.active {
  color: #ffffff;
  border: 1px solid #7c3aed; /* Purple border capsule */
  background: rgba(124, 58, 237, 0.15); /* Low opacity violet background */
}

.slide-tab .tab-dot,
.slide-tab .tab-number {
  display: none !important; /* Hide dot and number span elements */
}

/* 4. Main Workspace Layout & Columns */
.app-main {
  background: #0d0d0d;
  grid-template-columns: 1fr 1fr;
}

.forms-column {
  background: #0d0d0d;
  border-right: 1px solid #1f1f1f;
  padding: 32px 24px;
  max-height: calc(100vh - var(--header-height) - var(--nav-height));
}

/* Hide badge and description above forms */
.form-slide-badge,
.form-slide-desc {
  display: none !important;
}

.form-slide-title {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 24px;
}

/* Hide variable hints inside labels */
.field-label .var-hint {
  display: none !important;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: none;
  margin-bottom: 8px;
}

/* Premium inputs styling */
.field input[type="text"],
.field textarea,
.field select,
.feature-card-input input[type="text"],
.feature-card-input textarea {
  background: #1e1e1e;
  border: 1px solid #2d2d2d;
  border-radius: 8px;
  color: #ffffff;
  padding: 10px 16px;
  font-size: 13px;
  transition: all 0.15s ease;
}

.field input[type="text"]::placeholder,
.field textarea::placeholder,
.field select::placeholder {
  color: #6b7280;
}

.field input[type="text"]:focus,
.field textarea:focus,
.field select:focus,
.feature-card-input input[type="text"]:focus,
.feature-card-input textarea:focus {
  border-color: #7c3aed; /* Premium purple focus outline */
  background: #1e1e1e;
  box-shadow: none;
}

/* Feature cards divider and inputs layout */
.section-divider-line {
  background: #1f1f1f;
}

.section-divider-text {
  color: #4b5563;
}

.feature-card-input {
  background: #151515;
  border: 1px solid #1f1f1f;
  border-radius: 12px;
  padding: 16px;
}

.feature-card-input:hover {
  border-color: #2d2d2d;
  background: #181818;
}

/* 5. Right Column (Preview Panel) */
.preview-column {
  background: #0d0d0d;
  padding: 32px 24px;
  max-height: calc(100vh - var(--header-height) - var(--nav-height));
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid #1f1f1f;
  padding-bottom: 12px;
}

.static-preview-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.preview-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.btn-copy-text {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  transition: opacity 0.2s ease;
  padding: 0;
}

.btn-copy-text:hover {
  opacity: 0.8;
}

/* Prompt output container box */
.preview-panel {
  background: #131313;
  border: 1px solid #2d2d2d;
  border-radius: 12px;
  padding: 16px;
  box-shadow: none;
  height: 100%;
}

.preview-output {
  background: transparent;
  font-size: 13.5px;
  line-height: 1.6;
  color: #a3a3a3;
  font-family: var(--font-ui); /* Sans-serif font as in screenshots */
  padding: 0;
}

.preview-output .ph-filled {
  color: #ffffff; /* White color for filled placeholder values */
  font-weight: 600;
}

.preview-output .ph-empty {
  color: #4b5563;
  font-weight: 400;
}

/* 6. Clean minimal scrollbars */
.forms-column::-webkit-scrollbar,
.preview-output::-webkit-scrollbar {
  width: 4px;
}
.forms-column::-webkit-scrollbar-track,
.preview-output::-webkit-scrollbar-track {
  background: transparent;
}
.forms-column::-webkit-scrollbar-thumb,
.preview-output::-webkit-scrollbar-thumb {
  background: #2d2d2d;
  border-radius: 4px;
}

@media (max-width: 1024px) {
  .app-main {
    grid-template-columns: 1fr;
  }

  .forms-column {
    max-height: none;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }

  .preview-column {
    position: static;
    max-height: 500px;
  }

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

@media (max-width: 768px) {
  /* Show hamburger button in header */
  .header-toggle-btn {
    display: flex;
  }

  .app-body {
    flex-direction: row;
    padding-bottom: 0; /* Remove bottom nav spacer */
  }

  /* Reset sidebar on mobile to be a slide-out drawer */
  .app-sidebar {
    position: fixed;
    top: var(--header-height);
    right: 0;
    bottom: 0;
    width: 240px;
    height: calc(100vh - var(--header-height));
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    background: rgba(17, 17, 17, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-left: 1px solid var(--border-subtle) !important;
    border-right: none !important;
    border-top: none;
    padding: 20px 16px;
    flex-direction: column;
    justify-content: space-between;
    z-index: 160;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.6);
  }

  /* Active state for mobile sidebar drawer */
  .app-sidebar.mobile-active {
    transform: translateX(0);
  }

  /* Hide desktop collapse button on mobile */
  .sidebar-header-row {
    display: none;
  }

  .sidebar-menu {
    flex-direction: column;
    width: 100%;
    gap: 6px;
    justify-content: flex-start;
  }

  .sidebar-btn {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 16px;
    font-size: 13.5px;
    font-weight: 550;
    text-align: left;
    border-radius: var(--radius-md);
  }

  .sidebar-btn .btn-icon {
    font-size: 15px;
    width: 20px;
  }

  .sidebar-footer {
    display: block;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
  }

  .sidebar-footer .footer-text {
    display: block;
    font-size: 9.5px;
  }

  .history-container {
    padding: 20px 16px;
  }

  .history-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-header {
    padding: 0 16px;
    gap: 10px;
  }

  .slide-nav {
    padding: 0 12px;
    gap: 2px;
    overflow-x: auto;
  }

  .slide-tab {
    padding: 5px 10px;
    font-size: 11px;
  }

  .forms-column,
  .preview-column {
    padding: 16px 12px;
  }

  .header-global-input-group {
    display: none;
  }
}

/* =========================================================
   SETTINGS MODAL & SIDEBAR PROFILE CUSTOM STYLES
   ========================================================= */

/* ---- Sidebar Profile Widget ---- */
.sidebar-profile-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  width: 100%;
}

.sidebar-profile-btn {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  cursor: pointer;
  outline: none;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
  text-align: left;
}

.sidebar-profile-btn:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.sidebar-profile-btn:hover .profile-settings-icon {
  transform: rotate(45deg);
  color: var(--text-primary);
}

.avatar-container {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #111;
}

.status-indicator {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
}

.status-indicator.online {
  background: var(--accent-primary, #00ff66);
  box-shadow: 0 0 6px var(--accent-primary, #00ff66);
}

.profile-info-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
  transition: opacity 0.2s ease;
}

.profile-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-title {
  font-size: 9.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-settings-icon {
  font-size: 13px;
  color: var(--text-muted);
  transition: all var(--transition-base);
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Settings View Layout ---- */
.settings-container {
  padding: 32px;
  animation: fade-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
}

.settings-header {
  margin-bottom: 32px;
}

.settings-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.settings-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
}

.settings-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}

.settings-fields-column,
.settings-options-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Settings Cards styling similar to history cards */
.settings-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-base);
}

.settings-card:hover {
  border-color: var(--border-medium);
  background: rgba(255, 255, 255, 0.02);
}

.settings-card-title {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding-bottom: 10px;
}

.settings-card-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 4px;
}

.settings-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Make profile button active highlight look like an active tab */
.sidebar-profile-btn.active {
  color: var(--text-primary);
  background: var(--bg-tab-active);
  border-color: var(--accent-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 0 12px var(--accent-glow);
}

.sidebar-profile-btn.active .profile-settings-icon {
  color: var(--accent-primary);
  animation: spin-slow 8s linear infinite;
}

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

@media (max-width: 900px) {
  .settings-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* =========================================================
   AI AUTO-FILL BUTTON (in preview header)
   ========================================================= */
.btn-ai-fill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 255, 102, 0.3);
  background: rgba(0, 255, 102, 0.06);
  color: var(--accent-primary);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.btn-ai-fill:hover {
  background: rgba(0, 255, 102, 0.12);
  border-color: rgba(0, 255, 102, 0.5);
  box-shadow: 0 0 12px rgba(0, 255, 102, 0.15);
}

.btn-ai-fill:active {
  transform: scale(0.97);
}

/* =========================================================
   AI AUTO-FILL MODAL
   ========================================================= */
.autofill-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.autofill-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.autofill-modal {
  position: fixed;
  inset: 0;
  z-index: 301;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
}

.autofill-modal:not([hidden]) {
  pointer-events: auto;
}

.autofill-modal[hidden] {
  display: none;
}

.autofill-modal-inner {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: #111111;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  display: flex;
  flex-direction: column;
  gap: 0;
  animation: autofill-enter 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes autofill-enter {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.autofill-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 24px 0;
}

.autofill-header-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.autofill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-primary);
  background: rgba(0, 255, 102, 0.08);
  border: 1px solid rgba(0, 255, 102, 0.2);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  width: fit-content;
}

.autofill-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.2;
}

.autofill-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 420px;
}

.autofill-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  outline: none;
  margin-top: 4px;
}

.autofill-close:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.autofill-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 24px 0;
  padding: 10px 12px;
  background: rgba(255, 255, 102, 0.04);
  border: 1px solid rgba(255, 255, 102, 0.1);
  border-radius: var(--radius-md);
  font-size: 11.5px;
  color: rgba(255, 230, 80, 0.7);
  line-height: 1.4;
}

.autofill-notice i {
  font-size: 12px;
  flex-shrink: 0;
  color: rgba(255, 230, 80, 0.6);
}

.autofill-inputs {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px 0;
}

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

.autofill-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.autofill-label i {
  font-size: 11px;
  color: var(--text-muted);
}

.autofill-optional {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
  margin-left: auto;
}

.autofill-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.6;
  resize: vertical;
  min-height: 110px;
  outline: none;
  transition: all var(--transition-fast);
}

.autofill-textarea::placeholder { color: var(--text-placeholder); }

.autofill-textarea:focus {
  border-color: rgba(0, 255, 102, 0.4);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px rgba(0, 255, 102, 0.06);
}

.autofill-dropzone {
  position: relative;
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  cursor: pointer;
  transition: all var(--transition-base);
  overflow: hidden;
}

.autofill-dropzone:hover,
.autofill-dropzone.dragover {
  border-color: rgba(0, 255, 102, 0.4);
  background: rgba(0, 255, 102, 0.04);
}

.autofill-dropzone.has-file {
  border-color: rgba(0, 255, 102, 0.5);
  border-style: solid;
  background: rgba(0, 255, 102, 0.04);
}

.autofill-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.autofill-dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px;
  pointer-events: none;
}

.autofill-upload-icon {
  font-size: 22px;
  color: var(--text-muted);
  transition: color var(--transition-base);
}

.autofill-dropzone.has-file .autofill-upload-icon { color: var(--accent-primary); }

.autofill-dropzone-text {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.autofill-browse {
  color: var(--accent-primary);
  font-weight: 500;
}

.autofill-file-name {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.autofill-dropzone.has-file .autofill-file-name { color: var(--accent-primary); }

.autofill-progress {
  margin: 16px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.autofill-progress[hidden] { display: none; }

.autofill-progress-bar {
  height: 3px;
  background: var(--border-subtle);
  border-radius: 2px;
  overflow: hidden;
}

.autofill-progress-fill {
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, var(--accent-primary), #00ccff);
  border-radius: 2px;
  animation: progress-shimmer 1.5s ease infinite;
}

@keyframes progress-shimmer {
  0%   { opacity: 0.7; }
  50%  { opacity: 1; }
  100% { opacity: 0.7; }
}

.autofill-progress-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.autofill-progress-text i { color: var(--accent-primary); }

.autofill-result {
  margin: 16px 24px 0;
  background: rgba(0, 255, 102, 0.04);
  border: 1px solid rgba(0, 255, 102, 0.15);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.autofill-result[hidden] { display: none; }

.autofill-result-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.autofill-result-icon {
  font-size: 20px;
  color: var(--accent-primary);
  margin-top: 1px;
  flex-shrink: 0;
}

.autofill-result-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.autofill-result-stats {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.autofill-coverage-bar {
  height: 4px;
  background: var(--border-subtle);
  border-radius: 2px;
  overflow: hidden;
}

.autofill-coverage-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), #00e5ff);
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  width: 0%;
}

.autofill-empty-fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.autofill-empty-fields[hidden] { display: none; }

.autofill-empty-label {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.autofill-empty-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.autofill-empty-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 2px 6px;
}

.autofill-error {
  margin: 16px 24px 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255, 80, 80, 0.06);
  border: 1px solid rgba(255, 80, 80, 0.2);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 13px;
  color: #ff9090;
  line-height: 1.5;
}

.autofill-error[hidden] { display: none; }

.autofill-error i {
  font-size: 14px;
  color: #ff6b6b;
  flex-shrink: 0;
  margin-top: 1px;
}

.autofill-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 20px 24px 24px;
}

.autofill-footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.autofill-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
}

.autofill-btn-secondary:hover {
  border-color: var(--border-medium);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.autofill-btn-secondary[hidden] { display: none; }

.autofill-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 255, 102, 0.5);
  background: rgba(0, 255, 102, 0.1);
  color: var(--accent-primary);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
  box-shadow: 0 0 16px rgba(0, 255, 102, 0.1);
}

.autofill-btn-primary:hover {
  background: rgba(0, 255, 102, 0.15);
  border-color: rgba(0, 255, 102, 0.7);
  box-shadow: 0 0 24px rgba(0, 255, 102, 0.2);
}

.autofill-btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.autofill-btn-primary[hidden] { display: none; }

.autofill-btn-apply {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
}

.autofill-btn-apply:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.autofill-btn-apply[hidden] { display: none; }

.autofill-modal-inner::-webkit-scrollbar { width: 4px; }
.autofill-modal-inner::-webkit-scrollbar-track { background: transparent; }
.autofill-modal-inner::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
}
