/* Image2CNC Studio - Pro Max Industrial Dark CAD/CAM Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Surface Layers (Ultra Premium Dark) */
  --bg-app: #09090b;
  --bg-header: rgba(9, 9, 11, 0.85);
  --bg-sidebar: #121214;
  --bg-card: #18181b;
  --bg-card-hover: #27272a;
  --bg-input: #09090b;
  --bg-glass: rgba(24, 24, 27, 0.65);

  /* Borders & Dividers */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-card: rgba(255, 255, 255, 0.12);
  --border-card-hover: rgba(255, 255, 255, 0.2);
  --border-focus: #3b82f6;
  --border-active: #60a5fa;

  /* Typography Colors */
  --text-pure: #ffffff;
  --text-main: #e4e4e7;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;

  /* Accents */
  --accent-cyan: #22d3ee;
  --accent-blue: #3b82f6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;

  /* Gradients & Shadows */
  --gradient-brand: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --gradient-amber: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);
  --inner-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.08);

  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Monaco, Consolas, monospace;
}

/* Global Smooth Transitions */
button, input, select, .pro-card, .accordion-box, .export-card-tile {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Safari & Browser Global Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Force Safari Button & Input Resets */
button {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  outline: none;
  font-family: inherit;
  cursor: pointer;
}

input, select {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  outline: none;
  font-family: inherit;
}

/* ============================================================
   TOP NAVIGATION BAR
   ============================================================ */
.top-nav {
  height: 52px;
  background: var(--bg-header);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  z-index: 100;
  flex-shrink: 0;
}

/* Brand Section */
.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
}

.brand-badge-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0e1626, #1b263b);
  border: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm), var(--inner-highlight);
}

.brand-badge-icon svg {
  width: 18px;
  height: 18px;
  fill: var(--accent-cyan);
  filter: drop-shadow(0 0 5px rgba(6, 182, 212, 0.6));
}

.brand-text-block {
  display: flex;
  flex-direction: column;
}

.brand-main-line {
  display: flex;
  align-items: center;
  gap: 7px;
}

.brand-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-pure);
  letter-spacing: -0.3px;
}

.brand-title span {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.pro-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--gradient-brand);
  color: #ffffff;
  text-transform: uppercase;
  box-shadow: var(--shadow-glow);
}

.brand-subline {
  font-size: 10.5px;
  color: var(--text-dim);
}

/* Center Viewport Switcher Tabs (Segmented Control) */
.nav-center-segment {
  display: flex;
  background: #080c14;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}

.segment-tab-btn {
  background: transparent;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.segment-tab-btn:hover {
  color: var(--text-pure);
  background: rgba(255, 255, 255, 0.04);
}

.segment-tab-btn.active {
  background: var(--bg-card);
  color: var(--text-pure);
  border: 1px solid var(--border-card-hover);
  box-shadow: var(--shadow-md), var(--inner-highlight);
  font-weight: 600;
  transform: translateY(-1px);
}

.segment-tab-btn.active .tab-ico {
  color: var(--accent-cyan);
}

.tab-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 9999px;
  font-size: 9.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  margin-right: 2px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.segment-tab-btn:hover .tab-step-badge {
  background: rgba(255, 255, 255, 0.16);
  color: var(--text-pure);
}

.segment-tab-btn.active .tab-step-badge {
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
}

.nav-segment-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.12);
  margin: auto 4px;
  align-self: center;
}

.nav-secondary-tab {
  opacity: 0.82;
  font-size: 11.5px;
}

.nav-secondary-tab:hover,
.nav-secondary-tab.active {
  opacity: 1;
}

/* Right Actions */
.nav-right-cluster {
  display: flex;
  align-items: center;
  gap: 9px;
}

.btn-header-tool {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}

.btn-header-tool:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  color: var(--text-pure);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-header-tool.amber {
  background: rgba(245, 158, 11, 0.08);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.28);
}

.btn-header-tool.amber:hover {
  background: rgba(245, 158, 11, 0.16);
  border-color: #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

.engine-status-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(16, 185, 129, 0.08);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.22);
  padding: 5px 10px;
  border-radius: 16px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseLight 2s infinite;
}

@keyframes pulseLight {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
}

/* ============================================================
   MAIN LAYOUT & SIDEBAR
   ============================================================ */
.main-workspace {
  display: flex;
  flex: 1;
  height: calc(100vh - 52px);
  overflow: hidden;
  position: relative;
}

/* Left Sidebar */
.sidebar {
  width: 360px;
  height: 100%;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  z-index: 20;
}

.sidebar-content-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 12px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-content-scroll::-webkit-scrollbar {
  width: 5px;
}
.sidebar-content-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-content-scroll::-webkit-scrollbar-thumb {
  background: var(--border-card);
  border-radius: 4px;
}
.sidebar-content-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--border-card-hover);
}

/* Section Container Cards */
.pro-card {
  background: rgba(24, 24, 27, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-header-caption {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Workflow Presets Bar */
.workflow-pills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.preset-chip-btn {
  background: rgba(24, 24, 27, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  padding: 5px 6px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.preset-chip-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-pure);
  transform: translateY(-1px);
}

.preset-chip-btn.active {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2), inset 0 1px 0 rgba(255,255,255,0.1);
  font-weight: 600;
  transform: translateY(-1px);
}

/* Source Upload Zone */
.upload-drop-tile {
  border: 1.5px dashed rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(180deg, rgba(24, 24, 27, 0.4) 0%, rgba(9, 9, 11, 0.6) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.upload-drop-tile::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.03), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s;
  pointer-events: none;
}

.upload-drop-tile:hover::after {
  transform: translateX(100%);
}

.upload-drop-tile:hover, .upload-drop-tile.dragover {
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.08);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
  transform: translateY(-2px);
}

.drop-icon-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(14, 165, 233, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  font-size: 15px;
  flex-shrink: 0;
  pointer-events: none;
}

.drop-text-content {
  text-align: left;
  pointer-events: none;
}

.drop-text-main {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-pure);
  pointer-events: none;
}

.drop-text-sub {
  font-size: 10px;
  color: var(--text-dim);
  pointer-events: none;
}

/* Sample Design Quick Buttons */
.samples-row-wrap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding-bottom: 2px;
}

.sample-pill-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  padding: 4px 6px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 500;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s;
}

.sample-pill-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-pure);
  border-color: var(--border-card-hover);
}

.sample-pill-btn.active {
  background: rgba(6, 182, 212, 0.16);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 600;
}

/* Active Image Thumbnail (Strictly Constrained) */
.image-thumbnail-card {
  position: relative;
  background: #050810;
  border-radius: 7px;
  border: 1px solid var(--border-card);
  overflow: hidden;
  display: none;
}

.image-thumbnail-card img {
  width: 100%;
  height: 85px;
  max-height: 85px;
  object-fit: contain;
  display: block;
}

.image-thumbnail-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10, 13, 22, 0.9);
  backdrop-filter: blur(4px);
  padding: 3px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* AI Self-Learning Insights Card */
.ai-status-strip {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(6, 182, 212, 0.05) 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 9px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-status-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-status-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-pure);
}

.ai-status-archetype {
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
}

.ai-status-pill {
  font-size: 10px;
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  padding: 2px 7px;
  border-radius: 10px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Collapsible Accordion Panels */
.accordion-box {
  background: rgba(24, 24, 27, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-box:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.accordion-trigger {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.accordion-label-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-pure);
}

.accordion-arrow {
  font-size: 9px;
  color: var(--text-dim);
  transition: transform 0.2s ease;
}

.accordion-box.collapsed .accordion-arrow {
  transform: rotate(-90deg);
}

.accordion-box.collapsed .accordion-content {
  display: none;
}

.accordion-content {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border-subtle);
}

/* Form Rows & Inputs */
.pro-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pro-field-label {
  font-size: 11.5px;
  color: var(--text-muted);
  flex: 1;
}

.pro-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pro-text-input {
  background: var(--bg-input);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-pure);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-family: var(--font-mono);
  width: 100px;
  text-align: right;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}

