/* ==========================================================================
   Plant Tag Generator - Design System & Styles
   Aesthetic: Premium Botanical Studio with Forest Greens, Warm Cream & Gold
   ========================================================================== */

:root {
  /* Color Palette */
  --color-forest-900: #0b2e24;
  --color-forest-800: #134e3f;
  --color-forest-700: #1b6351;
  --color-forest-600: #257e67;
  --color-forest-500: #32997e;
  --color-forest-100: #e5f4ef;
  --color-forest-50:  #f0f8f5;

  --color-sage-500:   #5b8c7c;
  --color-sage-100:   #e8f0ec;

  --color-amber-600:  #c2841b;
  --color-amber-500:  #e5a93b;
  --color-amber-100:  #fdf3e2;

  --color-danger-600: #c93b3b;
  --color-danger-100: #fde8e8;

  --color-surface-bg: #f5f7f5;
  --color-surface-card: #ffffff;
  --color-surface-card-subtle: #fafbf9;
  --color-border-subtle: #e2e8e3;
  --color-border-strong: #cad4cc;
  
  --color-text-primary: #192621;
  --color-text-secondary: #566860;
  --color-text-muted: #83948c;
  --color-text-inverse: #ffffff;

  /* Typography */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Elevations */
  --shadow-sm: 0 1px 3px rgba(15, 35, 27, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 35, 27, 0.08);
  --shadow-lg: 0 12px 28px rgba(15, 35, 27, 0.12);
  --shadow-sheet: 0 16px 40px rgba(11, 46, 36, 0.18), 0 2px 6px rgba(0, 0, 0, 0.06);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-surface-bg);
  color: var(--color-text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
}

/* App Main Container */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
}

/* Sticky Top Navigation Group (Header + Mobile Tabs) */
.app-sticky-header {
  position: sticky;
  top: 0;
  z-index: 1020;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.app-header {
  background: #ffffff;
  border-bottom: 1px solid var(--color-border-subtle);
  padding: 0.85rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-icon {
  font-size: 1.75rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-forest-100);
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px rgba(37, 126, 103, 0.15);
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-forest-900);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  font-weight: 400;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Workspace Layout */
.app-main {
  display: block;
  flex: 1;
  max-width: 1920px;
  margin: 0 auto;
  width: 100%;
}

/* Left Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Cards */
.card {
  background: var(--color-surface-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface-card-subtle);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-forest-900);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title svg {
  color: var(--color-forest-600);
}

.card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Forms & Inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.required {
  color: var(--color-amber-600);
}

.form-input, .form-select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-strong);
  background: #ffffff;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--color-text-primary);
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus, .form-select:focus {
  border-color: var(--color-forest-600);
  box-shadow: 0 0 0 3px rgba(37, 126, 103, 0.15);
}

.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* Unit Toggle Switcher */
.unit-toggle {
  display: flex;
  background: var(--color-border-subtle);
  padding: 2px;
  border-radius: var(--radius-md);
}

.unit-btn {
  border: none;
  background: transparent;
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.unit-btn.active {
  background: #ffffff;
  color: var(--color-forest-800);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Dimension Status Bar */
.dimension-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.35rem;
}

.dim-label {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-weight: 500;
  font-feature-settings: "tnum";
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge-nature {
  background: var(--color-forest-100);
  color: var(--color-forest-700);
}

.badge-accent {
  background: var(--color-amber-100);
  color: var(--color-amber-600);
}

/* Text Formatting & Font Size Slider Controls - Ultra-Compact Inline */
.form-group-compact {
  margin-bottom: 0.75rem;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.field-label-row label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-forest-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inline-typography-bar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--color-surface-card-subtle);
  padding: 2px 5px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-subtle);
}

.mini-format-btn {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border-subtle);
  background: #ffffff;
  color: var(--color-text-secondary);
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0;
  line-height: 1;
  transition: all var(--transition-fast);
}

.mini-format-btn:hover {
  border-color: var(--color-forest-400);
  color: var(--color-forest-700);
}

.mini-format-btn.active {
  background: var(--color-forest-600);
  border-color: var(--color-forest-600);
  color: #ffffff;
}

.mini-slider-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.2rem;
}

