/* ==========================================================================
   THE CATALYST AI — LIGHT & AIRY STEPPED QA/QC STUDIO
   Theme: Crisp Light Theme by Default + High-Contrast Dark Mode Toggle
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── THEME VARIABLES ─────────────────────────────────────────────────────── */
:root, [data-theme="light"] {
  /* Light Theme (Default) */
  --bg-page:        #f8fafc;
  --bg-surface:     #ffffff;
  --bg-subtle:      #f1f5f9;
  --bg-hover:       #f8fafc;
  --bg-input:       #ffffff;
  
  --border:         #e2e8f0;
  --border-strong:  #cbd5e1;
  --border-focus:   #2563eb;

  --primary:        #2563eb;
  --primary-hover:  #1d4ed8;
  --primary-light:  #eff6ff;
  --primary-text:   #1d4ed8;

  --accent:         #d97706;
  --accent-light:   #fffbeb;

  --text-main:      #0f172a;
  --text-muted:     #64748b;
  --text-light:     #94a3b8;

  --card-shadow:    0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --card-shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      16px;
  --radius-full:    9999px;

  --font-sans:      'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:      'IBM Plex Mono', monospace;

  --transition:     all 0.2s ease;
}

/* Dark Mode Overrides */
[data-theme="dark"] {
  --bg-page:        #090d16;
  --bg-surface:     #0f172a;
  --bg-subtle:      #1e293b;
  --bg-hover:       #1a2436;
  --bg-input:       #0b1220;
  
  --border:         #1e293b;
  --border-strong:  #334155;
  --border-focus:   #3b82f6;

  --primary:        #3b82f6;
  --primary-hover:  #2563eb;
  --primary-light:  rgba(59, 130, 246, 0.12);
  --primary-text:   #93c5fd;

  --accent:         #f59e0b;
  --accent-light:   rgba(245, 158, 11, 0.12);

  --text-main:      #f8fafc;
  --text-muted:     #94a3b8;
  --text-light:     #64748b;

  --card-shadow:    0 4px 12px rgba(0, 0, 0, 0.3);
  --card-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
}

html {
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
  height: auto;
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: clip;
  overflow-y: visible;
  max-width: 100%;
}

/* ── HEADER ──────────────────────────────────────────────────────────────── */
.app-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-sizing: border-box;
  width: 100%;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
  min-width: 0;
  flex-shrink: 1;
}

.brand-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-title-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.brand-tag {
  background: var(--primary-light);
  color: var(--primary-text);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: 0;
}

.btn-icon-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 15px;
}

.btn-icon-toggle:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--border-strong);
}

.author-link {
  font-size: 12.5px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.author-link:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.model-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(118, 185, 0, 0.1);
  color: #76b900;
  border: 1px solid rgba(118, 185, 0, 0.3);
  padding: 5px 11px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  user-select: none;
  cursor: pointer;
  transition: var(--transition);
}

.model-badge:hover {
  background: rgba(118, 185, 0, 0.2);
  border-color: rgba(118, 185, 0, 0.5);
  transform: translateY(-1px);
}

[data-theme="dark"] .model-badge {
  background: rgba(118, 185, 0, 0.15);
  color: #92e000;
  border-color: rgba(118, 185, 0, 0.4);
}

.model-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #76b900;
  box-shadow: 0 0 6px #76b900;
  display: inline-block;
  animation: pulse-badge 2s infinite ease-in-out;
}

.model-badge.offline .model-badge-dot {
  background: #f59e0b;
  box-shadow: 0 0 6px #f59e0b;
  animation: none;
}

.model-badge.offline {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.3);
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

/* ── BODY LAYOUT & GOOGLE ADSENSE SIDEBAR RAILS ──────────────────────────── */
.app-body-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  max-width: 1420px;
  margin: 0 auto;
  padding: 0 16px;
  gap: 20px;
  flex: 1;
}

.app-central-col {
  flex: 1;
  max-width: 960px;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.ad-rail {
  width: 160px;
  min-width: 160px;
  flex-shrink: 0;
  margin-top: 24px;
}

.ad-sticky-container {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ad-unit-card {
  width: 160px;
  min-height: 600px;
  background: transparent;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.ad-unit-card ins.adsbygoogle {
  display: inline-block;
  width: 160px;
  height: 600px;
  background: transparent;
  border: none;
}

ins.adsbygoogle,
ins.adsbygoogle iframe {
  border: none !important;
  background: transparent !important;
}

/* Mobile & Tablet Google AdSense Slot (Strictly hidden on desktop / website view) */
.ad-mobile-slot {
  display: none !important;
}

/* Tablet & Mobile Screens (< 1180px): Hide side rails and display ad at bottom */
@media (max-width: 1179px) {
  .ad-rail {
    display: none !important;
  }
  .app-body-layout {
    padding: 0;
    gap: 0;
  }
  .ad-mobile-slot {
    display: block !important;
    width: 100%;
    max-width: 960px;
    margin: 28px auto 20px;
    padding: 0 16px;
    box-sizing: border-box;
    text-align: center;
    overflow: hidden;
    background: transparent;
  }
  .ad-mobile-slot ins.adsbygoogle {
    display: block;
    margin: 0 auto;
    width: 100%;
    min-width: 280px;
    background: transparent;
    border: none;
  }
}

/* ── STEPPER PROGRESS BAR ────────────────────────────────────────────────── */
.stepper-section {
  max-width: 960px;
  margin: 24px auto 0;
  padding: 0 20px;
  width: 100%;
}

.stepper-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 20px;
  box-shadow: var(--card-shadow);
}

.step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-light);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  outline: none;
}

.step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  transition: var(--transition);
}

.step-item.active {
  color: var(--text-main);
  font-weight: 600;
}

.step-item.active .step-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 0 3px var(--primary-light);
}

.step-item.completed .step-circle {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

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

/* ── MAIN CONTAINER ──────────────────────────────────────────────────────── */
.main-wrapper {
  max-width: 960px;
  margin: 20px auto 40px;
  padding: 0 16px;
  width: 100%;
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
}

/* ── WIZARD STEP CONTAINER ───────────────────────────────────────────────── */
.wizard-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--card-shadow-lg);
  animation: fadeIn 0.25s ease forwards;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: visible;
}

#stepPanel1 {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: visible;
}

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

.panel-header {
  margin-bottom: 20px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.panel-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  word-break: break-word;
}

.panel-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  width: 100%;
  min-width: 0;
  word-break: break-word;
  line-height: 1.5;
}

/* ── STEP 1: DOCUMENT GROUPS / CATEGORY SELECTOR ───────────────────────── */
.doc-group-container,
.doc-docs-container {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin-bottom: 6px;
}

.group-select-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 10px;
  width: 100%;
  min-width: 0;
}

.step-mini-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
  min-width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.doc-group-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin-bottom: 6px;
}