.pro-text-input:focus {
  border-color: var(--accent-blue);
  background: #0f172a;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25), inset 0 1px 2px rgba(0,0,0,0.2);
  outline: none;
}

select.pro-text-input {
  width: 150px;
  text-align: left;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='%2394a3b8'%3E%3Cpath d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 22px;
}

.pro-unit-tag {
  position: absolute;
  right: 7px;
  font-size: 10.5px;
  color: var(--text-dim);
  pointer-events: none;
  font-family: var(--font-mono);
}

/* Modern Pill Toggle Switch */
.pro-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
}

.pill-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 19px;
}

.pill-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.pill-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pill-slider::before {
  position: absolute;
  content: "";
  height: 13px;
  width: 13px;
  left: 2px;
  bottom: 2px;
  background-color: var(--text-dim);
  border-radius: 50%;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pill-switch input:checked + .pill-slider {
  background-color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

.pill-switch input:checked + .pill-slider::before {
  transform: translateX(17px);
  background-color: #ffffff;
}

/* Sticky Action Footer (Generate Button) */
.sidebar-sticky-footer {
  position: relative;
  width: 100%;
  flex-shrink: 0;
  padding: 12px 14px;
  background: rgba(14, 19, 31, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  z-index: 30;
}

.btn-generate-hero {
  width: 100%;
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--gradient-brand);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-generate-hero:hover {
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn-generate-hero:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.btn-generate-hero:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.kbd-badge {
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ============================================================
   CENTER VIEWPORT WORKSPACE
   ============================================================ */
.viewport-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-app);
  position: relative;
  overflow: hidden;
}

.tab-pane {
  flex: 1;
  display: none;
  height: 100%;
  position: relative;
}

.tab-pane.active {
  display: flex;
  flex-direction: column;
}

/* 2D CAD Canvas */
#canvas2d-container {
  width: 100%;
  height: 100%;
  position: relative;
  background: radial-gradient(circle at center, #101726 0%, #060911 100%);
}

#cad2d-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Floating CAD Toolbar */
.cad-floating-toolbar {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 4px;
  display: flex;
  gap: 3px;
  box-shadow: var(--shadow-md);
  z-index: 10;
}

.cad-tool-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.15s;
}

.cad-tool-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-pure);
}

.cad-tool-btn.active {
  background: rgba(14, 165, 233, 0.2);
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
}

/* Floating Layer Visibility Legend (Top Right) */
.cad-layer-tray {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  z-index: 10;
  box-shadow: var(--shadow-md);
}

.cad-layer-btn {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-family: var(--font-sans);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.cad-layer-btn:hover {
  background: rgba(30, 41, 59, 0.95);
  transform: translateY(-1px);
}
.cad-layer-btn.dim {
  opacity: 0.45;
}
.cad-layer-btn.active {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.layer-chip-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s;
}

.layer-chip-toggle:hover {
  color: var(--text-pure);
}

.dot-color {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.dot-color.outer { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.dot-color.inner { background: #f59e0b; box-shadow: 0 0 6px #f59e0b; }
.dot-color.offset { background: #ec4899; box-shadow: 0 0 6px #ec4899; }
.dot-color.stock { background: #06b6d4; box-shadow: 0 0 6px #06b6d4; }

/* Dynamic Coordinates HUD */
.cad-coords-indicator {
  position: absolute;
  bottom: 10px;
  left: 36px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  z-index: 10;
}

.cad-coords-indicator span {
  color: var(--accent-cyan);
  font-weight: 600;
}

/* 3D Relief Viewport */
#canvas3d-container {
  width: 100%;
  height: 100%;
  position: relative;
  background: radial-gradient(circle at center, #111a2e 0%, #060911 100%);
  overflow: hidden;
}

#canvas3d-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  outline: none;
}

#canvas3d-container::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 65%, rgba(6, 9, 17, 0.55) 100%);
  z-index: 2;
}

/* Floating 3D Material & View Dock */
.view3d-glass-dock {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: 9px;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  gap: 3px;
  z-index: 10;
  box-shadow: var(--shadow-lg);
  max-width: calc(100% - 24px);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.view3d-glass-dock::-webkit-scrollbar {
  height: 3px;
}
.view3d-glass-dock::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.mat-pill-btn {
  background: transparent;
  color: var(--text-muted);
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
  white-space: nowrap;
}

.mat-pill-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-pure);
}

.mat-pill-btn.active {
  background: rgba(14, 165, 233, 0.2);
  color: #ffffff;
  border: 1px solid var(--border-focus);
  font-weight: 600;
}

.dock-v-line {
  width: 1px;
  height: 18px;
  background: var(--border-card);
  margin: 0 4px;
}

.dock-cluster {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 4px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.dock-select {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.dock-select:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-pure);
  border-color: var(--border-card-hover);
}

.dock-select:focus {
  border-color: var(--border-focus);
  color: var(--text-pure);
}

.dock-select option {
  background: #121214;
  color: var(--text-main);
}

/* 3D Mesh Health HUD */
.mesh-hud-tray {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: 7px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}

.mesh-hud-col {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
}

.mesh-hud-col .hud-val {
  font-weight: 600;
  font-family: var(--font-mono);
  color: #38bdf8;
}

.mesh-hud-col .hud-val.green {
  color: #34d399;
}

/* Floating Cross-Section Depth Profile Drawer */
.slice-profile-drawer {
  position: absolute;
  bottom: 14px;
  left: 14px;
  width: 360px;
  background: rgba(10, 15, 28, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: 9px;
  padding: 10px 12px;
  z-index: 15;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: slide-up-fade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.slice-profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slice-axis-pills {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  padding: 2px;
  gap: 2px;
}

.slice-axis-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 9.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.slice-axis-btn:hover {
  color: #fff;
}

.slice-axis-btn.active {
  background: rgba(14, 165, 233, 0.3);
  color: #38bdf8;
}

.slice-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  transition: all 0.15s;
}

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

.slice-metrics-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  border-top: 1px solid rgba(51, 65, 85, 0.3);
  padding-top: 5px;
}

/* ============================================================
   CNC SIMULATOR VIEW
   ============================================================ */
.simulator-layout {
  display: flex;
  width: 100%;
  height: 100%;
}

.sim-viewport {
  flex: 1;
  height: 100%;
  position: relative;
  background: radial-gradient(circle at center, #101728 0%, #060911 100%);
  overflow: hidden;
}

.sim-viewport::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 70%, rgba(6, 9, 17, 0.55) 100%);
  z-index: 2;
}

.sim-controls-panel {
  width: 310px;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border-subtle);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

/* Haas Style DRO Card */
.dro-display-card {
  background: #050810;
  border: 1px solid var(--border-card);
  border-radius: 9px;
  padding: 12px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.9);
}

.dro-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 5px;
}

.dro-caption {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
}

.dro-status-led {
  font-size: 9.5px;
  font-weight: 800;
  color: #10b981;
}

.dro-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}

.axis-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.axis-badge.x { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.axis-badge.y { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.axis-badge.z { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }

.axis-digits {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-pure);
  letter-spacing: 0.8px;
}

.dro-state-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
}
.dro-state-badge.idle { background: rgba(6, 182, 212, 0.15); color: #06b6d4; border: 1px solid rgba(6, 182, 212, 0.4); }
.dro-state-badge.rapid-g0, .dro-state-badge.rapid { background: rgba(245, 158, 11, 0.18); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.dro-state-badge.cutting-g1, .dro-state-badge.feed-g1 { background: rgba(16, 185, 129, 0.18); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.dro-state-badge.alarm, .dro-state-badge.e-stop { background: rgba(239, 68, 68, 0.25); color: #f87171; border: 1px solid #ef4444; animation: blink-alarm 0.8s infinite alternate; }

@keyframes blink-alarm {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0.65; transform: scale(0.97); }
}

.dro-telemetry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.dro-tele-item {
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.6);
  padding: 5px 7px;
  border-radius: 5px;
  border: 1px solid rgba(51, 65, 85, 0.35);
}

.dro-tele-label {
  font-size: 8.5px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.dro-tele-val {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  margin-top: 1px;
}

/* Simulator Kinematic & Safety Clearance Card */
.sim-safety-card {
  background: #050810;
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.7);
}

.sim-safety-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 5px;
}

.sim-safety-title {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
}

.badge-safe {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-hazard {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.22);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.5);
  animation: blink-alarm 0.8s infinite alternate;
}

