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

:root {
  --bg: #070b14;
  --surface: #0e1525;
  --surface2: #141d30;
  --surface3: #1a2540;
  --border: rgba(99, 160, 255, .12);
  --border2: rgba(99, 160, 255, .22);
  --accent: #4f8eff;
  --accent2: #a855f7;
  --accent3: #06d6a0;
  --accent4: #f59e0b;
  --text: #e2e8f0;
  --muted: #64748b;
  --danger: #ef4444;
  --glow: rgba(79, 142, 255, .35);
  --glow2: rgba(168, 85, 247, .3);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
}

html,
body {
  height: 100%;
  scroll-behavior: smooth
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden
}

/* BG GRID */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(79, 142, 255, .04)1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 142, 255, .04)1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 0%, black 40%, transparent 100%)
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0
}

.bg-orb-1 {
  width: 600px;
  height: 600px;
  background: rgba(79, 142, 255, .06);
  top: -200px;
  left: -100px
}

.bg-orb-2 {
  width: 500px;
  height: 500px;
  background: rgba(168, 85, 247, .05);
  bottom: -100px;
  right: -100px
}

/* HEADER */
header {
  position: relative;
  z-index: 10;
  padding: 18px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(14, 21, 37, .8);
  backdrop-filter: blur(20px)
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px
}

.logo-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 0 24px var(--glow)
}

.logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(90deg, #e2e8f0, #4f8eff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent
}

.logo-sub {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .5px;
  margin-top: 2px
}

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

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: .4px
}

.badge-blue {
  background: rgba(79, 142, 255, .15);
  border: 1px solid rgba(79, 142, 255, .3);
  color: var(--accent)
}

.badge-purple {
  background: rgba(168, 85, 247, .15);
  border: 1px solid rgba(168, 85, 247, .3);
  color: var(--accent2)
}

.badge-green {
  background: rgba(6, 214, 160, .12);
  border: 1px solid rgba(6, 214, 160, .3);
  color: var(--accent3)
}

/* MAIN LAYOUT */
.app-wrap {
  position: relative;
  z-index: 5;
  display: flex;
  height: calc(100vh - 73px)
}

.sidebar {
  width: 320px;
  min-width: 320px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.sidebar::-webkit-scrollbar {
  width: 4px
}

.sidebar::-webkit-scrollbar-track {
  background: transparent
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 2px
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden
}

.main-content::-webkit-scrollbar {
  width: 6px
}

.main-content::-webkit-scrollbar-track {
  background: transparent
}

.main-content::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 3px
}

/* TABS */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface2)
}

.tab-btn {
  flex: 1;
  padding: 14px 8px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: all .2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  border-bottom: 2px solid transparent;
  letter-spacing: .3px
}

.tab-btn .ti {
  font-size: 18px
}

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

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(79, 142, 255, .06)
}

.tabs-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* PANELS */
.tab-panel {
  display: none;
  padding: 20px;
  flex-direction: column;
  gap: 16px
}

.tab-panel.active {
  display: flex
}

/* SECTION */
.section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border)
}

/* UPLOAD ZONE */
.upload-zone {
  border: 2px dashed rgba(79, 142, 255, .3);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all .3s;
  background: rgba(14, 21, 37, .6);
  position: relative;
  overflow: hidden
}

.upload-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50%, rgba(79, 142, 255, .04), transparent 70%)
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(79, 142, 255, .07);
  box-shadow: 0 0 30px rgba(79, 142, 255, .12)
}

.upload-icon {
  font-size: 44px;
  margin-bottom: 12px;
  display: block;
  filter: drop-shadow(0 0 16px rgba(79, 142, 255, .5))
}

.upload-zone h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px
}

.upload-zone p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6
}

#fileInput {
  display: none
}

.btn-upload {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .3s;
  box-shadow: 0 4px 16px rgba(79, 142, 255, .3)
}

.btn-upload:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79, 142, 255, .45)
}

/* CONTROLS */
.ctrl-row {
  display: flex;
  flex-direction: column;
  gap: 6px
}

.ctrl-row label {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  display: flex;
  justify-content: space-between
}

.ctrl-row label span {
  color: var(--accent);
  font-weight: 700
}

input[type=range] {
  width: 100%;
  -webkit-appearance: none;
  height: 5px;
  border-radius: 3px;
  background: var(--surface3);
  cursor: pointer;
  outline: none
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(79, 142, 255, .2), 0 2px 6px rgba(0, 0, 0, .4)
}

select {
  width: 100%;
  padding: 9px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%2364748b' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px
}

select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 142, 255, .15)
}

/* TOGGLE SWITCH */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border)
}

.toggle-row:last-child {
  border-bottom: none
}

