/* ==========================================================================
   TOOL WORKSPACES & INTERACTIVE UI STYLES
   ========================================================================== */

/* --- Dropzone / File Uploaders --- */
.dropzone-container {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 1.5rem;
  text-align: center;
  background: var(--bg-surface);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.dropzone-container:hover, .dropzone-container.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.005);
}

.dropzone-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.dropzone-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

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

.file-input-hidden {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* File Selected Preview Strip */
.file-preview-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  margin-top: 1rem;
}

.file-info-col {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.file-thumb-mini {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border);
}

.file-name {
  font-weight: 700;
  font-size: 0.95rem;
  max-width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   IMAGE CONVERTER - TARGET CONVERSION SETTINGS PANEL
   ========================================================================== */
.converter-settings-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.converter-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.converter-settings-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.converter-settings-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.converter-settings-icon i {
  width: 20px;
  height: 20px;
}

.converter-settings-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  line-height: 1.2;
}

.converter-settings-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 3px 0 0 0;
}

.converter-engine-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.converter-engine-pill i {
  width: 14px;
  height: 14px;
}

/* Settings 3-Column Grid */
.converter-settings-grid {
  display: grid;
  grid-template-columns: 1.35fr 1.2fr 1fr;
  gap: 1.25rem;
  align-items: stretch;
}

@media (max-width: 992px) {
  .converter-settings-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .converter-settings-grid {
    grid-template-columns: 1fr;
  }
}

.converter-setting-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.6rem;
  background: var(--bg-body);
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.converter-setting-item:hover {
  border-color: rgba(99, 102, 241, 0.35);
  background: var(--bg-card-hover);
}

.converter-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.converter-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-main);
  margin: 0;
}

.converter-label i {
  width: 15px;
  height: 15px;
  color: var(--primary);
  flex-shrink: 0;
}

.converter-select-wrap {
  position: relative;
  width: 100%;
}

.converter-select {
  width: 100%;
  padding: 0.65rem 2.2rem 0.65rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  appearance: none;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: var(--transition);
}

.converter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.converter-select-arrow {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.converter-control-hint {
  font-size: 0.73rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.converter-quality-badge {
  font-size: 0.75rem;
  font-weight: 800;
  font-family: var(--font-mono);
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.converter-slider-wrap {
  padding: 0.2rem 0;
  display: flex;
  align-items: center;
}

.converter-range-slider {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  accent-color: var(--primary);
  cursor: pointer;
}

.converter-quality-hints {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.converter-quality-hints .active-preset {
  color: var(--primary);
  font-weight: 700;
}

/* Background Color Row */
.converter-color-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.converter-color-input-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--border);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition);
}

.converter-color-input-wrap:hover {
  border-color: var(--primary);
  transform: scale(1.05);
}

.converter-color-picker {
  position: absolute;
  inset: -12px;
  width: 64px;
  height: 64px;
  border: none;
  cursor: pointer;
  background: transparent;
}

.converter-color-desc {
  display: flex;
  flex-direction: column;
}

.color-desc-main {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.color-desc-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.converter-color-presets {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.color-preset-chip {
  padding: 2px 7px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.color-preset-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* --- Batch Resizer Gallery Cards --- */
.batch-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.batch-image-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
}

.batch-image-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.batch-card-thumb-wrap {
  position: relative;
  height: 160px;
  background: repeating-conic-gradient(#80808020 0% 25%, transparent 0% 50%) 50% / 16px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.batch-card-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.batch-badge-overlay {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

.batch-remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.batch-remove-btn:hover {
  transform: scale(1.15);
  background: #dc2626;
}

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

.batch-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.batch-dim-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.batch-status-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.batch-status-ready { background: var(--primary-light); color: var(--primary); }
.batch-status-done { background: var(--success-light); color: var(--success); }
.batch-status-processing { background: var(--warning-light); color: var(--warning); }

.batch-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Form Controls & Grids */
.tool-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-textarea {
  min-height: 140px;
  font-family: var(--font-mono);
  resize: vertical;
  line-height: 1.5;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary,
a.btn-primary {
  background: var(--primary);
  color: #ffffff !important;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover,
.btn-primary:focus,
a.btn-primary:hover,
a.btn-primary:focus {
  background: var(--primary-hover);
  color: #ffffff !important;
  transform: translateY(-1px);
}

.btn-secondary,
a.btn-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-main) !important;
}

.btn-secondary:hover,
.btn-secondary:focus,
a.btn-secondary:hover,
a.btn-secondary:focus {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
  color: var(--text-main) !important;
}

.btn-success,
a.btn-success {
  background: var(--success);
  color: #ffffff !important;
}

.btn-success:hover,
.btn-success:focus,
a.btn-success:hover,
a.btn-success:focus {
  background: #059669;
  color: #ffffff !important;
}

.btn-danger,
a.btn-danger {
  background: var(--danger);
  color: #ffffff !important;
}

.btn-danger:hover,
.btn-danger:focus,
a.btn-danger:hover,
a.btn-danger:focus {
  background: #dc2626;
  color: #ffffff !important;
}

.btn i,
.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  gap: 0.4rem;
}

.btn-sm i,
.btn-sm svg {
  width: 15px;
  height: 15px;
}

.btn-xs {
  padding: 0.32rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  gap: 0.35rem;
  border-radius: var(--radius-sm);
}

.btn-xs i,
.btn-xs svg {
  width: 13px;
  height: 13px;
}

.btn-block {
  width: 100%;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Sliders */
.range-slider-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.range-slider {
  flex-grow: 1;
  accent-color: var(--primary);
  cursor: pointer;
}

.range-val-badge {
  font-weight: 800;
  font-size: 0.9rem;
  min-width: 45px;
  padding: 4px 8px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-sm);
  text-align: center;
}

/* Stats Counter Badges (Word counter, etc) */
.stats-counter-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}

.stat-number {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-top: 0.25rem;
}

/* Code & JSON Workspace */
.code-editor-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

@media (max-width: 768px) {
  .code-editor-container {
    grid-template-columns: 1fr;
  }
}

.editor-box {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: var(--bg-card-hover);
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 700;
}

.code-textarea {
  width: 100%;
  min-height: 320px;
  padding: 1rem;
  background: var(--bg-input);
  border: none;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-main);
  resize: vertical;
  outline: none;
  line-height: 1.5;
}

/* Image Cropper & Preview */
.canvas-preview-container {
  max-width: 100%;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: repeating-conic-gradient(#80808020 0% 25%, transparent 0% 50%) 50% / 20px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  min-height: 250px;
  border: 1px solid var(--border);
}

.canvas-preview-container canvas, .canvas-preview-container img {
  max-width: 100%;
  max-height: 480px;
  box-shadow: var(--shadow-md);
}

/* EMI & Finance Highlight Cards */
.result-hero-card {
  background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  margin: 1.5rem 0;
}

.result-hero-value {
  font-size: 3rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1.1;
}

.result-hero-subtitle {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Google SERP Preview Box */
.serp-preview-box {
  background: #ffffff;
  color: #202124;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  font-family: Arial, sans-serif;
  margin-top: 1.5rem;
}

.serp-url-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 12px;
  color: #202124;
  margin-bottom: 4px;
}

.serp-title {
  font-size: 20px;
  color: #1a0dab;
  cursor: pointer;
  line-height: 1.3;
  margin-bottom: 4px;
  word-break: break-word;
}

.serp-title:hover {
  text-decoration: underline;
}

.serp-snippet {
  font-size: 14px;
  color: #4d5156;
  line-height: 1.58;
}

/* Social Card Preview */
.social-card-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
  max-width: 520px;
  margin-top: 1.5rem;
}

.social-card-img {
  width: 100%;
  height: 270px;
  object-fit: cover;
  background: var(--bg-body);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.social-card-body {
  padding: 1rem 1.25rem;
}

.social-card-domain {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.social-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0.25rem 0;
}

.social-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Diff Viewer */
.diff-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.diff-pane {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  min-height: 250px;
  white-space: pre-wrap;
}

.diff-add { background: rgba(16, 185, 129, 0.2); color: #059669; }
.diff-del { background: rgba(239, 68, 68, 0.2); color: #dc2626; text-decoration: line-through; }

/* ==========================================================================
   IMAGE COMPRESSOR - BATCH STUDIO & BEFORE/AFTER COMPARISON STYLING
   ========================================================================== */

.compressor-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
  gap: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.compressor-batch-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 1 1 auto;
}

.compressor-batch-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-main);
  line-height: 1.2;
}

.compressor-batch-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.35;
  word-break: break-word;
}

.compressor-top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .compressor-top-bar {
    padding: 0.75rem 0.85rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .compressor-batch-meta {
    width: 100%;
  }

  .compressor-batch-title {
    font-size: 0.95rem;
  }

  .compressor-batch-sub {
    font-size: 0.76rem;
  }

  .compressor-top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.4rem;
  }

  .compressor-top-actions .btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.4rem;
    font-size: 0.8rem;
    font-weight: 700;
    gap: 0.3rem;
    white-space: nowrap;
  }
}

