/* ==========================================================================
   FileFormatLab design system
   Light, roomy, one accent colour. Type floor is 13px, line height is always
   explicit, and every control is at least 44px tall.
   ========================================================================== */

@font-face {
  font-family: 'DM Sans';
  src: url('/fonts/dm-sans-var-latin.woff2') format('woff2-variations');
  font-weight: 100 1000; font-style: normal; font-display: swap;
  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: 'DM Sans';
  src: url('/fonts/dm-sans-var-latin-ext.woff2') format('woff2-variations');
  font-weight: 100 1000; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;

  --brand: #1d4ed8;
  --brand-hover: #1740b0;
  --brand-ink: #16308a;
  --brand-soft: #eef3ff;
  --brand-softer: #f6f9ff;
  --brand-line: #cbd9fb;

  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-sunk: #f1f4fa;

  --ink: #0d1425;
  --ink-2: #3d475c;
  --ink-3: #5b6578;

  --line: #e3e8f1;
  --line-2: #ccd5e4;

  --ok: #0b7a4f;
  --ok-soft: #e7f6ee;
  --ok-line: #b7e2cd;
  --warn: #8a5300;
  --warn-soft: #fdf5e7;
  --warn-line: #f0dcb4;
  --err: #b32218;
  --err-soft: #fdeeed;
  --err-line: #f4c9c5;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --r-pill: 999px;

  --sh-1: 0 1px 2px rgba(13, 20, 37, .06);
  --sh-2: 0 1px 3px rgba(13, 20, 37, .05), 0 8px 20px rgba(13, 20, 37, .06);
  --sh-3: 0 2px 6px rgba(13, 20, 37, .05), 0 18px 44px rgba(13, 20, 37, .10);
  --sh-focus: 0 0 0 3px rgba(29, 78, 216, .32);

  --shell: 1140px;
  --gap: 1.25rem;
}

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

/* A class that sets `display` beats the browser's own [hidden] rule, since both
   weigh the same and ours comes later. Every panel that toggles `hidden` needs
   this or it stays on screen: the convert button appeared with no files queued
   and filtered tool cards refused to disappear. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.nav-open { overflow: hidden; }

h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.2; font-weight: 700; letter-spacing: -.015em; color: var(--ink); }
h1 { font-size: clamp(1.95rem, 5.2vw, 2.9rem); letter-spacing: -.025em; }
h2 { font-size: clamp(1.4rem, 3.1vw, 1.95rem); letter-spacing: -.02em; }
h3 { font-size: 1.0625rem; line-height: 1.35; }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0 0 1rem; padding-left: 1.2rem; }
li { margin: 0 0 .35rem; }
strong { font-weight: 700; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .875em; background: var(--surface-sunk); padding: .1em .35em; border-radius: 6px;
}
img, svg { max-width: 100%; }
img { height: auto; }

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-hover); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

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

.skip-link {
  position: absolute; left: 50%; top: -100px; transform: translateX(-50%);
  z-index: 100; background: var(--surface); color: var(--brand);
  padding: .7rem 1.1rem; border-radius: 0 0 var(--r-md) var(--r-md);
  box-shadow: var(--sh-2); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 0; }

.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 1.15rem; }
.shell-narrow { max-width: 46rem; }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .65rem 1.15rem;
  border: 1px solid transparent; border-radius: var(--r-pill);
  font: inherit; font-size: .9375rem; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .12s ease;
}
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--sh-1); }
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); color: #fff; transform: translateY(-1px); box-shadow: var(--sh-2); }
.btn-secondary { background: var(--surface); color: var(--brand-ink); border-color: var(--brand-line); }
.btn-secondary:hover:not(:disabled) { background: var(--brand-soft); color: var(--brand-ink); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-sm { min-height: 40px; padding: .45rem .9rem; font-size: .875rem; }
.btn-lg { min-height: 52px; padding: .8rem 1.6rem; font-size: 1.0625rem; }

.link-arrow {
  display: inline-flex; align-items: center; gap: .4rem;
  font-weight: 600; text-decoration: none; min-height: 44px;
}
.link-arrow svg { width: 1.1em; height: 1.1em; transition: transform .16s ease; }
.link-arrow:hover svg { transform: translateX(3px); }

/* ----------------------------------------------------------------- header -- */

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 1px 12px rgba(13, 20, 37, .05); }
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 68px; }

