/* ==========================================================================
   ImageCombiner Web - Monochromatic Minimalist Light Gray Theme
   ========================================================================== */

:root {
  /* Flat Monochromatic Light Gray Palette (Tone-on-tone) */
  --bg-app: #e5e7eb;          /* Clean flat light gray body & canvas backdrop */
  --bg-sidebar: #eceef1;      /* Slightly softer tone-on-tone panel gray */
  --bg-card: #f3f4f6;         /* Refined card background */
  --bg-card-hover: #ffffff;
  --bg-input: #ffffff;
  --bg-input-focus: #ffffff;
  
  --border-subtle: #d1d5db;   /* Crisp hairline borders */
  --border-medium: #9ca3af;
  --border-focus: #111827;

  --text-main: #111827;       /* Dark slate / charcoal text */
  --text-muted: #4b5563;      /* Secondary slate text */
  --text-dim: #6b7280;        /* Subtle secondary captions */
  
  --primary: #111827;         /* Crisp minimalist dark button */
  --primary-hover: #1f2937;
  --primary-active: #030712;
  --primary-text: #ffffff;

  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-bg: rgba(220, 38, 38, 0.08);

  --success: #059669;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --font-display: 'Newsreader', serif;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 220ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Shadows (Flat / Hairline depth) */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px -4px rgba(0, 0, 0, 0.08);
}

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

html, body {
  height: 100%;
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

/* Accessibility helper */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   App Layout (Navbar + 3 Columns)
   ========================================================================== */

.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 20px;
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.logo-icon {
  width: 22px;
  height: 22px;
  color: var(--primary);
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background-color: var(--border-subtle);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Main Content Workspace */
.app-main {
  display: flex;
  flex: 1;
  height: calc(100vh - 56px);
  width: 100%;
  overflow: hidden;
  align-items: stretch;
}

/* ==========================================================================
   Column 1 (Left): Added Media (Photos Queue)
   ========================================================================== */

.col-left {
  width: 320px;
  min-width: 300px;
  height: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-app);
  box-sizing: border-box;
  overflow: hidden;
  border-right: 1px solid var(--border-subtle);
}

.media-scroll-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.media-scroll-area::-webkit-scrollbar {
  width: 5px;
}
.media-scroll-area::-webkit-scrollbar-track {
  background: transparent;
}
.media-scroll-area::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}
.media-scroll-area::-webkit-scrollbar-thumb:hover {
  background: var(--border-medium);
}

.text-dock-section {
  flex-shrink: 0;
  padding: 12px 16px 14px 16px;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-card);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
  z-index: 10;
}

.text-dock-card {
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  gap: 8px;
}

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

.text-settings-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.text-settings-toggle-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-hover);
}

.text-settings-toggle-btn.active {
  color: var(--color-primary);
  background-color: var(--color-primary-subtle);
}

.text-overlay-input {
  width: 100%;
  resize: none;
  min-height: 48px;
  max-height: 420px;
  font-size: 0.8125rem;
  line-height: 1.45;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  box-sizing: border-box;
  overflow-y: hidden;
  scrollbar-width: none;
  transition: height 0.1s ease;
}

.text-overlay-input::-webkit-scrollbar {
  display: none;
}

.text-dock-position-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 0;
}

.text-dock-position-row .control-label {
  margin-bottom: 0;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.text-dock-position-row .form-select-sm {
  flex: 1;
  max-width: 170px;
}

.text-settings-drawer {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.text-settings-drawer::-webkit-scrollbar {
  width: 4px;
}
.text-settings-drawer::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}

.content-box-section {
  height: auto;
  overflow: visible;
  flex-shrink: 0;
}

/* ==========================================================================
   Column 2 (Center): Preview & Game Promotion
   ========================================================================== */

.col-center {
  flex: 1;
  min-width: 480px;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  background-color: var(--bg-app);
  overflow: hidden;
  box-sizing: border-box;
}

.preview-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-sidebar);
  min-height: 48px;
  flex-shrink: 0;
}

.preview-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.preview-meta-tag {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  background: var(--bg-card);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.render-stat {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

/* Game Promotion Ad Placeholder */
.ad-banner-section {
  flex-shrink: 0;
  height: 130px;
  margin: 10px 16px 14px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-card);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast);
}

