/* ==========================================================================
   FreeConvert - Scandinavian Minimalist Light Theme (Gallery & E-commerce Style)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Minimalist Light Palette */
  --bg-page: #f4f4f6;
  --bg-card: #ffffff;
  --bg-subtle: #f9fafb;
  --bg-hover: #f3f4f6;
  
  /* Borders & Shadows */
  --border-color: #e5e7eb;
  --border-dark: #111111;
  --shadow-subtle: 0 10px 40px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.03);
  
  /* Typography Colors */
  --text-main: #111111;
  --text-muted: #555555;
  --text-dim: #888888;
  
  /* Functional Colors */
  --accent-black: #111111;
  --accent-black-hover: #262626;
  --success: #059669;
  --error: #dc2626;
  --warning: #d97706;
  
  /* Radii & Spacing */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  
  /* Smooth Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  padding: 8px 16px 32px;
  display: flex;
  justify-content: center;
}

/* Page Wrapper (Minimalist Crisp White Sheet) */
.page-wrapper {
  width: 100%;
  max-width: 1200px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.app-header {
  padding: 24px 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  background: #ffffff;
}

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

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

.language-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
}

.language-picker-icon {
  font-size: 0.9rem;
  line-height: 1;
}

.language-picker select {
  max-width: 150px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-main);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-full);
  color: #166534;
  font-size: 0.8rem;
  font-weight: 600;
}

.privacy-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #16a34a;
}

@media (max-width: 720px) {
  .app-header {
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
  }

  .header-right {
    align-items: flex-end;
    flex-direction: column;
    gap: 8px;
  }

  .privacy-badge {
    padding: 5px 9px;
    font-size: 0.68rem;
  }

  .language-picker select {
    max-width: 118px;
  }
}

/* Top Tab Bar (Minimalist Navigation) */
.top-tab-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 36px;
  border-bottom: 1px solid var(--border-color);
  background: #ffffff;
  gap: 42px;
  position: relative;
  z-index: 20;
}

.nav-menu {
  position: relative;
}

.nav-menu summary,
.nav-tab-link {
  align-items: center;
  color: #303641;
  cursor: pointer;
  display: flex;
  font-size: 1rem;
  font-weight: 600;
  gap: 10px;
  list-style: none;
  padding: 18px 4px;
  transition: var(--transition-fast);
}

.nav-tab-link {
  text-decoration: none;
}

.nav-menu summary::-webkit-details-marker {
  display: none;
}

.nav-menu summary:hover,
.nav-menu.active summary,
.nav-menu[open] summary,
.nav-tab-link:hover,
.nav-tab-link.active {
  color: #175cd3;
}

.nav-chevron {
  border-bottom: 2px solid currentColor;
  border-right: 2px solid currentColor;
  display: block;
  height: 8px;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--transition-fast);
  width: 8px;
}

.nav-menu[open] .nav-chevron {
  transform: rotate(225deg) translate(-1px, -1px);
}

.nav-dropdown {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(17, 24, 39, 0.13);
  display: grid;
  gap: 3px;
  left: 50%;
  min-width: 260px;
  padding: 14px;
  position: absolute;
  top: calc(100% + 1px);
  transform: translateX(-50%);
}

.nav-dropdown-wide {
  grid-template-columns: repeat(2, minmax(190px, 1fr));
  min-width: 440px;
}

.nav-dropdown-heading {
  color: var(--text-dim);
  font-size: 0.68rem;
  font-weight: 700;
  grid-column: 1 / -1;
  letter-spacing: 0.1em;
  padding: 7px 12px 4px;
  text-transform: uppercase;
}

.nav-dropdown a {
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.9rem;
  padding: 11px 12px;
  text-decoration: none;
  transition: var(--transition-fast);
}

.nav-dropdown a:hover,
.nav-dropdown a.active {
  background: #eef4ff;
  color: #175cd3;
}