@media (max-width: 820px) {
  .doc-group-switcher {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.group-tab-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  position: relative;
  outline: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.group-tab-btn:hover {
  border-color: var(--primary);
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.group-tab-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 1px var(--primary);
}

.group-tab-btn i {
  font-size: 18px;
  color: var(--primary);
  flex-shrink: 0;
}

.group-tab-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-tab-hint {
  display: none !important; /* Title only as requested */
}

.group-tab-arrow {
  font-size: 13px;
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.2s ease;
  margin-left: 2px;
  flex-shrink: 0;
}

.group-tab-btn:hover .group-tab-arrow {
  color: var(--primary);
  transform: translateX(3px);
}

.group-tab-subtitle {
  display: none !important;
}

.group-tab-count {
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  white-space: nowrap;
}

.group-tab-btn.active .group-tab-count {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.active-group-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 2px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.btn-change-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-change-group:hover {
  background: var(--primary);
  color: #ffffff;
}

.btn-change-group:hover i {
  color: #ffffff;
}

/* ── STEP 1: CLEAN DOCUMENT TILES (Icon & Title Focused) ───────────────────── */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.doc-tile {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  outline: none;
  position: relative;
  min-height: 100px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.doc-tile:hover {
  border-color: var(--primary);
  background: var(--bg-surface);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.doc-tile.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 1.5px var(--primary), 0 4px 12px rgba(37, 99, 235, 0.1);
}

.doc-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.doc-tile-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  transition: var(--transition);
}

.doc-tile:hover .doc-tile-icon {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.doc-tile.selected .doc-tile-icon {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.doc-tile-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  max-width: calc(100% - 42px);
  flex-shrink: 1;
}

.doc-tile-badge {
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: inline-block;
}

.doc-tile.selected .doc-tile-badge {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.25);
  color: var(--primary);
}

.doc-tile-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 12px;
  cursor: help;
  transition: var(--transition);
  flex-shrink: 0;
}

.doc-tile-help:hover {
  color: var(--primary);
  background: var(--bg-hover);
}

.doc-tile-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin-top: auto;
  width: 100%;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Remove bulky in-card explanatory text paragraph */
.doc-tile-desc {
  display: none !important;
}

/* ── STEP 2: FORM & CONTROLS (Progressive Question Flow) ─────────────────── */
.view-mode-toggle {
  display: inline-flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
}

.mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

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

.mode-btn.active {
  background: var(--bg-surface);
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--card-shadow-sm);
}

/* Stepper Progress Bar & Meta */
.param-stepper-track {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.param-stepper-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.param-step-badge {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.param-step-pct {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  font-family: var(--font-mono);
}

.param-progress-bg {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.param-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #3b82f6);
  border-radius: var(--radius-full);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.param-pills-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 4px;
}

.param-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.param-pill:hover {
  border-color: var(--primary);
  color: var(--text-main);
}

.param-pill.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-text);
  font-weight: 600;
}

.param-pill.completed {
  border-color: #10b981;
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

.param-pill.completed i {
  color: #10b981;
}

/* Single-Question Focus Card */
.form-row.guided-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: slideQuestion 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideQuestion {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.form-row.guided-card .form-row-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 2px;
}

.guided-q-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  margin-right: 8px;
  flex-shrink: 0;
}

.guided-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: -6px;
  line-height: 1.4;
}

.guided-keyboard-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.guided-keyboard-hint kbd {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
}

/* Guided Navigation Box (Previous / Next) */
.guided-nav-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  margin-bottom: 8px;
  gap: 12px;
}

.guided-action-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Summary Card for All Answered Values */
.answers-summary-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-top: 20px;
  animation: fadeIn 0.25s ease;
}

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

.summary-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-link-sm {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.summary-pills-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.summary-item-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  transition: var(--transition);
}

.summary-item-chip:hover {
  border-color: var(--primary);
  background: var(--bg-hover);
}

.summary-item-key {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.summary-item-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── STEP 2: CHATBOT INTERVIEW MODE ────────────────────────────────────────── */
.param-chat-container {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  margin-top: 10px;
  margin-bottom: 24px;
  animation: fadeIn 0.25s ease;
  min-height: 520px;
}

.chat-assistant-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.chat-assistant-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar-badge {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.chat-online-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  background: #10b981;
  border: 2px solid var(--bg-surface);
  border-radius: 50%;
}

.chat-assistant-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.chat-badge-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.chat-assistant-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.chat-action-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--border-strong);
}

.chat-progress-line {
  width: 100%;
  height: 3px;
  background: var(--border);
}

.chat-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #3b82f6, #10b981);
  transition: width 0.35s ease;
}

.chat-messages-stream {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 480px;
  min-height: 320px;
  scroll-behavior: smooth;
  background: var(--bg-page);
}

.chat-msg-row {
  display: flex;
  gap: 12px;
  width: 100%;
  animation: fadeIn 0.2s ease-out;
}

.chat-bot-row {
  justify-content: flex-start;
  align-items: flex-start;
}

.chat-user-row {
  justify-content: flex-end;
  align-items: flex-start;
}

.chat-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 2px;
}

.chat-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #10b981;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}

.chat-bot-bubble {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px 16px 16px 16px;
  padding: 14px 16px;
  max-width: 82%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.chat-user-bubble {
  background: var(--primary);
  color: #ffffff;
  border-radius: 16px 4px 16px 16px;
  padding: 12px 16px;
  max-width: 78%;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-topic-tag,
.chat-q-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid rgba(37, 99, 235, 0.2);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
  width: fit-content;
}

.chat-bot-ack {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #059669;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  margin-bottom: 8px;
  width: fit-content;
}

.chat-msg-text,
.chat-q-text {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.5;
  margin-bottom: 6px;
}

.chat-msg-helper,
.chat-q-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

/* Options Inside Chat */
.chat-options-panel {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-suggestions-banner,
.chat-options-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.chat-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chat-opt-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.chat-opt-chip:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  transform: translateY(-1px);
}

.chat-opt-chip.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  font-weight: 600;
}

.chat-opt-chip.active i {
  color: #ffffff;
}

.chat-confirm-tags-btn {
  align-self: flex-start;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
}

.chat-confirm-tags-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.chat-user-text {
  font-size: 13.5px;
  line-height: 1.4;
  word-break: break-word;
}

.chat-user-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  opacity: 0.85;
}

.chat-edit-answer-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #ffffff;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.chat-edit-answer-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* Chatbot Completion Card */
.chat-completion-box {
  background: var(--bg-surface);
  border: 1px solid #10b981;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.1);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-completion-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-completion-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.chat-completion-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.chat-completion-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.chat-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
}

.chat-summary-cell {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  transition: var(--transition);
}

.chat-summary-cell:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.chat-summary-key {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.chat-summary-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 2px;
  word-break: break-word;
}

.chat-completion-cta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-chat-generate-ai {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary), #1d4ed8);
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: var(--transition);
}

.btn-chat-generate-ai:hover {
  background: linear-gradient(135deg, var(--primary-hover), #1e40af);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

/* Chat Composer */
.chat-composer-wrap {
  padding: 14px 18px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-composer-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.chat-nav-btn:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

.chat-input-field-wrap {
  flex: 1;
  position: relative;
}

.chat-composer-input {
  width: 100%;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-main);
  padding: 0 14px;
  font-size: 13px;
  font-family: inherit;
  transition: var(--transition);
}

.chat-composer-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.chat-skip-btn {
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.chat-skip-btn:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

.chat-send-btn {
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  background: var(--primary);
  border: none;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.chat-send-btn:hover {
  background: var(--primary-hover);
}

.chat-composer-footer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-meta-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.chat-link-btn {
  background: none;
  border: none;
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.chat-typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
}

.chat-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: chatDotPulse 1.4s infinite ease-in-out both;
}

.chat-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.chat-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes chatDotPulse {
  0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.preset-pills-bar {
  display: none !important;
}

.preset-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.preset-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.preset-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

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

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.req-star {
  color: #ef4444;
}

.input-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 9px 13px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.input-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

textarea.input-control {
  min-height: 80px;
  resize: vertical;
  line-height: 1.5;
}

select.input-control {
  cursor: pointer;
}

/* Multi-select tag chips */
.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 2px;
}

.tag-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}

.tag-btn:hover {
  border-color: var(--primary);
  color: var(--text-main);
}

.tag-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-text);
  font-weight: 600;
}

/* ── STEP 3: RESULTS / OUTPUT WORKSPACE ──────────────────────────────────── */
.results-subnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.subnav-tabs {
  display: none !important;
}

.tab-pill {
  padding: 6px 14px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.tab-pill.active {
  background: var(--primary-light);
  color: var(--primary-text);
  border-color: var(--border);
}

.results-actions-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.action-btn-sm:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.action-btn-sm.primary {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.action-btn-sm.primary:hover {
  background: var(--primary-hover);
}

/* Print/PDF Export Button Specific Styling */
#btnPrintDocument {
  background: var(--primary-light);
  color: var(--primary-text);
  border-color: rgba(2, 132, 199, 0.4);
  font-weight: 600;
  transition: all 0.2s ease;
}

#btnPrintDocument:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

#btnPrintDocument:active {
  transform: scale(0.97);
}