.logo { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ink); }
.logo-mark { flex: none; display: block; }
.logo-text { font-size: 1.15rem; font-weight: 800; letter-spacing: -.045em; }
.logo-text span { color: var(--brand); }

.nav-toggle {
  margin-left: auto; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle-close { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle-open { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle-close { display: inline-flex; }

.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list a {
  display: flex; align-items: center; min-height: 46px;
  color: var(--ink-2); font-size: .9375rem; font-weight: 600; text-decoration: none;
  border-radius: var(--r-sm);
}
.nav-list a:hover { color: var(--brand); }
.nav-list a[aria-current="page"] { color: var(--brand); }

@media (max-width: 900px) {
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--surface); border-bottom: 1px solid var(--line);
    box-shadow: var(--sh-3); padding: .5rem 1.15rem 1.15rem;
    display: flex; flex-direction: column; gap: .35rem;
  }
  .nav-list { display: flex; flex-direction: column; }
  .nav-list a { padding: .35rem .25rem; min-height: 48px; border-bottom: 1px solid var(--line); }
  .nav-cta { margin-top: .75rem; align-self: stretch; }
}
@media (min-width: 901px) {
  .nav-toggle { display: none; }
  .site-nav { margin-left: auto; display: flex; align-items: center; gap: 1.5rem; }
  .nav-list { display: flex; align-items: center; gap: 1.4rem; }
}

/* ------------------------------------------------------------------- hero -- */

.hero { padding: clamp(2.25rem, 6vw, 3.75rem) 0 1.25rem; }
.hero-inner { text-align: center; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .45rem;
  margin: 0 0 1rem; padding: .35rem .8rem .35rem .6rem;
  background: var(--brand-soft); color: var(--brand-ink);
  border: 1px solid var(--brand-line); border-radius: var(--r-pill);
  font-size: .8125rem; font-weight: 600; letter-spacing: .01em; line-height: 1.5;
}
.hero-eyebrow svg { width: 16px; height: 16px; flex: none; }
.hero h1 { margin: 0 auto .75rem; max-width: 20ch; }
.hero-lede {
  margin: 0 auto; max-width: 44ch;
  font-size: clamp(1.0625rem, 2.2vw, 1.25rem); line-height: 1.55; color: var(--ink-2);
}
.hero-facts {
  list-style: none; margin: 1.5rem 0 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.5rem;
}
.hero-facts li {
  display: inline-flex; align-items: center; gap: .4rem; margin: 0;
  font-size: .875rem; font-weight: 600; color: var(--ink-2);
}
.hero-facts svg { width: 18px; height: 18px; color: var(--brand); flex: none; }
.hero-facts-center { justify-content: center; }

/* The homepage hero: the drop box on one side, the promise on the other. Below
   980px it stacks, headline first so the page still reads top to bottom. */
.hero-split { padding: clamp(1.75rem, 5vw, 3.25rem) 0 clamp(2rem, 5vw, 3rem); }
.hero-split-inner { display: grid; gap: 1.75rem; }
.hero-split .hero-copy { text-align: center; }
/* Set as a small caps label, the way the heading was written. */
.hero-split .hero-eyebrow { text-transform: uppercase; letter-spacing: .07em; font-size: .875rem; }
/* The hero sets its own scale rather than using the shared h1 size: the vw term
   is kept gentle so "Convert any file," still fits its column at 1024px, where
   the two columns are at their narrowest. */
.hero-split h1 { margin: 0 0 .9rem; max-width: none; font-size: clamp(2.5rem, 4.4vw, 3.9rem); }
.hero-split .hero-lede { margin: 0 auto; font-size: clamp(1.2rem, 1.75vw, 1.4rem); }
.hero-checks {
  list-style: none; margin: 1.5rem 0 0; padding: 0;
  display: grid; gap: .65rem; justify-content: center;
}
.hero-checks li {
  display: flex; align-items: center; gap: .65rem; margin: 0;
  font-size: 1.125rem; font-weight: 600; color: var(--ink-2);
}
.hero-check {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-line);
}
.hero-check svg { width: 16px; height: 16px; }
.hero-accent { color: var(--brand); }
.hero-panel .upload-card-home { max-width: none; margin: 0; }
.hero-panel .convert-foot { margin-inline: 0; }