.sim-safety-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.sim-safety-item {
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.6);
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid rgba(51, 65, 85, 0.35);
}

.sim-safety-k {
  font-size: 8px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.4px;
}

.sim-safety-v {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: #38bdf8;
  margin-top: 1px;
}

/* Simulator Timeline Slider */
.sim-timeline-box {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sim-slider-bar {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: var(--bg-input);
  outline: none;
}

.sim-slider-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 6px var(--accent-cyan);
}

.sim-btn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  margin-top: 3px;
}

.sim-btn-action {
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.15s;
}

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

.sim-btn-action.play {
  background: rgba(14, 165, 233, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  flex: 1;
}

.sim-btn-action.active {
  background: rgba(14, 165, 233, 0.25);
  border-color: var(--accent-cyan);
  color: #38bdf8;
  box-shadow: 0 0 8px rgba(14, 165, 233, 0.35);
}

.sim-btn-action.estop {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
  font-weight: 700;
  transition: all 0.2s;
}

.sim-btn-action.estop:hover {
  background: rgba(239, 68, 68, 0.28);
  border-color: #ef4444;
  color: #fff;
}

.sim-btn-action.estop.active {
  background: #ef4444;
  border-color: #b91c1c;
  color: #fff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.8);
  animation: blink-alarm 0.8s infinite alternate;
}

/* Virtual Jog Pad */
.jog-pad-box {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: auto;
}

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

.jog-key-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  color: var(--text-pure);
  height: 32px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.jog-key-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-card-hover);
}

.jog-key-btn.origin {
  background: rgba(245, 158, 11, 0.14);
  color: #facc15;
  border-color: rgba(245, 158, 11, 0.35);
}

/* ============================================================
   EXPORT SUITE VIEW
   ============================================================ */
.export-workspace {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.export-hero-banner {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.14) 0%, rgba(6, 182, 212, 0.04) 100%);
  border: 1px solid rgba(14, 165, 233, 0.35);
  border-radius: 12px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.export-hero-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 3px;
}

.export-hero-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-zip-hero {
  background: var(--gradient-brand);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.4);
  transition: all 0.2s;
}

.btn-zip-hero:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(6, 182, 212, 0.55);
}

.export-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.export-card-tile {
  background: rgba(24, 24, 27, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.export-card-tile:hover {
  border-color: var(--accent-blue);
  background: rgba(39, 39, 42, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.export-badge-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ext-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.btn-download-file {
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  color: var(--text-pure);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
}

.btn-download-file:hover {
  background: rgba(14, 165, 233, 0.2);
  border-color: var(--accent-cyan);
  color: #ffffff;
}

.btn-zip-hero.ready {
  background: linear-gradient(135deg, #059669 0%, #10b981 50%, #06b6d4 100%);
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.45);
  border: 1px solid rgba(52, 211, 153, 0.6);
}

.btn-zip-hero.action-gen {
  background: linear-gradient(135deg, #0284c7 0%, #06b6d4 50%, #3b82f6 100%);
  box-shadow: 0 4px 18px rgba(6, 182, 212, 0.45);
  cursor: pointer;
}

.btn-zip-hero.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #27272a;
  box-shadow: none;
}

.btn-download-file.ready {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(52, 211, 153, 0.5);
  color: #34d399;
  cursor: pointer;
}

.btn-download-file.ready:hover {
  background: rgba(16, 185, 129, 0.28);
  border-color: #34d399;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.35);
}

.btn-download-file.action-gen {
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.4);
  color: #22d3ee;
  cursor: pointer;
}

.btn-download-file.action-gen:hover {
  background: rgba(6, 182, 212, 0.24);
  border-color: #22d3ee;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.35);
}

.btn-download-file.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.08);
}

/* ============================================================
   MODALS & OVERLAYS
   ============================================================ */
.modal-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-window {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 22px;
  width: 460px;
  max-width: 95vw;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-text {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 7px;
}

.modal-close-icon {
  background: transparent;
  color: var(--text-dim);
  font-size: 16px;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* Loading Overlay */
.loading-screen-scrim {
  position: fixed;
  inset: 0;
  background: rgba(8, 11, 17, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 2000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.loading-ring {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(14, 165, 233, 0.15);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spinCycle 0.75s linear infinite;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.35);
}

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

.loading-heading {
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
}

.loading-subtext {
  font-size: 11.5px;
  color: var(--text-dim);
}

/* Modern High-Tech Synthesis Modal */
.cad-synthesis-modal {
  width: 92%;
  max-width: 580px;
  background: rgba(11, 16, 28, 0.96);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8), 0 0 40px rgba(6, 182, 212, 0.18);
  animation: modalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.synthesis-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.synthesis-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.synthesis-ring-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  animation: spinSlow 6s linear infinite;
}

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

.synthesis-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.synthesis-subtitle {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.synthesis-timer {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.3);
  padding: 4px 10px;
  border-radius: 99px;
}

.synthesis-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

.synthesis-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #06b6d4, #3b82f6, #10b981);
  border-radius: 99px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.6);
}

.synthesis-pct-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: -6px;
}

.synthesis-stages-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(6, 10, 18, 0.7);
  border: 1px solid rgba(51, 65, 85, 0.4);
  border-radius: 12px;
  padding: 10px;
}

.synthesis-stage-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.synthesis-stage-item.active {
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.synthesis-stage-item.completed {
  opacity: 0.75;
}

.stage-badge {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(51, 65, 85, 0.5);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.synthesis-stage-item.active .stage-badge {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.5);
}

.synthesis-stage-item.completed .stage-badge {
  background: #059669;
  color: #ffffff;
}

.stage-text-col {
  flex: 1;
}

.stage-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-pure);
}

.stage-desc {
  font-size: 10.5px;
  color: var(--text-dim);
  margin-top: 1px;
}

.stage-status-indicator {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.synthesis-stage-item.active .stage-status-indicator {
  color: #38bdf8;
  animation: pulseCyan 1.5s infinite;
}

.synthesis-stage-item.completed .stage-status-indicator {
  color: #34d399;
}

@keyframes pulseCyan {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.synthesis-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 4px;
}

.btn-synthesis-dismiss {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(71, 85, 105, 0.5);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-synthesis-dismiss:hover {
  background: rgba(51, 65, 85, 0.8);
  color: #ffffff;
  border-color: #38bdf8;
}

/* ============================================================
   STAGE 1: DEEP DESIGN SCANNER WORKSPACE
   ============================================================ */
.scanner-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  position: relative;
  background: #080c14;
  overflow: hidden;
}

/* Scanner Top Bar - Pro-Max Clean Flexbox & Grid */
.scanner-top-bar {
  min-height: 48px;
  height: auto;
  background: rgba(14, 18, 26, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  gap: 10px 14px;
  z-index: 20;
  flex-wrap: wrap;
}

.scanner-header-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 200px;
  max-width: 460px;
  flex-shrink: 0;
  overflow: hidden;
}

.scanner-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.scanner-status-text {
  font-size: 11.5px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: 0.3px;
}

.scanner-radar-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 10px #22d3ee;
  animation: radarBlink 1.5s infinite;
  flex-shrink: 0;
}

@keyframes radarBlink {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 14px #22d3ee; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

.scanner-title-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #22d3ee;
  text-transform: uppercase;
}