/* Output Document Box */
.output-document-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  min-height: 350px;
  max-height: none;
  overflow: visible;
  line-height: 1.7;
  font-size: 14.5px;
}

.output-document-box h1 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  color: var(--text-main);
}

.output-document-box h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 18px 0 8px;
  color: var(--primary);
}

.output-document-box h3 {
  font-size: 14.5px;
  font-weight: 600;
  margin: 14px 0 6px;
}

.output-document-box p {
  margin-bottom: 12px;
}

.output-document-box ul,
.output-document-box ol {
  padding-left: 20px;
  margin-bottom: 14px;
}

.output-document-box li {
  margin-bottom: 4px;
}

/* Document Markdown Tables */
.output-document-box table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13px;
  display: block;
  overflow-x: auto;
}

.output-document-box th {
  background: var(--bg-subtle);
  color: var(--text-main);
  font-weight: 600;
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.output-document-box td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  color: var(--text-main);
  vertical-align: top;
}

.output-document-box tr:nth-child(even) td {
  background: var(--bg-hover);
}

/* Raw Prompt Box */
.prompt-raw-view {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-main);
  white-space: pre-wrap;
  max-height: 55vh;
  overflow-y: auto;
  line-height: 1.6;
}

/* Refinement bar */
.refine-dock {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px;
}

.refine-input-field {
  flex: 1;
  background: transparent;
  border: none;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text-main);
  outline: none;
}

.refine-input-field::placeholder {
  color: var(--text-muted);
}

/* ── STEP FOOTER BUTTONS ─────────────────────────────────────────────────── */
.step-nav-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.btn-wizard-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid var(--primary);
  cursor: pointer;
  transition: var(--transition);
}

.btn-wizard-main:hover {
  background: var(--primary-hover);
}

.btn-wizard-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-wizard-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

/* ── HISTORY DRAWER / MODAL ──────────────────────────────────────────────── */
.history-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.history-modal-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.history-modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--card-shadow-lg);
}

/* ── AZURE ENVIRONMENT & API KEY MODAL ───────────────────────────────────── */
.api-status-banner {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  line-height: 1.5;
}

.api-status-banner.connected {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.api-status-banner.missing {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.azure-guide-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 14px;
}

.azure-guide-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.azure-guide-title i {
  color: #0078d4;
  font-size: 16px;
}

.azure-guide-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 10px;
}

.azure-guide-steps {
  font-size: 12.5px;
  color: var(--text-main);
  line-height: 1.6;
  padding-left: 20px;
  margin: 0;
}

.azure-guide-steps li {
  margin-bottom: 6px;
}

.azure-var-pill {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 6px 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.azure-var-pill code {
  color: var(--primary);
}

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

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item-row {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
}

.history-item-row:hover {
  border-color: var(--primary);
  background: var(--bg-hover);
}

/* ── TOAST NOTIFICATION ──────────────────────────────────────────────────── */
.toast-bar {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text-main);
  color: var(--bg-surface);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--card-shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateY(60px);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: none;
  z-index: 300;
}

.toast-bar.show {
  transform: translateY(0);
  opacity: 1;
}

/* ── FOOTER ──────────────────────────────────────────────────────────────── */
.app-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  padding: 24px 20px 20px;
  color: var(--text-muted);
}

.footer-container {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.footer-disclaimer-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  max-width: 900px;
  width: 100%;
  box-sizing: border-box;
}

.footer-disclaimer-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
  text-align: center;
}

.footer-disclaimer-text strong {
  color: var(--text-main);
  font-weight: 700;
}

.footer-bottom-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.footer-visitor-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.visitor-counter-img {
  height: 20px;
  max-width: 100%;
  display: block;
}

/* ── UTILITY ─────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── PRINT VIEW ──────────────────────────────────────────────────────────── */
@media print {
  body {
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 13.5px !important;
  }
  .app-header, .stepper-section, .ad-rail, .ad-mobile-slot, .step-nav-footer, .results-subnav, .refine-dock, .app-footer,
  .history-modal-backdrop, .toast-bar, #stepPanel1, #stepPanel2 {
    display: none !important;
  }
  .main-container {
    padding: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
  .wizard-panel {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    background: #ffffff !important;
  }
  .output-document-box {
    border: none !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #0f172a !important;
  }
  .prompt-raw-view {
    border: none !important;
    max-height: none !important;
    overflow: visible !important;
    white-space: pre-wrap !important;
    background: #ffffff !important;
    color: #0f172a !important;
  }
  table {
    page-break-inside: avoid !important;
    border-collapse: collapse !important;
    width: 100% !important;
  }
  th, td {
    border: 1px solid #cbd5e1 !important;
    padding: 6px 10px !important;
  }
  th {
    background: #f1f5f9 !important;
    color: #0f172a !important;
  }
  h1, h2, h3 {
    page-break-after: avoid !important;
    color: #0f172a !important;
  }
}

/* ── MOBILE & TABLET RESPONSIVE SYSTEM ────────────────────────────────────── */