@media (min-width: 980px) {
  /* Copy first, box second, in source order: the stacked phone layout and the
     two column layout then agree without any reordering. */
  .hero-split-inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    align-items: center;
    gap: 3.25rem;
  }
  .hero-split .hero-copy { text-align: left; }
  .hero-split .hero-lede { margin-left: 0; max-width: 38ch; }
  .hero-checks { justify-content: start; }
}

/* --------------------------------------------------------- upload card ---- */

.convert-section { padding: .5rem 0 clamp(2rem, 5vw, 3rem); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-2);
}
.upload-card { padding: clamp(1rem, 3vw, 1.5rem); }
.upload-card-home { max-width: 44rem; margin: 0 auto; box-shadow: var(--sh-3); }

.upload-head {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  margin-bottom: .9rem; flex-wrap: wrap;
}
.upload-title {
  display: flex; align-items: center; gap: .5rem; margin: 0;
  font-size: 1.0625rem; font-weight: 700; letter-spacing: -.01em;
}
.swap-arrow { display: inline-flex; color: var(--brand); }
.swap-arrow svg { width: 18px; height: 18px; }

.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .65rem; border-radius: var(--r-pill);
  font-size: .78125rem; font-weight: 600; line-height: 1.45; white-space: nowrap;
}
.badge svg { width: 15px; height: 15px; flex: none; }
.badge-local { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-line); }
.badge-server { background: var(--surface-sunk); color: var(--ink-2); border: 1px solid var(--line-2); }
.inline-badge {
  display: inline-flex; align-items: center; gap: .25rem; vertical-align: baseline;
  padding: .05rem .4rem; border-radius: var(--r-pill);
  background: var(--ok-soft); color: var(--ok); font-size: .8125rem; font-weight: 600;
}
.inline-badge svg { width: 13px; height: 13px; }

.dropzone {
  position: relative; display: block; width: 100%;
  padding: clamp(1.5rem, 5vw, 2.5rem) 1.15rem;
  background:
    linear-gradient(var(--brand-softer), var(--brand-softer)) padding-box;
  border: 2px dashed var(--brand-line);
  border-radius: var(--r-lg);
  text-align: center; cursor: pointer;
  transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}
.dropzone:hover { border-color: var(--brand); }
.dropzone.is-over {
  border-color: var(--brand); border-style: solid;
  background: var(--brand-soft); transform: scale(1.005);
}
.dropzone-lg { padding: clamp(2rem, 6vw, 3.25rem) 1.15rem; }
.dz-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; margin-bottom: .85rem;
  background: var(--surface); color: var(--brand);
  border: 1px solid var(--brand-line); border-radius: 16px; box-shadow: var(--sh-1);
}
.dz-icon svg { width: 26px; height: 26px; }
.dz-title { margin: 0 0 .75rem; font-size: 1.0625rem; font-weight: 700; letter-spacing: -.01em; }
.dz-or {
  display: flex; align-items: center; gap: .75rem;
  max-width: 15rem; margin: 0 auto .9rem;
  color: var(--ink-3); font-size: .8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
}
.dz-or::before, .dz-or::after { content: ""; flex: 1; height: 1px; background: var(--brand-line); }
.dz-hint { margin: .9rem auto 0; max-width: 42ch; color: var(--ink-3); font-size: .8125rem; line-height: 1.55; }

/* the from and to picker on the homepage */
.picker { margin-top: 1.15rem; padding-top: 1.15rem; border-top: 1px solid var(--line); }
.picker-fields { display: grid; gap: .75rem; }
.picker-arrow { display: none; }
.picker-hint { margin: .8rem 0 0; color: var(--ink-3); font-size: .8125rem; line-height: 1.55; }
@media (min-width: 620px) {
  .picker-fields { grid-template-columns: 1fr auto 1fr auto; align-items: end; gap: .75rem; }
  .picker-arrow {
    display: flex; align-items: center; justify-content: center;
    height: 46px; color: var(--ink-3);
  }
  .picker-arrow svg { width: 20px; height: 20px; }
  .picker-fields .btn { height: 46px; min-height: 46px; }
}

