/* ==========================================================================
   Utility Seva - Upgraded Compact Passport Photo Maker Stylesheet
   Modern, responsive, compact two-column workspace with tabbed controls
   ========================================================================== */

/* ==========================================================================
   Shared Site Header & Theme Toggle Alignment
   Ensure exact match with homepage header and theme toggle
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.site-header .nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

.site-header .nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.site-header .theme-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: all var(--transition-fast);
}

.site-header .theme-toggle-btn:hover {
  background-color: var(--bg-surface-alt);
  color: var(--text-primary);
  border-color: var(--border-color-hover);
}

.site-header .theme-toggle-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin: auto;
}

.site-header .theme-toggle-btn .sun-icon {
  display: none;
}

.site-header .theme-toggle-btn .moon-icon {
  display: block;
}

html[data-theme="dark"] .site-header .theme-toggle-btn .sun-icon,
html.dark .site-header .theme-toggle-btn .sun-icon {
  display: block;
}

html[data-theme="dark"] .site-header .theme-toggle-btn .moon-icon,
html.dark .site-header .theme-toggle-btn .moon-icon {
  display: none;
}

/* Main Page Container */
.tool-editor-main {
  padding: 1rem 0 3rem;
}

/* ==========================================================================
   Compact Header & Mode Switcher
   ========================================================================== */
.editor-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.top-bar-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.breadcrumb-nav-compact {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.breadcrumb-nav-compact a {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.breadcrumb-nav-compact a:hover {
  color: var(--brand-600);
}

.tool-title-compact {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.02em;
}

.tool-badge-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background-color: rgba(5, 150, 105, 0.12);
  color: #059669;
  border: 1px solid rgba(5, 150, 105, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

html[data-theme="dark"] .tool-badge-pill,
html.dark .tool-badge-pill {
  background-color: rgba(52, 211, 153, 0.16);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.3);
}

/* Top-Level Mode Switcher (Edit Photo vs. Photo Sheet) */
.mode-switcher-container {
  display: inline-flex;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.25rem;
  box-shadow: var(--shadow-sm);
}

.mode-btn {
  padding: 0.45rem 1.15rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: none;
  cursor: pointer;
}

.mode-btn:hover {
  color: var(--text-primary);
}

.mode-btn.active {
  background-color: var(--brand-600);
  color: #ffffff;
  box-shadow: 0 2px 6px var(--brand-glow);
}

.mode-btn svg {
  width: 15px;
  height: 15px;
}

/* ==========================================================================
   Two-Column Compact Workspace (Edit Photo Mode)
   ========================================================================== */
.editor-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 960px) {
  .editor-workspace {
    grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr);
    align-items: start;
  }
}

@media (min-width: 1200px) {
  .editor-workspace {
    grid-template-columns: minmax(0, 1.35fr) minmax(380px, 1fr);
  }
}

/* Common Workspace Cards */
.workspace-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
  position: relative;
}

/* ==========================================================================
   Left Column: Photo Canvas & Interactive Tools
   ========================================================================== */
.photo-workspace-col {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.canvas-viewport-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
}

/* The soft sky-blue stage container holding the crop canvas & upload area */
.canvas-stage-outer {
  background-color: #e0f2fe; /* Soft sky blue */
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 380px;
  user-select: none;
  touch-action: none;
  cursor: grab;
  border: 1px solid #bae6fd;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.canvas-stage-outer:active {
  cursor: grabbing;
}

.canvas-stage-outer.erase-mode {
  cursor: crosshair !important;
}

/* Canvas Element */
.viewport-crop-canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.15);
}

/* Visual Passport Guide Overlay - Shading surrounding workspace in soft sky-blue */
.crop-guide-box {
  position: absolute;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(224, 242, 254, 0.92);
  border: 2px solid #0284c7;
  border-radius: 3px;
  transition: width 0.15s ease, height 0.15s ease;
}

/* Face Oval and Eye Level Guides with high-contrast shadow */
.crop-guide-box::before {
  content: '';
  position: absolute;
  top: 14%;
  bottom: 22%;
  left: 20%;
  right: 20%;
  border: 1.5px dashed #ffffff;
  border-radius: 50% / 42%;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.9));
}

.crop-guide-box::after {
  content: '';
  position: absolute;
  top: 42%;
  left: 0;
  right: 0;
  height: 1px;
  border-top: 1.5px dashed #ffffff;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.9));
}

/* Empty Drop Placeholder - High-contrast text, instructions & icons on sky blue */
.canvas-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  color: #334155;
  text-align: center;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.canvas-empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 0.75rem;
  color: #0284c7;
}

.canvas-empty-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.25rem;
}

.canvas-empty-sub {
  font-size: 0.825rem;
  color: #475569;
  max-width: 260px;
}

/* Metadata Info Bar */
.photo-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 0.65rem;
  padding: 0 0.25rem;
  font-size: 0.785rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.photo-info-pill {
  font-weight: 600;
  color: var(--text-primary);
}