/* Tablet Screen Adjustments (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .header-inner {
    padding: 12px 18px;
  }
  .stepper-section {
    padding: 0 16px;
  }
  .main-wrapper {
    padding: 0 16px;
  }
  .wizard-panel {
    padding: 24px 20px;
  }
  .doc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .doc-group-switcher {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
}

/* Small Tablets & Large Phones (601px to 768px) */
@media (max-width: 768px) {
  .header-inner {
    padding: 10px 14px;
    gap: 8px;
    box-sizing: border-box;
    width: 100%;
  }
  .brand-group {
    gap: 8px;
    min-width: 0;
    flex-shrink: 1;
  }
  .brand-icon-wrap {
    width: 32px;
    height: 32px;
  }
  .brand-name {
    font-size: 15px;
    white-space: nowrap;
  }
  .brand-sub {
    display: none !important;
  }
  .header-controls {
    gap: 6px;
    flex-shrink: 0;
    min-width: 0;
  }
  .author-link {
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
    border-radius: var(--radius-md);
    flex-shrink: 0;
  }
  .author-link span {
    display: none !important;
  }
  .author-link i {
    font-size: 15px;
    margin: 0;
  }
  .btn-icon-toggle {
    width: 34px;
    height: 34px;
    font-size: 14px;
    flex-shrink: 0;
  }
  .model-badge {
    padding: 4px 8px;
    font-size: 11px;
    gap: 5px;
    flex-shrink: 0;
  }
  .btn-install-pwa {
    padding: 5px 9px;
    font-size: 11px;
    gap: 4px;
    flex-shrink: 0;
  }
  .stepper-section {
    padding: 0 14px;
    margin-top: 14px;
  }
  .stepper-nav {
    padding: 10px 14px;
  }
  .main-wrapper {
    padding: 0 14px;
    margin: 14px auto 30px;
  }
  .wizard-panel {
    padding: 20px 16px;
  }
  .doc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .doc-group-switcher {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* Mobile Phones (<= 600px) */
@media (max-width: 600px) {
  /* Header: ultra-resilient fluid single row with zero page horizontal overflow */
  .app-header {
    border-bottom: 1px solid var(--border);
  }
  .header-inner {
    padding: 8px 10px;
    gap: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
  }
  .brand-group {
    gap: 7px;
    min-width: 0;
    flex-shrink: 0;
  }
  .brand-icon-wrap {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    flex-shrink: 0;
  }
  .brand-name {
    font-size: 14px;
    white-space: nowrap;
    letter-spacing: -0.01em;
  }
  .brand-tag {
    font-size: 8.5px;
    padding: 1.5px 5px;
  }
  .brand-sub {
    display: none !important;
  }
  .header-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 1;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    padding: 2px 0;
  }
  .header-controls::-webkit-scrollbar {
    display: none;
  }
  .btn-install-pwa {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
  }
  .btn-install-pwa .btn-install-text {
    display: none !important;
  }
  .btn-install-pwa i {
    font-size: 14px;
    margin: 0;
  }
  .model-badge {
    height: 32px;
    min-width: 32px;
    padding: 0 6px;
    border-radius: 8px;
    font-size: 11px;
    gap: 4px;
    flex-shrink: 0;
    justify-content: center;
  }
  .model-badge #modelBadgeText {
    display: none !important;
  }
  .model-badge-dot {
    margin: 0;
  }
  .btn-icon-toggle {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 14px;
    border-radius: 8px;
    flex-shrink: 0;
  }
  .author-link {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
  }
  .author-link span {
    display: none !important;
  }
  .author-link i {
    font-size: 15px;
    margin: 0;
  }

  /* Stepper Bar */
  .stepper-section {
    padding: 0 10px;
    margin-top: 10px;
  }
  .stepper-nav {
    padding: 8px 10px;
    border-radius: var(--radius-md);
  }
  .step-item {
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
  }
  .step-circle {
    width: 22px;
    height: 22px;
    font-size: 10.5px;
  }
  .step-divider {
    margin: 0 4px;
  }

  /* Main Wizard & Panels */
  .main-wrapper {
    padding: 0 10px;
    margin: 10px auto 20px;
  }
  .wizard-panel {
    padding: 16px 12px;
    border-radius: var(--radius-md);
  }
  .panel-header {
    margin-bottom: 14px;
  }
  .panel-title {
    font-size: 17px;
  }
  .panel-desc {
    font-size: 12.5px;
  }

  /* Mobile Ad Slot (At bottom of page) */
  .ad-mobile-slot {
    padding: 0 10px;
    margin: 20px auto 16px;
  }

  /* Step 1: Switchers & Grid */
  .doc-group-container {
    margin-bottom: 12px;
  }
  .doc-group-switcher {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .group-tab-btn {
    padding: 10px 12px;
    gap: 10px;
  }
  .group-tab-btn i {
    font-size: 18px;
  }
  .group-tab-title {
    font-size: 13px;
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .group-tab-hint {
    display: none !important;
  }
  .active-group-toolbar {
    margin-bottom: 10px;
    padding-bottom: 8px;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .btn-change-group {
    padding: 5px 9px;
    font-size: 11px;
    gap: 4px;
    flex-shrink: 0;
  }

  /* Step 1B / 2nd Step Documents: 2 items per line on mobile screen */
  .doc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-bottom: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  .doc-tile {
    min-height: 85px !important;
    padding: 10px 8px !important;
    gap: 6px !important;
    border-radius: var(--radius-md) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  .doc-tile-top {
    gap: 4px !important;
    margin-bottom: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  .doc-tile-icon {
    width: 26px !important;
    height: 26px !important;
    font-size: 12px !important;
    border-radius: 6px !important;
    flex-shrink: 0 !important;
  }
  .doc-tile-meta {
    gap: 2px !important;
    min-width: 0 !important;
    max-width: calc(100% - 30px) !important;
    overflow: hidden !important;
    flex-shrink: 1 !important;
  }
  .doc-tile-badge {
    font-size: 8px !important;
    padding: 1px 4px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    display: inline-block !important;
  }
  .doc-tile-help {
    display: none !important;
  }
  .doc-tile-title {
    font-size: 11px !important;
    line-height: 1.25 !important;
    font-weight: 600 !important;
    width: 100% !important;
    min-width: 0 !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }

  /* Footer on Mobile */
  .app-footer {
    padding: 18px 12px 16px;
  }
  .footer-disclaimer-box {
    padding: 10px 12px;
  }
  .footer-disclaimer-text {
    font-size: 11px;
    line-height: 1.45;
    text-align: left;
  }

  /* Step 2: Form & Progressive Flow */
  .view-mode-toggle {
    width: 100%;
    margin-top: 8px;
  }
  .view-mode-toggle .mode-btn {
    flex: 1;
    justify-content: center;
    padding: 6px 10px;
    font-size: 12px;
  }
  .param-stepper-track {
    padding: 10px 10px;
    margin-bottom: 14px;
  }
  .guided-nav-box {
    flex-direction: column-reverse;
    gap: 8px;
  }
  .guided-action-right {
    width: 100%;
    display: flex;
    gap: 6px;
  }
  .guided-action-right button {
    flex: 1;
    justify-content: center;
    padding: 9px 12px;
  }
  #btnPrevQuestion {
    width: 100%;
    justify-content: center;
    padding: 8px 12px;
  }
  .step-nav-footer {
    flex-direction: column-reverse;
    gap: 8px;
    margin-top: 16px;
    padding-top: 14px;
  }
  .step-nav-footer button {
    width: 100%;
    justify-content: center;
  }

  /* Step 3: Document Deliverables & Results */
  .results-subnav {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .results-tabs {
    width: 100%;
    display: flex;
  }
  .results-tab-btn {
    flex: 1;
    justify-content: center;
    padding: 8px 10px;
    font-size: 12px;
  }
  .results-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .results-actions button {
    flex: 1;
    min-width: 90px;
    justify-content: center;
    padding: 7px 10px;
    font-size: 12px;
  }
  .output-document-box {
    padding: 14px 10px;
    font-size: 13px;
    max-height: 60vh;
  }
  .output-document-box table {
    font-size: 12px;
  }
  .output-document-box th,
  .output-document-box td {
    padding: 6px 8px;
  }
  .refine-dock {
    padding: 12px 10px;
    margin-top: 14px;
  }
  .refine-input-row {
    flex-direction: column;
    gap: 8px;
  }
  .refine-input-row input {
    width: 100%;
  }
  .refine-input-row button {
    width: 100%;
    justify-content: center;
  }

  /* Modals on Mobile */
  .history-modal-box {
    max-width: 95vw;
    margin: 8px;
    max-height: 85vh;
  }
}

/* Extra Narrow Phones (<= 380px) */
@media (max-width: 380px) {
  .header-inner {
    padding: 6px 8px;
    gap: 5px;
  }
  .brand-group {
    gap: 5px;
  }
  .brand-icon-wrap {
    width: 26px;
    height: 26px;
    border-radius: 6px;
  }
  .brand-name {
    font-size: 13px;
    letter-spacing: -0.02em;
  }
  .brand-tag {
    font-size: 8px;
    padding: 1px 4px;
    border-radius: 3px;
  }
  .header-controls {
    gap: 3px;
  }
  .btn-install-pwa,
  .btn-icon-toggle,
  .author-link,
  .model-badge {
    width: 29px;
    height: 29px;
    min-width: 29px;
    min-height: 29px;
    border-radius: 6px;
    font-size: 13px;
    padding: 0;
    justify-content: center;
  }
  .model-badge #modelBadgeText {
    display: none !important;
  }
  .model-badge-dot {
    margin: 0;
  }
  .step-item span:not(.step-circle) {
    font-size: 10px;
  }
}

/* ==========================================================================
   STRATEGY 1 & 2: CORPORATE ENGINEERING DELIVERABLE & JSON PARSER STYLES
   ========================================================================== */

/* Strategy 1 Toolbar & JSON Editor */
.strategy-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 12px;
}

.strategy-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.strategy-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.strategy-toolbar-sub {
  font-size: 12.5px;
  color: var(--text-muted);
}

.strategy-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.strategy-info-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(2, 132, 199, 0.07);
  border: 1px solid rgba(2, 132, 199, 0.25);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-main);
}

.json-editor-wrap {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-subtle);
}

.json-code-editor {
  width: 100%;
  height: 480px;
  background: var(--bg-card);
  color: var(--text-main);
  border: none;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
  tab-size: 2;
}

.json-status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── STRATEGY 2: CORPORATE ENGINEERING SHEET DOCUMENT ──────────────────────── */
.corporate-sheet-document {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}