.ad-placeholder-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.ad-placeholder-label {
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--font-mono);
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ==========================================================================
   Column 3 (Right): Settings + Pinned Save & Download Dock
   ========================================================================== */

.col-right {
  width: 350px;
  min-width: 340px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-sidebar);
  overflow: hidden;
  flex-shrink: 0;
  box-sizing: border-box;
}

.params-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.params-scroll-area::-webkit-scrollbar {
  width: 5px;
}
.params-scroll-area::-webkit-scrollbar-track {
  background: transparent;
}
.params-scroll-area::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}
.params-scroll-area::-webkit-scrollbar-thumb:hover {
  background: var(--border-medium);
}

.download-dock-section {
  flex-shrink: 0;
  padding: 14px 16px;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-card);
  z-index: 10;
}

.download-dock-card {
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  gap: 10px;
}

/* Canvas Viewport */
.canvas-viewport {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
  position: relative;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 420px;
  padding: 32px;
  animation: fadeIn 0.3s ease;
}

.empty-icon-wrap {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-lg);
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.empty-icon {
  width: 32px;
  height: 32px;
  color: var(--text-dim);
}

.empty-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.empty-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Canvas Wrapper with Checkerboard Background */
.canvas-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.preview-canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 4px 20px -2px rgba(17, 24, 39, 0.12);
  border-radius: 4px;
  transition: transform 0.15s ease-out;
  /* Subtle light checkerboard pattern visible when transparent */
  background-image: 
    linear-gradient(45deg, #dedede 25%, transparent 25%), 
    linear-gradient(-45deg, #dedede 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #dedede 75%), 
    linear-gradient(-45deg, transparent 75%, #dedede 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  background-color: #ffffff;
}

/* ==========================================================================
   Cards & Controls
   ========================================================================== */

.card-section {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color var(--transition-fast);
}

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

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background-color: var(--bg-input);
  color: var(--text-muted);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
}

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

.value-indicator {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Form Controls */
.form-select,
.form-input,
.form-number-input,
.form-textarea {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
  outline: none;
}

.form-select,
.form-input,
.form-number-input {
  height: 38px;
  padding: 0 10px;
}

.form-textarea {
  padding: 8px 10px;
}

.form-select:focus,
.form-input:focus,
.form-number-input:focus,
.form-textarea:focus {
  border-color: var(--border-focus);
  background-color: var(--bg-input-focus);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234b5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
  cursor: pointer;
}

.form-select-sm {
  height: 30px;
  font-size: 0.8125rem;
  padding: 0 28px 0 8px;
  background-position: right 8px center;
}

/* Range Sliders */
.range-with-number {
  display: flex;
  align-items: center;
  gap: 12px;
  transition: opacity var(--transition-fast);
}

.range-with-number.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.form-range {
  flex: 1;
  height: 6px;
  appearance: none;
  background: var(--border-subtle);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
}

.form-range::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--bg-card);
  cursor: pointer;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.form-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: var(--primary-hover);
}

.form-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--bg-card);
  cursor: pointer;
}