/* Dual Column Studio Grid */
.compressor-studio-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.25rem;
  align-items: start;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1024px) {
  .compressor-studio-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

/* Left: Before/After Comparison Stage Box */
.compressor-stage-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.compressor-stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.15rem;
  background: var(--bg-body);
  border-bottom: 1px solid var(--border);
  gap: 0.75rem;
  width: 100%;
  box-sizing: border-box;
}

.compressor-active-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1 1 auto;
}

.active-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
  flex-shrink: 0;
}

.compressor-active-filename {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.compressor-view-modes {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}

.comp-view-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.comp-view-pill.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.comp-view-pill i {
  width: 14px;
  height: 14px;
}

@media (max-width: 640px) {
  .compressor-stage-header {
    padding: 0.65rem 0.75rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .compressor-active-info {
    width: 100%;
  }

  .compressor-active-filename {
    max-width: 100%;
    font-size: 0.85rem;
  }

  .compressor-view-modes {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    box-sizing: border-box;
  }

  .comp-view-pill {
    width: 100%;
    justify-content: center;
    padding: 0.45rem 0.25rem;
    font-size: 0.75rem;
  }
}

/* Interactive Before / After Comparison Container */
.compressor-compare-container {
  position: relative;
  min-height: 320px;
  max-height: 480px;
  background: repeating-conic-gradient(var(--border) 0% 25%, transparent 0% 50%) 50% / 20px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0.75rem;
  user-select: none;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .compressor-compare-container {
    min-height: 220px;
    max-height: 340px;
    padding: 0.35rem;
  }
}

/* Split Slider Mode */
.compare-split-wrapper {
  position: relative;
  max-width: 100%;
  max-height: 450px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  overflow: hidden;
  touch-action: none;
  cursor: ew-resize;
  box-sizing: border-box;
}

.compare-img {
  display: block;
  max-width: 100%;
  max-height: 450px;
  object-fit: contain;
  vertical-align: middle;
  user-select: none;
  -webkit-user-drag: none;
}

.compare-before-img {
  display: block;
  max-width: 100%;
  height: auto;
}

.compare-after-clip {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 50%;
  overflow: hidden;
  border-right: 2px solid #ffffff;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.compare-after-img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  max-height: 100%;
  height: 100%;
  width: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.compare-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ffffff;
  pointer-events: none;
  z-index: 10;
}

.compare-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  background: #ffffff;
  color: #0f172a;
  border: 2px solid var(--primary);
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: ew-resize;
  pointer-events: auto;
  transition: transform 0.15s ease, background-color 0.15s ease;
  z-index: 15;
}

@media (max-width: 640px) {
  .compare-handle {
    width: 44px;
    height: 44px;
  }

  .compare-handle i {
    width: 20px;
    height: 20px;
  }
}

.compare-handle:hover, .compare-handle:active {
  transform: translate(-50%, -50%) scale(1.12);
  background: var(--primary);
  color: #ffffff;
}

.compare-handle i {
  width: 18px;
  height: 18px;
}

/* Floating Badges inside Comparison */
.compare-badge {
  position: absolute;
  z-index: 12;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(6px);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  white-space: nowrap;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compare-badge-before {
  top: 8px;
  right: 8px;
}

.compare-badge-after {
  top: 8px;
  left: 8px;
}

.compare-badge strong {
  font-family: var(--font-mono);
  color: #38bdf8;
}

@media (max-width: 480px) {
  .compare-badge {
    font-size: 0.65rem;
    padding: 2px 5px;
    top: 5px;
  }
  .compare-badge-before { right: 5px; }
  .compare-badge-after { left: 5px; }
}

/* Side by Side Mode */
.compare-side-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .compare-side-wrapper {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

.side-img-wrap {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  box-sizing: border-box;
}

.side-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Stage Bottom Metrics Strip - 3-Stat Card Grid */
.compressor-metric-strip {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  width: 100%;
  box-sizing: border-box;
}

.compressor-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  width: 100%;
  box-sizing: border-box;
}

.comp-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.5rem;
  min-width: 0;
  box-sizing: border-box;
}

.comp-stat-lbl {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
}

.comp-stat-val {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text-main);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.comp-stat-card.comp-stat-new .comp-stat-val {
  color: var(--primary);
}

.comp-stat-card.comp-stat-saved .comp-stat-val {
  color: var(--success);
}

.comp-download-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-weight: 800;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  box-sizing: border-box;
}