/* 1. Header Block */
.corp-header-block {
  display: grid;
  grid-template-columns: 180px 1fr 220px;
  gap: 16px;
  align-items: center;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 16px;
  margin-bottom: 18px;
}

.corp-logo-box {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-placeholder-frame {
  width: 100%;
  height: 70px;
  border: 1.5px dashed var(--border-strong);
  border-radius: 6px;
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  padding: 4px;
}

.logo-placeholder-frame i {
  font-size: 22px;
  color: var(--primary);
}

.corp-title-box {
  text-align: center;
}

.corp-company-name {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.corp-doc-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.03em;
  margin: 0;
  line-height: 1.25;
}

.corp-doc-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.corp-control-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
}

.control-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.control-table td {
  padding: 2px 4px;
  border: none !important;
  background: transparent !important;
}

.control-table td:first-child {
  color: var(--text-muted);
  width: 75px;
}

/* 2. Section Banners & Metadata Grid */
.corp-section-banner {
  background: var(--primary);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.corp-meta-section {
  margin-bottom: 20px;
}

.project-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 13px;
}

.meta-field {
  display: flex;
  gap: 8px;
}

.meta-field.full-width {
  grid-column: 1 / -1;
}

.meta-field-label {
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.meta-field-val {
  color: var(--text-main);
  font-weight: 500;
}

/* 3. Deliverable Tables */
.table-scroll-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 20px;
}

.corp-itp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 950px;
  border: 2px solid #0284c7;
}

.corp-itp-table thead {
  display: table-header-group !important;
}

.corp-itp-table thead th {
  background: #0284c7 !important;
  color: #ffffff !important;
  font-weight: 700;
  padding: 8px 10px;
  border: 1px solid #0284c7;
  vertical-align: middle;
  text-align: center;
}

.corp-itp-table th {
  background: #0284c7;
  color: #ffffff;
  font-weight: 700;
  padding: 8px 10px;
  border: 1px solid #0284c7;
  vertical-align: middle;
}

.corp-itp-table td {
  padding: 8px 10px;
  border: 1px solid #bfdbfe;
  color: var(--text-main);
  vertical-align: top;
}

.corp-itp-table tbody tr:nth-child(even) td {
  background: var(--bg-subtle);
}

.corp-itp-table tbody tr:hover td {
  background: var(--bg-hover);
}

.stage-cell {
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  background: rgba(2, 132, 199, 0.04) !important;
}

.activity-cell {
  line-height: 1.45;
}

/* Role Badges */
.role-symbol-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
}

.role-badge-h {
  background: #dc2626;
  color: #ffffff;
}

.role-badge-w {
  background: #ea580c;
  color: #ffffff;
}

.role-badge-i {
  background: #0284c7;
  color: #ffffff;
}

.role-badge-r {
  background: #475569;
  color: #ffffff;
}

.role-badge-rh {
  background: #7c3aed;
  color: #ffffff;
}

.role-badge-s {
  background: #059669;
  color: #ffffff;
}

/* 4. Legend Section */
.corp-legend-section {
  margin-bottom: 20px;
}

.legend-badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
}

.legend-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  line-height: 1.4;
}

.legend-desc {
  color: var(--text-main);
}

/* 5. Approval & Sign-Off Matrix */
.corp-approval-section {
  margin-bottom: 18px;
}

.approval-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.approval-box {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-subtle);
  padding: 10px 12px;
  font-size: 12px;
}

.approval-role-header {
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  margin-bottom: 8px;
  letter-spacing: 0.03em;
}

.approval-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  color: var(--text-muted);
}

.sign-space {
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* 6. Engineering Disclaimer */
.corp-disclaimer-note {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 16px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: justify;
}

/* MOS, Checklists & NCR Extras */
.mos-step-card {
  border-left: 3px solid var(--primary);
  background: var(--bg-subtle);
  border-radius: 0 6px 6px 0;
  padding: 12px 14px;
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.55;
}

.mos-step-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.step-num {
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.step-title {
  font-weight: 700;
  color: var(--text-main);
}

.badge-risk {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.chk-box {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 11px;
  color: var(--text-muted);
}

.stage-divider-row td {
  background: rgba(2, 132, 199, 0.08) !important;
  color: var(--primary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 6px 10px !important;
}

.score-card-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, rgba(2,132,199,0.1), rgba(16,185,129,0.1));
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 16px;
}

.score-num {
  font-size: 44px;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
}

.score-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.score-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Print Stylesheet Overrides */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
  }
  .app-header,
  .wizard-stepper,
  .results-subnav,
  .refine-dock,
  .step-nav-footer,
  .app-sidebar-ad,
  .ad-mobile-slot,
  .app-footer,
  .strategy-toolbar,
  .strategy-info-banner,
  #viewJsonResult,
  #viewPromptResult {
    display: none !important;
  }
  #stepPanel3,
  #viewDocResult,
  .output-document-box,
  .corporate-sheet-document {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: #ffffff !important;
  }
  .table-scroll-container {
    overflow: visible !important;
    border: none !important;
  }
  .corp-itp-table {
    min-width: 100% !important;
    font-size: 8.5pt !important;
    page-break-inside: auto !important;
    border: 2px solid #0284c7 !important;
  }
  .corp-itp-table thead {
    display: table-header-group !important;
  }
  .corp-itp-table tfoot {
    display: table-footer-group !important;
  }
  .corp-itp-table tbody tr {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
  .corp-itp-table thead th {
    background: #0284c7 !important;
    color: #ffffff !important;
    padding: 4px 6px !important;
    border: 1px solid #0284c7 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .corp-itp-table th {
    background: #0284c7 !important;
    color: #ffffff !important;
    border: 1px solid #0284c7 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .corp-itp-table td {
    padding: 4px 6px !important;
    border: 1px solid #bfdbfe !important;
  }
  .role-symbol-badge {
    border: 1px solid #000000 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .corp-section-banner {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* Orientation Banner & Meta Form in Modal */
.print-orientation-banner {
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.print-orientation-banner.portrait {
  background: rgba(100, 116, 139, 0.08);
  border-color: var(--border-strong);
}

/* Part 1 & Part 2 Informational Banners */
.part1-technical-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(2, 132, 199, 0.06);
  border: 1px solid rgba(2, 132, 199, 0.22);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-main);
}

.part2-info-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-main);
}

/* Orientation Badge in toolbar */
.orientation-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.3);
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

/* Logo Uploader in Modal */
.meta-logo-block {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meta-logo-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.meta-logo-preview {
  width: 110px;
  height: 52px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4px;
  flex-shrink: 0;
}

.meta-logo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.meta-logo-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 10.5px;
  color: var(--text-muted);
}

.meta-logo-empty i {
  font-size: 18px;
}

.meta-logo-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}

/* Company Logo in Document Header */
.logo-img-frame {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  padding: 4px;
  border-radius: var(--radius-sm);
}

.corp-company-logo-img {
  max-width: 100%;
  max-height: 64px;
  object-fit: contain;
}

.meta-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 14px;
}

.meta-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-form-group.full-width {
  grid-column: 1 / -1;
}

.meta-form-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Landscape mode for ITP deliverable */
.corporate-sheet-document.landscape-mode {
  width: 100%;
}

.corporate-sheet-document.landscape-mode .corp-itp-table {
  min-width: 100%;
  font-size: 11.5px;
}

.corporate-sheet-document.landscape-mode .corp-itp-table th,
.corporate-sheet-document.landscape-mode .corp-itp-table td {
  padding: 6px 8px;
}

/* ══════════════════════════════════════════════════════════════════════════
   METHOD STATEMENT (MOS) CORPORATE MULTI-PAGE STYLING
   ══════════════════════════════════════════════════════════════════════════ */

.page {
  page-break-after: always;
  break-after: page;
}

.mos-document-container {
  width: 100%;
}

/* 1. Cover Page */
.mos-cover-page {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 44px 38px 32px 38px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  min-height: 720px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.mos-cover-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border);
}