@media (max-width: 720px) {
  .top-tab-bar {
    gap: 22px;
    justify-content: flex-start;
    overflow: visible;
    padding: 0 18px;
  }

  .nav-menu summary {
    font-size: 0.87rem;
    padding: 15px 0;
  }

  .nav-dropdown,
  .nav-dropdown-wide {
    grid-template-columns: 1fr;
    left: 0;
    max-height: 68vh;
    min-width: min(320px, calc(100vw - 36px));
    overflow-y: auto;
    transform: none;
  }
}

/* ==========================================================================
   Main Content Layout & Hero
   ========================================================================== */
.main-container {
  padding: 48px 36px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.hero-section {
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
}

.hero-title {
  font-family: 'Outfit', sans-serif;
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 14px;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.tool-hero {
  max-width: 760px;
}

.local-processing-pill {
  align-items: center;
  background: #ecfdf3;
  border: 1px solid #abefc6;
  border-radius: var(--radius-full);
  color: #067647;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 700;
  gap: 7px;
  margin-bottom: 14px;
  padding: 6px 11px;
}

.local-processing-pill > span:first-child {
  color: #17b26a;
  font-size: 0.7rem;
}

.side-ad-rail {
  display: none;
}

@media (min-width: 1560px) {
  .side-ad-rail {
    display: block;
    min-height: 600px;
    position: fixed;
    top: 80px;
    width: 160px;
    z-index: 10;
  }

  .side-ad-rail-left {
    right: calc(50% + 620px);
  }

  .side-ad-rail-right {
    left: calc(50% + 620px);
  }

  .side-ad-label {
    color: var(--text-dim);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    margin-bottom: 5px;
    text-align: center;
    text-transform: uppercase;
  }

  .side-ad-rail .adsbygoogle {
    min-height: 600px;
    width: 160px;
  }
}

@media (max-width: 720px) {
  body {
    padding: 0;
  }

  .page-wrapper {
    border-left: 0;
    border-radius: 0;
    border-right: 0;
  }
}

/* ==========================================================================
   Converter Workspace Grid
   ========================================================================== */
.converter-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

/* ==========================================================================
   Image Resizer
   ========================================================================== */
.resize-builder-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
}

.resize-input-panel,
.resize-results-panel {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 24px;
}

.resize-input-panel {
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.resize-input-panel h2 {
  border-bottom: 1px solid var(--border-color);
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  padding-bottom: 12px;
}

.resize-dimensions {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.resize-dimensions label,
.resize-item-controls label {
  display: grid;
  gap: 6px;
}

.resize-dimensions label span,
.resize-item-controls label span {
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 600;
}

.resize-dimensions input,
.resize-item-controls input {
  appearance: textfield;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font: inherit;
  font-size: 0.85rem;
  min-width: 0;
  outline: none;
  padding: 9px 10px;
  width: 100%;
}

.resize-dimensions input:focus,
.resize-item-controls input:focus {
  border-color: #175cd3;
  box-shadow: 0 0 0 3px rgba(23, 92, 211, 0.1);
}

.resize-dimension-separator {
  color: var(--text-dim);
  padding-bottom: 9px;
}

.resize-dimension-help {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.resize-apply-btn {
  width: 100%;
}

.resize-results-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 440px;
}

.resize-files-list {
  display: grid;
  gap: 12px;
}

.resize-files-list .empty-state {
  min-height: 300px;
}

.resize-file-row {
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: grid;
  gap: 14px;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  padding: 14px;
}

.resize-thumb {
  background: #eef0f3;
  border-radius: var(--radius-sm);
  height: 72px;
  object-fit: cover;
  width: 72px;
}

.resize-file-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.resize-file-heading {
  align-items: baseline;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.resize-file-heading strong {
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resize-file-heading span {
  color: var(--text-dim);
  flex: 0 0 auto;
  font-size: 0.72rem;
}

.resize-item-controls {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: 100px auto 100px minmax(130px, auto);
}

.resize-calculated {
  align-self: end;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 9px 0;
}

.resize-state {
  font-size: 0.72rem;
  font-weight: 600;
}

.resize-state.processing { color: #175cd3; }
.resize-state.completed { color: var(--success); }
.resize-state.error { color: var(--error); }

.resize-row-actions {
  display: flex;
  gap: 7px;
}

@media (min-width: 992px) {
  .resize-builder-grid {
    align-items: start;
    grid-template-columns: 360px minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .top-tab-bar {
    gap: 16px;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 0 18px;
  }

  .nav-menu summary,
  .nav-tab-link {
    font-size: 0.88rem;
    white-space: nowrap;
  }

  .resize-file-row {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .resize-thumb {
    height: 56px;
    width: 56px;
  }

  .resize-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .resize-item-controls {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .resize-calculated {
    grid-column: 1 / -1;
    padding: 0;
  }

  .resize-file-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
}

@media (min-width: 992px) {
  .converter-workspace {
    grid-template-columns: 360px 1fr;
    align-items: start;
  }
}

/* Left Panel: Controls */
.controls-panel {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--shadow-card);
}

.panel-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quality-value {
  color: var(--text-main);
  font-weight: 700;
}

/* Format Switcher Tabs */
.format-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #f4f4f6;
  padding: 4px;
  border-radius: var(--radius-sm);
}

.format-switcher-many {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.format-btn[hidden] {
  display: none;
}

.device-only-note {
  align-items: flex-start;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  color: #166534;
  display: flex;
  gap: 10px;
  padding: 12px;
}

.device-only-icon {
  align-items: center;
  background: #16a34a;
  border-radius: 50%;
  color: white;
  display: inline-flex;
  flex: 0 0 20px;
  font-size: 0.72rem;
  height: 20px;
  justify-content: center;
}

.device-only-note strong {
  display: block;
  font-size: 0.78rem;
  margin-bottom: 2px;
}

.device-only-note p {
  font-size: 0.72rem;
  line-height: 1.5;
}

/* ==========================================================================
   Dedicated PDF Builder
   ========================================================================== */
.pdf-builder {
  width: 100%;
}

.pdf-builder-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
}

.pdf-input-panel,
.pdf-order-panel {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.pdf-input-panel {
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
}

.pdf-input-panel h2,
.pdf-order-panel h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.08rem;
  font-weight: 650;
}

.pdf-dropzone {
  align-items: center;
  background: #fafafa;
  border: 1px dashed #cfd3d9;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  justify-content: center;
  min-height: 150px;
  padding: 22px 16px;
  text-align: center;
  transition: var(--transition-fast);
}

.pdf-dropzone:hover,
.pdf-dropzone.dragover {
  background: #f5f8ff;
  border-color: #175cd3;
}

.pdf-dropzone input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.pdf-dropzone-icon {
  align-items: center;
  background: #111111;
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  font-size: 1.2rem;
  height: 38px;
  justify-content: center;
  margin-bottom: 5px;
  width: 38px;
}

.pdf-dropzone strong {
  font-size: 0.84rem;
}

.pdf-dropzone > span:last-of-type {
  color: var(--text-dim);
  font-size: 0.72rem;
}

.pdf-text-entry {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pdf-text-entry label {
  font-size: 0.82rem;
  font-weight: 650;
}

.pdf-text-entry textarea {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.55;
  min-height: 112px;
  outline: none;
  padding: 12px;
  resize: vertical;
}

.pdf-text-entry textarea:focus {
  border-color: #9ca3af;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.05);
}

.pdf-order-panel {
  display: flex;
  flex-direction: column;
  min-height: 510px;
  overflow: hidden;
}

.pdf-order-header {
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  padding: 20px 22px;
}

.pdf-order-header p {
  color: var(--text-dim);
  font-size: 0.75rem;
  margin-top: 3px;
}

.pdf-item-count {
  align-items: center;
  background: #f2f4f7;
  border-radius: var(--radius-full);
  display: flex;
  font-size: 0.78rem;
  font-weight: 700;
  height: 30px;
  justify-content: center;
  min-width: 30px;
}

.pdf-items-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
}

.pdf-empty-state {
  align-items: center;
  color: var(--text-dim);
  display: flex;
  flex: 1;
  flex-direction: column;
  font-size: 0.78rem;
  gap: 5px;
  justify-content: center;
  min-height: 260px;
  padding: 30px;
  text-align: center;
}

.pdf-empty-state strong {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.pdf-sort-item {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: grid;
  gap: 12px;
  grid-template-columns: 34px 54px minmax(0, 1fr) auto;
  min-height: 76px;
  padding: 9px 10px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
}

.pdf-sort-item.dragging {
  border-color: #175cd3;
  box-shadow: 0 8px 24px rgba(23, 92, 211, 0.14);
  opacity: 0.88;
}

.pdf-drag-handle {
  background: transparent;
  border: 0;
  color: #98a2b3;
  cursor: grab;
  font-size: 1.35rem;
  height: 40px;
  touch-action: none;
}

.pdf-drag-handle:active {
  cursor: grabbing;
}

.pdf-item-preview {
  align-items: center;
  background: #f2f4f7;
  border-radius: 6px;
  color: #475467;
  display: flex;
  font-size: 0.7rem;
  font-weight: 750;
  height: 54px;
  justify-content: center;
  overflow: hidden;
  width: 54px;
}

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

.pdf-item-preview-text {
  font-family: Georgia, serif;
  font-size: 1rem;
}

.pdf-item-info {
  min-width: 0;
}

.pdf-item-info strong,
.pdf-item-info span,
.pdf-item-info p {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-item-info strong {
  font-size: 0.8rem;
}

.pdf-item-info span {
  color: var(--text-dim);
  font-size: 0.68rem;
  margin-top: 2px;
}

.pdf-item-info p {
  color: var(--text-muted);
  font-size: 0.7rem;
  margin-top: 4px;
}

.pdf-item-controls {
  display: flex;
  gap: 3px;
}

.pdf-item-controls button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 5px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  font-size: 0.9rem;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.pdf-item-controls button:hover:not(:disabled) {
  background: #f2f4f7;
  color: var(--text-main);
}

.pdf-item-controls button:disabled {
  cursor: default;
  opacity: 0.25;
}

.pdf-actions {
  align-items: center;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  min-height: 76px;
  padding: 14px 18px;
}

.pdf-status {
  color: var(--text-dim);
  flex: 1;
  font-size: 0.72rem;
}

.pdf-status[data-type="error"] {
  color: var(--error);
}

.pdf-status[data-type="success"] {
  color: var(--success);
}

.pdf-create-btn {
  min-width: 210px;
}

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

  .pdf-order-panel {
    min-height: 430px;
  }
}

@media (max-width: 560px) {
  .pdf-sort-item {
    gap: 8px;
    grid-template-columns: 28px 46px minmax(0, 1fr) auto;
    padding: 8px 7px;
  }

  .pdf-item-preview {
    height: 46px;
    width: 46px;
  }

  .pdf-item-controls button[data-action="up"],
  .pdf-item-controls button[data-action="down"] {
    display: none;
  }

  .pdf-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .pdf-create-btn {
    min-width: 0;
    width: 100%;
  }
}

.format-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

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

.format-btn.active {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Quality Slider */
.quality-container {
  transition: var(--transition-normal);
  overflow: hidden;
  max-height: 80px;
  opacity: 1;
}

.quality-container.hidden {
  max-height: 0;
  opacity: 0;
  margin-top: -10px;
  pointer-events: none;
}

.quality-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: var(--radius-full);
  background: #e5e7eb;
  outline: none;
}

.quality-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-main);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: var(--transition-fast);
}

.quality-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Dropzone (Minimalist & Clean) */
.dropzone {
  position: relative;
  border: 1px dashed #cccccc;
  border-radius: var(--radius-md);
  padding: 28px 16px;
  text-align: center;
  background: #fafafa;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--text-main);
  background: #f3f4f6;
}

.dropzone-icon {
  color: var(--text-main);
}

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

.dropzone-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 240px;
}

.browse-btn {
  display: inline-block;
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  margin-top: 4px;
  pointer-events: none;
}

.browse-btn:hover {
  border-color: var(--text-main);
  background: #f9fafb;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Tips Box */
.tips-box {
  background: #f9fafb;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tips-box strong {
  color: var(--text-main);
}

.tips-box kbd {
  background: #ffffff;
  border: 1px solid #d1d5db;
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--text-main);
  font-family: monospace;
}

/* Right Panel: Results Grid */
.results-panel {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--shadow-card);
  min-height: 440px;
}

.results-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.results-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-count {
  background: var(--text-main);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Minimalist Action Buttons */
.btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: #f9fafb;
  border-color: #999999;
}

.btn-primary {
  background: var(--accent-black);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-black-hover);
}

.btn-success {
  background: #059669;
  color: #ffffff;
}

.btn-success:hover {
  background: #047857;
}

/* Files Grid (Scandinavian Squares) */
.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-dim);
  gap: 12px;
}

.empty-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* File Card (Minimalist Square Aesthetic) */
.file-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition-fast);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.file-card:hover {
  border-color: #999999;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.card-top {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Fixed height thumbnail container to prevent vertical stretching */
.thumbnail-preview {
  width: 100%;
  height: 160px;
  background: #f4f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid var(--border-color);
}

.clickable-thumb, .thumbnail-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.clickable-thumb:hover, .thumbnail-preview img:hover {
  transform: scale(1.06);
}

.thumbnail-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 2.2rem;
  width: 100%;
  height: 100%;
}

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