@media (max-width: 480px) {
  .compressor-metric-strip {
    padding: 0.65rem 0.75rem;
    gap: 0.6rem;
  }

  .compressor-metrics-grid {
    gap: 0.35rem;
  }

  .comp-stat-card {
    padding: 0.35rem 0.25rem;
  }

  .comp-stat-lbl {
    font-size: 0.62rem;
  }

  .comp-stat-val {
    font-size: 0.76rem;
  }

  .comp-download-btn {
    padding: 0.65rem;
    font-size: 0.88rem;
  }
}

/* Right Sidebar Box */
.compressor-sidebar-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.compressor-setting-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-sm);
  width: 100%;
  box-sizing: border-box;
}

.comp-setting-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.comp-quality-presets {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.comp-preset-btn {
  flex: 1;
  padding: 0.35rem 0.4rem;
  font-size: 0.74rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-body);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.comp-preset-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.comp-preset-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  font-weight: 800;
}

/* Batch Filmstrip / Queue in Compressor */
.compressor-batch-tray {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
  box-sizing: border-box;
}

.comp-tray-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.compressor-queue-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 2px;
  width: 100%;
  box-sizing: border-box;
}

.comp-queue-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.65rem;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  box-sizing: border-box;
}

.comp-queue-card:hover {
  border-color: var(--primary);
  transform: translateX(2px);
}

.comp-queue-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 1px var(--primary-glow);
}

.comp-queue-thumb {
  width: 42px;
  height: 42px;
  border-radius: 4px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.comp-queue-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comp-queue-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex-grow: 1;
}

.comp-queue-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.comp-queue-stats {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.comp-queue-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.comp-queue-del-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.comp-queue-del-btn:hover {
  background: var(--danger-light);
  color: var(--danger);
}

/* ==========================================================================
   IMAGERESIZER.COM-STYLE STUDIO WORKSPACE STYLING
   ========================================================================== */

.resizer-studio-container {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Studio Topbar */
.resizer-studio-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: var(--bg-body);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  gap: 0.75rem;
  width: 100%;
  box-sizing: border-box;
}

.studio-file-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1 1 auto;
}

.studio-active-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-main);
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.studio-active-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.studio-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .resizer-studio-topbar {
    padding: 0.65rem 0.85rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .studio-file-info {
    width: 100%;
  }

  .studio-active-title {
    max-width: calc(100vw - 120px);
    font-size: 0.9rem;
  }

  .studio-active-meta {
    font-size: 0.75rem;
  }

  .studio-topbar-actions {
    width: 100%;
    display: flex;
    gap: 0.4rem;
  }

  .studio-topbar-actions .btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.4rem;
    font-size: 0.78rem;
    font-weight: 700;
    gap: 0.3rem;
    white-space: nowrap;
  }

  .studio-topbar-actions .btn i {
    width: 14px;
    height: 14px;
  }
}

/* Studio Main Grid Layout */
.resizer-studio-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  min-height: 600px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 992px) {
  .resizer-studio-grid {
    grid-template-columns: 1fr;
    min-height: auto;
  }
}

/* Left Column: Canvas Stage */
.resizer-canvas-stage {
  display: flex;
  flex-direction: column;
  background: var(--bg-body);
  border-right: 1px solid var(--border);
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 992px) {
  .resizer-canvas-stage {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

/* Canvas Stage Header (Responsive Toolbar) */
.canvas-stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  gap: 0.75rem;
  min-height: 52px;
}

/* Mode Pills Container */
.studio-mode-pill-group {
  display: inline-flex;
  align-items: center;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.studio-mode-pill-group::-webkit-scrollbar {
  display: none;
}

.studio-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.studio-mode-pill i {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.studio-mode-pill:hover {
  color: var(--text-main);
}

.studio-mode-pill.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

/* Zoom Toolbar */
.canvas-zoom-toolbar {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 2px 4px;
  flex-shrink: 0;
}

.canvas-tool-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.canvas-tool-btn i {
  width: 14px;
  height: 14px;
}

.canvas-tool-btn:hover {
  background: var(--bg-surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.canvas-zoom-badge {
  font-size: 0.75rem;
  font-weight: 800;
  font-family: var(--font-mono);
  padding: 0 0.35rem;
  color: var(--text-main);
  min-width: 40px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  user-select: none;
}

/* Responsive adjustments for Canvas Stage Header */
@media (max-width: 768px) {
  .canvas-stage-header {
    padding: 0.45rem 0.75rem;
    gap: 0.5rem;
  }

  .studio-mode-pill {
    padding: 0.32rem 0.65rem;
    font-size: 0.78rem;
    gap: 0.25rem;
  }

  .studio-mode-pill i {
    width: 14px;
    height: 14px;
  }

  .canvas-zoom-toolbar {
    padding: 2px 3px;
    gap: 1px;
  }

  .canvas-tool-btn {
    width: 26px;
    height: 26px;
  }

  .canvas-tool-btn i {
    width: 13px;
    height: 13px;
  }

  .canvas-zoom-badge {
    font-size: 0.72rem;
    min-width: 36px;
    padding: 0 0.2rem;
  }
}

@media (max-width: 480px) {
  .canvas-stage-header {
    padding: 0.4rem 0.5rem;
    gap: 0.35rem;
  }

  .studio-mode-pill {
    padding: 0.3rem 0.5rem;
    font-size: 0.72rem;
    gap: 0.2rem;
  }

  .studio-mode-pill i {
    width: 13px;
    height: 13px;
  }

  #resizerResetZoomBtn {
    display: none;
  }

  .canvas-zoom-badge {
    font-size: 0.68rem;
    min-width: 32px;
    padding: 0 0.15rem;
  }
}

/* Canvas Viewport */
.canvas-viewport {
  flex: 1;
  min-height: 380px;
  max-height: 520px;
  background: repeating-conic-gradient(var(--border) 0% 25%, transparent 0% 50%) 50% / 20px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  contain: paint;
  padding: 1.25rem;
  position: relative;
  user-select: none;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .canvas-viewport {
    padding: 0.6rem;
    min-height: 260px;
  }
}

.canvas-content-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease-out;
  max-width: 100%;
  max-height: 100%;
}

#resizerMainCanvas {
  max-width: 100%;
  max-height: 480px;
  object-fit: contain;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
  border-radius: 4px;
  background: #ffffff;
  display: block;
}

/* Interactive Visual Cropper Box */
.visual-crop-box {
  position: absolute;
  top: 0;
  left: 0;
  border: 2px dashed #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.65);
  cursor: move;
  touch-action: none;
  z-index: 10;
}

/* Rule of Thirds Lines */
.crop-grid-h1, .crop-grid-h2 {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  border-top: 1px dotted rgba(255, 255, 255, 0.6);
  pointer-events: none;
}
.crop-grid-h1 { top: 33.333%; }
.crop-grid-h2 { top: 66.666%; }

.crop-grid-v1, .crop-grid-v2 {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  border-left: 1px dotted rgba(255, 255, 255, 0.6);
  pointer-events: none;
}
.crop-grid-v1 { left: 33.333%; }
.crop-grid-v2 { left: 66.666%; }

/* Dimension pill inside crop box */
.crop-dim-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}

/* 8 Drag Handles */
.crop-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border: 2px solid #0284c7;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  z-index: 12;
}

