/* Convert Box styles. Design language shared with the PixLab Photo Editor and Video Editor:
   tokens from pixlab-smart-ai-editor/assets/css/theme.css, IBM Plex Sans + Space Grotesk headings. */

/* ------------------------------------------------------------------ fonts (self-hosted, latin; licenses in fonts/) */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Headings: own family name, as in the Photo Editor */
@font-face {
  font-family: "PixLab Heading";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ------------------------------------------------------------------ tokens */

:root {
  color-scheme: light;
  --font: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-heading: "PixLab Heading", "IBM Plex Sans", "Segoe UI", sans-serif;

  --bg: #e8edf4;
  --bg-2: #f3f7fd;
  --surface: #ffffff;
  --surface-alt: #f7faff;
  --border: #d0d8e5;
  --border-light: #e5ebf3;
  --border-medium: #b9c6d8;
  --text: #162133;
  --text-2: #516074;
  --text-3: #5e7088;
  --placeholder: #8a9ab0;
  --hover: #eef3fb;
  --hover-strong: #e3ebf7;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #e8f0fe;
  --primary-on: #ffffff;
  --gradient-primary: linear-gradient(180deg, #4e92ff, #2563eb);
  --gradient-primary-hover: linear-gradient(180deg, #3b82f6, #1d4ed8);
  --focus-ring: rgba(37, 99, 235, 0.18);

  --success: #15803d;
  --success-soft: #dcfce7;
  --danger: #c2334f;
  --danger-soft: #fdecef;
  --tint-image: #c026d3;
  --tint-image-soft: #fae8ff;
  --tint-video: #2563eb;
  --tint-video-soft: #e8f0fe;
  --tint-audio: #0d9466;
  --tint-audio-soft: #ddf7ec;

  --topbar-bg: rgba(247, 250, 255, 0.9);
  --footer-bg: #0b1324;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --radius-2xl: 16px;
  --radius-full: 999px;

  --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.04), 0 6px 14px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 6px 14px rgba(15, 23, 42, 0.07), 0 16px 34px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 34px rgba(15, 23, 42, 0.1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a111f;
  --bg-2: #0f192d;
  --surface: #131f34;
  --surface-alt: #0f192d;
  --border: #263852;
  --border-light: #1d2c45;
  --border-medium: #34496a;
  --text: #e2ebfb;
  --text-2: #bbcde7;
  --text-3: #97aac7;
  --placeholder: #6f84a3;
  --hover: #182843;
  --hover-strong: #1e3150;

  --primary: #5d92ff;
  --primary-hover: #7ba7ff;
  --primary-soft: rgba(93, 146, 255, 0.14);
  --gradient-primary-hover: linear-gradient(180deg, #5d9aff, #325fd0);
  --focus-ring: rgba(93, 146, 255, 0.24);

  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.12);
  --danger: #ff8197;
  --danger-soft: rgba(255, 129, 151, 0.12);
  --tint-image: #e879f9;
  --tint-image-soft: rgba(232, 121, 249, 0.14);
  --tint-video: #5d92ff;
  --tint-video-soft: rgba(93, 146, 255, 0.14);
  --tint-audio: #34d399;
  --tint-audio-soft: rgba(52, 211, 153, 0.13);

  --topbar-bg: rgba(15, 25, 45, 0.88);
  --footer-bg: #070c17;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.45);
}

/* ------------------------------------------------------------------ base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, p, ul, ol, figure {
  margin: 0;
}

img, svg {
  vertical-align: middle;
}

a {
  color: var(--primary);
}

button, input, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

[hidden],
.hidden {
  display: none !important;
}

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

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 2000;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--primary-on);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--primary-on);
}

.btn-primary:hover:not(:disabled) {
  background: var(--gradient-primary-hover);
  box-shadow: var(--shadow-sm);
  color: var(--primary-on);
}

.btn-outline {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

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

.btn-danger {
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
  background: var(--surface);
  color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-soft);
}

.btn-lg {
  min-height: 46px;
  padding: 0 22px;
  font-size: 15px;
}

.btn-sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.btn:disabled {
  opacity: 0.55;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-2);
}

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

.icon-btn:disabled {
  opacity: 0.35;
}

/* ------------------------------------------------------------------ top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-right: auto;
  color: var(--text);
  text-decoration: none;
}

.brand-logo {
  width: auto;
  height: 34px;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

[data-theme="dark"] .invert-on-dark {
  filter: invert(1) hue-rotate(180deg);
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.topbar-nav a,
.topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.topbar-nav a:hover,
.topbar-btn:hover,
.menu.open > .topbar-btn {
  background: var(--hover);
}

.topbar-btn .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.4;
}

.menu {
  position: relative;
}

.menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 1100;
  display: none;
  min-width: 250px;
  max-height: min(72vh, 560px);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.menu.open > .menu-panel {
  display: block;
}

.menu-panel a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

.menu-panel a:hover,
.menu-panel a:focus-visible {
  background: var(--hover);
  outline: none;
}

.menu-sep {
  height: 1px;
  margin: 6px 4px;
  background: var(--border);
}

.menu-mobile-only {
  display: none;
}

/* Theme switch: one icon button (moon in light, sun in dark), as in the Photo Editor */
.theme-toggle {
  position: relative;
}

.theme-toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-toggle-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--text-2);
  cursor: pointer;
}

.theme-toggle-label:hover {
  background: var(--hover);
  color: var(--text);
}

.theme-toggle-input:focus-visible + .theme-toggle-label {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.theme-toggle-label .i-sun,
[data-theme="dark"] .theme-toggle-label .i-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle-label .i-sun {
  display: block;
}

/* ------------------------------------------------------------------ converter panel */

.hero {
  padding-top: 28px;
  padding-bottom: 8px;
}

.panel {
  max-width: 1040px;
  margin: 0 auto;
  padding: 36px 40px 32px;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

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

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  color: var(--primary-hover);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-text h1 {
  margin: 14px 0 8px;
  text-wrap: balance;
  font-family: var(--font-heading);
  font-size: clamp(27px, 4vw, 38px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.accent {
  color: var(--primary);
}

.tagline {
  margin-bottom: 8px;
  font-size: 17px;
  font-weight: 600;
}

.intro {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.65;
}

/* File type filter */
.tabs {
  display: flex;
  width: fit-content;
  max-width: 100%;
  margin: 26px auto 16px;
  padding: 4px;
  gap: 2px;
  border-radius: var(--radius-full);
  background: var(--bg);
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.tab .icon {
  width: 16px;
  height: 16px;
}

.tab:hover:not(:disabled):not(.active) {
  color: var(--text);
}

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

.tab:disabled {
  opacity: 0.5;
}

/* Error banner */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 12px 12px 14px;
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  border-radius: var(--radius-xl);
  background: var(--danger-soft);
  color: var(--text);
  font-size: 14px;
}

.alert > .icon {
  margin-top: 1px;
  color: var(--danger);
}

.alert-body {
  flex: 1;
  min-width: 0;
}

.alert-title {
  font-weight: 600;
}

.alert .icon-btn {
  width: 28px;
  height: 28px;
  margin: -3px 0;
}

/* Drop zone */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 250px;
  padding: 28px 20px;
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-2xl);
  background: var(--bg);
  color: var(--text-2);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone:hover,
.dropzone.drag-active,
.dropzone:has(input:focus-visible) {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 5%, var(--bg));
}

.dropzone:has(input:focus-visible) {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.dropzone-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.dropzone-icon .icon {
  width: 26px;
  height: 26px;
  stroke-width: 1.8;
}

.dropzone-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
}

.dropzone .btn {
  margin-top: 10px;
  pointer-events: none;
}

.dropzone-formats {
  margin-top: 8px;
  color: var(--text-2);
  font-size: 13px;
}

.dropzone-note {
  color: var(--text-2);
  font-size: 12px;
}

/* ------------------------------------------------------------------ queue */

.queue {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  background: var(--surface-alt);
}

.queue.drag-active {
  outline: 2px dashed var(--primary);
  outline-offset: -6px;
}

.queue-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-bottom: 12px;
}

.queue-title {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 700;
}

.queue-summary {
  color: var(--text-3);
  font-size: 13px;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file {
  padding: 12px 12px 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
}

.file-main {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
}

.file-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  background: var(--tint-video-soft);
  color: var(--tint-video);
}

.file-icon.is-image {
  background: var(--tint-image-soft);
  color: var(--tint-image);
}

.file-icon.is-audio {
  background: var(--tint-audio-soft);
  color: var(--tint-audio);
}

.file-meta {
  min-width: 0;
}

.file-name {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.file-details {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: var(--text-3);
  font-size: 13px;
}

.extension {
  color: var(--text-2);
  font-weight: 600;
  text-transform: uppercase;
}

.extension.active {
  color: var(--success);
}

.conversion-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.conversion-actions .label {
  color: var(--text-3);
  font-size: 13px;
}

.format-select,
.settings-field select,
.settings-field input[type="number"] {
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--surface);
  color: var(--text);
  font-size: 14px;
}

.format-select,
.settings-field select {
  min-width: 96px;
  padding: 0 32px 0 12px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237f90a6' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='m6 9 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.format-select:hover:not(:disabled),
.settings-field select:hover:not(:disabled),
.settings-field input[type="number"]:hover:not(:disabled) {
  border-color: var(--border-medium);
}

.format-select:focus-visible,
.settings-field select:focus-visible,
.settings-field input:focus-visible {
  border-color: var(--primary);
  outline: 3px solid var(--focus-ring);
  outline-offset: 0;
}

.file-secondary-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--success-soft);
  color: var(--success);
  font-size: 13px;
  font-weight: 600;
}

.status-badge .icon {
  width: 15px;
  height: 15px;
}

.progress-container {
  width: 220px;
}

.progress-text {
  margin-bottom: 6px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}

.progress-bar-container,
.engine-status-track {
  height: 6px;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: var(--border-light);
}

.progress-bar,
.engine-status-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--gradient-primary);
  transition: width 0.2s;
}