/* fields */
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.field label { font-size: .8125rem; font-weight: 600; color: var(--ink-2); }
.field-hint { margin: .1rem 0 0; font-size: .78125rem; line-height: 1.5; color: var(--ink-3); }
.select-wrap { position: relative; display: block; }
.select-wrap select, .field input[type="text"] {
  width: 100%; min-height: 46px; padding: .5rem 2.4rem .5rem .8rem;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  font: inherit; font-size: .9375rem; line-height: 1.4;
  appearance: none;
}
.field input[type="text"] { padding-right: .8rem; }
.select-wrap select:hover { border-color: var(--brand-line); }
.select-chevron {
  position: absolute; right: .6rem; top: 50%; transform: translateY(-50%);
  display: flex; color: var(--ink-3); pointer-events: none;
}
.select-chevron svg { width: 20px; height: 20px; }

.options { margin-top: 1.15rem; padding: 1rem; background: var(--surface-sunk); border-radius: var(--r-md); }
.options-title { margin: 0 0 .7rem; font-size: .8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.fields { display: grid; gap: .8rem; }
@media (min-width: 560px) { .fields { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); } }

/* file rows */
.file-list {
  list-style: none; margin: 1.15rem 0 0; padding: 0; display: grid; gap: .5rem;
  /* A batch of forty photos should not push the convert button off the screen. */
  max-height: 24rem; overflow-y: auto; overscroll-behavior: contain;
}
.file-row {
  display: flex; align-items: center; gap: .7rem; margin: 0;
  padding: .6rem .7rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md);
}
.file-row.is-dragging { opacity: .5; }
.file-row.drop-target { border-color: var(--brand); box-shadow: var(--sh-focus); }
.drag-handle { display: flex; color: var(--ink-3); cursor: grab; }
.drag-handle svg { width: 18px; height: 18px; }
.file-icon {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; overflow: hidden;
  background: var(--brand-soft); color: var(--brand-ink);
  border: 1px solid var(--brand-line); border-radius: var(--r-sm);
  font-size: .78125rem; font-weight: 700; letter-spacing: .01em;
}
.file-icon-thumb { padding: 0; background: var(--surface-sunk); }
.file-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-meta { min-width: 0; display: flex; flex-direction: column; gap: .1rem; flex: 1; }
.file-name { font-size: .9375rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-sub { font-size: .8125rem; color: var(--ink-3); line-height: 1.5; }
.icon-btn {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  background: transparent; color: var(--ink-3);
  border: 1px solid transparent; border-radius: var(--r-sm); cursor: pointer;
}
.icon-btn:hover { background: var(--err-soft); color: var(--err); }
.icon-btn svg { width: 19px; height: 19px; }

.upload-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.15rem; }
.upload-actions .btn-primary { flex: 1 1 14rem; }

/* progress */
.progress { margin-top: 1.15rem; }
.progress-track {
  height: 10px; background: var(--surface-sunk);
  border-radius: var(--r-pill); overflow: hidden;
}
.progress-fill {
  width: 0; height: 100%; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--brand), #4b7bff);
  background-size: 200% 100%;
  transition: width .28s cubic-bezier(.4, 0, .2, 1);
  position: relative; overflow: hidden;
}
.progress-fill::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.45) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: sheen 1.15s linear infinite;
}
@keyframes sheen { to { transform: translateX(100%); } }
.progress-label { margin: .5rem 0 0; font-size: .8125rem; font-weight: 600; color: var(--ink-3); }

.spinner {
  display: inline-block; width: 1em; height: 1em; flex: none;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .progress-fill::after { animation: none; }
  .spinner { animation-duration: 2s; }
  .btn:hover { transform: none; }
}

/* notices */
.status:empty, .results:empty { display: none; }
.notice {
  display: flex; gap: .7rem; margin-top: 1.15rem; padding: .9rem 1rem;
  border: 1px solid; border-radius: var(--r-md); font-size: .9375rem; line-height: 1.6;
}
.notice svg { width: 20px; height: 20px; flex: none; margin-top: .15rem; }
.notice p { margin: .35rem 0 0; }
.notice-list { margin: .35rem 0 0; padding-left: 1.1rem; }
.notice-info { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-ink); }
.notice-ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.notice-warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.notice-error { background: var(--err-soft); border-color: var(--err-line); color: var(--err); }
.notice a { color: inherit; text-decoration: underline; font-weight: 600; }