.mos-cover-logo-wrap {
  width: 80px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mos-cover-logo-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.mos-cover-logo-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: rgba(2, 132, 199, 0.08);
  border: 1px dashed var(--primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--primary);
}

.mos-cover-logo-placeholder span {
  font-size: 7.5px;
  font-weight: 700;
  text-align: center;
  margin-top: 2px;
}

.mos-cover-company-meta {
  flex: 1;
}

.mos-cover-company-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.mos-cover-qms-sub {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.mos-cover-hero {
  text-align: center;
  padding: 44px 16px 32px 16px;
}

.mos-doc-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(2, 132, 199, 0.1);
  color: var(--primary);
  border: 1px solid rgba(2, 132, 199, 0.25);
  margin-bottom: 12px;
}

.mos-cover-main-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 10px;
}

.mos-cover-sub-title {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.5;
}

.mos-cover-card {
  margin: 16px 0 auto 0;
}

.mos-meta-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.mos-meta-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.mos-meta-table td {
  padding: 7px 12px;
  border: 1px solid var(--border);
}

.mos-meta-table td.meta-label {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 600;
  width: 130px;
}

.mos-meta-table td.meta-value {
  color: var(--text-main);
}

.mos-rev-pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.mos-cover-endorsement {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 2px solid var(--border);
}

.endorse-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
}

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

.endorse-name {
  font-weight: 600;
  color: var(--text-main);
}

/* 2. Table of Contents Page */
.mos-toc-page {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 30px 36px;
  margin-bottom: 24px;
  min-height: 640px;
  box-shadow: var(--shadow-sm);
}

.mos-page-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mos-toc-container {
  padding: 6px 0;
}

.mos-toc-title-wrap {
  margin-bottom: 24px;
  border-bottom: 2px solid var(--text-main);
  padding-bottom: 8px;
}

.mos-toc-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: 0.05em;
  margin: 0;
}

.mos-toc-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.mos-toc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mos-toc-row {
  display: flex;
  align-items: center;
  font-size: 12.5px;
  color: var(--text-main);
  padding: 4px 0;
}

.toc-sec-num {
  font-weight: 700;
  color: var(--primary);
  width: 40px;
  flex-shrink: 0;
}

.toc-sec-title {
  font-weight: 600;
  flex-shrink: 0;
}

.toc-dots {
  flex: 1;
  border-bottom: 1px dotted var(--border-focus);
  margin: 0 10px;
  height: 1px;
}

.toc-sec-target {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  background: rgba(2, 132, 199, 0.08);
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}

.toc-sec-target:hover {
  background: var(--primary);
  color: #fff;
}

/* 3. Document Body Sections */
.mos-document-body {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 30px 36px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.mos-section {
  margin-bottom: 26px;
  padding-bottom: 20px;
  border-bottom: 1px dashed var(--border);
}

.mos-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.mos-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--text-main);
}

.mos-sec-badge {
  background: var(--text-main);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}

.mos-sec-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.mos-section-content {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-main);
}

.mos-section-content p {
  margin-bottom: 8px;
}

.mos-section-content ul,
.mos-section-content ol {
  margin-bottom: 10px;
  padding-left: 20px;
}

.mos-section-content li {
  margin-bottom: 5px;
}

/* 4. MOS Cover Approval Matrix & Running Footer */
.mos-cover-approval-wrap {
  margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.mos-cover-approval-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.mos-page-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 20px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.mos-page-footer-bar .page-number-display {
  font-weight: 700;
  color: var(--primary);
}

/* ══════════════════════════════════════════════════════════════════════════
   CHECKLIST (CHK) INTERACTIVE & PRINT STYLING
   ══════════════════════════════════════════════════════════════════════════ */

.chk-master-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  border: 2px solid #0284c7;
}

.chk-master-table thead {
  display: table-header-group !important;
}

.chk-master-table tfoot {
  display: table-footer-group !important;
}

.chk-master-table tbody tr {
  page-break-inside: avoid !important;
  break-inside: avoid !important;
}

.chk-interactive-box {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #0284c7;
  border-radius: 3px;
  margin: 0 auto;
  display: block;
}

.chk-interactive-box.chk-box-complied:checked {
  accent-color: #059669;
}

.chk-interactive-box.chk-box-not-complied:checked {
  accent-color: #dc2626;
}

.chk-interactive-box.chk-box-na:checked {
  accent-color: #64748b;
}

.chk-comment-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  background: transparent;
  color: #0f172a;
}

.chk-comment-input:focus {
  outline: none;
  border-color: #0284c7;
  background: #ffffff;
}

.chk-sign-input {
  border: none;
  border-bottom: 1px dashed #94a3b8;
  background: transparent;
  padding: 1px 4px;
  font-size: 11px;
  color: #0f172a;
  font-weight: 500;
  width: 65%;
}

.chk-sign-input:focus {
  outline: none;
  border-bottom: 1.5px solid #0284c7;
  background: rgba(2, 132, 199, 0.05);
}

.chk-signoff-table th {
  background: #f1f5f9;
  color: #0284c7;
  font-weight: 700;
  text-align: center;
}

.chk-signoff-table td {
  border: 1px solid #94a3b8;
}