.form-number-input {
  width: 76px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* Presets Buttons Row */
.preset-buttons {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.preset-btn {
  flex: 1;
  height: 28px;
  font-size: 0.75rem;
  font-weight: 500;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

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

/* Resolution Summary Box */
.resolution-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-sidebar);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.summary-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.summary-value {
  font-size: 0.875rem;
  color: var(--text-main);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Color Controls */
.color-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 10px 4px 6px;
  height: 38px;
}

.color-picker-wrapper input[type="color"] {
  appearance: none;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  cursor: pointer;
  background: none;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.color-hex-text {
  font-size: 0.8125rem;
  font-family: monospace;
  color: var(--text-muted);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

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

.sub-checkbox-row {
  display: flex;
  align-items: center;
  margin-top: -2px;
  margin-bottom: 2px;
  transition: opacity var(--transition-fast);
}

.sub-checkbox-row.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.sub-checkbox {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.sub-checkbox:hover {
  color: var(--text-muted);
}

/* Color Swatches */
.color-swatches {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.swatch-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border-medium);
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.swatch-btn:hover {
  transform: scale(1.15);
  border-color: var(--primary);
}

/* ==========================================================================
   Drop Zone & Photo Queue
   ========================================================================== */

.drop-zone {
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  background-color: var(--bg-sidebar);
  transition: all var(--transition-fast);
}

.drop-zone:hover,
.drop-zone.drag-active {
  border-color: var(--primary);
  background-color: #e2e5e9;
}

.drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.drop-zone-icon {
  width: 32px;
  height: 32px;
  color: var(--primary);
}

.drop-zone-primary {
  font-size: 0.875rem;
  color: var(--text-main);
}

.drop-zone-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Queue Container */
.photo-queue-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.queue-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.queue-tip {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.photo-queue-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

/* Single Queue Item Card */
.queue-card {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  user-select: none;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
  overflow: hidden;
}

.queue-card:hover {
  border-color: var(--border-medium);
}

.queue-card.dragging {
  opacity: 0.35;
  border: 2px dashed var(--primary);
}

.queue-card.drag-over {
  border-top: 2px solid var(--primary);
}

.queue-card-main {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: grab;
  width: 100%;
  box-sizing: border-box;
}

.queue-card-main:hover {
  background-color: var(--bg-card-hover);
}

.queue-card-index {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dim);
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.queue-card-thumb-wrap {
  width: 46px;
  height: 46px;
  border-radius: 4px;
  overflow: hidden;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

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

.queue-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.queue-card-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.queue-card-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.queue-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.queue-card-meta {
  font-size: 0.6875rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.queue-btn:hover:not(:disabled) {
  background-color: var(--border-medium);
  color: var(--text-main);
}

.queue-btn.adjust-btn.active {
  background-color: rgba(59, 130, 246, 0.15);
  color: var(--primary);
}

.queue-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.queue-btn.remove-btn:hover {
  background-color: var(--danger-bg);
  color: var(--danger);
}

/* Card Adjustments Expandable Dropdown Panel */
.queue-card-adjust-panel {
  padding: 8px 10px 10px 10px;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: default;
  user-select: auto;
}

.adjust-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
}

.adjust-label {
  width: 52px;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
}

.adjust-range {
  flex: 1;
  height: 4px;
}

.adjust-val {
  width: 44px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

.adjust-actions-row {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
}

.btn-text-reset {
  background: none;
  border: none;
  font-size: 0.72rem;
  color: var(--text-dim);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  transition: color var(--transition-fast);
}

.btn-text-reset:hover {
  color: var(--primary);
}

/* Queue Footer & Global Reset */
.queue-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-top: 6px;
  border-top: 1px dashed var(--border-subtle);
  margin-top: 2px;
}

.queue-reset-all-btn {
  width: 100%;
  justify-content: center;
  gap: 6px;
  font-size: 0.75rem;
  padding: 6px 10px;
}

/* Preview Header Drag Tip */
.preview-drag-tip {
  font-size: 0.7rem;
  font-family: var(--font-sans);
  color: var(--primary);
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-left: 6px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  outline: none;
  text-decoration: none;
}

.btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

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

.btn-primary:active:not(:disabled) {
  background-color: var(--primary-active);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border-medium);
  color: var(--text-main);
}

.btn-outline:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--text-muted);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-muted);
  padding: 6px 12px;
}

.btn-ghost:hover {
  background-color: var(--bg-card);
  color: var(--text-main);
}

.btn-subtle-danger {
  font-size: 0.75rem;
  background: transparent;
  color: var(--danger);
  border: none;
  padding: 2px 6px;
  border-radius: 4px;
}

.btn-subtle-danger:hover {
  background: var(--danger-bg);
}

.btn-large {
  height: 44px;
  font-size: 0.9375rem;
}

.btn-block {
  width: 100%;
}

.btn-xs {
  font-size: 0.75rem;
  padding: 3px 8px;
}

/* ==========================================================================
   About Modal Dialog
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  width: 100%;
  max-width: 540px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card.modal-card-lg {
  max-width: 880px;
  width: 94%;
  max-height: 88vh;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-icon {
  width: 22px;
  height: 22px;
  color: var(--primary);
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-main);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  max-height: 70vh;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--border-medium);
}

.modal-about-body {
  padding: 22px 26px 26px 26px;
  gap: 22px;
  max-height: calc(88vh - 130px);
}

.modal-intro {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* About Modal Specific Sections */
.about-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.about-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.about-section-badge {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background-color: var(--primary);
  color: var(--primary-text);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.about-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

/* 1. Privacy Card */
.about-privacy-card {
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.about-privacy-highlight {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.privacy-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background-color: rgba(5, 150, 105, 0.12);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.privacy-icon-wrap svg {
  width: 20px;
  height: 20px;
}

.privacy-content h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.privacy-content p {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.about-terms-row {
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* 2. Feature Grid */
.about-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (max-width: 680px) {
  .about-feature-grid {
    grid-template-columns: 1fr;
  }
}

.about-feature-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.about-feature-card:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-medium);
}

.about-feature-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-sidebar);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.about-feature-icon svg {
  width: 17px;
  height: 17px;
}

.about-feature-info h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 3px;
}

.about-feature-info p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.about-feature-info code {
  background-color: var(--border-subtle);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* 3. Credits */
.about-creator-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  gap: 16px;
  flex-wrap: wrap;
}

.creator-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--border-subtle);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}

.creator-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-main);
}