.toggle-label {
  font-size: 13px;
  color: var(--text)
}

.toggle-label small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px
}

.switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0
}

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

.slider-sw {
  position: absolute;
  inset: 0;
  background: var(--surface3);
  border-radius: 11px;
  cursor: pointer;
  transition: .3s;
  border: 1px solid var(--border)
}

.slider-sw::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: .3s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3)
}

input:checked+.slider-sw {
  background: var(--accent);
  border-color: var(--accent)
}

input:checked+.slider-sw::before {
  transform: translateX(18px)
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s;
  font-family: 'Inter', sans-serif
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  box-shadow: 0 4px 16px rgba(79, 142, 255, .3)
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79, 142, 255, .45)
}

.btn-primary:disabled {
  opacity: .4;
  cursor: not-allowed;
  transform: none
}

.btn-secondary {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text)
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(79, 142, 255, .07)
}

.btn-danger {
  background: rgba(239, 68, 68, .15);
  border: 1px solid rgba(239, 68, 68, .3);
  color: var(--danger)
}

.btn-danger:hover {
  background: rgba(239, 68, 68, .25)
}

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

.btn-lg {
  padding: 14px 28px;
  font-size: 15px;
  border-radius: var(--radius);
  font-weight: 700
}

/* EXPORT GRID */
.export-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px
}

.export-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  transition: all .25s;
  display: flex;
  flex-direction: column;
  gap: 6px
}

.export-card:hover:not(.disabled) {
  border-color: var(--accent2);
  background: rgba(168, 85, 247, .07);
  transform: translateY(-2px)
}

.export-card.disabled {
  opacity: .4;
  cursor: not-allowed
}

.export-icon {
  font-size: 24px
}

.export-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text)
}

.export-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4
}

.export-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-block;
  letter-spacing: .4px
}

.eb-svg {
  background: rgba(79, 142, 255, .2);
  color: var(--accent)
}

.eb-dxf {
  background: rgba(245, 158, 11, .2);
  color: var(--accent4)
}

.eb-png {
  background: rgba(6, 214, 160, .2);
  color: var(--accent3)
}

.eb-gcode {
  background: rgba(239, 68, 68, .2);
  color: #f87171
}

.eb-pdf {
  background: rgba(168, 85, 247, .2);
  color: var(--accent2)
}

.eb-nc {
  background: rgba(100, 116, 139, .2);
  color: #94a3b8
}

/* PREVIEW AREA */
.preview-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 16px;
  background: var(--bg);
  height: calc(100vh - 73px);
  overflow: hidden;
}

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

.preview-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px
}

.preview-title .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent3);
  box-shadow: 0 0 8px var(--accent3)
}

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

.preview-panels {
  display: flex;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.preview-panel {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.preview-panel-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, .02)
}

.preview-panel-head .ph-title {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 8px
}

.preview-panel-head .ph-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600
}

.ph-orig {
  background: rgba(100, 116, 139, .2);
  color: #94a3b8
}

.ph-vec {
  background: rgba(79, 142, 255, .2);
  color: var(--accent)
}

.preview-canvas-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: repeating-conic-gradient(rgba(255, 255, 255, .03) 0% 25%, transparent 0% 50%) 0 0/20px 20px;
  min-height: 0;
  overflow: hidden;
}

.preview-canvas-wrap canvas,
.preview-canvas-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.placeholder-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--muted)
}

.placeholder-msg .pm-icon {
  font-size: 40px;
  opacity: .3
}

.placeholder-msg p {
  font-size: 13px;
  text-align: center
}

/* STATS BAR */
.stats-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap
}

.stat-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 110px
}

.stat-chip .sc-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px
}

.stat-chip .sc-val {
  font-size: 20px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--text)
}

.stat-chip .sc-unit {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500
}

/* PROGRESS */
.progress-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--surface3);
  overflow: hidden;
  margin: 4px 0
}

.progress-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  width: 0%;
  transition: width .4s;
  box-shadow: 0 0 8px rgba(79, 142, 255, .5)
}

/* TOAST */
.toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px
}

.toast {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  transform: translateX(120%);
  opacity: 0;
  transition: all .4s cubic-bezier(.34, 1.56, .64, 1);
  min-width: 240px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .4)
}

.toast.show {
  transform: translateX(0);
  opacity: 1
}

.toast.success {
  border-left: 3px solid var(--accent3)
}

.toast.error {
  border-left: 3px solid var(--danger)
}

.toast.info {
  border-left: 3px solid var(--accent)
}

.toast-icon {
  font-size: 18px
}

/* SPINNER */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(79, 142, 255, .2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite
}

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