@media print {
  .page {
    page-break-after: always !important;
    break-after: page !important;
  }
  .mos-page-footer-bar {
    display: flex !important;
  }
  .chk-master-table {
    min-width: 100% !important;
    font-size: 8.5pt !important;
    border: 2px solid #0284c7 !important;
  }
  .chk-interactive-box {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .chk-sign-input, .chk-comment-input, .chk-notes-textarea {
    border: none !important;
    background: transparent !important;
  }
  .mos-cover-page {
    border: none !important;
    box-shadow: none !important;
    padding: 14mm 12mm !important;
    min-height: 94vh !important;
  }
  .mos-toc-page {
    border: none !important;
    box-shadow: none !important;
    padding: 12mm 12mm !important;
    min-height: 94vh !important;
  }
  .mos-document-body {
    border: none !important;
    box-shadow: none !important;
    padding: 12mm 12mm !important;
  }
  .mos-approval-page {
    border: none !important;
    box-shadow: none !important;
    padding: 12mm 12mm !important;
  }
  .mos-section {
    page-break-inside: avoid;
    break-inside: avoid;
  }
  .mos-print-layout-table {
    width: 100% !important;
    border: none !important;
  }
  .mos-print-layout-table thead {
    display: table-header-group !important;
  }
  .mos-print-layout-table tfoot {
    display: table-footer-group !important;
  }
  .mos-page-num-counter::after,
  .chk-page-num-counter::after {
    content: counter(page);
  }
}

.chk-page-num-counter::after,
.mos-page-num-counter::after {
  content: counter(page);
}

.chk-master-table tfoot.chk-table-footer-group {
  display: table-footer-group !important;
}

/* Multi-page MOS Layout Table for Repeated Header & Footer */
.mos-print-layout-table {
  width: 100%;
  border-collapse: collapse;
  border: none;
}
.mos-print-layout-table thead.mos-table-header-group {
  display: table-header-group !important;
}
.mos-print-layout-table tfoot.mos-table-footer-group {
  display: table-footer-group !important;
}
.mos-print-layout-table thead th,
.mos-print-layout-table tfoot td,
.mos-print-layout-table tbody td {
  border: none !important;
  background: transparent !important;
}

/* Disabled document and category styles */
.doc-tile.disabled-tile,
.doc-tile[disabled] {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  filter: grayscale(80%);
}
.doc-tile-badge.badge-disabled {
  background: #f1f5f9 !important;
  color: #94a3b8 !important;
  border: 1px solid #cbd5e1 !important;
}
.group-tab-btn.disabled,
.group-tab-btn[disabled] {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  /* Prevent automatic iOS Safari zoom on input focus */
  input, 
  select, 
  textarea, 
  .input-control, 
  .form-input, 
  .form-select, 
  .chat-composer-input, 
  .refine-input-field,
  .prompt-textarea {
    font-size: 16px !important;
  }

  .meta-form-grid {
    grid-template-columns: 1fr;
  }
  .corp-header-block {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .project-info-grid {
    grid-template-columns: 1fr;
  }
  .approval-grid {
    grid-template-columns: 1fr 1fr;
  }
  .strategy-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .strategy-toolbar-right {
    justify-content: flex-start;
  }

  /* Step 3 Action Buttons on Mobile */
  .results-actions-right {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
  }
  .results-actions-right .action-btn-sm {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
    min-height: 40px;
    padding: 8px 10px;
    font-size: 12px;
  }
  .results-actions-right .orientation-badge {
    width: 100%;
    justify-content: center;
    margin-bottom: 2px;
  }

  /* Document Table Horizontal Scroll on Mobile */
  .output-document-box {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
  }
  .corp-itp-table {
    min-width: 680px;
  }

  /* Chatbot on Mobile */
  .chat-messages-stream {
    max-height: 55vh;
    min-height: 280px;
    padding: 14px 12px;
    gap: 12px;
  }
  .chat-msg-row {
    gap: 8px;
  }
  .chat-bot-bubble {
    max-width: 90%;
    padding: 12px 14px;
  }
  .chat-user-bubble {
    max-width: 88%;
    padding: 10px 14px;
  }
  .chat-composer-wrap {
    padding: 10px 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  .chat-composer-form {
    gap: 6px;
  }
  .chat-skip-btn {
    padding: 0 10px;
    font-size: 11px;
  }
}

/* ── PWA & NATIVE MOBILE APP BUNDLING SUPPORT ────────────────────────────── */

/* Safe Area Insets for iOS Notches & Android Gesture Bars */
html, body {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

.app-header {
  padding-top: max(0px, env(safe-area-inset-top));
  padding-left: max(0px, env(safe-area-inset-left));
  padding-right: max(0px, env(safe-area-inset-right));
}

/* Standalone PWA & Native App Mode (iOS Home Screen / Android TWA / Cordova) */
@media (display-mode: standalone), (display-mode: fullscreen) {
  .app-header {
    padding-top: max(12px, env(safe-area-inset-top));
  }
  .ad-rail, 
  .ad-mobile-slot {
    display: none !important;
  }
  .app-central-col {
    max-width: 100% !important;
  }
}

body.pwa-standalone .ad-rail,
body.pwa-standalone .ad-mobile-slot {
  display: none !important;
}

body.pwa-standalone .app-header {
  padding-top: max(12px, env(safe-area-inset-top));
}

/* In-App PWA Install Button */
.btn-install-pwa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
  animation: pulseInstallBtn 3s infinite ease-in-out;
}

.btn-install-pwa:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45);
}

.btn-install-pwa:active {
  transform: scale(0.97);
}

.btn-install-pwa i {
  font-size: 13px;
}

@keyframes pulseInstallBtn {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
  }
  50% {
    box-shadow: 0 0 14px rgba(37, 99, 235, 0.6);
  }
}

@media (max-width: 600px) {
  .btn-install-pwa {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
  }
  .btn-install-pwa .btn-install-text {
    display: none !important;
  }
  .btn-install-pwa i {
    font-size: 14px;
    margin: 0;
  }
}

@media (max-width: 380px) {
  .btn-install-pwa {
    width: 29px;
    height: 29px;
    min-width: 29px;
    min-height: 29px;
    border-radius: 6px;
  }
  .btn-install-pwa i {
    font-size: 13px;
  }
}

/* Offline Connectivity Banner */
.offline-indicator-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  animation: slideUpToast 0.25s ease-out;
  pointer-events: none;
}

.offline-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #b45309;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.offline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fef08a;
  animation: pulseDot 1.5s infinite;
}

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

/* iOS PWA Installation Guide Modal */
.pwa-install-modal {
  max-width: 440px !important;
  border-radius: 18px !important;
  overflow: hidden;
}

.pwa-guide-body {
  padding: 20px !important;
}

.pwa-app-preview-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
}

.pwa-app-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.pwa-app-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pwa-app-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-app-subtitle {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-app-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: #10b981;
  margin-top: 2px;
}

.pwa-guide-desc {
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.5;
  margin-bottom: 16px;
}

.pwa-steps-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pwa-step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.pwa-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.pwa-step-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text-main);
}

.pwa-icon-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  width: fit-content;
}

/* Touch feedback for mobile */
button:active, 
.doc-tile:active,
.group-tab-btn:active,
.btn-icon-toggle:active {
  transform: scale(0.98);
}

/* ── PUSH NOTIFICATION BANNER (iOS & Android Style) ───────────────────────── */
.push-notification-banner {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  width: calc(100% - 24px);
  max-width: 440px;
  animation: pushBannerSlideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
}

@keyframes pushBannerSlideDown {
  0% {
    transform: translate(-50%, -130%);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

.push-notification-card {
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

[data-theme="light"] .push-notification-card {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(37, 99, 235, 0.15);
  color: #0f172a;
}

.push-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.push-app-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.push-app-icon {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  object-fit: cover;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.push-app-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

[data-theme="light"] .push-app-name {
  color: #64748b;
}

.push-time {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}

.push-card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.push-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
}

[data-theme="light"] .push-title {
  color: #0f172a;
}

.push-desc {
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.45;
}

[data-theme="light"] .push-desc {
  color: #475569;
}

.push-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.btn-push-view {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
  transition: opacity 0.15s ease;
}

.btn-push-view:hover {
  opacity: 0.92;
}

.btn-push-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-push-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

[data-theme="light"] .btn-push-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #0f172a;
}

.btn-icon-toggle.active-bell {
  color: #3b82f6 !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
  background: rgba(59, 130, 246, 0.1) !important;
}




/* ==========================================================================
   CATALYST FIRST-SCREEN REDESIGN: HERO, ONE-BOX GENERATOR, SAMPLES, DEMO
   Clean Engineering Aesthetic · Zero-Pill Discipline · Mobile-Optimized
   ========================================================================== */

/* ── 1. HERO SECTION ─────────────────────────────────────────────────────── */
.hero-section {
  padding: 40px 20px 24px 20px;
  text-align: center;
  max-width: 920px;
  margin: 0 auto;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 14px;
}

.hero-title {
  font-size: clamp(26px, 4.2vw, 42px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.025em;
  color: var(--text-main);
  margin-bottom: 16px;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.hero-subtitle {
  font-size: clamp(15px, 2vw, 17.5px);
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 740px;
  margin: 0 auto 24px auto;
  font-weight: 400;
}

.hero-cta-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.btn-hero-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #ffffff;
  padding: 13px 30px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35), 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn-hero-primary:hover {
  background: linear-gradient(135deg, #1e40af, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
  color: #ffffff;
}

.btn-hero-primary:active {
  transform: translateY(1px);
}

/* Zero-Pill Trust Points */
.hero-trust-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 0;
}

.hero-trust-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--text-main);
}

.hero-trust-item i {
  color: #10b981;
  font-size: 14px;
}

.hero-trust-dot {
  color: var(--border-strong);
  user-select: none;
}

/* ── 2. ONE-BOX GENERATOR ───────────────────────────────────────────────── */
.onebox-section {
  max-width: 920px;
  margin: 0 auto 36px auto;
  padding: 0 16px;
}

.onebox-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
  padding: 24px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.onebox-card:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 10px 36px rgba(37, 99, 235, 0.12);
}

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

.onebox-label-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.onebox-icon-badge {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.onebox-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
}

.onebox-doc-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.onebox-select-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.onebox-select {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-width: 190px;
}

.onebox-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.onebox-input-group {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.onebox-textarea {
  width: 100%;
  min-height: 92px;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-main);
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  resize: vertical;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.onebox-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.15);
}

.onebox-textarea::placeholder {
  color: var(--text-light);
  font-size: 14.5px;
}

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

.onebox-hint-text {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-onebox-generate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 26px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-onebox-generate:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(37, 99, 235, 0.4);
}