/* File Details & Info */
.file-info {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.file-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.file-name strong {
  color: var(--accent-black);
}

.file-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.size-badge {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  width: fit-content;
}

.status-waiting {
  background: #f3f4f6;
  color: var(--text-muted);
}

.status-converting {
  background: #fef3c7;
  color: #92400e;
}

.status-completed, .status-done {
  background: #d1fae5;
  color: #065f46;
}

.status-error {
  background: #fee2e2;
  color: #991b1b;
}

/* Progress Bar */
.progress-container {
  width: 100%;
  height: 4px;
  background: #f3f4f6;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--text-main);
  transition: width 0.3s ease;
}

.progress-bar.animated {
  background: linear-gradient(90deg, #111111, #6b7280, #111111);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Card Actions */
.card-actions {
  padding: 10px 14px 14px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--border-color);
  background: #fafafa;
}

.btn-card {
  flex: 1;
  padding: 7px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  justify-content: center;
}

.btn-icon-only {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.btn-icon-only:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* ==========================================================================
   SEO Articles & Features (Gallery / E-commerce Colored Squares)
   ========================================================================== */
.seo-section {
  display: flex;
  flex-direction: column;
  gap: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.seo-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.seo-main-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.seo-main-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Grid matching reference image's pastel squares! */
.seo-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.seo-card {
  padding: 28px 24px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition-fast);
}

.seo-card:hover {
  transform: translateY(-2px);
}

.card-blue { background: #e0f2fe; color: #075985; }
.card-gray { background: #f3f4f6; color: #1f2937; }
.card-dark { background: #111111; color: #ffffff; }
.card-cream { background: #fef3c7; color: #78350f; }

.seo-card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.seo-card-text {
  font-size: 0.85rem;
  line-height: 1.5;
  opacity: 0.9;
}

.seo-article {
  background: #fafafa;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 32px;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.8;
}

.article-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 16px;
}

.article-subtitle {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 24px 0 10px 0;
}

.seo-article p {
  margin-bottom: 14px;
}

.seo-article strong {
  color: var(--text-main);
}

/* ==========================================================================
   FAQ Section
   ========================================================================== */
.faq-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.faq-header-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
}

.faq-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border-color);
}

.faq-item {
  border-bottom: 1px solid var(--border-color);
}

.faq-question {
  width: 100%;
  background: transparent;
  border: none;
  padding: 18px 0;
  text-align: left;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.faq-question:hover {
  color: #555555;
}

.faq-icon {
  font-size: 1.25rem;
  color: var(--text-main);
  transition: transform 0.3s ease;
  line-height: 1;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.faq-item.active .faq-answer {
  max-height: 250px;
  padding: 0 0 18px 0;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

/* ==========================================================================
   Modals & Toasts
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #ffffff;
  border-radius: var(--radius-md);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

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

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  color: var(--text-main);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 20px;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9fafb;
}

.modal-body img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.inline-status {
  color: var(--text-dim);
  font-size: 0.72rem;
  height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 2px;
  transition: height var(--transition-fast), opacity var(--transition-fast);
}

.inline-status.visible {
  height: 22px;
  opacity: 1;
}

.inline-status[data-type="error"] {
  color: var(--error);
}

.inline-status[data-type="success"] {
  color: var(--success);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.app-footer {
  padding: 32px 36px;
  text-align: center;
  border-top: 1px solid var(--border-color);
  background: #fafafa;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.app-footer strong {
  color: var(--text-main);
}

/* ==========================================================================
   Mobile experience — touch-first, focused and intentionally single-column
   ========================================================================== */
@media (max-width: 720px) {
  html {
    scroll-padding-top: 62px;
  }

  body {
    background: #ffffff;
    line-height: 1.5;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .page-wrapper {
    border: 0;
    box-shadow: none;
    min-height: 100vh;
    overflow: visible;
  }

  .app-header {
    align-items: center;
    flex-direction: row;
    gap: 10px;
    min-height: 62px;
    padding: 11px 16px;
  }

  .logo-container {
    gap: 8px;
  }

  .logo-icon svg {
    height: 32px;
    width: 32px;
  }

  .logo-text {
    font-size: 1.12rem;
  }

  .header-right {
    align-items: center;
    flex-direction: row;
    gap: 0;
    margin-left: auto;
  }

  .language-picker {
    border-radius: 10px;
    min-height: 40px;
    padding: 7px 9px;
  }

  .language-picker-icon {
    display: none;
  }

  .language-picker select {
    max-width: 116px;
    min-height: 24px;
  }

  .privacy-badge {
    display: none;
  }

  .top-tab-bar {
    display: grid;
    gap: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
    padding: 0 8px;
    position: sticky;
    top: 0;
    z-index: 50;
  }

  .nav-menu,
  .nav-tab-link {
    min-width: 0;
  }

  .nav-menu summary,
  .nav-tab-link {
    font-size: 0.72rem;
    gap: 5px;
    justify-content: center;
    min-height: 46px;
    padding: 10px 4px;
    text-align: center;
    white-space: normal;
  }

  .nav-chevron {
    height: 6px;
    width: 6px;
  }

  .nav-dropdown,
  .nav-dropdown-wide {
    border-radius: 14px;
    box-shadow: 0 18px 46px rgba(17, 24, 39, 0.18);
    left: 4px;
    max-height: min(62vh, 460px);
    min-width: min(330px, calc(100vw - 24px));
    padding: 10px;
    top: calc(100% + 6px);
  }

  .nav-dropdown-right {
    left: auto;
    right: 4px;
  }

  .nav-dropdown a {
    min-height: 44px;
    padding: 11px 12px;
  }

  .main-container {
    gap: 22px;
    padding: 24px 14px 40px;
  }

  .hero-section {
    padding: 0 4px;
  }

  .local-processing-pill {
    font-size: 0.68rem;
    margin-bottom: 10px;
    padding: 5px 10px;
  }

  .hero-title {
    font-size: clamp(1.65rem, 8vw, 2rem);
    letter-spacing: -0.7px;
    line-height: 1.12;
    margin-bottom: 10px;
  }

  .hero-subtitle {
    font-size: 0.9rem;
    line-height: 1.55;
  }

  .converter-workspace,
  .resize-builder-grid,
  .pdf-builder-grid {
    gap: 16px;
  }

  .controls-panel,
  .results-panel,
  .resize-input-panel,
  .resize-results-panel,
  .pdf-input-panel,
  .pdf-order-panel {
    border-radius: 16px;
    box-shadow: none;
    padding: 16px;
  }

  .controls-panel {
    gap: 16px;
  }

  .controls-panel .panel-title {
    font-size: 1rem;
    order: 0;
    padding-bottom: 10px;
  }

  .controls-panel .dropzone {
    order: 1;
  }

  .controls-panel .setting-group {
    order: 2;
  }

  .controls-panel .quality-container {
    order: 3;
  }

  .controls-panel .device-only-note {
    order: 4;
  }

  .controls-panel .tips-box {
    display: none;
    order: 5;
  }

  .dropzone,
  .pdf-dropzone {
    background: linear-gradient(180deg, #f8fbff 0%, #f4f7fb 100%);
    border: 2px dashed #a9b8ca;
    border-radius: 14px;
    min-height: 190px;
    padding: 24px 16px;
  }

  .dropzone:active,
  .pdf-dropzone:active {
    background: #edf4ff;
    border-color: #175cd3;
    transform: scale(0.995);
  }

  .dropzone-icon svg {
    height: 36px;
    width: 36px;
  }

  .dropzone-title {
    font-size: 1rem;
  }

  .dropzone-subtitle {
    font-size: 0.75rem;
    line-height: 1.5;
    max-width: 290px;
  }

  .browse-btn {
    background: #111111;
    border-color: #111111;
    border-radius: 9px;
    color: #ffffff;
    font-size: 0.86rem;
    min-height: 44px;
    padding: 10px 22px;
  }

  .format-switcher,
  .format-switcher-many {
    gap: 5px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 5px;
  }

  .format-btn {
    min-height: 44px;
    padding: 9px 7px;
  }

  .quality-slider {
    height: 6px;
    margin: 6px 0;
  }

  .quality-slider::-webkit-slider-thumb {
    height: 24px;
    width: 24px;
  }

  .device-only-note {
    padding: 11px 12px;
  }

  .results-panel {
    gap: 14px;
    min-height: 300px;
  }

  .results-header {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 14px;
  }

  .results-title {
    justify-content: space-between;
  }

  .action-buttons {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .action-buttons .btn {
    min-height: 44px;
    padding: 10px 8px;
  }

  .action-buttons .btn-success {
    grid-column: 1 / -1;
  }

  .files-grid {
    gap: 12px;
    grid-template-columns: 1fr;
  }

  .file-card {
    border-radius: 12px;
  }

  .thumbnail-preview {
    height: min(52vw, 210px);
  }

  .card-actions {
    padding: 10px 12px 12px;
  }

  .btn-card,
  .btn-icon-only {
    min-height: 44px;
  }

  .btn-icon-only {
    min-width: 44px;
  }

  .empty-state {
    min-height: 210px;
    padding: 34px 12px;
  }

  .resize-input-panel,
  .pdf-input-panel {
    gap: 15px;
  }

  .resize-dimensions input,
  .resize-item-controls input,
  .pdf-text-entry textarea {
    font-size: 16px;
    min-height: 44px;
  }

  .resize-apply-btn,
  .pdf-text-entry .btn,
  .pdf-actions .btn {
    min-height: 46px;
  }

  .resize-results-panel,
  .pdf-order-panel {
    min-height: 320px;
  }

  .seo-section {
    gap: 24px;
    padding-top: 10px;
  }

  .seo-main-title {
    font-size: 1.45rem;
  }

  .seo-features-grid {
    grid-template-columns: 1fr;
  }

  .seo-card {
    border-radius: 12px;
    padding: 22px 20px;
  }

  .seo-article {
    border-radius: 14px;
    font-size: 0.88rem;
    line-height: 1.7;
    padding: 22px 18px;
  }

  .faq-question {
    min-height: 56px;
    padding: 15px 0;
  }

  .modal-content {
    border-radius: 16px 16px 0 0;
    margin-top: auto;
    max-height: 92dvh;
    width: 100%;
  }

  .app-footer {
    font-size: 0.78rem;
    padding: 26px 18px calc(26px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 380px) {
  .logo-text {
    font-size: 1rem;
  }

  .language-picker select {
    max-width: 92px;
  }

  .main-container {
    padding-inline: 10px;
  }

  .nav-menu summary,
  .nav-tab-link {
    font-size: 0.67rem;
  }
}