.mini-range {
  -webkit-appearance: none;
  appearance: none;
  width: 74px;
  height: 5px;
  border-radius: var(--radius-full);
  background: var(--color-border-strong);
  outline: none;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.mini-range:hover {
  background: var(--color-forest-300);
}

.mini-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--color-forest-600);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform var(--transition-fast);
}

.mini-range::-webkit-slider-thumb:hover {
  background: var(--color-forest-700);
  transform: scale(1.2);
}

.mini-range::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--color-forest-600);
  border: none;
  cursor: pointer;
}

.mini-val {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-forest-700);
  font-feature-settings: "tnum";
  min-width: 27px;
  text-align: right;
}

.form-input-compact {
  padding: 0.45rem 0.65rem;
  font-size: 0.85rem;
}

/* Clearable Text Input with Close/Clear Button */
.input-clearable-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-clearable-wrapper .form-input,
.input-clearable-wrapper .form-control {
  padding-right: 2rem !important;
}

.btn-clear-input {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--color-border-subtle);
  color: var(--color-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all var(--transition-fast);
  z-index: 3;
}

.btn-clear-input.is-visible {
  opacity: 0.75;
  visibility: visible;
  pointer-events: auto;
}

.btn-clear-input.is-visible:hover {
  opacity: 1;
  background: var(--color-danger-100);
  color: var(--color-danger-600);
  transform: translateY(-50%) scale(1.12);
}

.compact-grid {
  gap: 0.65rem;
}

/* Image Dropzone */
.image-dropzone {
  position: relative;
  border: 2px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.85rem;
  background: var(--color-surface-card-subtle);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
}

.image-dropzone:hover, .image-dropzone.drag-over {
  border-color: var(--color-forest-600);
  background: var(--color-forest-50);
}

.file-input-hidden {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  pointer-events: none;
}

.dropzone-content svg {
  color: var(--color-forest-600);
}

.dropzone-text {
  font-size: 0.82rem;
  color: var(--color-forest-800);
}

.dropzone-hint {
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

.dropzone-preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  z-index: 2;
}

.dropzone-preview img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-subtle);
}

.preview-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
}

.preview-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-primary);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Brand / Nursery Logo Dropzone */
.logo-dropzone {
  position: relative;
  border: 2px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.8rem;
  background: var(--color-surface-card-subtle);
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
}

.logo-dropzone:hover, .logo-dropzone.drag-over {
  border-color: var(--color-forest-600);
  background: var(--color-forest-50);
}

.logo-dropzone-content {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  pointer-events: none;
  width: 100%;
}

.logo-dropzone-content svg {
  color: var(--color-forest-600);
  flex-shrink: 0;
}

.logo-text-col {
  display: flex;
  flex-direction: column;
}

.logo-dropzone-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-forest-800);
  line-height: 1.25;
}

.logo-dropzone-hint {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

.logo-dropzone-preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  z-index: 2;
}

.logo-thumb-wrapper {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: repeating-conic-gradient(#e8ece9 0% 25%, #ffffff 0% 50%) 50% / 10px 10px;
  flex-shrink: 0;
}

.logo-thumb-wrapper img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.logo-preview-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  min-width: 0;
}