.scanner-subtext {
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Scanner Mode Switcher */
.scanner-mode-switch {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.45);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  gap: 3px;
  flex-shrink: 0;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.scanner-mode-switch::-webkit-scrollbar {
  display: none;
}

.scanner-mode-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.scanner-mode-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.scanner-mode-btn.active {
  color: #000;
  background: #22d3ee;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.4);
}

@media (max-width: 1380px) {
  .scanner-top-bar {
    justify-content: space-between;
  }
  .scanner-header-left {
    max-width: 360px;
  }
  .scanner-mode-btn {
    padding: 4px 8px;
    font-size: 10.5px;
  }
}

@media (max-width: 1180px) {
  .scanner-top-bar {
    padding: 6px 10px;
    gap: 8px;
  }
  .scanner-header-left {
    order: 1;
    max-width: calc(100% - 190px);
  }
  .scanner-audit-badge {
    order: 2;
    margin-left: auto;
  }
  .scanner-mode-switch {
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }
}

/* 100% Accuracy Audit Badge */
.scanner-audit-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 8px;
}

.audit-check-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #10b981;
  color: #000;
  font-weight: 800;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.audit-badge-title {
  font-size: 10.5px;
  font-weight: 800;
  color: #34d399;
  letter-spacing: 0.5px;
}

.audit-badge-sub {
  font-size: 9.5px;
  color: #a7f3d0;
}

/* Scanner Viewport */
.scanner-viewport-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #060910;
  padding: 16px;
}

/* Laser Scan Sweep Animation */
.scanner-laser-beam {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, rgba(34, 211, 238, 0.4) 15%, #22d3ee 50%, rgba(34, 211, 238, 0.4) 85%, transparent 100%);
  box-shadow: 0 0 18px #22d3ee, 0 0 32px rgba(34, 211, 238, 0.6);
  z-index: 15;
  pointer-events: none;
  animation: laserScanSweep 2s ease-in-out infinite alternate;
}

@keyframes laserScanSweep {
  0% { top: 4%; }
  100% { top: 96%; }
}

.scanner-display-wrapper {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.scanner-preview-img {
  max-height: calc(100vh - 170px);
  max-width: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(34, 211, 238, 0.25);
}

/* Side-by-Side Split View */
.scanner-split-container {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  max-height: calc(100vh - 170px);
  max-width: 100%;
}

.split-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-height: 100%;
}

.split-pane-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.scanner-split-img {
  max-height: calc(100vh - 200px);
  max-width: 44vw;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--border-card);
}

.scanner-split-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 44vw;
  height: 480px;
  max-height: calc(100vh - 200px);
  background: rgba(14, 18, 26, 0.75);
  border: 1px dashed rgba(34, 211, 238, 0.4);
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  box-sizing: border-box;
}

.split-placeholder-spinner {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(34, 211, 238, 0.2);
  border-top-color: #22d3ee;
  border-radius: 50%;
  animation: cadSpin 1s linear infinite;
  margin-bottom: 16px;
}

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

.split-placeholder-title {
  font-size: 13px;
  font-weight: 600;
  color: #22d3ee;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.split-placeholder-desc {
  font-size: 11px;
  color: var(--text-dim, #94a3b8);
}

/* Scanner HUD Tray */
.scanner-hud-tray {
  position: absolute;
  bottom: 14px;
  left: 16px;
  background: rgba(14, 18, 26, 0.85);
  backdrop-filter: blur(10px);
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-card);
  display: flex;
  gap: 16px;
  z-index: 10;
  font-size: 11px;
}

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

.hud-highlight {
  color: #fff;
  font-weight: 700;
  font-family: var(--font-mono);
}

.hud-highlight.green {
  color: #34d399;
}

/* Scanner Bottom Bar */
.scanner-bottom-bar {
  min-height: 54px;
  height: auto;
  background: rgba(14, 18, 26, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  z-index: 20;
  gap: 12px;
  flex-wrap: wrap;
}

.scanner-layers-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  flex: 1 1 auto;
  min-width: 220px;
  scrollbar-width: thin;
}

.layers-title-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  white-space: nowrap;
}

.scanner-layer-chips-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.layer-filter-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.layer-filter-chip:hover {
  background: rgba(255, 255, 255, 0.1);
}

.layer-filter-chip.active {
  border-color: #22d3ee;
  background: rgba(34, 211, 238, 0.15);
  color: #fff;
}

.layer-filter-chip .chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* Scanner Action CTA */
.scanner-action-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-convert-scan-hero {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  color: #fff;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.35);
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-convert-scan-hero:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(6, 182, 212, 0.5);
  background: linear-gradient(135deg, #22d3ee 0%, #60a5fa 100%);
}

.btn-convert-scan-hero .kbd-hint {
  font-size: 10px;
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 6px;
  border-radius: 4px;
  color: #e0f2fe;
}

/* ============================================================
   PARAM GRID 2-COLUMN (Declutter Workpiece Dimensions)
   ============================================================ */
.param-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  padding: 4px 0;
}

.param-field-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.param-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}

/* ============================================================
   SCANNER RADAR SKELETON & LOADING STATE
   ============================================================ */
.scanner-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 40px;
  width: 100%;
  max-width: 540px;
  background: rgba(14, 18, 26, 0.6);
  border: 1px dashed rgba(34, 211, 238, 0.3);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  animation: radarFadeIn 0.4s ease-out;
}

@keyframes radarFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.scanner-radar-box {
  width: 130px;
  height: 130px;
  position: relative;
  border-radius: 50%;
  border: 1.5px solid rgba(34, 211, 238, 0.4);
  background: radial-gradient(circle, rgba(34, 211, 238, 0.1) 0%, rgba(14, 18, 26, 0.8) 70%);
  overflow: hidden;
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.2);
}

.radar-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(34, 211, 238, 0.25);
  pointer-events: none;
}

.radar-circle.rc1 { width: 35%; height: 35%; }
.radar-circle.rc2 { width: 68%; height: 68%; }
.radar-circle.rc3 { width: 92%; height: 92%; }

.radar-line-sweep {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, transparent 270deg, rgba(34, 211, 238, 0.4) 360deg);
  animation: radarSweep 2.2s linear infinite;
}

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

.radar-target-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: #22d3ee;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px #22d3ee;
  animation: radarPulse 1.2s ease-in-out infinite alternate;
}

@keyframes radarPulse {
  from { transform: translate(-50%, -50%) scale(0.8); opacity: 0.7; }
  to { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
}

.scanner-loading-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.scanner-loading-headline {
  font-size: 14px;
  font-weight: 700;
  color: #f4f4f5;
  letter-spacing: 0.3px;
}

.scanner-loading-subline {
  font-size: 12px;
  color: var(--text-muted);
}

.scanner-progress-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 4px 14px;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 9999px;
  color: #22d3ee;
  font-size: 11px;
  font-weight: 600;
}

.pulse-dot-cyan {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #22d3ee;
  box-shadow: 0 0 8px #22d3ee;
  animation: pulseCyan 1.5s infinite;
}

@keyframes pulseCyan {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px #22d3ee; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

/* ============================================================
   SCANNER SENSITIVITY CLUSTER
   ============================================================ */
.scanner-sens-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-card);
}

.sens-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.sens-slider {
  width: 80px;
  height: 4px;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

.sens-val-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  min-width: 32px;
  text-align: center;
}

/* ============================================================
   FLOATING TOAST NOTIFICATION (Apple/Figma Grade Feedback)
   ============================================================ */
.cad-floating-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-35px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 99999;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.7), 0 0 20px rgba(16, 185, 129, 0.25);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 90vw;
}

.cad-floating-toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.cad-floating-toast .toast-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.cad-floating-toast .toast-body {
  display: flex;
  flex-direction: column;
}

.cad-floating-toast .toast-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.2px;
}

.cad-floating-toast .toast-subtitle {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 1px;
}

.t2c-chip {
  background: #0f172a;
  border: 1px solid #334155;
  color: #cbd5e1;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.t2c-chip:hover {
  background: #1e293b;
  border-color: #38bdf8;
  color: #38bdf8;
}

/* ==========================================================================
   SEO Semantic Knowledge & Features Section
   ========================================================================== */
.seo-knowledge-section {
  display: none !important;
}

.seo-container {
  max-width: 1320px;
  margin: 0 auto;
}

.seo-hero-block {
  text-align: center;
  margin-bottom: 40px;
}