.btn-onebox-generate:active {
  transform: translateY(1px);
}

.btn-onebox-generate:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* 8 Clickable Example Chips */
.onebox-chips-container {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.onebox-chips-header {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.onebox-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.onebox-chip {
  background: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.onebox-chip:hover {
  background: var(--primary-light);
  border-color: rgba(37, 99, 235, 0.4);
  color: var(--primary);
  transform: translateY(-1px);
}

.onebox-chip i {
  color: var(--text-muted);
  font-size: 13px;
  transition: color 0.15s ease;
}

.onebox-chip:hover i {
  color: var(--primary);
}

/* Switch link under generator */
.onebox-footer {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.onebox-switch-link {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease, opacity 0.15s ease;
}

.onebox-switch-link:hover {
  color: var(--primary-hover);
  opacity: 0.9;
}

/* Back to one-box banner inside wizard */
.wizard-return-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary-light);
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-main);
}

.btn-return-onebox {
  background: var(--bg-surface);
  color: var(--primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-return-onebox:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* ── 3. SAMPLE OUTPUTS SECTION ("See real examples") ─────────────────────── */
.samples-section {
  max-width: 920px;
  margin: 0 auto 40px auto;
  padding: 0 16px;
}

.section-header-block {
  margin-bottom: 18px;
}

.section-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
  display: block;
}

.section-main-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.section-main-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

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

.sample-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--card-shadow);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.sample-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
}

.sample-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.sample-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.sample-card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.sample-card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.sample-card-preview {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-muted);
  min-height: 96px;
}

.sample-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.sample-mini-table th {
  text-align: left;
  padding: 4px 6px;
  border-bottom: 1px solid var(--border-strong);
  color: var(--text-main);
  font-weight: 700;
}

.sample-mini-table td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--border);
}

.sample-mini-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sample-mini-list-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.sample-mini-list-item i {
  color: #10b981;
  font-size: 12px;
  margin-top: 2px;
}

.btn-sample-view {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg-surface);
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-sample-view:hover {
  background: var(--primary);
  color: #ffffff;
}

/* ── 4. DEMO SECTION ─────────────────────────────────────────────────────── */
.demo-section {
  max-width: 920px;
  margin: 0 auto 40px auto;
  padding: 0 16px;
}

.demo-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.demo-chrome-bar {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.demo-chrome-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.demo-chrome-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-strong);
}

.demo-chrome-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.demo-frame-container {
  position: relative;
  width: 100%;
  background: #090d16;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.demo-media {
  width: 100%;
  height: auto;
  max-height: 440px;
  object-fit: contain;
  display: block;
}

.demo-placeholder-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: #f8fafc;
  z-index: 2;
  gap: 12px;
}

.demo-play-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.9);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  padding-left: 4px;
  box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.25);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.demo-play-circle:hover {
  transform: scale(1.08);
  background: #2563eb;
  box-shadow: 0 0 0 12px rgba(37, 99, 235, 0.35);
}

.demo-placeholder-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.demo-placeholder-sub {
  font-size: 13px;
  color: #94a3b8;
  max-width: 480px;
  line-height: 1.45;
}

.demo-duration-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.12);
  padding: 3px 10px;
  border-radius: 4px;
}

/* ── RESPONSIVE ADAPTATIONS (< 860px and < 600px) ────────────────────────── */
@media (max-width: 860px) {
  .samples-cards-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .hero-section {
    padding: 28px 16px 18px 16px;
  }

  .onebox-card {
    padding: 18px 16px;
  }

  .onebox-action-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-onebox-generate {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 540px) {
  .hero-title {
    font-size: 24px;
  }

  .hero-subtitle {
    font-size: 14.5px;
  }

  .hero-trust-bar {
    font-size: 12px;
    gap: 6px;
  }

  .onebox-doc-select-wrap {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .onebox-select {
    width: 100%;
  }

  .onebox-chips-grid {
    gap: 6px;
  }

  .onebox-chip {
    font-size: 11.5px;
    padding: 5px 10px;
  }
}

/* ── ONE-BOX COUNTER & REALTIME LOADING PROGRESS ──────────────────────────── */
.onebox-hint-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.onebox-char-counter {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-mono);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  user-select: none;
}

.onebox-char-counter.warning {
  color: #ea580c;
  border-color: #fdba74;
}

.onebox-char-counter.exceeded {
  color: #ef4444;
  border-color: #fca5a5;
  font-weight: 700;
}

.loading-progress-stage {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.loading-progress-stage.fade {
  opacity: 0.3;
  transform: translateY(-2px);
}

/* ══════════════════════════════════════════════════════════════════════════════
   LANDING VIEW & EXECUTION STUDIO PAGE SEPARATION
   ══════════════════════════════════════════════════════════════════════════════ */
.landing-page-view {
  display: block;
  width: 100%;
  animation: fadeIn 0.25s ease-out;
}

.execution-page-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  animation: fadeIn 0.25s ease-out;
}

.execution-page-view.hidden,
.landing-page-view.hidden,
.hidden {
  display: none !important;
}

/* ── STUDIO TOP BAR ──────────────────────────────────────────────────────── */
.studio-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.btn-studio-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-studio-back:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--primary);
}

.studio-title-badge-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.studio-title-text {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.studio-status-pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 100px;
  background: rgba(2, 132, 199, 0.12);
  color: var(--primary);
  border: 1px solid rgba(2, 132, 199, 0.25);
  font-family: var(--font-mono);
}

.studio-toggle-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.studio-toggle-mode-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-main);
  background: var(--bg-subtle);
}

/* ── STUDIO COMPOSER SECTION ─────────────────────────────────────────────── */
.studio-composer-section {
  width: 100%;
}

.studio-composer-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

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

.studio-field-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.studio-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.studio-select {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
}

.studio-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.studio-textarea-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.studio-textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  min-height: 84px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.studio-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

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

.studio-hint-text {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-studio-generate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: none;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
  transition: all 0.15s ease;
}

.btn-studio-generate:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.4);
}

.studio-chips-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.studio-chips-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 4px;
}

.studio-mini-chip {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.studio-mini-chip:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* ── TEMPLATES SPOTLIGHT ON LANDING PAGE ─────────────────────────────────── */
.templates-spotlight-section {
  margin-top: 48px;
  margin-bottom: 24px;
}

.templates-spotlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.spotlight-disc-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}

.spotlight-disc-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.spotlight-disc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.spotlight-doc-count {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.spotlight-links-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spotlight-links-list li a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  transition: color 0.15s ease;
}

.spotlight-links-list li a i {
  color: var(--primary);
  font-size: 13px;
}

.spotlight-links-list li a:hover {
  color: var(--primary);
}

.spotlight-browse-btn {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: inline-block;
}

.spotlight-browse-btn:hover {
  text-decoration: underline;
}

.templates-spotlight-cta {
  text-align: center;
  margin-top: 28px;
}

.btn-browse-all-templates {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1.5px solid var(--primary);
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  padding: 11px 24px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.12);
  transition: all 0.2s ease;
}

.btn-browse-all-templates:hover {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
}

/* ── 4-COLUMN FOOTER LINKS ───────────────────────────────────────────────── */
.footer-links-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 28px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

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

@media (max-width: 540px) {
  .footer-links-grid {
    grid-template-columns: 1fr;
  }
}

.footer-brand-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.01em;
  display: block;
  margin-bottom: 8px;
}

.footer-brand-title span {
  color: #ea580c;
}

.footer-brand-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}

.footer-trust-tags {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  color: #10b981;
  font-weight: 600;
}

.footer-col-heading {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-main);
  margin-bottom: 12px;
}

.footer-links-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.footer-links-list li a {
  font-size: 12.5px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-links-list li a:hover {
  color: var(--primary);
}

.footer-copyright-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 14px;
  flex-wrap: wrap;
}

.header-templates-btn {
  color: var(--primary) !important;
}