.logo-preview-name {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-text-primary);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Quick sample chips */
.quick-samples {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.quick-samples span {
  font-size: 0.74rem;
  color: var(--color-text-muted);
}

.sample-chip {
  border: 1px solid var(--color-border-subtle);
  background: #ffffff;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--color-text-secondary);
}

.sample-chip:hover {
  background: var(--color-forest-100);
  color: var(--color-forest-800);
  border-color: var(--color-forest-500);
}

/* Toggle Checkbox Row */
.toggle-row {
  display: flex;
  align-items: center;
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.custom-checkbox {
  width: 17px;
  height: 17px;
  accent-color: var(--color-forest-600);
  cursor: pointer;
}

.sub-group {
  margin-top: 0.6rem;
  padding-left: 1.5rem;
  border-left: 2px solid var(--color-forest-100);
}

/* Batch Controls Card */
.card-action-sticky {
  padding: 1.25rem;
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.batch-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.quantity-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.quantity-group label {
  font-size: 0.84rem;
  font-weight: 600;
}

.quantity-stepper {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #ffffff;
}

.step-btn {
  background: var(--color-surface-card-subtle);
  border: none;
  width: 32px;
  height: 34px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-forest-800);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.step-btn:hover {
  background: var(--color-forest-100);
}

.quantity-stepper input {
  width: 44px;
  height: 34px;
  border: none;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text-primary);
  outline: none;
}

.quick-qty-pills {
  display: flex;
  gap: 0.35rem;
}

.pill-btn {
  border: 1px solid var(--color-border-subtle);
  background: var(--color-surface-card-subtle);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pill-btn:hover {
  background: var(--color-forest-100);
  color: var(--color-forest-800);
  border-color: var(--color-forest-500);
}

.action-buttons-stack {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn-lg {
  padding: 0.85rem 1.25rem;
  font-size: 0.95rem;
  font-family: var(--font-display);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;
}

.btn-primary {
  background: var(--color-forest-700);
  color: #ffffff;
  border-color: var(--color-forest-800);
  box-shadow: 0 2px 6px rgba(19, 78, 63, 0.25);
}

.btn-primary:hover {
  background: var(--color-forest-800);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(19, 78, 63, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--color-forest-50);
  color: var(--color-forest-800);
  border-color: var(--color-forest-100);
}

.btn-secondary:hover {
  background: var(--color-forest-100);
  border-color: var(--color-forest-500);
}

.btn-outline {
  background: #ffffff;
  color: var(--color-text-primary);
  border-color: var(--color-border-strong);
}

.btn-outline:hover {
  background: var(--color-forest-50);
  color: var(--color-forest-800);
  border-color: var(--color-forest-600);
}

.btn-danger-outline {
  background: #ffffff;
  color: var(--color-danger-600);
  border-color: rgba(201, 59, 59, 0.3);
}

.btn-danger-outline:hover {
  background: var(--color-danger-100);
  border-color: var(--color-danger-600);
}

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
}

.btn-icon:hover {
  background: var(--color-border-subtle);
  color: var(--color-text-primary);
}

.btn-icon.danger:hover {
  background: var(--color-danger-100);
  color: var(--color-danger-600);
}

/* ==========================================================================
   Right Panel / Workspace Visual Studio
   ========================================================================== */

.workspace {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

/* Single Tag Preview Card - Normal Flow (Not Sticky) */
.preview-card {
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: relative;
}

.preview-card-header {
  padding: 0.65rem 1.15rem;
  background: var(--color-surface-card-subtle);
  border-bottom: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-with-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.preview-quick-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-forest-900);
}

.single-tag-stage {
  padding: 1rem 1.25rem;
  background: repeating-conic-gradient(#f7faf8 0% 25%, #edf2ef 0% 50%) 50% / 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  overflow: hidden;
  transition: min-height var(--transition-normal);
}

.tag-shadow-wrapper {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12), 0 2px 5px rgba(0, 0, 0, 0.05);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  max-width: 100%;
}

#single-tag-canvas {
  display: block;
  object-fit: contain;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
  transition: max-height var(--transition-normal), max-width var(--transition-normal);
  /* Default compact landscape sizing */
  max-width: 380px;
  max-height: 130px;
}

/* Landscape tags (3"x1", 4"x2", 3.5"x2", 2"x1"):
   Realistic, sleek, compact nursery stake preview (NOT oversized) */
.single-tag-stage.is-landscape {
  min-height: 155px;
  padding: 0.75rem 1rem;
}

.single-tag-stage.is-landscape #single-tag-canvas {
  max-width: 380px;
  max-height: 130px;
  width: auto;
  height: auto;
}

/* Portrait tags (2.5"x3.5", 2"x4"):
   Generous height so hanging tags are tall, spacious, legible and easy to drag */
.single-tag-stage.is-portrait {
  min-height: 375px;
  padding: 0.85rem 1.25rem;
}

.single-tag-stage.is-portrait #single-tag-canvas {
  max-width: 275px;
  max-height: 350px;
  width: auto;
  height: auto;
}

/* Enlarge mode toggle for precision editing */
.preview-card.expanded .single-tag-stage.is-landscape {
  min-height: 205px;
}

.preview-card.expanded .single-tag-stage.is-landscape #single-tag-canvas {
  max-width: 500px;
  max-height: 165px;
}

.preview-card.expanded .single-tag-stage.is-portrait {
  min-height: 480px;
}