.creator-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.creator-repo-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  padding: 8px 14px;
  white-space: nowrap;
}

.about-libraries-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.libraries-heading {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.libraries-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 680px) {
  .libraries-list {
    grid-template-columns: 1fr;
  }
}

.library-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.library-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.library-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  font-family: var(--font-mono);
}

.library-badge {
  font-size: 0.6875rem;
  background-color: var(--border-subtle);
  color: var(--text-muted);
  padding: 1px 5px;
  border-radius: 3px;
}

.library-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.feature-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background-color: var(--border-subtle);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feature-icon-badge svg {
  width: 18px;
  height: 18px;
}

.feature-text h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 2px;
}

.feature-text p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-sidebar);
  display: flex;
  justify-content: flex-end;
}

/* ==========================================================================
   Animation Playback Controls & Modals
   ========================================================================== */

/* Playback Bar (docked at bottom of preview area) */
.playback-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 18px;
  background-color: var(--bg-sidebar);
  border-top: 1px solid var(--border-subtle);
  z-index: 10;
  width: 100%;
}

.playback-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
  flex-shrink: 0;
}

.playback-btn:hover {
  background-color: var(--primary-hover);
  transform: scale(1.05);
}

.playback-btn:active {
  background-color: var(--primary-active);
  transform: scale(0.95);
}

.playback-scrubber-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.playback-scrubber {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border-subtle);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.playback-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--bg-sidebar);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.playback-scrubber::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.playback-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.825rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 85px;
  text-align: right;
}

/* Speed selector pills */
.playback-speed-group {
  display: flex;
  align-items: center;
  background-color: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.speed-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.775rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

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

/* Animated Badge on Queue Cards */
.badge-animated {
  display: inline-flex;
  align-items: center;
  font-size: 0.675rem;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background-color: var(--border-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-medium);
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Progress Modal */
.modal-progress-card {
  max-width: 440px;
  text-align: center;
}

.progress-status-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 12px;
}

.progress-bar-track {
  width: 100%;
  height: 10px;
  background-color: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #06fe51);
  border-radius: var(--radius-full);
  transition: width 100ms ease;
}

.progress-sub-text {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Advanced Timing Modal */
.anim-timing-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 4px;
}

.anim-timing-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
}

.anim-timing-thumb {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background-color: #000;
  flex-shrink: 0;
}

.anim-timing-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

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

.anim-timing-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.anim-timing-val {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  color: #60a5fa;
  font-weight: 600;
}

.anim-timing-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.anim-timing-slider {
  flex: 1;
}

.anim-timing-reset-btn {
  background: transparent;
  border: 1px solid var(--border-medium);
  color: var(--text-muted);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.anim-timing-reset-btn:hover {
  border-color: var(--primary);
  color: var(--text-main);
}

/* ==========================================================================
   Animations & Responsive Breakpoints
   ========================================================================== */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Tablet & Mobile responsive layout */
@media (max-width: 1024px) {
  html, body {
    overflow: auto;
  }

  .app-layout {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .app-main {
    flex-direction: column;
    height: auto;
    min-height: auto;
    align-items: stretch;
    overflow: visible;
  }

  .col-center {
    order: 1;
    position: relative;
    top: 0;
    height: 65vh;
    min-height: 420px;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }

  .col-left {
    order: 2;
    width: 100%;
    min-width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }

  .media-scroll-area {
    overflow-y: visible;
  }

  .col-right {
    order: 3;
    width: 100%;
    min-width: 100%;
    position: relative;
    top: 0;
    height: auto;
  }

  .params-scroll-area {
    overflow-y: visible;
  }
}
