:root {
  /* Default: Clean Professional Light Theme (Print & CAD Studio) */
  --bg-app: #f8fafc;
  --bg-header: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-workbench: #f1f5f9;
  --bg-input: #ffffff;
  --bg-input-hover: #f8fafc;
  --bg-pill: #f1f5f9;
  --bg-pill-hover: #e2e8f0;
  --bg-pill-active: #0f172a;
  --text-pill-active: #ffffff;

  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-hover: #94a3b8;
  --border-focus: #2563eb;
  
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-subtle: rgba(37, 99, 235, 0.08);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-dim: #94a3b8;

  /* Gradient Zones */
  --z1: #16a34a; /* <5% Emerald */
  --z2: #d97706; /* 5-8% Amber */
  --z3: #ea580c; /* 8-12% Orange */
  --z4: #dc2626; /* >12% Red */

  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;

  --sticker-w: 110mm;
  --sticker-h: 35mm;
  --stage-zoom-w: 720px;
}

[data-theme="dark"] {
  --bg-app: #0b0f17;
  --bg-header: #111827;
  --bg-sidebar: #111827;
  --bg-card: #111827;
  --bg-workbench: #080c14;
  --bg-input: #0b0f17;
  --bg-input-hover: #161f30;
  --bg-pill: #1f2937;
  --bg-pill-hover: #374151;
  --bg-pill-active: #3b82f6;
  --text-pill-active: #ffffff;

  --border-color: #1f2937;
  --border-subtle: #161f30;
  --border-hover: #4b5563;
  --border-focus: #3b82f6;
  
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-subtle: rgba(59, 130, 246, 0.12);

  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-dim: #6b7280;

  --z1: #22c55e;
  --z2: #eab308;
  --z3: #f97316;
  --z4: #ef4444;
}

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

html {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 13px;
  line-height: 1.45;
}

/* Screen-reader & Accessible offscreen positioning (Universal cross-browser file input) */
.sr-only,
#file-input {
  position: fixed !important;
  top: -9999px !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  overflow: hidden !important;
  z-index: -1 !important;
}