.preview-card.expanded .single-tag-stage.is-portrait #single-tag-canvas {
  max-width: 375px;
  max-height: 450px;
}

.badge-drag-hint {
  background: rgba(255, 255, 255, 0.95) !important;
  color: var(--color-forest-800) !important;
  border: 1px solid var(--color-forest-200) !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   18" x 12" Print Sheet Canvas Section
   ========================================================================== */

.sheet-card {
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.sheet-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border-subtle);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.sheet-title-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.sheet-main-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sheet-spec-pill {
  background: var(--color-forest-100);
  color: var(--color-forest-800);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.sheet-stats {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.84rem;
  color: var(--color-text-secondary);
}

.stat-item strong {
  color: var(--color-forest-900);
}

.stat-divider {
  color: var(--color-border-strong);
}

.stat-badge {
  background: var(--color-forest-50);
  border: 1px solid var(--color-forest-100);
  color: var(--color-forest-700);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.stat-badge.full {
  background: var(--color-amber-100);
  border-color: var(--color-amber-500);
  color: var(--color-amber-600);
}

.sheet-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.4rem;
  border-top: 1px solid var(--color-border-subtle);
}

.zoom-toolbar {
  display: flex;
  align-items: center;
  background: var(--color-surface-card-subtle);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: 2px;
}

.zoom-btn {
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.zoom-btn:hover {
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.zoom-btn.text-btn {
  width: auto;
  padding: 0 0.5rem;
  font-size: 0.76rem;
}

.zoom-display {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0 0.5rem;
  min-width: 48px;
  text-align: center;
  color: var(--color-text-secondary);
}

.sheet-action-btns {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Sheet Viewport Stage */
.sheet-viewport-container {
  position: relative;
  background: #1f2523;
  height: 560px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.sheet-scroll-canvas {
  width: 100%;
  height: 100%;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.sheet-canvas-wrapper {
  position: relative;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.25);
  background: #ffffff;
  line-height: 0;
  flex-shrink: 0;
  margin: auto;
  transition: width 0.15s cubic-bezier(0.4, 0, 0.2, 1), height 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Empty Sheet Overlay */
.sheet-empty-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  gap: 0.85rem;
  z-index: 25;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 0.25rem;
}

.sheet-empty-overlay h4 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--color-forest-900);
}

.sheet-empty-overlay p {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  max-width: 380px;
  line-height: 1.4;
}

/* Tag Queue Section */
.queue-section {
  padding: 1.25rem;
  border-top: 1px solid var(--color-border-subtle);
  background: var(--color-surface-card-subtle);
}

.queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.queue-header h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--color-forest-900);
}

.queue-hint {
  font-size: 0.76rem;
  color: var(--color-text-muted);
}

.queue-items-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.queue-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.75rem;
  transition: all var(--transition-fast);
}

.queue-card:hover {
  border-color: var(--color-forest-500);
  box-shadow: var(--shadow-sm);
}

.queue-thumb {
  width: 50px;
  height: 38px;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  background: #fafafa;
  object-fit: cover;
}

.queue-details {
  flex: 1;
  min-width: 0;
}

.queue-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-meta {
  font-size: 0.74rem;
  color: var(--color-text-muted);
}

.queue-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.queue-count-badge {
  background: var(--color-forest-100);
  color: var(--color-forest-800);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
}

/* Modal Backdrop & Spinner */
.modal-backdrop-custom,
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 46, 36, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1060;
}

.modal-card {
  background: #ffffff;
  padding: 2.25rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  text-align: center;
  max-width: 440px;
  width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--color-forest-100);
  border-top-color: var(--color-forest-600);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.modal-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--color-forest-900);
}

.modal-card p {
  font-size: 0.86rem;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-forest-500);
}

/* ==========================================================================
   Auto Re-arrange Toolbar & Multi-Sheet Pagination Styles
   ========================================================================== */

.sheet-arrange-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.6rem 0.85rem;
  background: var(--color-forest-50);
  border: 1px solid var(--color-forest-100);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.arrange-actions-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-arrange {
  background: var(--color-forest-800);
  color: #ffffff;
  border: 1px solid var(--color-forest-900);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(19, 78, 63, 0.2);
  transition: all var(--transition-fast);
}