.seo-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.seo-main-heading {
  font-size: 26px;
  font-weight: 800;
  color: #f8fafc;
  margin: 0 0 12px 0;
  letter-spacing: -0.4px;
}

.seo-sub-heading {
  font-size: 14px;
  color: #94a3b8;
  max-width: 820px;
  margin: 0 auto;
  line-height: 1.6;
}

.seo-grid-3col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.seo-feature-card {
  background: #0d1424;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.2s ease;
}

.seo-feature-card:hover {
  border-color: #38bdf8;
}

.seo-card-icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.seo-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0 0 8px 0;
}

.seo-card-desc {
  font-size: 13px;
  line-height: 1.55;
  color: #94a3b8;
  margin: 0;
}

.seo-faq-section {
  background: #0d1424;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 36px;
}

.seo-faq-title {
  font-size: 20px;
  font-weight: 800;
  color: #f8fafc;
  margin: 0 0 20px 0;
}

.seo-faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.seo-faq-item {
  border-bottom: 1px solid #1e293b;
  padding-bottom: 16px;
}

.seo-faq-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.seo-faq-question {
  font-size: 14.5px;
  font-weight: 700;
  color: #e2e8f0;
  margin: 0 0 6px 0;
}

.seo-faq-answer {
  font-size: 13px;
  line-height: 1.6;
  color: #94a3b8;
  margin: 0;
}

.seo-specs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
}

.seo-spec-pill {
  background: #1e293b;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
}

.seo-footer-bottom {
  text-align: center;
  font-size: 12px;
  color: #64748b;
  border-top: 1px solid #1e293b;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* Comparison Table & Technical Guides */
.seo-table-container {
  background: #0d1424;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 36px;
  overflow-x: auto;
}

.seo-table-header {
  margin-bottom: 16px;
}

.seo-table-header h3 {
  font-size: 19px;
  font-weight: 800;
  color: #f8fafc;
  margin: 0 0 6px 0;
}

.seo-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.seo-table th {
  background: #131d33;
  color: #38bdf8;
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid #1e293b;
  white-space: nowrap;
}

.seo-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #1a2333;
  color: #cbd5e1;
}

.seo-table tr:hover td {
  background: rgba(56, 189, 248, 0.04);
}

.seo-table .highlight-col {
  color: #38bdf8;
  font-weight: 700;
}

.seo-badge-yes {
  color: #10b981;
  font-weight: 700;
}

.seo-badge-no {
  color: #ef4444;
}

.seo-steps-container {
  background: #0d1424;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 36px;
}

.seo-steps-container h3 {
  font-size: 20px;
  font-weight: 800;
  color: #f8fafc;
  margin: 0 0 20px 0;
}

.seo-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.seo-step-card {
  background: #111a2e;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 20px;
  position: relative;
}

.seo-step-num {
  width: 28px;
  height: 28px;
  background: #38bdf8;
  color: #080c15;
  font-weight: 800;
  font-size: 13px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.seo-step-card h4 {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0 0 6px 0;
}

.seo-step-card p {
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.5;
  margin: 0;
}

/* ============================================================
   RESPONSIVE DESIGN SYSTEM (MOBILE, TABLET & LAPTOP)
   ============================================================ */

/* Mobile Sidebar Drawer Toggle Button */
.mobile-sidebar-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid var(--border-card);
  color: var(--text-pure);
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 6px;
  flex-shrink: 0;
  touch-action: manipulation;
  transition: all 0.18s ease;
}

.mobile-sidebar-toggle:hover,
.mobile-sidebar-toggle:active {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent-cyan);
  color: #38bdf8;
}

.mobile-sidebar-toggle .hamburger-icon {
  font-size: 15px;
  line-height: 1;
  color: var(--accent-cyan);
}

.mobile-sidebar-toggle .hamburger-text {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* Sidebar Mobile Header Bar (inside the drawer) */
.sidebar-mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-card);
  background: #090e17;
  flex-shrink: 0;
}

.sidebar-mobile-title {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-mobile-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.sidebar-mobile-close:hover,
.sidebar-mobile-close:active {
  color: #ffffff;
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
}

/* Sidebar Backdrop Overlay */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 140;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* ------------------------------------------------------------
   TABLET BREAKPOINT (max-width: 1024px)
   ------------------------------------------------------------ */
@media screen and (max-width: 1024px) {
  .mobile-sidebar-toggle {
    display: flex;
  }

  .sidebar-mobile-header {
    display: flex;
  }

  .top-nav {
    padding: 0 12px;
    gap: 8px;
    justify-content: flex-start;
  }

  .brand-section {
    min-width: auto;
    gap: 8px;
    flex-shrink: 0;
  }

  .brand-subline {
    display: none;
  }

  /* Horizontally scrollable center segment for smooth touch navigation */
  .nav-center-segment {
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    max-width: calc(100vw - 320px);
    flex-shrink: 1;
  }

  .nav-center-segment::-webkit-scrollbar {
    display: none;
  }

  .segment-tab-btn {
    padding: 6px 11px;
    font-size: 11.5px;
    flex-shrink: 0;
  }

  .nav-right-cluster {
    margin-left: auto;
    gap: 6px;
    flex-shrink: 0;
  }

  /* Sidebar becomes an off-canvas drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 350px;
    max-width: 88vw;
    height: 100vh;
    height: 100dvh;
    z-index: 150;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 15px 0 40px rgba(0, 0, 0, 0.85);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-workspace {
    width: 100vw;
    height: calc(100vh - 52px);
    height: calc(100dvh - 52px);
  }

  .viewport-area {
    width: 100vw;
    flex: 1;
  }

  /* Text-to-CAD tab layout */
  #tab-text2cad > div {
    flex-direction: column !important;
  }

  #tab-text2cad > div > div:first-child {
    max-width: 100% !important;
  }
}

/* ------------------------------------------------------------
   SMARTPHONE BREAKPOINT (max-width: 768px)
   ------------------------------------------------------------ */
@media screen and (max-width: 768px) {
  html, body {
    font-size: 12px;
  }

  .top-nav {
    height: 48px;
    padding: 0 8px;
    gap: 5px;
  }

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

  .pro-badge {
    display: none;
  }

  .brand-badge-icon {
    width: 28px;
    height: 28px;
  }

  .brand-badge-icon svg {
    width: 15px;
    height: 15px;
  }

  .engine-status-tag {
    display: none;
  }

  #btn-open-learning-modal {
    display: none;
  }

  .btn-header-tool.amber {
    padding: 4px 8px;
    font-size: 11px;
  }

  .nav-center-segment {
    max-width: calc(100vw - 160px);
  }

  .segment-tab-btn {
    padding: 5px 8px;
    font-size: 11px;
    gap: 4px;
  }

  /* Scanner Top Bar */
  .scanner-top-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    height: auto !important;
    padding: 8px 10px !important;
    gap: 8px !important;
  }

  .scanner-status-indicator {
    flex-wrap: wrap;
    gap: 6px;
  }

  .scanner-gpu-pill {
    display: none !important;
  }

  /* Scanner Split Layout: stack vertically on phones */
  .scanner-split-container {
    flex-direction: column !important;
  }

  .scanner-split-pane {
    width: 100% !important;
    height: 50% !important;
    min-height: 240px;
  }

  .scanner-split-divider {
    display: none !important;
  }

  /* Floating Toolbars and HUDs */
  .scanner-mode-switcher-tray,
  .cad-bottom-toolbar,
  .floating-cad-tools {
    max-width: calc(100vw - 16px);
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 8px;
  }

  .scanner-mode-switcher-tray::-webkit-scrollbar,
  .cad-bottom-toolbar::-webkit-scrollbar,
  .floating-cad-tools::-webkit-scrollbar {
    display: none;
  }

  .btn-mode-pill {
    padding: 5px 9px;
    font-size: 10.5px;
    flex-shrink: 0;
  }

  /* 3D Viewport Controls */
  .cad3d-floating-panel {
    max-width: calc(100vw - 20px) !important;
    left: 10px !important;
    right: 10px !important;
  }

  /* Export Suite Grid */
  .export-cards-grid,
  .export-grid-modern {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* Generous touch targets for action buttons */
  .btn-action-primary,
  .btn-action-secondary,
  .preset-chip-btn {
    min-height: 40px;
  }
}

