:root {
  --bg-dark: #07080d;
  --bg-darker: #040508;
  --panel-bg: rgba(15, 18, 28, 0.88);
  --panel-border: rgba(255, 255, 255, 0.1);
  --panel-border-hover: rgba(255, 255, 255, 0.25);
  --toolbar-bg: rgba(18, 22, 36, 0.96);
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --shadow-glow: 0 8px 32px rgba(6, 182, 212, 0.2);
  --shadow-luxury: 0 16px 40px rgba(0, 0, 0, 0.6);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(6, 182, 212, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 90% 15%, rgba(139, 92, 246, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 50% 90%, rgba(236, 72, 153, 0.08) 0%, transparent 45%);
  background-attachment: fixed;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-main);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Header */
header.app-header {
  height: 54px;
  background: rgba(10, 13, 22, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  z-index: 50;
  flex-shrink: 0;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #06b6d4, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.4);
}

.brand-title {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
  text-transform: uppercase;
  margin-top: -2px;
}

.header-center-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.doc-name-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  padding: 0.28rem 0.75rem;
  border-radius: 8px;
  color: #fff;
  font-weight: 600;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: all 0.2s;
}

.doc-name-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--panel-border-hover);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.42rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  border: none;
  outline: none;
  text-decoration: none;
  user-select: none;
  touch-action: manipulation;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}

.btn-ghost:hover, .btn-ghost:active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  color: #e2e8f0;
}

.btn-secondary:hover, .btn-secondary:active {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--panel-border-hover);
  color: #fff;
}

.btn-primary {
  background: linear-gradient(135deg, #06b6d4, #2563eb);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.35);
}

.btn-primary:hover, .btn-primary:active {
  filter: brightness(1.1);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.5);
}

.btn-luxury-export {
  background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #8b5cf6 100%);
  color: #fff;
  font-weight: 850;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.4);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn-luxury-export::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  transform: rotate(25deg);
  animation: glossSweep 4s ease-in-out infinite;
}

@keyframes glossSweep {
  0% { left: -60%; }
  30% { left: 140%; }
  100% { left: 140%; }
}

/* App Main Layout */
.app-container {
  display: flex;
  flex: 1;
  height: calc(100vh - 54px);
  height: calc(100dvh - 54px);
  position: relative;
  overflow: hidden;
}

/* Primary Toolbar Dock */
.toolbar-container {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--toolbar-bg);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius-xl);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 20px rgba(6, 182, 212, 0.15);
  max-width: 95vw;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  transition: all 0.25s ease;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.toolbar-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 0.25rem;
  flex-shrink: 0;
}

.tool-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.18s ease;
  touch-action: manipulation;
}

.tool-btn:hover, .tool-btn:active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}

.tool-btn.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(59, 130, 246, 0.25));
  color: var(--accent-cyan);
  border-color: rgba(6, 182, 212, 0.6);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.3);
}

.tool-btn svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

/* Tool badge for Exact Font Match */
.font-match-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  color: white;
  font-size: 0.52rem;
  font-weight: 850;
  padding: 1px 4px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 2px 6px rgba(236, 72, 153, 0.5);
  pointer-events: none;
}

/* Floating Properties Inspector Sub-Bar */
.inspector-bar {
  position: absolute;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 39;
  display: none;
  align-items: center;
  gap: 0.55rem;
  background: rgba(14, 18, 30, 0.98);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  font-size: 0.8rem;
  max-width: 95vw;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  animation: slideDownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.inspector-bar.visible {
  display: flex;
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translate(-50%, -8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.inspector-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.inspector-label {
  color: var(--text-dim);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.inspector-select, .inspector-input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  color: #fff;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  outline: none;
  transition: all 0.2s;
}

.inspector-select:focus, .inspector-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.3);
}

.color-picker-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.color-swatch-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.color-input-native {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

/* Smart 100% Font Match Highlight Tag */
.font-match-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* Sidebar (Page Thumbnails & Reorder) */
.sidebar-drawer {
  width: 220px;
  background: rgba(10, 13, 22, 0.96);
  border-right: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.25s ease, width 0.25s ease;
  z-index: 35;
}

.sidebar-drawer.collapsed {
  width: 0;
  border-right: none;
  overflow: hidden;
}

.sidebar-header {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.page-thumbnail-card {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 0.45rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-thumbnail-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.15);
}

.page-thumbnail-card.active {
  background: rgba(6, 182, 212, 0.08);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.25);
}

.thumbnail-canvas-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1.414;
  background: #ffffff;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.thumbnail-canvas-wrapper canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.thumbnail-placeholder {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 700;
}