.btn-arrange:hover {
  background: var(--color-forest-900);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(19, 78, 63, 0.3);
}

.btn-arrange:active {
  transform: translateY(0);
}

.btn-arrange.arranging {
  background: var(--color-amber-600);
  border-color: var(--color-amber-600);
}

.arrange-select-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-forest-900);
}

.select-compact {
  padding: 0.28rem 0.55rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong);
  background: #ffffff;
  width: auto;
  font-weight: 500;
}

.select-compact:focus {
  border-color: var(--color-forest-600);
  box-shadow: 0 0 0 2px rgba(37, 126, 103, 0.15);
}

.compact-toggle {
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  gap: 0.35rem;
}

/* Multi-sheet Pagination */
.sheet-pagination {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: 2px 6px;
  box-shadow: var(--shadow-sm);
}

.page-nav-btn {
  background: transparent;
  border: none;
  width: 26px;
  height: 26px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-forest-900);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.page-nav-btn:hover:not(:disabled) {
  background: var(--color-forest-100);
}

.page-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.sheet-page-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-forest-900);
  padding: 0 0.4rem;
  min-width: 76px;
  text-align: center;
}

.btn-xs {
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Bootstrap 5 Harmonization & Overrides
   ========================================================================== */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.btn.btn-primary {
  background-color: var(--color-forest-700) !important;
  border-color: var(--color-forest-800) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(19, 78, 63, 0.25);
}

.btn.btn-primary:hover,
.btn.btn-primary:focus {
  background-color: var(--color-forest-800) !important;
  border-color: var(--color-forest-900) !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(19, 78, 63, 0.35);
}

.btn.btn-secondary {
  background-color: var(--color-forest-50) !important;
  color: var(--color-forest-800) !important;
  border-color: var(--color-forest-100) !important;
}

.btn.btn-secondary:hover,
.btn.btn-secondary:focus {
  background-color: var(--color-forest-100) !important;
  border-color: var(--color-forest-500) !important;
  color: var(--color-forest-900) !important;
}

.btn.btn-outline {
  background-color: #ffffff !important;
  color: var(--color-text-primary) !important;
  border-color: var(--color-border-strong) !important;
}

.btn.btn-outline:hover,
.btn.btn-outline:focus {
  background-color: var(--color-forest-50) !important;
  color: var(--color-forest-800) !important;
  border-color: var(--color-forest-600) !important;
}

.btn.btn-danger-outline {
  background-color: #ffffff !important;
  color: var(--color-danger-600) !important;
  border-color: rgba(201, 59, 59, 0.35) !important;
}

.btn.btn-danger-outline:hover,
.btn.btn-danger-outline:focus {
  background-color: var(--color-danger-100) !important;
  border-color: var(--color-danger-600) !important;
  color: var(--color-danger-600) !important;
}

.btn-sm-mobile {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
}

/* ==========================================================================
   Mobile Responsive Navigation & View Tabs
   ========================================================================== */
.mobile-tabs-container {
  background: var(--color-surface-bg);
  border-bottom: 1px solid var(--color-border-subtle);
  padding: 0.35rem 0.5rem 0.45rem 0.5rem;
}

/* Mobile Bottom Clearance Spacers */
.mobile-bottom-spacer {
  display: block;
  height: 5.5rem;
  width: 100%;
  pointer-events: none;
  flex-shrink: 0;
}

.mobile-view-tabs {
  display: flex;
  background: var(--color-surface-card);
  padding: 4px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-sm);
  gap: 4px;
  width: 100%;
}