.handle-nw { top: -6px; left: -6px; cursor: nwse-resize; }
.handle-n  { top: -6px; left: calc(50% - 6px); cursor: ns-resize; }
.handle-ne { top: -6px; right: -6px; cursor: nesw-resize; }
.handle-e  { top: calc(50% - 6px); right: -6px; cursor: ew-resize; }
.handle-se { bottom: -6px; right: -6px; cursor: nwse-resize; }
.handle-s  { bottom: -6px; left: calc(50% - 6px); cursor: ns-resize; }
.handle-sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
.handle-w  { top: calc(50% - 6px); left: -6px; cursor: ew-resize; }

/* Canvas Info Strip */
.canvas-info-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 0.65rem 1.25rem;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  flex-wrap: wrap;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .canvas-info-strip {
    gap: 0.35rem;
    font-size: 0.74rem;
    padding: 0.45rem 0.6rem;
  }

  .canvas-info-item {
    gap: 0.2rem;
  }

  .canvas-info-arrow {
    margin: 0 0.15rem;
  }

  .canvas-info-arrow i {
    width: 13px;
    height: 13px;
  }
}

.canvas-info-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.canvas-info-item.highlight {
  color: var(--primary);
}

.canvas-info-item strong {
  font-family: var(--font-mono);
}

.canvas-info-item .info-size {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.canvas-info-item .info-size.badge-success {
  color: var(--success);
  font-weight: 700;
}

.canvas-info-arrow {
  color: var(--text-sub);
}

.canvas-info-arrow i {
  width: 16px;
  height: 16px;
}

/* Bottom Batch Tray */
.batch-tray-section {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .batch-tray-section {
    padding: 0.5rem 0.75rem;
  }

  .batch-tray-header {
    font-size: 0.78rem;
    gap: 0.35rem;
  }

  .batch-apply-all-toggle {
    font-size: 0.72rem;
  }
}

.batch-tray-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  font-size: 0.85rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.batch-tray-title {
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-main);
}

.batch-apply-all-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
}

.batch-filmstrip {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 2px 8px 2px;
}

.batch-thumb-item {
  flex: 0 0 76px;
  height: 76px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: var(--bg-body);
  transition: var(--transition);
}

.batch-thumb-item:hover {
  border-color: var(--primary-hover);
  transform: translateY(-2px);
}

.batch-thumb-item.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.batch-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.batch-thumb-del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: var(--transition);
}

.batch-thumb-item:hover .batch-thumb-del {
  opacity: 1;
}

.batch-thumb-del:hover {
  background: #dc2626;
  transform: scale(1.15);
}

.batch-thumb-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.8);
  color: #fff;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  text-align: center;
  padding: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Right Column: Settings Sidebar (Dual-column on desktop, transforms to Bottom Sheet on mobile) */
.resizer-sidebar-panel {
  padding: 1.25rem;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow-y: auto;
  max-height: 680px;
}

/* Bottom Sheet Elements (Desktop default: hidden) */
.bottomsheet-backdrop {
  display: none;
}

.bottomsheet-handle-bar {
  display: none;
}

.bottomsheet-mobile-header {
  display: none;
}

.bottomsheet-mode-nav {
  display: none;
}

.resizer-mobile-bottom-bar {
  display: none;
}

.desktop-only-header {
  display: block;
}

/* ==========================================================================
   MOBILE BOTTOM SHEET RESPONSIVE RULES (<= 992px)
   ========================================================================== */
@media (max-width: 992px) {
  .desktop-only-header {
    display: none;
  }

  /* Backdrop Overlay with Rich Blur */
  .bottomsheet-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 30, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .bottomsheet-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  /* Slide-up Bottom Sheet Drawer */
  .resizer-sidebar-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -20px 50px -10px rgba(0, 0, 0, 0.45);
    z-index: 999;
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(102%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1), visibility 0.38s ease;
    padding: 0 1.25rem max(2rem, env(safe-area-inset-bottom)) 1.25rem;
    box-sizing: border-box;
    max-width: 100vw;
  }

  .resizer-sidebar-panel.sheet-open {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }

  /* Pill Grabber Handle */
  .bottomsheet-handle-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 0 8px 0;
    cursor: grab;
    touch-action: none;
  }

  .bottomsheet-grabber {
    width: 44px;
    height: 5px;
    background: var(--border);
    border-radius: 9999px;
    transition: var(--transition);
  }

  .bottomsheet-handle-bar:active .bottomsheet-grabber {
    background: var(--primary);
    transform: scaleX(1.2);
  }

  /* Header inside Bottom Sheet */
  .bottomsheet-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem 0 0.85rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.85rem;
  }

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

  .bottomsheet-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .bottomsheet-icon-wrap i {
    width: 20px;
    height: 20px;
  }

  .bottomsheet-title-col {
    display: flex;
    flex-direction: column;
  }

  .bottomsheet-title-text {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
    line-height: 1.2;
  }

  .bottomsheet-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
  }

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

  .bottomsheet-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-body);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
  }

  .bottomsheet-close-btn:hover {
    background: var(--danger-light);
    color: var(--danger);
    border-color: var(--danger);
    transform: scale(1.06);
  }

  /* Segmented Mode Switcher inside Bottom Sheet */
  .bottomsheet-mode-nav {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-body);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-bottom: 1.15rem;
  }

  .sheet-mode-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem 0.3rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
  }

  .sheet-mode-tab i {
    width: 15px;
    height: 15px;
  }

  .sheet-mode-tab.active {
    background: var(--bg-surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
    font-weight: 800;
  }

  /* Floating Bottom Dock Bar */
  .resizer-mobile-bottom-bar {
    display: flex;
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 0.5rem 0.75rem max(0.5rem, env(safe-area-inset-bottom)) 0.75rem;
    z-index: 990;
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
  }

  .mobile-dock-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
  }

  .mobile-tool-btn-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
  }

  .mobile-tool-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 0.4rem 0.2rem;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
  }

  .mobile-tool-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
  }

  .mobile-tool-icon-wrap i {
    width: 17px;
    height: 17px;
  }

  .mobile-tool-btn.active {
    color: var(--primary);
  }

  .mobile-tool-btn.active .mobile-tool-icon-wrap {
    background: var(--primary-light);
    color: var(--primary);
    transform: translateY(-2px);
  }

  .mobile-quick-cta {
    padding: 0.6rem 1.15rem;
    font-weight: 800;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: var(--radius-full);
    white-space: nowrap;
    box-shadow: 0 4px 14px var(--primary-glow);
    transition: var(--transition);
  }

  .mobile-quick-cta:active {
    transform: scale(0.96);
  }
}