.file-error {
  margin: 10px 0 0 52px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}

/* Per-file settings */
.file-settings-details {
  margin: 10px 0 0 52px;
}

.file-settings-details > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.file-settings-details > summary::-webkit-details-marker {
  display: none;
}

.file-settings-details > summary .icon {
  width: 15px;
  height: 15px;
}

.file-settings-details > summary:hover {
  color: var(--primary);
}

.settings-chip {
  overflow: hidden;
  color: var(--text-3);
  font-weight: 400;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.settings-chip::before {
  content: "· ";
}

.file-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--surface-alt);
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-field label {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

.settings-field input[type="number"] {
  padding: 0 10px;
}

.settings-field input::placeholder {
  color: var(--placeholder);
}

.settings-field.checkbox-field {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  align-self: end;
  min-height: 36px;
}

.settings-field.checkbox-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.settings-field.checkbox-field label {
  font-size: 13px;
}

.settings-hint {
  grid-column: 1 / -1;
  color: var(--text-3);
  font-size: 12px;
}

/* Engine download / start-up (non-blocking) */
.engine-status:not(.hidden) {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-xl);
  background: var(--primary-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.engine-status-body {
  flex: 1;
  min-width: 0;
}

.engine-status-track {
  margin-top: 8px;
}

.spinner {
  flex: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--primary);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Actions under the list; they stay in view while a long list scrolls */
.queue-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px -18px -18px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
  background: var(--surface-alt);
}

.queue-actions-end {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.add-more-files.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.add-more-files:has(input:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Trust points under the converter */
.trust-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  margin-top: 20px;
  padding: 0;
  color: var(--text-2);
  font-size: 13px;
  list-style: none;
}

.trust-list li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trust-list .icon {
  width: 16px;
  height: 16px;
  color: var(--success);
}

/* ------------------------------------------------------------------ content sections */

.section {
  padding-top: 56px;
}

.section-title {
  margin-bottom: 8px;
  text-wrap: balance;
  font-family: var(--font-heading);
  font-size: clamp(23px, 3vw, 30px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-align: center;
}

.section-lead {
  max-width: 640px;
  margin: 0 auto 26px;
  color: var(--text-2);
  font-size: 15px;
  text-align: center;
}

.steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  counter-increment: step;
}

.step::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-hover);
  font-size: 14px;
  font-weight: 600;
}