/* results */
.result-card {
  margin-top: 1.15rem; padding: 1.15rem;
  background: var(--ok-soft); border: 1px solid var(--ok-line); border-radius: var(--r-lg);
  animation: rise .28s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .result-card { animation: none; } }
.result-head { display: flex; gap: .75rem; align-items: flex-start; }
.result-head h3 { margin: 0 0 .2rem; }
.result-head p { margin: 0; font-size: .9375rem; color: var(--ink-2); }
.result-tick { flex: none; display: flex; color: var(--ok); }
.result-tick svg { width: 26px; height: 26px; }
.saving { color: var(--ok); }
.result-list {
  list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .5rem;
  max-height: 24rem; overflow-y: auto; overscroll-behavior: contain;
}
.result-list li {
  display: flex; align-items: center; gap: .7rem; margin: 0;
  padding: .55rem .7rem; background: var(--surface);
  border: 1px solid var(--ok-line); border-radius: var(--r-md);
}
.result-list .btn { margin-left: auto; }
.result-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }

/* homepage match panel */
.home-matches:empty { display: none; }
.match { margin-top: 1.15rem; }
.match-head {
  display: flex; align-items: center; gap: .7rem;
  padding: .6rem .7rem; background: var(--surface-sunk); border-radius: var(--r-md);
}
.format-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.format-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  min-height: 44px; padding: .5rem .95rem;
  background: var(--surface); color: var(--brand-ink);
  border: 1px solid var(--brand-line); border-radius: var(--r-pill);
  font: inherit; font-size: .9375rem; font-weight: 600; cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, transform .12s ease;
}
.format-btn:hover:not(:disabled) { background: var(--brand-soft); transform: translateY(-1px); }
.format-btn[aria-pressed="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.format-btn-flag { display: flex; opacity: .65; }
.format-btn-flag svg { width: 15px; height: 15px; }
.home-progress { margin-top: .9rem; }

.convert-foot {
  display: flex; gap: .55rem; justify-content: center; align-items: flex-start;
  max-width: 44rem; margin: 1.15rem auto 0;
  color: var(--ink-3); font-size: .8125rem; line-height: 1.6; text-align: left;
}
.convert-foot svg { width: 16px; height: 16px; flex: none; margin-top: .2rem; }

/* ------------------------------------------------------------------ bands -- */

.band { padding: clamp(2.25rem, 6vw, 4rem) 0; }
.band-soft { background: var(--surface); border-block: 1px solid var(--line); }
.band-article { padding-top: clamp(1.5rem, 4vw, 2.25rem); }
.band-more { margin: 1.5rem 0 0; }

.section-head { max-width: 40rem; margin: 0 0 1.75rem; }
.eyebrow {
  margin: 0 0 .5rem; font-size: .8125rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--brand);
}
.section-lede { margin: .5rem 0 0; font-size: 1.0625rem; line-height: 1.6; color: var(--ink-2); }

.page-hero { padding: clamp(2rem, 5vw, 3rem) 0 1.5rem; text-align: center; }
.page-hero-tight { padding-bottom: .5rem; text-align: left; }
.page-lede {
  margin: .75rem auto 0; max-width: 50ch;
  font-size: clamp(1rem, 2vw, 1.15rem); line-height: 1.6; color: var(--ink-2);
}
.page-hero-tight .page-lede { margin-left: 0; }
.page-meta { margin: .9rem 0 0; font-size: .8125rem; color: var(--ink-3); }

/* --------------------------------------------------------------- tool grid -- */

.tool-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.tool-card {
  display: flex; align-items: center; gap: .75rem;
  padding: .9rem 1rem; min-height: 72px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-md);
  text-decoration: none; box-shadow: var(--sh-1);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.tool-card:hover {
  color: var(--ink); border-color: var(--brand-line);
  box-shadow: var(--sh-2); transform: translateY(-2px);
}
.tool-card-icon {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; background: var(--brand-soft); color: var(--brand);
  border-radius: var(--r-sm);
}
.tool-card-icon svg { width: 21px; height: 21px; }
.tool-card-body { display: flex; flex-direction: column; gap: .1rem; min-width: 0; flex: 1; }
.tool-card-name { font-size: .9375rem; font-weight: 700; letter-spacing: -.01em; }
.tool-card-swap {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .8125rem; font-weight: 600; color: var(--ink-3);
}
.tool-card-swap svg { width: 15px; height: 15px; }
.tool-card-flag { flex: none; display: flex; color: var(--ok); opacity: .8; }
.tool-card-flag svg { width: 17px; height: 17px; }
.tool-grid-popular .tool-card { min-height: 78px; }
@media (min-width: 900px) { .tool-grid-wide { grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); } }