.sidebar-section-header h4 {
  font-size: 0.95rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.85rem 0;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-section-header h4 i {
  width: 17px;
  height: 17px;
  color: var(--primary);
}

.studio-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

/* Unit Tabs */
.unit-tabs-row {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  background: var(--bg-body);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow-x: auto;
}

.unit-tab-btn {
  flex: 1;
  padding: 0.4rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  text-align: center;
}

.unit-tab-btn:hover {
  color: var(--text-main);
}

.unit-tab-btn.active {
  background: var(--bg-surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Dimensions Inputs Row & Aspect Lock Button */
.dimension-inputs-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}

.aspect-lock-col {
  margin-bottom: 0.25rem;
}

.aspect-lock-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-body);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.aspect-lock-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.aspect-lock-btn.locked {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.aspect-lock-btn i {
  width: 17px;
  height: 17px;
}

/* Preset Chips */
.preset-chips-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.preset-chip {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-body);
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}

.preset-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.preset-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Crop Aspect Ratio Grid */
.aspect-ratio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.aspect-ratio-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-body);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.aspect-ratio-btn:hover {
  border-color: var(--primary);
}

.aspect-ratio-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.ratio-box {
  display: inline-block;
  border: 1.5px solid currentColor;
  border-radius: 1px;
}

.ratio-1-1 { width: 14px; height: 14px; }
.ratio-16-9 { width: 18px; height: 10px; }
.ratio-9-16 { width: 10px; height: 18px; }
.ratio-4-3 { width: 16px; height: 12px; }
.ratio-3-2 { width: 16px; height: 11px; }
.ratio-5-4 { width: 15px; height: 12px; }
.ratio-21-9 { width: 20px; height: 9px; }

.crop-coords-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.crop-actions-row {
  display: flex;
  gap: 0.5rem;
}

/* Rotate Grid */
.rotate-btn-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.rotate-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.rotate-action-btn i {
  width: 18px;
  height: 18px;
}

/* Target File Size Collapsible Card */
.sidebar-accordion-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-body);
  overflow: hidden;
}

.accordion-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  cursor: pointer;
  user-select: none;
  background: var(--bg-body);
}

.accordion-box-body {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}

/* Export Section */
.sidebar-export-section {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.quality-labels-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.quality-labels-row .active {
  color: var(--primary);
  font-weight: 700;
}

.color-picker-input {
  width: 44px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 2px;
  background: var(--bg-surface);
}

/* CTA */
.studio-cta-wrap {
  margin-top: auto;
  padding-top: 0.5rem;
}

.studio-primary-cta {
  padding: 0.95rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.studio-primary-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

/* Result Modal Dialog */
.resizer-result-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .resizer-result-modal-backdrop {
    padding: 0.75rem;
  }
}

.resizer-result-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 520px;
  width: 100%;
  box-sizing: border-box;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modalPop {
  0% { opacity: 0; transform: scale(0.92) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.result-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.result-dialog-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (max-width: 600px) {
  .result-dialog-header {
    padding: 1rem 1.15rem;
  }

  .result-dialog-body {
    padding: 1rem 1.15rem;
    gap: 1rem;
  }
}

.result-comparison-box {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-sizing: border-box;
}

.result-thumb-wrap {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: repeating-conic-gradient(#80808020 0% 25%, transparent 0% 50%) 50% / 12px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.result-thumb-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.result-stats-col {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex-grow: 1;
}

.result-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.stat-lbl { color: var(--text-muted); }
.stat-val { font-weight: 700; font-family: var(--font-mono); }

.result-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

/* =============================================================
   ADVANCED IMAGE CROPPER STUDIO STYLES
   ============================================================= */
.cropper-studio-container {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}

.cropper-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.cropper-file-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cropper-active-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-main);
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cropper-active-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

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

.cropper-studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  min-height: 520px;
  box-sizing: border-box;
}

.cropper-stage-col {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  border-right: 1px solid var(--border);
  background: var(--bg-body);
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}

.cropper-stage-toolbar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cropper-dim-badge {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.cropper-dim-badge strong {
  color: var(--text-main);
  font-family: var(--font-mono);
}

.cropper-zoom-tools {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cropper-tool-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cropper-tool-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.cropper-viewport {
  width: 100%;
  height: 440px;
  max-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  user-select: none;
  touch-action: none;
  background: repeating-conic-gradient(rgba(0,0,0,0.04) 0% 25%, transparent 0% 50%) 50% / 16px 16px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
}

.cropper-main-canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: crosshair;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

.cropper-hint-bar {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
}

.cropper-sidebar-col {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--bg-surface);
  overflow-y: auto;
  box-sizing: border-box;
}

.cropper-sidebar-card {
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.95rem;
}

.cropper-card-title {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text-main);
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.cropper-shape-toggles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.cropper-shape-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.cropper-shape-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.cropper-ratio-category-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.cropper-ratio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
}

.crop-preset-pill {
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.crop-preset-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.crop-preset-pill.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.cropper-dim-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cropper-dim-col {
  flex: 1;
}

.cropper-input-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.25rem;
}

.cropper-num-input {
  width: 100%;
  padding: 0.45rem 0.6rem;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: var(--font-mono);
  box-sizing: border-box;
}

.cropper-dim-x {
  font-weight: 800;
  color: var(--text-muted);
  margin-top: 1rem;
}

@media (max-width: 900px) {
  .cropper-studio-grid {
    grid-template-columns: 1fr;
  }

  .cropper-stage-col {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .cropper-viewport {
    height: 350px;
  }
}

@media (max-width: 480px) {
  .cropper-topbar {
    padding: 0.75rem;
  }

  .cropper-stage-col,
  .cropper-sidebar-col {
    padding: 0.85rem;
  }

  .cropper-ratio-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cropper-viewport {
    height: 280px;
  }
}

/* =============================================================
   PDF STUDIO & MERGE PDF ENGINE STYLES
   ============================================================= */
.pdf-studio-container {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  box-sizing: border-box;
}

.pdf-studio-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.25rem;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pdf-batch-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pdf-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pdf-queue-container {
  margin-bottom: 1.25rem;
}

.pdf-queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pdf-queue-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pdf-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  gap: 1rem;
  flex-wrap: wrap;
  transition: all 0.2s ease;
}

.pdf-item-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.pdf-item-card.is-locked {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.02);
}

.pdf-item-card.is-unlocked {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.02);
}