.step h3,
.feature h3 {
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 600;
}

.step p,
.feature p {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.55;
}

.optional {
  color: var(--text-3);
  font-weight: 400;
}

.features {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.feature {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  border-radius: var(--radius-lg);
  background: var(--primary-soft);
  color: var(--primary);
}

.feature-icon.is-green {
  background: var(--tint-audio-soft);
  color: var(--tint-audio);
}

.feature-icon.is-pink {
  background: var(--tint-image-soft);
  color: var(--tint-image);
}

.feature-icon.is-amber {
  background: color-mix(in srgb, #f59e0b 16%, transparent);
  color: #d97706;
}

[data-theme="dark"] .feature-icon.is-amber {
  color: #fbbf24;
}

/* Popular conversions: each one opens the file picker with the output preselected */
.conversions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.conversion {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.conversion:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.conversion:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.conversion-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
}

.conversion-title .icon {
  width: 15px;
  height: 15px;
  color: var(--primary);
  transition: transform 0.15s ease;
}

.conversion:hover .conversion-title .icon {
  transform: translateX(2px);
}

.conversion-desc {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
}

/* Pill links: other conversion pages */
.more-conversions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  margin-top: 20px;
}

.more-label {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pill-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pill-links.is-start {
  justify-content: flex-start;
}

.pill-links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.pill-links a:hover,
.pill-links a:focus-visible {
  border-color: var(--primary);
  color: var(--primary-hover);
}

/* Conversion pages: breadcrumb above the converter */
.breadcrumb {
  margin-bottom: 12px;
  font-size: 13px;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-3);
}

.breadcrumb li + li::before {
  content: "›";
  margin-right: 8px;
}

.breadcrumb a {
  color: var(--text-2);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Supported formats */
.formats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.format-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
}

.format-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.format-head .feature-icon {
  margin-bottom: 0;
}

.format-head h3 {
  font-size: 17px;
  font-weight: 600;
}

.format-label {
  margin-bottom: 6px;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.format-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  padding: 0;
  list-style: none;
}

.format-badges li {
  padding: 3px 9px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.format-note {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.55;
}

/* Conversion pages: the two formats side by side, then what happens to the file */
.formats.is-pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 940px;
  margin: 0 auto;
}

.formats.is-pair .format-note {
  margin-bottom: 14px;
}

.format-full {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 13px;
}

.format-desc {
  margin-bottom: 14px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.6;
}

.note-card {
  max-width: 940px;
  margin: 14px auto 0;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
}

.note-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 600;
}