/* ─────────────────────────────────────────────────────────────
   Prompt W1: Live UI Build Stamp Footer Bar
   ───────────────────────────────────────────────────────────── */
.ui-build-stamp-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: rgba(9, 13, 22, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid rgba(56, 189, 248, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  color: #94a3b8;
  padding: 0 16px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}
.ui-build-stamp-bar .stamp-container {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ui-build-stamp-bar .stamp-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.ui-build-stamp-bar .stamp-item strong {
  color: #38bdf8;
  font-weight: 600;
}
.ui-build-stamp-bar .stamp-item code {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 5px;
  border-radius: 3px;
}
.ui-build-stamp-bar .stamp-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  display: inline-block;
}
.ui-build-stamp-bar .stamp-sep {
  color: #475569;
}
.ui-build-stamp-bar .stamp-badge {
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}
.ui-build-stamp-bar .stamp-badge.clean {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
}
.ui-build-stamp-bar .stamp-badge.dirty {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* ============================================================
   PRO MAX UI/UX ENHANCEMENT SYSTEM v3.0
   ============================================================
   ▸ Entrance Animations & Stagger
   ▸ Ripple Effects
   ▸ Enhanced Focus States & Keyboard A11y
   ▸ Fluid Typography
   ▸ Skeleton Loading States
   ▸ Smooth Custom Scrollbars
   ▸ Reduced Motion Support
   ▸ Tooltip System
   ▸ Notification Toast System
   ▸ Progress Ring Indicators
   ▸ Enhanced Touch Targets
   ▸ Scroll-Reveal Animations
   ▸ Premium Button Interactions
   ============================================================ */

/* --- 1. CSS Custom Properties Extension --- */
:root {
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-quart: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 0.15s;
  --duration-med: 0.25s;
  --duration-slow: 0.4s;
  --duration-entrance: 0.5s;
  --z-tooltip: 9999;
  --z-toast: 9998;
  --focus-ring: 0 0 0 2px var(--bg-app), 0 0 0 4px var(--accent-cyan);
  --glass-heavy: rgba(10, 14, 22, 0.82);
  --glass-light: rgba(24, 28, 38, 0.55);
  --border-glow-blue: 0 0 12px rgba(59, 130, 246, 0.25);
  --border-glow-cyan: 0 0 12px rgba(34, 211, 238, 0.25);
}

/* --- 2. Smooth Scroll & Selection --- */
html {
  scroll-behavior: smooth;
}

::selection {
  background: rgba(34, 211, 238, 0.3);
  color: #ffffff;
}

::-moz-selection {
  background: rgba(34, 211, 238, 0.3);
  color: #ffffff;
}

/* --- 3. Enhanced Focus States (Keyboard A11y) --- */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 6px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  transition: box-shadow var(--duration-fast) ease;
}

/* Skip-to-content link (visually hidden until focused) */
.skip-to-content {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 10000;
  background: var(--accent-cyan);
  color: #000;
  padding: 8px 16px;
  border-radius: 0 0 8px 8px;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  transition: top var(--duration-med) var(--ease-out-expo);
}

.skip-to-content:focus {
  top: 0;
}

/* --- 4. Entrance Animations & Stagger --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); }
  50% { box-shadow: 0 0 0 6px rgba(34, 211, 238, 0.12); }
}

/* Stagger entrance for sidebar cards */
.sidebar-content-scroll > .pro-card,
.sidebar-content-scroll > .accordion-box,
.sidebar-content-scroll > .ai-status-strip {
  animation: fadeInUp var(--duration-entrance) var(--ease-out-expo) backwards;
}

.sidebar-content-scroll > :nth-child(1) { animation-delay: 0.04s; }
.sidebar-content-scroll > :nth-child(2) { animation-delay: 0.08s; }
.sidebar-content-scroll > :nth-child(3) { animation-delay: 0.12s; }
.sidebar-content-scroll > :nth-child(4) { animation-delay: 0.16s; }
.sidebar-content-scroll > :nth-child(5) { animation-delay: 0.20s; }
.sidebar-content-scroll > :nth-child(6) { animation-delay: 0.24s; }
.sidebar-content-scroll > :nth-child(7) { animation-delay: 0.28s; }

/* Stagger for export cards */
.export-cards-grid > .export-card-tile {
  animation: fadeInScale var(--duration-entrance) var(--ease-out-expo) backwards;
}
.export-cards-grid > :nth-child(1) { animation-delay: 0.05s; }
.export-cards-grid > :nth-child(2) { animation-delay: 0.10s; }
.export-cards-grid > :nth-child(3) { animation-delay: 0.15s; }
.export-cards-grid > :nth-child(4) { animation-delay: 0.20s; }
.export-cards-grid > :nth-child(5) { animation-delay: 0.25s; }
.export-cards-grid > :nth-child(6) { animation-delay: 0.30s; }

/* Top nav entrance */
.top-nav {
  animation: fadeInUp 0.4s var(--ease-out-expo);
}

/* --- 5. Ripple Effect for Buttons --- */
.ripple-container {
  position: relative;
  overflow: hidden;
}

.ripple-container::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: width 0.5s ease, height 0.5s ease, opacity 0.3s ease;
  pointer-events: none;
}

.ripple-container:active::after {
  width: 300px;
  height: 300px;
  opacity: 0;
}

/* Apply to main interactive buttons */
.btn-generate-hero,
.btn-convert-scan-hero,
.btn-action-primary,
.preset-chip-btn,
.segment-tab-btn,
.scanner-mode-btn,
.mat-pill-btn,
.btn-header-tool,
.sample-pill-btn,
.sim-btn-action {
  position: relative;
  overflow: hidden;
}

/* --- 6. Premium Card Hover Effects --- */
.pro-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.accordion-box:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Export card 3D perspective tilt on hover */
.export-card-tile {
  perspective: 800px;
  transform-style: preserve-3d;
}

.export-card-tile:hover {
  transform: translateY(-3px) rotateX(1deg);
}

/* --- 7. Skeleton Loading State --- */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  border-radius: 6px;
}

.skeleton-text {
  height: 12px;
  width: 70%;
  margin: 4px 0;
}

.skeleton-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.skeleton-rect {
  height: 80px;
  width: 100%;
  border-radius: 8px;
}

/* --- 8. Global Custom Scrollbar Enhancement --- */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  transition: background 0.2s;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

/* --- 9. Tooltip System --- */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::before,
[data-tooltip]::after {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--duration-med) var(--ease-out-expo),
              transform var(--duration-med) var(--ease-out-expo);
  z-index: var(--z-tooltip);
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--glass-heavy);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  color: var(--text-pure);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

[data-tooltip]::after {
  content: '';
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--glass-heavy);
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --- 10. Notification Toast System --- */
.toast-container {
  position: fixed;
  top: 64px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: var(--z-toast);
  pointer-events: none;
}

.toast {
  background: var(--glass-heavy);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-pure);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  animation: toastIn 0.35s var(--ease-out-expo);
  pointer-events: auto;
  max-width: 380px;
}

.toast.success {
  border-left: 3px solid #10b981;
}

.toast.error {
  border-left: 3px solid #ef4444;
}

.toast.info {
  border-left: 3px solid #3b82f6;
}

.toast.warning {
  border-left: 3px solid #f59e0b;
}

.toast-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all var(--duration-fast);
}

.toast-close:hover {
  color: var(--text-pure);
  background: rgba(255, 255, 255, 0.08);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(20px) scale(0.95);
  }
}

.toast.removing {
  animation: toastOut 0.25s var(--ease-in-out-quart) forwards;
}

/* --- 11. Progress Ring Indicator --- */
.progress-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.progress-ring svg {
  transform: rotate(-90deg);
}

.progress-ring circle {
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s var(--ease-out-expo);
}