.pdf-card-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
  min-width: 220px;
}

.pdf-card-order-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-main);
  font-weight: 800;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pdf-thumb-box {
  width: 46px;
  height: 58px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.pdf-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdf-card-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.pdf-card-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.pdf-card-meta-tags {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  flex-wrap: wrap;
}

.pdf-meta-pill {
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.72rem;
}

.pdf-lock-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.pdf-lock-pill.locked {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.pdf-lock-pill.unlocked {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.pdf-card-middle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pdf-pass-input-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-surface);
  padding: 0.25rem 0.35rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.pdf-pass-field {
  padding: 0.35rem 0.55rem;
  font-size: 0.8rem;
  width: 140px;
  border: none;
  background: transparent;
  color: var(--text-main);
  outline: none;
}

.pdf-card-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.pdf-order-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.pdf-order-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.pdf-order-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pdf-options-card {
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  margin-bottom: 1rem;
}

.pdf-options-title {
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--text-main);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.pdf-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

@media (max-width: 640px) {
  .pdf-studio-container {
    padding: 0.85rem;
  }

  .pdf-item-card {
    padding: 0.75rem;
  }

  .pdf-card-left {
    width: 100%;
  }

  .pdf-card-middle {
    width: 100%;
    justify-content: space-between;
  }

  .pdf-pass-input-row {
    width: 100%;
  }

  .pdf-pass-field {
    flex: 1;
  }

  .pdf-topbar-actions {
    width: 100%;
  }
}

/* =============================================================
   VISUAL SPLIT PDF STUDIO STYLES
   ============================================================= */
.split-mode-selector {
  display: flex;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.3rem;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.split-mode-pill {
  flex: 1;
  min-width: 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.split-mode-pill:hover {
  color: var(--text-main);
  background: var(--bg-surface);
}

.split-mode-pill.active {
  color: var(--primary);
  background: var(--bg-surface);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.split-pane-section {
  width: 100%;
}

.split-selection-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.split-sel-count {
  font-size: 0.85rem;
  color: var(--text-main);
}

.split-quick-buttons {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.split-pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1.15rem;
  max-height: 520px;
  overflow-y: auto;
  padding: 0.85rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.split-page-card {
  position: relative;
  background: var(--bg-body);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.6rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
}

.split-page-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.split-page-card.is-selected {
  border-color: var(--primary) !important;
  background: var(--primary-light) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22) !important;
}

.split-page-thumb-wrapper,
.split-page-thumb-wrap {
  width: 100%;
  aspect-ratio: 1 / 1.35;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.split-page-thumb-wrapper canvas,
.split-page-thumb-wrap canvas,
.split-page-thumb-wrapper img,
.split-page-thumb-wrap img,
.split-page-thumb-img {
  max-width: 100% !important;
  max-height: 100% !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  display: block;
}

.split-page-badge-num,
.split-page-label {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-main);
  text-align: center;
  width: 100%;
}

.split-page-check-pill,
.split-page-select-badge {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-body);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 0.75rem;
  transition: all 0.2s ease;
  z-index: 5;
}

.split-page-check-pill i,
.split-page-select-badge i {
  width: 13px;
  height: 13px;
}

.split-page-card.is-selected .split-page-check-pill,
.split-page-card.is-selected .split-page-select-badge {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.split-export-choice-row {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.split-choice-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-main);
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.split-choice-label:hover {
  border-color: var(--primary);
}

@media (max-width: 580px) {
  .split-pages-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 0.5rem;
  }
}


/* =============================================================
   PDF COMPRESSOR STUDIO STYLES
   ============================================================= */
.compress-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}

.compress-preset-card {
  background: var(--bg-body);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.compress-preset-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.compress-preset-card.active {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.04);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.compress-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.compress-card-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-main);
}

.compress-tag {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
}

.compress-card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 0.6rem;
}

.compress-card-meta {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-main);
  background: var(--bg-surface);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  width: fit-content;
}

.compress-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  flex-wrap: wrap;
}

.compress-stat-card {
  flex: 1;
  min-width: 120px;
  text-align: center;
}

.compress-stat-card .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.compress-stat-card .stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.compress-stat-arrow {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 640px) {
  .compress-preset-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================================================
   PDF TO JPG / IMAGES STUDIO STYLES
   ============================================================= */
.pdf-gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pdf-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.pdf-image-card {
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.2s ease;
}

.pdf-image-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.pdf-img-preview-box {
  width: 100%;
  aspect-ratio: 1 / 1.35;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.pdf-img-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pdf-img-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pdf-img-page-num {
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--text-main);
}

.pdf-img-res-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.pdf-img-card-actions {
  display: flex;
  gap: 0.4rem;
}

@media (max-width: 480px) {
  .pdf-images-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================================================
   JPG TO PDF STUDIO STYLES
   ============================================================= */
.jpg-to-pdf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.jpg-pdf-card {
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: relative;
  transition: all 0.2s ease;
}

.jpg-pdf-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.jpg-pdf-order-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  z-index: 2;
}

.jpg-pdf-thumb-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.jpg-pdf-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.jpg-pdf-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.jpg-pdf-name {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jpg-pdf-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.jpg-pdf-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
}

.jpg-pdf-order-btns {
  display: flex;
  gap: 0.25rem;
}

@media (max-width: 480px) {
  .jpg-to-pdf-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }
}

/* =============================================================
   NEW PDF TOOLS COMPONENT STYLES
   ============================================================= */

/* Page Deletion Cards */
.split-page-card.is-marked-delete {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.06) !important;
  opacity: 0.75;
}

.split-page-card.is-marked-delete .split-page-thumb-wrap::after {
  content: '✕ DELETED';
  position: absolute;
  inset: 0;
  background: rgba(239, 68, 68, 0.65);
  color: #ffffff;
  font-weight: 900;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 1px;
}

/* Rotation Angle Badge */
.page-rotation-badge {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  z-index: 2;
}

/* Metadata Inspection Table */
.meta-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  font-size: 0.88rem;
}