/* category cards */
.cat-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); }
.cat-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: .35rem .75rem;
  padding: 1.15rem; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  text-decoration: none; box-shadow: var(--sh-1);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.cat-card:hover { color: var(--ink); border-color: var(--brand-line); box-shadow: var(--sh-2); transform: translateY(-2px); }
.cat-card-icon {
  grid-row: span 2; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; background: var(--brand-soft); color: var(--brand); border-radius: var(--r-md);
}
.cat-card-icon svg { width: 23px; height: 23px; }
.cat-card-name { font-size: 1rem; font-weight: 700; letter-spacing: -.01em; align-self: end; }
.cat-card-count { font-size: .8125rem; font-weight: 600; color: var(--brand); align-self: end; white-space: nowrap; }
.cat-card-list { grid-column: 2 / -1; font-size: .8125rem; line-height: 1.55; color: var(--ink-3); }

/* chips */
.chip-row { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.chip-row li { margin: 0; }
.chip {
  display: inline-flex; align-items: center; gap: .45rem;
  min-height: 44px; padding: .5rem 1rem;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--line); border-radius: var(--r-pill);
  font-size: .9375rem; font-weight: 600; text-decoration: none;
}
.chip:hover { color: var(--brand); border-color: var(--brand-line); background: var(--brand-soft); }
.chip svg { width: 17px; height: 17px; color: var(--brand); }

/* ------------------------------------------------------------------ steps -- */

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; counter-reset: step; }
@media (min-width: 780px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; } }
.step {
  display: flex; gap: .9rem; margin: 0; padding: 1.25rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.band-soft .step { background: var(--surface-sunk); border-color: transparent; }
.step-num {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; background: var(--brand); color: #fff;
  border-radius: 50%; font-size: 1rem; font-weight: 700;
}
.step-body h3 { margin: .2rem 0 .3rem; }
.step-body p { margin: 0; font-size: .9375rem; line-height: 1.6; color: var(--ink-2); }

/* ------------------------------------------------------------------ trust -- */

.trust-row { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
@media (min-width: 620px) { .trust-row { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .trust-row { grid-template-columns: repeat(4, 1fr); gap: 1.25rem; } }
.trust-item {
  margin: 0; padding: 1.25rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg);
}
.band-soft .trust-item { background: var(--surface-sunk); border-color: transparent; }
.trust-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; margin-bottom: .75rem;
  background: var(--brand-soft); color: var(--brand); border-radius: var(--r-md);
}
.trust-icon svg { width: 22px; height: 22px; }
.trust-item h3 { margin: 0 0 .35rem; }
.trust-item p { margin: 0; font-size: .9375rem; line-height: 1.6; color: var(--ink-2); }

.privacy-note {
  display: flex; gap: .9rem; margin-top: 1.5rem; padding: 1.25rem;
  background: var(--brand-softer); border: 1px solid var(--brand-line); border-radius: var(--r-lg);
}
.privacy-icon { flex: none; display: flex; color: var(--brand); }
.privacy-icon svg { width: 26px; height: 26px; }
.privacy-note h3 { margin: .1rem 0 .4rem; }
.privacy-note p { margin: 0 0 .5rem; font-size: .9375rem; line-height: 1.65; color: var(--ink-2); max-width: 68ch; }
.privacy-more { margin: 0; font-size: .875rem; font-weight: 600; }

/* -------------------------------------------------------------------- FAQ -- */

.faq { margin-top: 2rem; }
.faq h2 { margin-bottom: 1rem; }
.faq-list { display: grid; gap: .6rem; }
.faq-item {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden;
}
.band-soft .faq-item { background: var(--surface); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 56px; padding: .85rem 1rem;
  font-size: 1rem; font-weight: 600; line-height: 1.5; cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--brand); }