/* SIDEBAR ACTIONS */
.sidebar-actions {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

/* VECTORIZE BTN */
.vectorize-btn-wrap {
  padding: 0;
}

/* PROCESSING OVERLAY */
.processing-overlay {
  position: absolute;
  inset: 0;
  background: rgba(7, 11, 20, .85);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 20;
  border-radius: var(--radius)
}

.processing-overlay.show {
  display: flex
}

.proc-text {
  font-size: 14px;
  color: var(--muted)
}

/* CNC MATERIAL CARDS */
.material-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px
}

.material-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  transition: all .2s
}

.material-card:hover {
  border-color: var(--accent);
  background: rgba(79, 142, 255, .07)
}

.material-card.active {
  border-color: var(--accent);
  background: rgba(79, 142, 255, .12);
  box-shadow: 0 0 12px rgba(79, 142, 255, .2)
}

.material-card .mc-icon {
  font-size: 22px;
  margin-bottom: 4px
}

.material-card .mc-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text)
}

/* PATH LAYERS */
.layers-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto
}

.layer-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px
}

.layer-color {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0
}

.layer-name {
  font-size: 12px;
  font-weight: 600;
  flex: 1
}

.layer-count {
  font-size: 11px;
  color: var(--muted)
}

/* RESPONSIVE */
@media(max-width:900px) {
  .app-wrap {
    flex-direction: column
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 60vh
  }

  .preview-panels {
    grid-template-columns: 1fr
  }
}

@media(max-width:600px) {
  header {
    padding: 14px 16px
  }

  .preview-wrap {
    padding: 14px
  }

  .export-grid {
    grid-template-columns: 1fr
  }
}

/* ANIMATIONS */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.fade-in {
  animation: fadeIn .3s ease forwards
}

@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: 0 0 16px rgba(79, 142, 255, .3)
  }

  50% {
    box-shadow: 0 0 32px rgba(79, 142, 255, .6)
  }
}

.pulse {
  animation: pulse-glow 2s ease-in-out infinite
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 3px
}

/* ZOOM controls */
.zoom-controls {
  display: flex;
  align-items: center;
  gap: 6px
}

.zoom-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all .2s
}

.zoom-btn:hover {
  border-color: var(--accent);
  color: var(--accent)
}

.zoom-val {
  font-size: 12px;
  color: var(--muted);
  min-width: 38px;
  text-align: center
}

/* VECTORIZE MODE CHIPS */
.mode-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap
}

.mode-chip {
  padding: 6px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all .2s
}

.mode-chip:hover {
  border-color: var(--accent);
  color: var(--accent)
}

.mode-chip.active {
  background: rgba(79, 142, 255, .15);
  border-color: var(--accent);
  color: var(--accent)
}

/* INFO BOX */
.info-box {
  background: rgba(79, 142, 255, .07);
  border: 1px solid rgba(79, 142, 255, .2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.6
}

.info-box strong {
  color: var(--accent)
}

/* MACHINE GRID (Feature 10) */
.machine-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.machine-chip {
  padding: 8px 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: all .2s;
}

.machine-chip:hover {
  border-color: var(--accent4);
  color: var(--accent4);
}

.machine-chip.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--accent4);
  color: var(--accent4);
}

/* MODAL / PREVIEW (Feature 4) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .3s;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  transform: scale(0.95);
  transition: transform .3s;
}

.modal-overlay.show .modal {
  transform: scale(1);
}

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

.modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s;
}

.modal-close:hover {
  color: var(--danger);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.modal-preview-canvas {
  max-width: 100%;
  max-height: 60vh;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  background: white;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.preview-info {
  flex: 1;
  font-size: 12px;
  color: var(--muted);
}

.preview-info span {
  color: var(--accent);
  font-weight: 600;
}

/* ═══════════════════════════════════════
   FEATURES.JS — Stiluri extra
═══════════════════════════════════════ */

/* Butoane transformare canvas (rotație, flip) */
.feat-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
  padding: 0;
  flex-shrink: 0;
}

.feat-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(79, 142, 255, .1);
  transform: translateY(-1px);
}

/* Miniaturi thumbnail history */
.hist-thumb {
  transition: border-color .2s, transform .2s;
}

.hist-thumb:hover {
  transform: scale(1.08);
}

/* Zoom-controls buton Fit */
#btnZoomFit {
  font-size: 15px;
  min-width: 28px;
}

/* Toast din features (override dacă e nevoie) */
#toastContainer .toast {
  pointer-events: none;
}

/* Ruler overlay nu trebuie să blocheze click-urile */
.ruler-overlay {
  pointer-events: none !important;
}

/* Compare overlay cursor */
#compareOverlay {
  cursor: col-resize;
}

/* Shortcut KBD inline */
kbd {
  display: inline-block;
  font-family: 'Space Grotesk', monospace;
}