.meta-table th, .meta-table td {
  padding: 0.65rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.meta-table th {
  background: var(--bg-surface);
  font-weight: 700;
  color: var(--text-main);
  width: 32%;
}

.meta-table td {
  background: var(--bg-body);
  color: var(--text-muted);
}

.meta-table tr:last-child th,
.meta-table tr:last-child td {
  border-bottom: none;
}

/* HTML to PDF Split Box */
@media (max-width: 768px) {
  .html-pdf-split-box {
    grid-template-columns: 1fr !important;
  }
}

/* =============================================================
   BASE64 ENCODER / DECODER WORKSPACE STYLES
   ============================================================= */

.b64-nav-tabs-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.35rem;
  box-shadow: var(--shadow-sm);
}

.b64-nav-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.b64-nav-tab {
  flex: 1;
  min-width: 170px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.b64-nav-tab:hover {
  color: var(--text-main);
  background: var(--bg-card-hover);
}

.b64-nav-tab.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.b64-tab-pane {
  animation: b64FadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes b64FadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Options Panel */
.b64-options-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.b64-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem 1.25rem;
}

.b64-check-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
}

.b64-check-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.b64-check-label code {
  background: var(--bg-input);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  font-size: 0.78rem;
}

/* Format Selector Pills */
.b64-format-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.b64-format-pill {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full, 9999px);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.b64-format-pill:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-hover, var(--border));
}

.b64-format-pill.active {
  background: var(--primary-subtle, rgba(99, 102, 241, 0.12));
  color: var(--primary);
  border-color: var(--primary);
}

/* File Summary Card */
.b64-file-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.1rem 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.b64-file-card-preview {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.b64-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.b64-file-icon {
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.b64-file-card-details {
  flex: 1;
  min-width: 220px;
}

.b64-file-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.b64-file-name {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-main);
  word-break: break-all;
}

.b64-file-stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  font-size: 0.82rem;
}

/* Media Detection Card & Preview Stage */
.b64-media-meta-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border-bottom: none;
}

.b64-preview-stage {
  min-height: 220px;
  background: repeating-conic-gradient(#80808018 0% 25%, transparent 0% 50%) 50% / 20px 20px, var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.b64-image-preview-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.b64-pdf-card,
.b64-generic-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 600px;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
  .b64-nav-tab {
    min-width: 100%;
  }
  .b64-options-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================================================
   SCHEMA MARKUP GENERATOR STYLES
   ============================================================= */

.schema-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.schema-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .schema-grid-2,
  .schema-grid-3 {
    grid-template-columns: 1fr;
  }
}

.schema-form-section {
  animation: b64FadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.schema-repeater-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.schema-repeater-item {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: var(--transition);
}

.schema-repeater-item:hover {
  border-color: var(--border-hover, var(--border));
}

.schema-remove-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: var(--transition);
}

.schema-remove-btn:hover {
  background: var(--danger);
  color: #ffffff;
  border-color: var(--danger);
}

.schema-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* =============================================================
   FILE & ARCHIVE TOOLS SUITE STYLES
   ============================================================= */

/* File Drop Zone / Box */
.file-dropzone-large {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.file-dropzone-large:hover,
.file-dropzone-large.dragover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.file-dropzone-large i {
  color: var(--primary);
  width: 44px;
  height: 44px;
  margin-bottom: 0.75rem;
}

/* File Queue / Items List */
.file-queue-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 380px;
  overflow-y: auto;
  padding: 0.5rem;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.file-queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.9rem;
  gap: 0.75rem;
  font-size: 0.86rem;
  transition: var(--transition);
}

.file-queue-item:hover {
  border-color: var(--border-hover, var(--border));
}

.file-queue-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  overflow: hidden;
  flex: 1;
}

.file-queue-name {
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-queue-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Hash Results Display */
.hash-results-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hash-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: var(--transition);
}

.hash-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

.hash-value-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--primary);
  word-break: break-all;
  gap: 0.5rem;
}

.hash-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
}