.thumbnail-footer {
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.thumbnail-page-num {
  background: rgba(0, 0, 0, 0.4);
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
}

.thumbnail-actions {
  display: flex;
  gap: 0.2rem;
}

.thumb-action-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb-action-btn:hover {
  background: var(--accent-cyan);
  color: #000;
}

.thumb-action-btn.delete:hover {
  background: var(--accent-rose);
  color: #fff;
}

/* Main Workspace / Viewport */
.viewport-wrapper {
  flex: 1;
  position: relative;
  background: #090b12;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 100px 1.5rem 5rem 1.5rem;
  user-select: none;
  touch-action: pan-x pan-y;
}

.viewport-wrapper.drag-over {
  background: rgba(6, 182, 212, 0.05);
}

/* Floating Bottom Controls */
.bottom-floating-controls {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(14, 18, 30, 0.96);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.35rem 0.75rem;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 40;
  max-width: 95vw;
}

.zoom-indicator {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  min-width: 44px;
  text-align: center;
  cursor: pointer;
}

.page-stepper {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.page-stepper input {
  width: 36px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--panel-border);
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 0.15rem;
  font-size: 0.78rem;
  font-weight: 700;
  outline: none;
}

/* PDF Pages Rendering Virtual Container */
.pdf-pages-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  position: relative;
  transition: transform 0.15s ease-out;
}

.pdf-page-container {
  position: relative;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.7);
  background: #ffffff;
  border-radius: 4px;
  overflow: visible;
  transition: box-shadow 0.2s;
}

.pdf-page-container.placeholder {
  background: #181c2b;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 700;
}

.pdf-page-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Text Layer */
.pdf-text-layer {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  line-height: 1.0;
  pointer-events: none;
}

.pdf-text-layer span {
  position: absolute;
  color: transparent;
  cursor: text;
  white-space: pre;
  transform-origin: 0% 0%;
  pointer-events: auto;
  box-sizing: border-box;
  transition: background-color 0.1s;
}

.tool-active-edit-text .pdf-text-layer span {
  cursor: pointer;
  border-radius: 2px;
}

.tool-active-edit-text .pdf-text-layer span:hover {
  background-color: rgba(6, 182, 212, 0.28) !important;
  outline: 1px dashed #06b6d4;
}

/* Annotation / Draw Layer */
.annotation-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  touch-action: none;
}

.annotation-canvas.active-drawing {
  pointer-events: auto;
  cursor: crosshair;
}

/* Interactive Elements Overlay Layer */
.interactive-overlay-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 15;
}

/* Editable Elements */
.editable-element {
  position: absolute;
  pointer-events: auto;
  cursor: move;
  user-select: none;
  box-sizing: border-box;
}

.editable-element:hover {
  outline: 1px dashed rgba(6, 182, 212, 0.6);
}

.editable-element.selected {
  outline: 2px solid var(--accent-cyan) !important;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.4);
}

/* Element Resize Handles */
.resize-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border: 2px solid var(--accent-cyan);
  border-radius: 50%;
  z-index: 20;
}

.resize-handle.nw { top: -6px; left: -6px; cursor: nw-resize; }
.resize-handle.ne { top: -6px; right: -6px; cursor: ne-resize; }
.resize-handle.se { bottom: -6px; right: -6px; cursor: se-resize; }
.resize-handle.sw { bottom: -6px; left: -6px; cursor: sw-resize; }