.progress-ring .ring-bg {
  stroke: rgba(255, 255, 255, 0.06);
}

.progress-ring .ring-fg {
  stroke: var(--accent-cyan);
  filter: drop-shadow(0 0 4px rgba(34, 211, 238, 0.4));
}

.progress-ring .ring-label {
  position: absolute;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-pure);
}

/* --- 12. Enhanced Button Interactions --- */
.btn-generate-hero {
  background-size: 200% 200%;
  animation: breathe 3s ease-in-out infinite;
}

.btn-generate-hero:hover {
  background-position: 100% 100%;
  animation: none;
}

.btn-convert-scan-hero {
  animation: breathe 3s ease-in-out infinite;
}

.btn-convert-scan-hero:hover {
  animation: none;
}

/* Button press haptic feedback */
.btn-generate-hero:active,
.btn-convert-scan-hero:active,
.btn-action-primary:active {
  transform: scale(0.97) translateY(1px);
  transition: transform 0.08s ease;
}

/* --- 13. Enhanced Range Input Sliders --- */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
  transition: background var(--duration-fast);
}

input[type="range"]:hover {
  background: rgba(255, 255, 255, 0.12);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.4);
  transition: transform var(--duration-fast) var(--ease-spring),
              box-shadow var(--duration-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.6);
}

input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: none;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.4);
}

/* --- 14. Enhanced Tab Transition --- */
.tab-pane {
  opacity: 0;
  transition: opacity var(--duration-med) ease;
}

.tab-pane.active {
  opacity: 1;
}

/* Tab switch indicator line animation */
.segment-tab-btn::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent-cyan);
  border-radius: 99px;
  transform: translateX(-50%);
  transition: width var(--duration-med) var(--ease-out-expo);
}

.segment-tab-btn.active::after {
  width: 60%;
}

/* --- 15. Enhanced Workflow Preset Chips --- */
.preset-chip-btn {
  position: relative;
}

.preset-chip-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.06), transparent 70%);
  opacity: 0;
  transition: opacity var(--duration-med);
  pointer-events: none;
}

.preset-chip-btn:hover::before {
  opacity: 1;
}

.preset-chip-btn.active::before {
  opacity: 0;
}

/* --- 16. Scanner Audit Badge Glow --- */
.scanner-audit-badge {
  position: relative;
}

.scanner-audit-badge::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), transparent 60%);
  z-index: -1;
  animation: breathe 4s ease-in-out infinite;
  pointer-events: none;
}

/* --- 17. Responsive Fluid Typography --- */
@media (min-width: 1441px) {
  html, body { font-size: 14px; }
  .brand-title { font-size: 16px; }
  .segment-tab-btn { font-size: 13px; }
  .pro-card { padding: 16px; }
  .export-hero-title { font-size: 19px; }
}

@media (max-width: 480px) {
  html, body { font-size: 11.5px; }
  .brand-title { font-size: 12px; }
  .brand-badge-icon { width: 26px; height: 26px; }

  .nav-center-segment {
    max-width: calc(100vw - 120px);
  }

  .segment-tab-btn {
    padding: 4px 6px;
    font-size: 10px;
    gap: 3px;
  }

  .tab-ico {
    font-size: 11px;
  }

  /* Stack scanner HUD vertically */
  .scanner-hud-tray {
    flex-wrap: wrap;
    gap: 4px;
    font-size: 10px;
  }

  /* Scanner bottom bar compact */
  .scanner-bottom-bar {
    flex-direction: column !important;
    gap: 8px !important;
    padding: 8px !important;
  }

  .scanner-layers-cluster,
  .scanner-sens-cluster {
    width: 100%;
  }

  .scanner-action-cluster {
    width: 100%;
  }

  .btn-convert-scan-hero {
    width: 100%;
  }

  /* Sidebar width reduction */
  .sidebar {
    width: 300px !important;
  }

  .sidebar-sticky-footer {
    width: 100% !important;
  }

  /* Workflow grid to single column */
  .workflow-pills-grid {
    grid-template-columns: 1fr !important;
  }

  /* DRO compact */
  .axis-digits {
    font-size: 14px;
  }

  /* 3D dock scrollable */
  .view3d-glass-dock {
    max-width: calc(100vw - 16px);
    overflow-x: auto;
    left: 8px !important;
    right: 8px !important;
    transform: none !important;
    border-radius: 8px;
  }

  /* Slice profile drawer compact */
  .slice-profile-drawer {
    width: calc(100vw - 16px) !important;
    left: 8px !important;
    right: 8px !important;
  }

  /* Mesh HUD compact */
  .mesh-hud-tray {
    flex-wrap: wrap;
    gap: 6px;
    max-width: calc(100vw - 16px);
    right: 8px !important;
    bottom: 8px !important;
  }
}

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

  .tab-pane { transition: none; }
  .sidebar-content-scroll > * { animation: none !important; }
  .export-cards-grid > * { animation: none !important; }
  .btn-generate-hero { animation: none; }
}

/* --- 19. Print Styles --- */
@media print {
  .top-nav,
  .sidebar,
  .sidebar-backdrop,
  .ui-build-stamp-bar,
  .toast-container {
    display: none !important;
  }

  .main-workspace {
    display: block;
    height: auto;
  }

  .viewport-area {
    width: 100%;
    overflow: visible;
  }

  body {
    background: #fff;
    color: #000;
  }
}

/* --- 20. Enhanced Mobile Off-Canvas Sidebar --- */
@media screen and (max-width: 1024px) {
  .sidebar {
    border-radius: 0 16px 16px 0;
    border-right: 1px solid rgba(34, 211, 238, 0.15);
  }

  .sidebar.open {
    animation: sidebarSlideIn 0.3s var(--ease-out-expo);
  }

  @keyframes sidebarSlideIn {
    from { transform: translateX(-100%); opacity: 0.8; }
    to { transform: translateX(0); opacity: 1; }
  }

  .sidebar-backdrop {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
}

/* --- 21. Enhanced Generate Button Gradient Animation --- */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.btn-generate-hero {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6, #06b6d4, #3b82f6);
  background-size: 300% 300%;
}

.btn-generate-hero:not(:disabled):hover {
  animation: gradientShift 3s ease infinite;
}

/* --- 22. Enhanced Input Interactions --- */
.pro-text-input {
  transition: all 0.2s var(--ease-out-expo);
}

.pro-text-input:hover:not(:focus) {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(15, 23, 42, 0.5);
}

/* Number input spin buttons refinement */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  opacity: 0;
  height: 28px;
  cursor: pointer;
}

input[type="number"]:hover::-webkit-inner-spin-button,
input[type="number"]:hover::-webkit-outer-spin-button {
  opacity: 0.7;
}

/* --- 23. Tab Content Smooth Crossfade --- */
.tab-pane {
  will-change: opacity;
}

/* --- 24. Enhanced Accordion Smooth Open/Close --- */
.accordion-content {
  overflow: hidden;
  transition: max-height 0.3s var(--ease-out-expo), 
              padding 0.2s var(--ease-out-expo),
              opacity 0.2s ease;
}

.accordion-box.collapsed .accordion-content {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  border-top: none;
}

.accordion-box:not(.collapsed) .accordion-content {
  max-height: 600px;
  opacity: 1;
}

/* Accordion trigger hover */
.accordion-trigger:hover {
  background: rgba(255, 255, 255, 0.03);
}

.accordion-trigger:active {
  background: rgba(255, 255, 255, 0.05);
}

/* --- 25. Mobile Bottom Action Bar Safe Area --- */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .sidebar-sticky-footer {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .ui-build-stamp-bar {
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(28px + env(safe-area-inset-bottom));
  }
}

/* --- 26. Improved Drag & Drop Zone --- */
.upload-drop-tile {
  position: relative;
}

.upload-drop-tile.dragover {
  border-color: var(--accent-cyan) !important;
  background: rgba(34, 211, 238, 0.08) !important;
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.2), inset 0 0 60px rgba(34, 211, 238, 0.03) !important;
}