.hash-status-match {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.hash-status-mismatch {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Hex Inspection Viewer */
.hex-inspector-box {
  background: #090d16;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  font-family: 'JetBrains Mono', 'Fira Code', var(--font-mono);
  font-size: 0.82rem;
  color: #38bdf8;
  overflow-x: auto;
  line-height: 1.6;
}

.hex-row {
  display: flex;
  gap: 1.25rem;
}

.hex-offset {
  color: #64748b;
  user-select: none;
}

.hex-bytes {
  color: #38bdf8;
  letter-spacing: 1px;
}

.hex-ascii {
  color: #a78bfa;
  border-left: 1px solid #1e293b;
  padding-left: 0.75rem;
}

/* Speed Transfer Table */
.speed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.speed-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.speed-card-title {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.speed-card-time {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

/* Distribution Bar for Folder Analyzer */
.dist-bar-wrapper {
  height: 18px;
  border-radius: var(--radius-full);
  overflow: hidden;
  display: flex;
  background: var(--bg-body);
  border: 1px solid var(--border);
  margin: 0.75rem 0;
}

.dist-bar-segment {
  height: 100%;
  transition: width 0.3s ease;
}

/* Rename Preview Table */
.rename-table-wrapper {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.rename-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.rename-table th {
  background: var(--bg-card-hover);
  padding: 0.65rem 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  text-align: left;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 2;
}

.rename-table td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.rename-table tr:hover td {
  background: var(--bg-surface);
}

.rename-new-name {
  color: var(--success);
  font-weight: 700;
  font-family: var(--font-mono);
}

/* =============================================================
   DEVELOPER, FORMATTER, MARKDOWN & REGEX TOOLS SUITE
   ============================================================= */

/* Two-Pane Split Editor Layout */
.code-split-pane {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

@media (max-width: 840px) {
  .code-split-pane {
    grid-template-columns: 1fr;
  }
}

.code-pane-box {
  display: flex;
  flex-direction: column;
}

.code-error-banner {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: var(--danger);
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.code-success-banner {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--success);
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

/* Markdown Rendered Live Body */
.markdown-preview-body {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 1.25rem;
  min-height: 280px;
  max-height: 520px;
  overflow-y: auto;
  line-height: 1.65;
  color: var(--text-main);
}

.markdown-preview-body h1,
.markdown-preview-body h2,
.markdown-preview-body h3,
.markdown-preview-body h4 {
  color: var(--text-main);
  margin-top: 1.2rem;
  margin-bottom: 0.6rem;
}

.markdown-preview-body p {
  margin-bottom: 0.85rem;
}

.markdown-preview-body code {
  background: var(--bg-body);
  border: 1px solid var(--border);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--primary);
}

.markdown-preview-body pre {
  background: #0d1117;
  color: #c9d1d9;
  padding: 1rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: 1rem;
}

.markdown-preview-body pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
}

.markdown-preview-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.markdown-preview-body th,
.markdown-preview-body td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.markdown-preview-body th {
  background: var(--bg-card-hover);
}

.markdown-preview-body blockquote {
  border-left: 4px solid var(--primary);
  margin: 0.75rem 0;
  padding-left: 1rem;
  color: var(--text-muted);
}

/* Regex Match Highlighting */
.regex-match-highlight {
  background: rgba(59, 130, 246, 0.35);
  border-bottom: 2px solid var(--primary);
  border-radius: 2px;
  color: inherit;
}

.regex-group-highlight {
  background: rgba(245, 158, 11, 0.35);
  border-bottom: 2px solid var(--warning);
  border-radius: 2px;
}

/* CSV Table Preview */
.csv-preview-table-wrapper {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 0.75rem;
}

.csv-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  font-family: var(--font-mono);
}

.csv-preview-table th {
  background: var(--bg-card-hover);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  color: var(--text-main);
  text-align: left;
  font-weight: 700;
}

.csv-preview-table td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}

.csv-preview-table tr:hover td {
  background: var(--bg-surface);
}

/* =============================================================
   GENERATOR TOOLS SUITE STYLES (19 TOOLS)
   ============================================================= */

/* Visual Preview Stages */
.gradient-preview-canvas {
  width: 100%;
  height: 220px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
  transition: background 0.15s ease;
}

.shadow-preview-stage {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3rem 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1rem;
  min-height: 240px;
}

.shadow-preview-box {
  width: 180px;
  height: 140px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-main);
  transition: box-shadow 0.1s ease;
}

.blob-preview-stage {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2.5rem 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 260px;
  margin-bottom: 1rem;
}

.blob-preview-box {
  width: 200px;
  height: 200px;
  background: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
  transition: border-radius 0.15s ease;
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.35);
}

.button-preview-stage {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3rem 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 180px;
  margin-bottom: 1rem;
}

/* Spinner Archetypes */
.spinner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.spinner-item-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.spinner-item-card:hover,
.spinner-item-card.active {
  border-color: var(--primary);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.spinner-item-card span {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Spinner Keyframes */
@keyframes spin-classic {
  to { transform: rotate(360deg); }
}

@keyframes spin-pulse {
  0%, 100% { transform: scale(0.6); opacity: 0.4; }
  50% { transform: scale(1.1); opacity: 1; }
}

@keyframes spin-wave {
  0%, 40%, 100% { transform: scaleY(0.4); }
  20% { transform: scaleY(1.0); }
}

/* QR Code & Barcode Display Cards */
.qr-preview-card,
.barcode-preview-card {
  background: #ffffff;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

/* Favicon Package Preview Grid */
.favicon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.favicon-tile {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.favicon-tile span {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* ==========================================================================
   ADVANCED SEO & WEB ANALYSIS TOOLS STYLING
   ========================================================================== */

/* SERP Snippet Preview Box */
.serp-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  font-family: Arial, Roboto, sans-serif;
  max-width: 650px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.serp-card-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
}

.serp-favicon-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-body);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.serp-site-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.serp-site-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
}

.serp-breadcrumb {
  font-size: 0.75rem;
  color: var(--text-muted);
  word-break: break-all;
}

.serp-title {
  font-size: 1.25rem;
  line-height: 1.3;
  color: #1a0dab;
  font-weight: 400;
  cursor: pointer;
  margin-bottom: 0.35rem;
  text-decoration: none;
  display: block;
}

[data-theme="dark"] .serp-title {
  color: #8ab4f8;
}

.serp-title:hover {
  text-decoration: underline;
}

.serp-desc {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-main);
  word-break: break-word;
}

.serp-desc b {
  font-weight: 700;
  color: var(--text-main);
}

.serp-rating-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: #e3a008;
  margin-bottom: 0.35rem;
}

/* Twitter Card Feed Preview */
.twitter-preview-card {
  background: #ffffff;
  border: 1px solid #cfd9de;
  border-radius: 16px;
  overflow: hidden;
  max-width: 520px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #0f1419;
}

[data-theme="dark"] .twitter-preview-card {
  background: #000000;
  border-color: #2f3336;
  color: #e7e9ea;
}

.twitter-card-img {
  width: 100%;
  height: 260px;
  background-color: var(--bg-body);
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.twitter-card-body {
  padding: 0.85rem 1rem;
}

.twitter-card-domain {
  font-size: 0.8rem;
  color: #536471;
  margin-bottom: 0.2rem;
}

[data-theme="dark"] .twitter-card-domain {
  color: #71767b;
}

.twitter-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.3rem;
}

.twitter-card-desc {
  font-size: 0.85rem;
  color: #536471;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

[data-theme="dark"] .twitter-card-desc {
  color: #71767b;
}

/* Open Graph Social Card Simulator */
.og-social-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  transition: all 0.2s ease;
}

.og-card-media {
  width: 100%;
  height: 240px;
  background-color: var(--bg-body);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.og-card-media-placeholder {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.og-card-content {
  padding: 0.9rem 1.15rem;
  background: var(--bg-surface);
}

.og-card-domain {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.og-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.og-card-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* Pixel Meter & Length Bars */
.pixel-meter-wrapper {
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.pixel-meter-track {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.4rem;
}

.pixel-meter-fill {
  height: 100%;
  width: 50%;
  background: var(--success);
  transition: width 0.2s ease, background-color 0.2s ease;
}

/* Heading Tree Hierarchy */
.heading-tree {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.heading-tree-node {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
}

.heading-tag-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.heading-h1 { border-left: 4px solid #3b82f6; }
.heading-h1 .heading-tag-badge { background: #3b82f6; color: #fff; }
.heading-h2 { margin-left: 1.25rem; border-left: 4px solid #8b5cf6; }
.heading-h2 .heading-tag-badge { background: #8b5cf6; color: #fff; }
.heading-h3 { margin-left: 2.5rem; border-left: 4px solid #10b981; }
.heading-h3 .heading-tag-badge { background: #10b981; color: #fff; }
.heading-h4 { margin-left: 3.75rem; border-left: 4px solid #f59e0b; }
.heading-h4 .heading-tag-badge { background: #f59e0b; color: #fff; }
.heading-h5 { margin-left: 5rem; border-left: 4px solid #ef4444; }
.heading-h5 .heading-tag-badge { background: #ef4444; color: #fff; }
.heading-h6 { margin-left: 6.25rem; border-left: 4px solid #64748b; }
.heading-h6 .heading-tag-badge { background: #64748b; color: #fff; }

/* Redirect Chain Hop Card */
.redirect-chain-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.redirect-hop-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.redirect-hop-badge {
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-family: var(--font-mono);
}

.redirect-hop-url {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  word-break: break-all;
  flex: 1;
}

/* Tag Cloud Badges */
.tag-cloud-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.tag-cloud-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: default;
}

.tag-cloud-item:hover {
  border-color: var(--primary);
  color: var(--primary);
}