/* Compact Toolbar beneath Canvas */
.canvas-quick-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 0.65rem;
  gap: 0.5rem;
  flex-wrap: wrap;
  background-color: var(--bg-surface-alt);
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.zoom-widget {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1;
  min-width: 180px;
}

.zoom-tool-slider {
  flex: 1;
  accent-color: var(--brand-600);
  cursor: pointer;
  height: 5px;
}

.icon-btn-tool {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn-tool:hover {
  background-color: var(--border-color);
}

.icon-btn-tool svg {
  width: 14px;
  height: 14px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-tool-text {
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.775rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-tool-text:hover {
  background-color: var(--border-color);
  color: var(--text-primary);
}

/* Compact Export Card (Always visible under photo) */
.export-bar-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.export-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.export-select-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.export-buttons-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-download-primary {
  background-color: var(--brand-600);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
  border: none;
}

.btn-download-primary:hover {
  background-color: var(--brand-700);
}

.btn-download-primary:active {
  transform: scale(0.97);
}

.btn-download-primary svg {
  width: 16px;
  height: 16px;
}

.btn-sheet-queue {
  background-color: var(--bg-surface-alt);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-sheet-queue:hover {
  background-color: var(--border-color);
}

.btn-sheet-queue svg {
  width: 16px;
  height: 16px;
  color: var(--brand-500);
}

/* ==========================================================================
   Right Column: Tabbed Control Panel
   ========================================================================== */
.controls-workspace-col {
  display: flex;
  flex-direction: column;
}

.tabbed-panel-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Horizontal Tabs Navigation Header */
.editor-tabs-nav {
  display: flex;
  background-color: var(--bg-surface-alt);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.editor-tabs-nav::-webkit-scrollbar {
  display: none;
}

.editor-tab-btn {
  padding: 0.75rem 0.95rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.editor-tab-btn:hover {
  color: var(--text-primary);
  background-color: rgba(99, 102, 241, 0.05);
}

.editor-tab-btn.active {
  color: var(--brand-600);
  border-bottom-color: var(--brand-600);
  background-color: var(--bg-surface);
}

html[data-theme="dark"] .editor-tab-btn.active,
html.dark .editor-tab-btn.active {
  color: var(--brand-500);
  border-bottom-color: var(--brand-500);
}

.editor-tab-btn svg {
  width: 15px;
  height: 15px;
}

/* Tab Panels Content Body */
.tab-panel-body {
  padding: 1.15rem;
  max-height: 480px;
  overflow-y: auto;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ==========================================================================
   Tab 1: Size & Crop
   ========================================================================== */
.preset-search-box {
  position: relative;
  margin-bottom: 0.75rem;
}

.preset-search-input {
  width: 100%;
  padding: 0.45rem 0.75rem 0.45rem 2rem;
  font-size: 0.825rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  outline: none;
}

.preset-search-input:focus {
  border-color: var(--brand-500);
}

.preset-search-icon {
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

/* Presets List */
.presets-list-scroll {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 0.25rem;
  margin-bottom: 0.85rem;
}

.preset-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.825rem;
}

.preset-item-row:hover {
  background-color: var(--bg-surface-alt);
  border-color: var(--border-color-hover);
}

.preset-item-row.active {
  border-color: var(--brand-500);
  background-color: rgba(99, 102, 241, 0.08);
  font-weight: 600;
}

.preset-country-name {
  color: var(--text-primary);
  font-weight: 600;
}

.preset-dim-badge {
  font-size: 0.75rem;
  color: var(--brand-600);
  background-color: rgba(99, 102, 241, 0.1);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
}

html[data-theme="dark"] .preset-dim-badge,
html.dark .preset-dim-badge {
  color: var(--brand-500);
}

/* Custom Dimensions Toggleable Box */
.custom-dims-wrapper {
  background-color: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-top: 0.5rem;
}

.custom-grid-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   Tab 2: Tune (Photo Enhancement)
   ========================================================================== */
.tune-controls-stack {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.tune-slider-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tune-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.tune-val-pill {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-600);
  background-color: var(--bg-surface-alt);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-sm);
}

html[data-theme="dark"] .tune-val-pill,
html.dark .tune-val-pill {
  color: var(--brand-500);
}

.tune-actions-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* ==========================================================================
   Tab 3: Background / Erase
   ========================================================================== */
.bg-tab-section {
  margin-bottom: 1rem;
}

.bg-tab-section:last-child {
  margin-bottom: 0;
}

.section-subhead {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.bg-palette-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.bg-swatch-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bg-swatch-btn:hover {
  transform: scale(1.08);
}

.bg-swatch-btn.active {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 2px var(--brand-glow);
}

.bg-swatch-btn svg {
  display: none;
  width: 14px;
  height: 14px;
}

.bg-swatch-btn.active svg {
  display: block;
}

/* Eraser Box */
.eraser-controls-card {
  background-color: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.eraser-btn-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.eraser-mode-btn {
  flex: 1;
  padding: 0.4rem 0.65rem;
  font-size: 0.775rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.eraser-mode-btn.active {
  background-color: var(--brand-600);
  color: #ffffff;
  border-color: var(--brand-600);
}


/* ==========================================================================
   FIX 1 & FIX 2: Circular Brush Cursor & Magic Brush Styles
   ========================================================================== */

/* Circular Brush Cursor Preview for Erase and Restore Brushes */
.brush-cursor-overlay {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 45;
  box-sizing: border-box;
  will-change: left, top, width, height;
}

/* Erase Mode: subtle red tint with crisp high-contrast white & red dual outline */
.brush-cursor-overlay.erase {
  background-color: rgba(239, 68, 68, 0.20);
  border: 1.5px solid #ef4444;
  box-shadow: 0 0 0 1.5px #ffffff, 0 0 4px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

/* Restore Mode: subtle green tint with crisp high-contrast white & green dual outline */
.brush-cursor-overlay.restore {
  background-color: rgba(16, 185, 129, 0.20);
  border: 1.5px solid #10b981;
  box-shadow: 0 0 0 1.5px #ffffff, 0 0 4px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

/* Hide native OS pointer when circular brush is active so the circular preview acts as cursor */
.canvas-stage-outer.brush-active {
  cursor: none !important;
}

.canvas-stage-outer.brush-active * {
  cursor: none !important;
}

/* Magic Brush cursor: high-precision crosshair cursor */
.canvas-stage-outer.magic-active {
  cursor: crosshair !important;
}

.canvas-stage-outer.magic-active * {
  cursor: crosshair !important;
}

/* Magic Brush Active Guidance Indicator */
.magic-brush-badge {
  font-size: 0.75rem;
  line-height: 1.4;
  padding: 0.45rem 0.65rem;
  background-color: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-sm);
  color: var(--brand-600);
  margin-top: 0.35rem;
  animation: fadeInBadge 0.2s ease-in-out;
}

html[data-theme="dark"] .magic-brush-badge,
html.dark .magic-brush-badge {
  background-color: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
}

@keyframes fadeInBadge {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Tab 4: Info (Name & Date Overlay)
   ========================================================================== */
.info-tab-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toggle-switch-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.info-fields-box {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

/* ==========================================================================
   Tab 5: Border
   ========================================================================== */
.border-tab-content {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* ==========================================================================
   Mode 2: Photo Sheet Workspace
   ========================================================================== */
.sheet-workspace-container {
  display: none;
}

.sheet-workspace-container.active {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sheet-header-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
}

.sheet-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  width: 100%;
}

.sheet-stage-wrap {
  background-color: #0c0f17;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 440px;
  max-height: 600px;
  overflow: auto;
}

.sheet-canvas-render {
  background-color: #ffffff;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  max-width: 100%;
  max-height: 540px;
  object-fit: contain;
}

/* ==========================================================================
   Shared Form Controls & Feedback Banners
   ========================================================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input-sm,
.form-select-sm {
  width: 100%;
  padding: 0.45rem 0.65rem;
  font-size: 0.825rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-input-sm:focus,
.form-select-sm:focus {
  border-color: var(--brand-500);
}

.output-specs-banner {
  background-color: var(--bg-surface-alt);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
}

.output-specs-highlight {
  font-weight: 700;
  color: var(--brand-600);
}

html[data-theme="dark"] .output-specs-highlight,
html.dark .output-specs-highlight {
  color: var(--brand-500);
}

.resolution-warning-box {
  background-color: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #d97706;
  border-radius: var(--radius-md);
  padding: 0.65rem 0.95rem;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

html[data-theme="dark"] .resolution-warning-box,
html.dark .resolution-warning-box {
  background-color: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.25);
  color: #fcd34d;
}

.resolution-warning-box svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.official-disclaimer-box {
  background-color: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--brand-500);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 1.5rem;
}

.guidance-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (min-width: 768px) {
  .guidance-cards-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.guidance-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  font-size: 0.825rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.guidance-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.guidance-card-title svg {
  width: 18px;
  height: 18px;
  color: var(--brand-500);
}

.guidance-card ul {
  padding-left: 1.25rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* Screen hidden for print wrapper */
.sheet-print-wrapper {
  display: none;
}

/* ==========================================================================
   Print Stylesheet (@media print)
   Dedicated clean layout without scrollbars, headers, margins, or clipping
   ========================================================================== */
@media print {
  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Hide absolutely everything on the web page except the dedicated print wrapper */
  .site-header,
  .site-footer,
  .tool-editor-main,
  .print-hide {
    display: none !important;
  }

  /* Display ONLY the dedicated print wrapper */
  .sheet-print-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    page-break-before: avoid !important;
    page-break-after: avoid !important;
  }

  /* Display the high-res sheet image matching exact physical page dimensions */
  .sheet-print-img {
    display: block !important;
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    margin: auto !important;
    border: none !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  @page {
    margin: 0;
    size: auto;
  }
}