/* Inline In-Place Exact Font Text Editor */
.inline-text-editor {
  position: absolute;
  outline: 2px solid var(--accent-cyan);
  border-radius: 2px;
  padding: 0;
  margin: 0;
  z-index: 25;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.0;
}

/* Empty Dropzone State */
.empty-state-card {
  max-width: 560px;
  width: 100%;
  background: var(--panel-bg);
  backdrop-filter: blur(24px);
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-xl);
  padding: 3rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.35rem;
  box-shadow: var(--shadow-luxury);
  transition: all 0.25s ease;
  margin: auto;
}

.empty-state-card:hover, .empty-state-card.drag-active {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 32px rgba(6, 182, 212, 0.25);
  transform: translateY(-2px);
}

.upload-icon-orb {
  width: 76px;
  height: 76px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(139, 92, 246, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: var(--accent-cyan);
  box-shadow: 0 10px 30px rgba(6, 182, 212, 0.25);
  animation: pulseOrb 3s ease-in-out infinite;
}

@keyframes pulseOrb {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.empty-title {
  font-size: 1.55rem;
  font-weight: 850;
  letter-spacing: -0.02em;
  color: #fff;
}

.empty-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 400px;
  line-height: 1.55;
}

.feature-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  margin-top: 0.4rem;
}

.feature-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  padding: 0.3rem 0.65rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.feature-tag span.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 5, 8, 0.85);
  backdrop-filter: blur(12px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

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

.modal-card {
  background: rgba(18, 22, 34, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8);
}

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

.modal-title {
  font-size: 1.1rem;
  font-weight: 850;
  color: #fff;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 8px;
}

.modal-body {
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.modal-footer {
  padding: 0.9rem 1.35rem;
  border-top: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  background: rgba(0, 0, 0, 0.2);
}

/* Tabs */
.tab-row {
  display: flex;
  border-bottom: 1px solid var(--panel-border);
  gap: 0.85rem;
}

.tab-btn {
  padding: 0.45rem 0.2rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  position: relative;
}

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

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-cyan);
}

/* Signature Drawing Canvas */
.signature-canvas-box {
  width: 100%;
  height: 160px;
  background: #ffffff;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  touch-action: none;
}

.signature-canvas-box canvas {
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.signature-font-preview {
  padding: 0.75rem;
  background: #ffffff;
  border-radius: var(--radius-md);
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #1e293b;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: 90vw;
}

.toast {
  background: rgba(18, 22, 34, 0.96);
  backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  pointer-events: auto;
  border-left: 4px solid var(--accent-cyan);
}

.toast.success { border-left-color: var(--accent-emerald); }
.toast.warning { border-left-color: var(--accent-amber); }
.toast.error { border-left-color: var(--accent-rose); }

/* --- RESPONSIVE MOBILE & TABLET OPTIMIZATIONS --- */
@media (max-width: 768px) {
  header.app-header {
    padding: 0 0.65rem;
  }

  .brand-name {
    display: none;
  }

  .header-center-info {
    display: none;
  }

  .sidebar-drawer {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.85);
    transform: translateX(-100%);
    width: 220px;
  }

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

  .toolbar-container {
    top: auto;
    bottom: 65px;
    width: 95vw;
    border-radius: 20px;
    padding: 0.3rem 0.5rem;
  }

  .inspector-bar {
    top: 10px;
    width: 95vw;
    border-radius: 16px;
  }

  .viewport-wrapper {
    padding: 60px 0.5rem 120px 0.5rem;
  }

  .bottom-floating-controls {
    bottom: 12px;
    padding: 0.25rem 0.6rem;
    gap: 0.35rem;
  }

  .empty-state-card {
    padding: 2rem 1.25rem;
    gap: 1.1rem;
  }

  .empty-title {
    font-size: 1.3rem;
  }

  .empty-desc {
    font-size: 0.82rem;
  }
}

@media (max-width: 480px) {
  .btn-luxury-export span {
    display: none;
  }
  .btn-luxury-export {
    padding: 0.42rem 0.7rem;
  }
  .tool-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
  }
}