.faq-chevron { display: flex; flex: none; color: var(--ink-3); transition: transform .18s ease; }
.faq-chevron svg { width: 20px; height: 20px; }
.faq-item[open] .faq-chevron { transform: rotate(180deg); }
.faq-answer { padding: 0 1rem 1rem; }
.faq-answer p { margin: 0; font-size: .9375rem; line-height: 1.7; color: var(--ink-2); max-width: 72ch; }

/* ------------------------------------------------------------------ prose -- */

.prose { max-width: 72ch; }
.prose h2 { margin: 2rem 0 .6rem; font-size: clamp(1.25rem, 2.4vw, 1.5rem); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 1.5rem 0 .4rem; font-size: 1.0625rem; }
.prose p, .prose li { font-size: 1rem; line-height: 1.75; color: var(--ink-2); }
.prose-article { max-width: 72ch; }
.prose-article ul { padding-left: 1.15rem; }
.contact-mail {
  display: inline-flex; align-items: center; gap: .5rem;
  min-height: 44px; font-size: 1.0625rem; font-weight: 700; text-decoration: none;
}
.contact-mail svg { width: 20px; height: 20px; }
.contact-mail:hover { text-decoration: underline; }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 0 1.5rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.format-table { width: 100%; min-width: 34rem; border-collapse: collapse; font-size: .9375rem; }
.format-table th, .format-table td { padding: .8rem .9rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); line-height: 1.6; }
.format-table thead th { font-size: .8125rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); background: var(--surface-sunk); }
.format-table tbody tr:last-child th, .format-table tbody tr:last-child td { border-bottom: 0; }
.format-table tbody th { white-space: nowrap; }
.fmt-key { display: block; font-weight: 700; }
.fmt-name { display: block; font-size: .8125rem; font-weight: 400; color: var(--ink-3); }
.fmt-note { display: block; margin-top: .25rem; font-size: .8125rem; color: var(--ink-3); max-width: 40ch; }

/* ------------------------------------------------------------- tool pages -- */

.crumbs { padding: 1rem 0 .25rem; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem .55rem; }
.crumbs li { margin: 0; font-size: .8125rem; color: var(--ink-3); display: flex; align-items: center; gap: .55rem; }
.crumbs li:not(:last-child)::after { content: "/"; color: var(--line-2); }
.crumbs a { color: var(--ink-3); text-decoration: none; font-weight: 600; }
.crumbs a:hover { color: var(--brand); text-decoration: underline; }

.tool-hero { padding: 1rem 0 clamp(1.5rem, 4vw, 2.5rem); }
.tool-hero-inner { display: grid; gap: 1.5rem; }
.tool-hero h1 { max-width: 22ch; }
.tool-lede { margin: .75rem 0 0; max-width: 46ch; font-size: clamp(1rem, 2vw, 1.15rem); line-height: 1.6; color: var(--ink-2); }
.tool-hero-facts { list-style: none; margin: 1.25rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.tool-hero-facts li { display: inline-flex; align-items: center; gap: .4rem; margin: 0; font-size: .875rem; font-weight: 600; color: var(--ink-2); }
.tool-hero-facts svg { width: 18px; height: 18px; color: var(--brand); flex: none; }
@media (min-width: 980px) {
  /* The panel is the point of the page, so on a phone it comes straight after
     the headline and the detail card follows it. On a wide screen the panel
     sits beside both, which is what the areas below arrange. */
  .tool-hero-inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    grid-template-areas: "copy panel" "glance panel";
    grid-template-rows: auto 1fr;
    gap: 1.75rem 2.5rem; align-items: start;
  }
  .tool-hero-copy { grid-area: copy; padding-top: 1rem; }
  .tool-hero-panel { grid-area: panel; }
  .at-glance { grid-area: glance; align-self: start; }
}

.at-glance {
  margin-top: 0; padding: 1.15rem 1.25rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.at-glance h2 {
  margin: 0 0 .7rem; font-size: .8125rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3);
}
.at-glance dl { display: grid; grid-template-columns: auto 1fr; gap: .45rem .9rem; margin: 0; }
.at-glance dt { font-size: .875rem; color: var(--ink-3); }
.at-glance dd { margin: 0; font-size: .875rem; font-weight: 600; color: var(--ink); }
.at-glance dd code { font-weight: 400; }