.upload-drop-tile.dragover .drop-icon-circle {
  transform: scale(1.15);
  background: rgba(34, 211, 238, 0.2);
  transition: transform 0.2s var(--ease-spring);
}

/* --- 27. Enhanced Status Indicators --- */
.engine-status-tag {
  transition: all var(--duration-med) ease;
}

.engine-status-tag:hover {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.35);
}

.ai-status-strip {
  transition: all var(--duration-med) ease;
}

.ai-status-strip:hover {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(6, 182, 212, 0.08) 100%);
}

/* --- 28. Pro Max Mobile Hamburger Enhancement --- */
.mobile-sidebar-toggle {
  transition: all var(--duration-med) var(--ease-out-expo);
}

.mobile-sidebar-toggle:active {
  transform: scale(0.93);
}

.hamburger-icon {
  transition: transform 0.2s ease;
}

.mobile-sidebar-toggle:hover .hamburger-icon {
  transform: rotate(90deg);
}

/* --- 29. Enhanced Image Thumbnail Preview --- */
.image-thumbnail-card {
  transition: all var(--duration-med) ease;
}

.image-thumbnail-card:hover {
  border-color: var(--border-card-hover);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.image-thumbnail-card img {
  transition: transform 0.3s ease;
}

.image-thumbnail-card:hover img {
  transform: scale(1.02);
}

/* --- 30. Layer Chip Toggle Enhancement --- */
.layer-chip-toggle {
  padding: 3px 8px;
  border-radius: 6px;
  transition: all var(--duration-fast) ease;
}

.layer-chip-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}

.layer-chip-toggle.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-pure);
}

.layer-filter-chip {
  transition: all var(--duration-fast) ease;
}

.layer-filter-chip:active {
  transform: scale(0.95);
}

/* --- 31. Subtle Grid Background Pattern --- */
.scanner-viewport-container {
  position: relative;
}

#canvas2d-container::before,
#canvas3d-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* --- 32. Loading State for Processing Overlay --- */
.loading-screen-scrim {
  animation: fadeInScale 0.3s var(--ease-out-expo);
}

.loading-ring {
  transition: border-top-color 0.3s ease;
}

/* --- 33. Floating Panel Entrance Animations --- */
.cad-floating-toolbar,
.cad-layer-tray,
.cad-coords-indicator {
  animation: fadeInLeft 0.3s var(--ease-out-expo) backwards;
}

.cad-layer-tray {
  animation-name: slideInRight;
  animation-delay: 0.1s;
}

.view3d-glass-dock {
  animation: fadeInUp 0.35s var(--ease-out-expo) backwards;
  animation-delay: 0.1s;
}

.mesh-hud-tray {
  animation: fadeInUp 0.35s var(--ease-out-expo) backwards;
  animation-delay: 0.15s;
}

/* ============================================================
   CLEAN NON-TECHNICAL UI/UX STYLING & WELCOME CARD
   ============================================================ */

/* Center Scanner Welcoming Empty State */
.scanner-welcome-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 36px 28px;
  max-width: 540px;
  margin: auto;
  border: 1.5px dashed rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(24, 24, 27, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  animation: fadeInScale 0.35s var(--ease-out-expo);
}

.welcome-icon-box {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(139, 92, 246, 0.18));
  border: 1px solid rgba(59, 130, 246, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25);
}

.welcome-heading {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-pure);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.welcome-desc {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 420px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.welcome-samples-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: 100%;
}

.welcome-sample-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

.welcome-sample-pill:hover {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.45);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25);
}

.welcome-sample-pill .w-icon {
  font-size: 16px;
}

/* Suppress Developer Debug & Unnecessary Engineering Noise */
#ui-build-stamp-bar,
.ui-build-stamp-bar,
.scanner-hud-tray,
.scanner-audit-badge,
.scanner-bottom-bar,
#btn-open-learning-modal,
.nav-secondary-tab {
  display: none !important;
}

/* ==========================================================================
   Multi-Core Parallel Image Splitting & Tiled Processing Visuals
   ========================================================================== */

.pulse-dot-cyan {
  width: 6px;
  height: 6px;
  background-color: #38bdf8;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px #38bdf8;
  animation: pulseCyan 1.5s infinite ease-in-out;
}

@keyframes pulseCyan {
  0%, 100% {
    transform: scale(0.9);
    opacity: 0.6;
    box-shadow: 0 0 4px #38bdf8;
  }
  50% {
    transform: scale(1.3);
    opacity: 1;
    box-shadow: 0 0 12px #38bdf8;
  }
}

.multi-file-queue {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: thin;
}

.file-queue-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  font-size: 10px;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.file-queue-chip:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.file-queue-chip.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #ffffff;
  font-weight: 600;
}

/* Scanner Parallel Split Grid Overlay */
.scanner-split-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  pointer-events: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  background: rgba(14, 23, 42, 0.35);
  backdrop-filter: blur(2px);
  animation: fadeInGrid 0.3s ease-out;
}

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

.split-grid-quadrant {
  position: relative;
  border: 1px dashed rgba(56, 189, 248, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
}

.split-quad-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #38bdf8;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.5px;
}

.split-grid-line-h {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #38bdf8, #818cf8, #38bdf8, transparent);
  box-shadow: 0 0 10px #38bdf8;
  transform: translateY(-50%);
}

.split-grid-line-v {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, #38bdf8, #818cf8, #38bdf8, transparent);
  box-shadow: 0 0 10px #38bdf8;
  transform: translateX(-50%);
}

.split-grid-center-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid #38bdf8;
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Progressive Quad Laser Sweep Effect */
.quad-laser-sweep {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #38bdf8, #00f0ff, #38bdf8, transparent);
  box-shadow: 0 0 12px #00f0ff, 0 0 4px #38bdf8;
  animation: sweepDown 1.4s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes sweepDown {
  0% { top: 0%; opacity: 0.2; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { top: 100%; opacity: 0.2; }
}

#split-quad-1 .quad-laser-sweep { animation-delay: 0s; }
#split-quad-2 .quad-laser-sweep { animation-delay: 0.35s; }
#split-quad-3 .quad-laser-sweep { animation-delay: 0.7s; }
#split-quad-4 .quad-laser-sweep { animation-delay: 1.05s; }

.split-quad-features {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #34d399;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Interactive Sub-Parts Grid Inspector Container */
.scanner-tiles-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 14px;
  box-sizing: border-box;
  overflow-y: auto;
  gap: 12px;
  background: radial-gradient(circle at 50% 20%, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.95));
}

.tiles-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 8px;
}

.tiles-summary-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
}

.tiles-count-pill {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid #38bdf8;
  color: #38bdf8;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.tiles-summary-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tiles-guarantee-tag {
  font-size: 11px;
  color: #34d399;
  font-weight: 600;
}

.tiles-grid-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  width: 100%;
}

.subpart-card {
  position: relative;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.subpart-card:hover {
  border-color: #38bdf8;
  box-shadow: 0 6px 16px rgba(56, 189, 248, 0.25);
  transform: translateY(-2px);
}

.subpart-preview-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #020617;
}

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

.subpart-title {
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  font-family: var(--font-mono, monospace);
}

.subpart-badge-done {
  font-size: 10px;
  color: #34d399;
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.4);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.subpart-metric-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #94a3b8;
  font-family: var(--font-mono, monospace);
}

.subpart-metric-val {
  color: #f1f5f9;
  font-weight: 600;
}

.tiles-fusion-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.12), rgba(129, 140, 248, 0.12));
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  padding: 10px 14px;
}

.fusion-icon {
  font-size: 18px;
}

.fusion-text {
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.4;
}

.fusion-text strong {
  color: #38bdf8;
}

/* ============================================================
   GEOMETRY MODE TOGGLE (Architectural Crisp vs Organic Relief)
   ============================================================ */
.geometry-mode-toggle {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.geom-toggle-btn {
  background: transparent;
  color: #94a3b8;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.geom-toggle-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.06);
}

.geom-toggle-btn.active {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.9), rgba(15, 23, 42, 0.95));
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
  border: 1px solid rgba(56, 189, 248, 0.6);
}