.note-card h3 .icon {
  color: var(--primary);
}

.note-card p {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.65;
}

/* Conversion pages: other converters, grouped by type */
.more-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.more-group {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
}

.more-group h3 {
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 600;
}

.more-group .pill-links a {
  background: var(--surface-alt);
}

.more-all {
  margin-top: 18px;
  text-align: center;
}

.more-all a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary-hover);
  font-weight: 600;
  text-decoration: none;
}

.more-all a:hover {
  text-decoration: underline;
}

.more-all .icon {
  width: 16px;
  height: 16px;
}

/* Comparison */
.compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 900px;
  margin: 0 auto;
}

.compare-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
}

.compare-card.is-yes {
  border-color: color-mix(in srgb, var(--success) 40%, var(--border));
}

.compare-card h3 {
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
}

.compare-card ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
  list-style: none;
}

.compare-card li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.5;
}

.compare-card li .icon {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--text-3);
}

.compare-card.is-yes li .icon {
  color: var(--success);
}

/* Call to action */
.cta {
  padding: 40px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  background: linear-gradient(180deg, var(--surface), var(--surface-alt));
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.cta-title {
  margin-bottom: 8px;
  text-wrap: balance;
  font-family: var(--font-heading);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  line-height: 1.2;
}

.cta p {
  margin-bottom: 20px;
  color: var(--text-2);
  font-size: 15px;
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 780px;
  margin: 0 auto;
}

.faq-list details {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
}

.faq-list summary {
  position: relative;
  padding: 15px 48px 15px 18px;
  font-size: 15px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

/* Questions are h3 headings (document outline); they keep the summary's look */
.faq-list summary h3 {
  display: inline;
  font: inherit;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
}

.faq-list details[open] summary::after {
  content: "−";
}

.faq-list details > p {
  padding: 0 18px 16px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.65;
}

/* ------------------------------------------------------------------ footer */

.site-footer {
  margin-top: 72px;
  padding: 48px 0 28px;
  background: var(--footer-bg);
  color: #bbcde7;
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.footer-brand img {
  margin-bottom: 14px;
}

.footer-brand p {
  max-width: 340px;
  line-height: 1.6;
}

.footer-col h2 {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-col h2:not(:first-child) {
  margin-top: 24px;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.site-footer a {
  color: #bbcde7;
  text-decoration: none;
}

.site-footer a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid #1d2c45;
  color: #97aac7;
  font-size: 13px;
}

.site-footer .link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: #bbcde7;
  font-size: 14px;
  text-align: left;
}

.site-footer .link-btn:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-badges {
  display: flex;
  gap: 10px;
}

/* ------------------------------------------------------------------ licenses dialog */

.notice-dialog {
  width: min(760px, calc(100% - 32px));
  max-height: calc(100% - 48px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.notice-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
}

.notice-dialog .dialog-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.notice-dialog .dialog-head h2 {
  font-family: var(--font-heading);
  font-size: 19px;
}

.notice-dialog form {
  margin: 0;
}

.notice-dialog .dialog-body {
  padding: 20px 24px 24px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.65;
}

.notice-dialog .dialog-body > * + * {
  margin-top: 12px;
}

.notice-dialog .dialog-body h3 {
  margin-top: 20px;
  color: var(--text);
  font-size: 15px;
}

.notice-dialog .dialog-body strong {
  color: var(--text);
}

.notice-dialog .dialog-body ul {
  padding-left: 20px;
}

/* ------------------------------------------------------------------ responsive */

@media (min-width: 1024px) {
  .steps.is-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .features,
  .conversions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .formats {
    grid-template-columns: 1fr;
    max-width: 640px;
    margin: 0 auto;
  }

  .more-groups {
    grid-template-columns: 1fr;
    max-width: 640px;
    margin: 0 auto;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .topbar-nav {
    display: none;
  }

  .menu-mobile-only {
    display: block;
  }

  .menu-panel a.menu-mobile-only {
    display: flex;
  }

  .hero {
    padding-top: 12px;
  }

  .panel {
    padding: 24px 16px 20px;
    border-radius: 16px;
  }

  .tabs {
    width: 100%;
    margin-top: 20px;
  }

  .tab {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 6px;
    font-size: 13px;
  }

  .dropzone {
    min-height: 210px;
  }

  .queue {
    padding: 12px;
  }

  /* Phones: not sticky (it would cover the list); Convert on its own row, the rest two per row */
  .queue-actions {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 12px -12px -12px;
    padding: 12px;
  }

  .queue-actions-end {
    display: contents;
  }

  #convert-btn,
  #cancel-btn {
    grid-column: 1 / -1;
    order: -1;
  }

  .queue-actions .btn {
    padding: 0 10px;
  }

  .file-main {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    row-gap: 10px;
  }

  .select-convert-format {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .file-secondary-actions {
    grid-column: 3;
    grid-row: 1;
  }

  .conversion-actions .format-select {
    flex: 1;
  }

  .progress-container {
    width: 100%;
  }

  .file-error,
  .file-settings-details {
    margin-left: 0;
  }

  .steps,
  .features,
  .compare,
  .formats.is-pair {
    grid-template-columns: 1fr;
  }

  .conversion {
    padding: 12px 14px;
  }

  .section {
    padding-top: 44px;
  }
}

@media (max-width: 479px) {
  .brand-logo {
    height: 30px;
  }

  .brand-name {
    font-size: 16px;
  }

  .tab .icon {
    display: none;
  }

  .conversions {
    gap: 8px;
  }

  .conversion {
    padding: 10px 12px;
  }

  .conversion-title {
    font-size: 14px;
  }

  .conversion-desc {
    font-size: 12.5px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .conversion:hover {
    transform: none;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation-duration: 0.01ms !important;
  }
}