.mobile-tab-btn {
  flex: 1;
  padding: 0.55rem 0.45rem;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.82rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.mobile-tab-btn:hover {
  background: var(--color-forest-50);
  color: var(--color-forest-800);
}

.mobile-tab-btn.active {
  background: var(--color-forest-700);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(19, 78, 63, 0.25);
}

.mobile-tab-btn strong {
  font-weight: 700;
  display: inline-block;
  min-width: 16px;
}

.mobile-pan-hint {
  text-align: center;
  padding: 0.35rem 0.5rem;
  background: var(--color-forest-50);
  color: var(--color-forest-700);
  font-size: 0.74rem;
  font-weight: 500;
  border-bottom: 1px solid var(--color-forest-100);
}

/* ==========================================================================
   Comprehensive Mobile Media Queries
   ========================================================================== */

/* Tablet & Mobile Screens (max-width: 991.98px) */
@media (max-width: 991.98px) {
  /* Dynamic mobile tab visibility */
  body.mobile-mode-editor #workspace-column {
    display: none !important;
  }
  body.mobile-mode-editor #sidebar-column {
    display: block !important;
  }

  body.mobile-mode-sheet #sidebar-column {
    display: none !important;
  }
  body.mobile-mode-sheet #workspace-column {
    display: block !important;
  }

  body.mobile-mode-both #sidebar-column,
  body.mobile-mode-both #workspace-column {
    display: block !important;
  }

  .sheet-viewport-container {
    height: 400px;
  }

  .app-main {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom, 24px)) !important;
  }

  .sidebar {
    padding-bottom: 1.5rem;
  }

  .card-action-sticky {
    position: static;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
  }

  .queue-section {
    padding-bottom: 2rem;
    margin-bottom: 1.5rem;
  }
}

/* Phones & Small Devices (max-width: 767.98px) */
@media (max-width: 767.98px) {
  .app-header {
    padding: 0.5rem 0.85rem;
  }

  .mobile-tabs-container {
    padding: 0.3rem 0.5rem 0.35rem 0.5rem;
  }

  .brand-icon {
    width: 36px;
    height: 36px;
    font-size: 1.3rem;
  }

  .brand-title {
    font-size: 1.1rem;
  }

  .header-actions .btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
  }

  /* Arrange Toolbar Stacking */
  .sheet-arrange-bar {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.6rem;
  }

  .arrange-actions-group {
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-start;
  }

  .sheet-pagination {
    width: 100%;
    justify-content: center;
  }

  /* Viewport Controls */
  .sheet-controls {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.6rem;
  }

  .zoom-toolbar {
    width: 100%;
    justify-content: center;
  }

  .sheet-action-btns {
    width: 100%;
    display: flex;
  }

  .sheet-action-btns .btn {
    flex: 1;
    justify-content: center;
  }

  .sheet-viewport-container {
    height: 340px;
    -webkit-overflow-scrolling: touch;
  }

  /* Stepper controls for touch */
  .quantity-stepper {
    height: 38px;
  }

  .step-btn {
    width: 38px;
    height: 38px;
    font-size: 1.2rem;
  }

  .pill-btn {
    min-width: 36px;
    height: 36px;
    font-size: 0.85rem;
  }
}

/* Extra Small Phones (max-width: 575.98px) */
@media (max-width: 575.98px) {
  .field-label-row {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.35rem;
  }

  .inline-typography-bar {
    width: 100%;
    justify-content: space-between;
  }

  .mini-slider-wrap {
    flex: 1;
    justify-content: flex-end;
  }

  .mini-range {
    width: 100%;
    max-width: 90px;
  }

  .unit-toggle {
    width: 100%;
    justify-content: stretch;
    margin-top: 0.4rem;
  }

  .unit-btn {
    flex: 1;
    text-align: center;
  }

  .card-header {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
  }

  .card-body {
    padding: 1rem;
  }

  .sheet-viewport-container {
    height: 290px;
  }

  .modal-card {
    padding: 1.5rem 1.15rem;
    width: 94%;
  }

  .single-tag-stage.is-landscape {
    min-height: 145px;
    padding: 0.6rem 0.5rem;
  }

  .single-tag-stage.is-landscape #single-tag-canvas {
    max-width: 100%;
    max-height: 120px;
  }

  .single-tag-stage.is-portrait {
    min-height: 330px;
    padding: 0.85rem 0.5rem;
  }

  .single-tag-stage.is-portrait #single-tag-canvas {
    max-width: 100%;
    max-height: 310px;
  }

  .quick-samples {
    gap: 0.35rem;
  }

  .sample-chip {
    padding: 0.25rem 0.6rem;
    font-size: 0.72rem;
  }
}

/* Very Small Phones (max-width: 380px) */
@media (max-width: 380px) {
  .brand-title {
    font-size: 1rem;
  }

  .mobile-tab-btn {
    font-size: 0.75rem;
    padding: 0.5rem 0.25rem;
  }

  .btn {
    font-size: 0.82rem;
  }
}