/* tool index */
.tool-search { position: relative; max-width: 30rem; margin: 1.5rem auto 0; }
.page-hero-tight .tool-search { margin-left: 0; }
.tool-search input {
  width: 100%; min-height: 52px; padding: .7rem 1rem .7rem 2.9rem;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--r-pill);
  font: inherit; font-size: 1rem; box-shadow: var(--sh-1);
}
.tool-search input::placeholder { color: var(--ink-3); }
.tool-search-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); display: flex; color: var(--ink-3); pointer-events: none; }
.tool-search-icon svg { width: 20px; height: 20px; }

.index-cat { padding: 1.75rem 0 0; }
.index-cat-head { display: grid; gap: .35rem .9rem; grid-template-columns: auto 1fr; margin-bottom: 1rem; align-items: start; }
.index-cat-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; background: var(--brand-soft); color: var(--brand); border-radius: var(--r-md);
}
.index-cat-icon svg { width: 22px; height: 22px; }
.index-cat-head h2 { margin: 0 0 .2rem; font-size: 1.3rem; }
.index-cat-head p { margin: 0; font-size: .9375rem; line-height: 1.6; color: var(--ink-3); max-width: 62ch; }
.index-cat-head .link-arrow { grid-column: 2; font-size: .875rem; }
@media (min-width: 900px) {
  .index-cat-head { grid-template-columns: auto 1fr auto; align-items: center; }
  .index-cat-head .link-arrow { grid-column: 3; grid-row: 1; }
}
.search-empty { margin: 2rem 0; padding: 1.15rem; background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: var(--r-md); color: var(--warn); font-size: .9375rem; }

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

.site-footer {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  padding: clamp(2.25rem, 5vw, 3.25rem) 0 1.5rem;
  background: var(--surface); border-top: 1px solid var(--line);
}
.footer-grid { display: grid; gap: 2rem; }
@media (min-width: 700px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .footer-grid { grid-template-columns: 1.4fr repeat(4, 1fr); gap: 2.5rem; } }
.footer-brand p { margin: .9rem 0 0; font-size: .875rem; line-height: 1.65; color: var(--ink-3); max-width: 40ch; }
.footer-note { display: flex; gap: .5rem; align-items: flex-start; }
.footer-note svg { width: 16px; height: 16px; flex: none; margin-top: .2rem; color: var(--ok); }
.footer-col h2 { margin: 0 0 .6rem; font-size: .8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink); }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 0; }
.footer-col a {
  display: flex; align-items: center; min-height: 38px;
  font-size: .875rem; color: var(--ink-3); text-decoration: none;
}
.footer-col a:hover { color: var(--brand); text-decoration: underline; }
.footer-base {
  display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; justify-content: space-between;
  margin-top: 2.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line);
}
.footer-base p { margin: 0; font-size: .8125rem; color: var(--ink-3); }
.footer-base-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.15rem; }
.footer-base-links li { margin: 0; }
.footer-base-links a { font-size: .8125rem; color: var(--ink-3); text-decoration: none; }
.footer-base-links a:hover { color: var(--brand); text-decoration: underline; }

/* ------------------------------------------------------------------ print -- */

@media print {
  .site-header, .site-footer, .upload-card, .skip-link, .crumbs { display: none !important; }
  body { background: #fff; }
  a { text-decoration: underline; }
}

/* A line under an automatic conversion, explaining that the choice is not final. */
.result-note {
  margin: .9rem 0 0; padding-top: .8rem; border-top: 1px solid var(--ok-line);
  font-size: .875rem; line-height: 1.6; color: var(--ink-2);
}

/* ----------------------------------------------------------- import row -- */

.dz-import-label {
  margin: 1.1rem 0 .55rem;
  font-size: .78125rem; font-weight: 600; line-height: 1.5;
  text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3);
}
.import-row { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.import-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  min-height: 44px; padding: .5rem 1.05rem;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: var(--r-pill);
  font: inherit; font-size: .875rem; font-weight: 600; line-height: 1.2; cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, color .16s ease;
}
.import-btn:hover:not(:disabled) { color: var(--ink); border-color: var(--line-2); box-shadow: var(--sh-2); }
.import-btn:disabled { opacity: .7; cursor: progress; }
.drive-logo { width: 17px; height: 17px; flex: none; }
.import-btn .spinner { width: 15px; height: 15px; border-width: 2px; }
