/*!
 * BeaverFile - application stylesheet.
 * No @import, no web fonts, no third-party anything: the page must render with zero
 * network requests, which is both the privacy promise and the offline guarantee.
 *
 * Structure:
 *   1  tokens and themes
 *   2  reset and primitives
 *   3  application bar
 *   4  hero and page shell
 *   5  workspace (dropzone, batch rows, settings panel)
 *   6  tool cards and documentation pages
 *   7  footer, notices, utilities
 *   8  responsive
 */

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

:root {
  /* Palette derived from the approved mascot: forest green, warm bark brown, cream paper. */
  --bg: #FDFBF6;
  --bg-deep: #F6F0E5;
  --surface: #FFFFFF;
  --surface-2: #F8F3E9;
  --surface-3: #EFE7D8;
  --ink: #14211A;
  --ink-2: #4E574F;
  --ink-3: #868C82;
  --line: #E6DECD;
  --line-strong: #D5C9B2;
  --acc: #2E7B58;
  --acc-hi: #35906A;
  --acc-soft: #E7F1EA;
  --acc-ink: #1D5B41;
  --bark: #A9744B;
  --bark-soft: #F4E7D6;
  --cream: #FBF1DE;
  --warn: #8A5A06;
  --warn-soft: #F8EEDC;
  --bad: #A3291F;
  --bad-soft: #FAEBE9;
  --shadow-1: 0 1px 2px rgba(20, 33, 26, .05), 0 1px 3px rgba(20, 33, 26, .04);
  --shadow-2: 0 8px 28px -12px rgba(20, 33, 26, .22), 0 2px 8px rgba(20, 33, 26, .05);
  --shadow-3: 0 24px 60px -30px rgba(20, 33, 26, .35);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --ease: cubic-bezier(.22, .86, .28, 1);
  --shell: 1160px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0E1512;
  --bg-deep: #0A100D;
  --surface: #141C18;
  --surface-2: #1A241F;
  --surface-3: #22302A;
  --ink: #EDF2EE;
  --ink-2: #A9B5AD;
  --ink-3: #7A857E;
  --line: #24312B;
  --line-strong: #304038;
  --acc: #5FC79A;
  --acc-hi: #7BD8AE;
  --acc-soft: #12291F;
  --acc-ink: #B6EDD2;
  --bark: #C89066;
  --bark-soft: #2A2018;
  --cream: #FBF1DE;
  --warn: #E0AE63;
  --warn-soft: #241C10;
  --bad: #FF9086;
  --bad-soft: #2B1614;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-2: 0 10px 34px -14px rgba(0, 0, 0, .75);
  --shadow-3: 0 30px 70px -30px rgba(0, 0, 0, .9);
  color-scheme: dark;
}

/* 2 ------------------------------------------------------------ reset and primitives */

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

/* The hidden attribute must beat component display rules (.field{display:flex}), otherwise
   panels the script hides stay on screen. */
[hidden] { display: none !important; }

/* scroll-padding keeps anything scrolled to (a fragment, the skip link, an error brought into
   view by script) clear of the 63px sticky header instead of landing underneath it. */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 78px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--font);
  font-feature-settings: "ss01" 1, "cv01" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(90rem 40rem at 50% -20%, var(--acc-soft), transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  opacity: .9;
}

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

h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.02em; margin: 0; font-weight: 650; }

p { margin: 0; }

img, svg { display: block; max-width: 100%; }

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

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

.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 24px; }

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

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--surface); color: var(--ink);
  padding: 10px 16px; border-radius: var(--r-sm); border: 1px solid var(--line);
  text-decoration: none; transition: top .18s var(--ease);
}
.skip:focus { top: 12px; }

.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* 3 ------------------------------------------------------------ application bar */

.appbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
}

.appbar__in { display: flex; align-items: center; gap: 20px; height: 62px; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--acc); text-decoration: none; font-weight: 700;
  letter-spacing: -.03em; font-size: 16.5px; white-space: nowrap;
}

/* The wordmark is the mascot tile at nav size: the approved identity in one image, so the
   header cannot drift out of sync with the icons or the favicon. */
.brand__mark {
  width: 30px; height: 30px; border-radius: 9px;
  display: block; flex: none;
  box-shadow: var(--shadow-1);
}

.nav { display: flex; align-items: center; gap: 4px; margin-left: 6px; }
.nav a {
  color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 7px 11px; border-radius: var(--r-sm);
  transition: background-color .16s var(--ease), color .16s var(--ease);
}
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }

.appbar__end { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.iconbtn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 10px;
  background: transparent; color: var(--ink-2);
  border: 1px solid transparent; border-radius: 10px;
  cursor: pointer; font-size: 13.5px; font-weight: 550;
  transition: background-color .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.iconbtn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.iconbtn[hidden] { display: none; }

#theme-btn .i-moon { display: none; }
html[data-theme="dark"] #theme-btn .i-moon { display: block; }
html[data-theme="dark"] #theme-btn .i-sun { display: none; }

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

main { padding-bottom: 40px; }

/* Longhand padding: the shorthand would wipe .shell's left/right padding, and the hero
   would then centre itself at 780px while the workspace below stayed at 1160px. */
.hero {
  padding-top: 56px; padding-bottom: 26px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px 40px;
}

.hero__copy { min-width: 0; }

/* The mascot is decoration with a job: it carries the personality so the workspace itself can
   stay quiet and functional. It is a plain image, no script, and collapses first on mobile. */
.hero__mascot {
  width: clamp(150px, 17vw, 220px); height: auto;
  border-radius: 26%;
  filter: drop-shadow(0 16px 28px rgba(20, 33, 26, .16));
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--acc-ink); background: var(--acc-soft);
  border: 1px solid color-mix(in srgb, var(--acc) 22%, transparent);
  padding: 5px 12px 5px 9px; border-radius: 999px; margin-bottom: 20px;
}
.eyebrow .ico { width: 14px; height: 14px; stroke-width: 2; }

.hero h1 {
  font-size: clamp(30px, 5.2vw, 52px);
  letter-spacing: -.035em;
  font-weight: 680;
  margin-bottom: 16px;
  max-width: 15em;
}
.hero h1 em { font-style: normal; color: var(--acc); }

.hero__sub {
  font-size: clamp(16px, 1.6vw, 18.5px);
  color: var(--ink-2); max-width: 60ch;
}

.hero__promise {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 18px; font-size: 13.5px; font-weight: 620; color: var(--bark);
}
.hero__promise .ico { width: 15px; height: 15px; }

/* 5 ------------------------------------------------------------ workspace */

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  padding-top: 8px;
  scroll-margin-top: 80px;
}

.workbench__main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }

/* dropzone */

.dropzone {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center;
  min-height: 288px; padding: 40px 24px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-xl);
  cursor: pointer;
  transition: border-color .2s var(--ease), background-color .2s var(--ease),
              min-height .28s var(--ease), box-shadow .2s var(--ease);
}
.dropzone:hover { border-color: var(--acc); background: color-mix(in srgb, var(--acc-soft) 55%, var(--surface)); }
.dropzone.is-over {
  border-color: var(--acc); border-style: solid;
  background: var(--acc-soft);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--acc) 12%, transparent);
}

.dropzone__icon {
  width: 60px; height: 60px; border-radius: 18px;
  display: grid; place-items: center; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--acc); box-shadow: var(--shadow-1);
  transition: transform .28s var(--ease);
}
.dropzone:hover .dropzone__icon { transform: translateY(-2px); }
.dropzone__icon .ico { width: 26px; height: 26px; }
.dropzone__icon img { width: 100%; height: 100%; object-fit: contain; border-radius: 12px; }

.dropzone__title { font-size: 19px; font-weight: 640; letter-spacing: -.02em; }
.dropzone__hint { color: var(--ink-2); font-size: 14.5px; }
.dropzone__browse { color: var(--acc); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

.dz-types { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 0; margin: 14px 0 0; }
.dz-types li {
  font-size: 11.5px; font-weight: 600; letter-spacing: .03em;
  color: var(--ink-3); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px;
}

/* compact dropzone once files exist */

.dropzone.is-compact {
  min-height: 0; padding: 18px 20px;
  flex-direction: row; justify-content: flex-start; gap: 14px;
  text-align: left; border-radius: var(--r-lg);
}
.dropzone.is-compact .dropzone__icon { width: 40px; height: 40px; border-radius: 12px; margin: 0; }
.dropzone.is-compact .dropzone__icon .ico { width: 19px; height: 19px; }
.dropzone.is-compact .dz-types { margin: 0 0 0 auto; }
.dropzone.is-compact .dropzone__title { font-size: 15px; }
.dropzone.is-compact .dropzone__hint { font-size: 13px; }

/* batch list */

.batch {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  animation: rise .3s var(--ease);
}

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.batch__head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 60%, var(--surface));
}
.batch__count { font-weight: 640; font-size: 14.5px; }
.batch__size { color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.batch__head .spacer { margin-left: auto; }

.linkbtn {
  background: none; border: 0; padding: 5px 8px; border-radius: var(--r-sm);
  color: var(--ink-3); font-size: 13px; cursor: pointer;
  transition: color .16s var(--ease), background-color .16s var(--ease);
}
.linkbtn:hover { color: var(--bad); background: var(--bad-soft); }

.rows { list-style: none; margin: 0; padding: 0; }

.row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 6.75rem 74px;
  align-items: center; gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: background-color .16s var(--ease);
}
.row:last-child { border-bottom: 0; }
.row:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }

.row__thumb {
  width: 42px; height: 42px; border-radius: 9px; overflow: hidden;
  background: var(--surface-3); display: grid; place-items: center;
  color: var(--ink-3); border: 1px solid var(--line);
}
.row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.row__thumb .ico { width: 18px; height: 18px; }

.row__main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row__name {
  font-size: 14px; font-weight: 550; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; letter-spacing: -.01em;
}
.row__meta { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.row__select {
  appearance: none;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238A8593' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 9px center;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 26px 5px 11px; font-size: 12.5px; font-weight: 600;
  color: var(--ink); cursor: pointer;
  transition: border-color .16s var(--ease), background-color .16s var(--ease);
}
.row__select:hover { border-color: var(--acc); }
.row__na { color: var(--ink-3); font-size: 12.5px; }

.row__state { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; min-width: 0; }
.row__state .pill { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

.pill {
  display: inline-block; max-width: 100%;
  font-size: 12px; font-weight: 600; letter-spacing: .01em;
  color: var(--ink-2); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px;
}
.pill--done { color: var(--acc-ink); background: var(--acc-soft); border-color: color-mix(in srgb, var(--acc) 26%, transparent); font-variant-numeric: tabular-nums; }
.pill--bad { color: var(--bad); background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 26%, transparent); }
.pill--warn { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }

.row__actions { display: flex; align-items: center; gap: 2px; justify-content: flex-end; }

.row__dl, .row__x {
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--ink-3); cursor: pointer;
  transition: background-color .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.row__dl { color: var(--acc); }
.row__dl:hover { background: var(--acc-soft); border-color: color-mix(in srgb, var(--acc) 30%, transparent); }
.row__x:hover { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 28%, transparent); }

.row[data-state="blocked"] .row__name { color: var(--ink-3); }
.row[data-state="blocked"] .pill { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.row[data-state="error"] { background: color-mix(in srgb, var(--bad-soft) 55%, transparent); }
.row[data-state="error"] .row__meta { color: var(--bad); }

.row--result { background: color-mix(in srgb, var(--acc-soft) 55%, transparent); }

.spinner {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--acc) 30%, transparent);
  border-top-color: var(--acc);
  animation: spin .7s linear infinite; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

.row__track {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%;
  overflow: hidden; background: color-mix(in srgb, var(--acc) 14%, transparent);
}
.row__track::after {
  content: ""; position: absolute; inset: 0; width: 38%;
  background: linear-gradient(90deg, transparent, var(--acc), transparent);
  animation: sweep 1.15s var(--ease) infinite;
}
@keyframes sweep { 0% { transform: translateX(-100%); } 100% { transform: translateX(280%); } }

/* notice */

.notice {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 13.5px; line-height: 1.5;
  color: var(--warn); background: var(--warn-soft);
  border: 1px solid color-mix(in srgb, var(--warn) 28%, transparent);
  border-radius: var(--r); padding: 11px 13px;
}
.notice[hidden] { display: none; }

/* settings panel */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  padding: 16px;
  display: flex; flex-direction: column; gap: 14px;
  animation: rise .3s var(--ease);
}
.panel[hidden] { display: none; }

.panel__label {
  font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 2px;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips[hidden] { display: none; }

.chip {
  background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: all .16s var(--ease);
}
.chip:hover { color: var(--ink); border-color: var(--line-strong); }
.chip.is-active {
  color: var(--acc-ink); background: var(--acc-soft);
  border-color: color-mix(in srgb, var(--acc) 40%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--acc) 18%, transparent);
}

.fieldset { display: flex; flex-direction: column; gap: 12px; border: 0; padding: 0; margin: 0; }
.fieldset[hidden] { display: none; }

.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.field__row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.field label { color: var(--ink-2); font-weight: 600; font-size: 12.5px; }
.field output { color: var(--ink); font-variant-numeric: tabular-nums; font-size: 12.5px; font-weight: 600; }
.field__hint { color: var(--ink-3); font-size: 12px; line-height: 1.45; }

.field input[type="number"], .field select {
  width: 100%; padding: 8px 10px;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: border-color .16s var(--ease), background-color .16s var(--ease);
}
.field input[type="number"]:focus, .field select:focus { border-color: var(--acc); background: var(--surface); }

.field input[type="color"] {
  width: 100%; height: 34px; padding: 2px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm);
}

.field input[type="range"] {
  width: 100%; height: 20px; appearance: none; background: transparent; cursor: pointer;
}
.field input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 99px; background: var(--line-strong);
}
.field input[type="range"]::-webkit-slider-thumb {
  appearance: none; width: 16px; height: 16px; margin-top: -6px;
  border-radius: 50%; background: var(--acc); border: 2px solid var(--surface);
  box-shadow: var(--shadow-1);
}
.field input[type="range"]::-moz-range-track { height: 4px; border-radius: 99px; background: var(--line-strong); }
.field input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--acc); border: 2px solid var(--surface); }

.panel__actions { display: flex; flex-direction: column; gap: 10px; margin-top: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px;
  border-radius: var(--r); border: 1px solid transparent;
  font-size: 14.5px; font-weight: 620; letter-spacing: -.01em;
  cursor: pointer; text-decoration: none;
  transition: transform .12s var(--ease), background-color .16s var(--ease), box-shadow .16s var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--acc); color: #fff; box-shadow: var(--shadow-1); }
html[data-theme="dark"] .btn--primary { color: #04110E; }
.btn--primary:hover { background: var(--acc-hi); }
.btn--primary:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn--ghost { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--surface-3); }
.btn--ghost[hidden] { display: none; }
.btn--block { width: 100%; }

.progress { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--acc); transition: width .25s var(--ease); }

.status { font-size: 12.5px; color: var(--ink-3); min-height: 1.2em; }

.panel__note { font-size: 12px; color: var(--ink-3); line-height: 1.45; display: flex; gap: 7px; align-items: flex-start; }
.panel__note .ico { width: 14px; height: 14px; margin-top: 2px; flex: none; color: var(--acc); }

.panel__empty { font-size: 13.5px; color: var(--ink-3); }

/* mobile action bar */

.actionbar { display: none; }

/* error box used by the single-tool pages */

.err {
  border: 1px solid color-mix(in srgb, var(--bad) 26%, transparent);
  background: var(--bad-soft); color: var(--bad);
  border-radius: var(--r); padding: 12px 14px; font-size: 14px;
  /* No scroll-margin here on purpose: html's scroll-padding-top already clears the sticky
     header, and setting both stacks the offsets (measured 156px instead of 78px). */
}

/*
 * Warning box used by the compressor when the delivered file is larger than the target.
 * Deliberately distinct from .err: the conversion succeeded and the download stands, so this
 * must not read as a failure. Amber (--warn) rather than red (--bad) is the whole point.
 */

.warn {
  border: 1px solid color-mix(in srgb, var(--warn) 28%, transparent);
  background: var(--warn-soft); color: var(--warn);
  border-radius: var(--r); padding: 12px 14px; font-size: 14px; margin-bottom: 14px;
}
.warn[hidden] { display: none; }

/* 6 ------------------------------------------------------------ tools and docs */

.section { padding-top: 54px; scroll-margin-top: 80px; }

.section__head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.section__head h2 { font-size: clamp(21px, 2.6vw, 27px); letter-spacing: -.03em; }
.section__head p { color: var(--ink-3); font-size: 14px; }
.section__lead { color: var(--ink-2); margin-bottom: 22px; max-width: 68ch; }

.grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
}

.card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none;
  transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.card:hover {
  border-color: color-mix(in srgb, var(--acc) 45%, var(--line));
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}
.card h3 { font-size: 14.5px; font-weight: 620; letter-spacing: -.01em; }
.card p { color: var(--ink-3); font-size: 12.5px; line-height: 1.5; }
.card__foot { margin-top: 10px; display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--acc); }
.card__foot .ico { width: 13px; height: 13px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; margin-bottom: 8px; width: fit-content;
}
.badge.works { color: var(--acc-ink); background: var(--acc-soft); border: 1px solid color-mix(in srgb, var(--acc) 26%, transparent); }
.badge.pending { color: var(--warn); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 26%, transparent); }
.card.is-pending { background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }

/* trust row */

.trust { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); padding-top: 30px; }
.trust__item {
  display: flex; gap: 11px; align-items: flex-start;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px; font-size: 13px; color: var(--ink-2); line-height: 1.5;
}
.trust__item .ico { width: 16px; height: 16px; color: var(--acc); margin-top: 2px; flex: none; }
.trust__item strong { color: var(--ink); display: block; font-size: 13.5px; margin-bottom: 1px; }

/* prose / documentation pages */

.prose { max-width: 720px; padding-top: 48px; }
.prose h1 { font-size: clamp(27px, 4vw, 38px); margin-bottom: 14px; }
.prose h2 { font-size: 19px; margin: 34px 0 10px; letter-spacing: -.02em; }
.prose p, .prose li { color: var(--ink-2); }
.prose p { margin: 12px 0; }
.prose ul { padding-left: 20px; margin: 12px 0; }
.prose li { margin: 6px 0; }
.prose strong { color: var(--ink); }

.lede { font-size: 18px; color: var(--ink-2); margin: 0 0 22px; max-width: 64ch; }

.privacy-strip {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: var(--acc-soft);
  border: 1px solid color-mix(in srgb, var(--acc) 22%, transparent);
  border-radius: var(--r); padding: 11px 14px;
  font-size: 13.5px; color: var(--ink-2); margin: 0 0 26px;
}
.privacy-strip strong { color: var(--acc-ink); font-weight: 640; }

/* single-tool pages reuse the workspace primitives */

.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 200px; padding: 32px 20px; text-align: center;
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-xl);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  cursor: pointer; transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.drop:hover, .drop.over { border-color: var(--acc); background: var(--acc-soft); }
.drop .big { font-size: 17px; font-weight: 620; color: var(--ink); }
.drop p { color: var(--ink-2); font-size: 14px; margin: 0; }

ul.files { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 6px; }
ul.files li {
  display: flex; gap: 12px; align-items: center;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 9px 12px; font-size: 13.5px; background: var(--surface);
}
ul.files li .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
ul.files li .meta { color: var(--ink-3); font-variant-numeric: tabular-nums; }
ul.files li .ok { color: var(--acc); }
ul.files li .bad { color: var(--bad); }

.controls { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin: 22px 0 18px; }

details.faq { border-bottom: 1px solid var(--line); padding: 15px 0; }
details.faq:first-of-type { border-top: 1px solid var(--line); }
details.faq summary { cursor: pointer; font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
details.faq summary::marker { color: var(--acc); }
details.faq p { color: var(--ink-2); margin: 9px 0 0; font-size: 14.5px; max-width: 68ch; }

/* 7 ------------------------------------------------------------ footer and utilities */

.ad-slot { display: none; }

footer.site {
  border-top: 1px solid var(--line);
  margin-top: 64px; padding: 30px 0 40px;
  font-size: 13.5px; color: var(--ink-3);
  background: color-mix(in srgb, var(--surface) 45%, transparent);
}
footer.site nav { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 12px; }
footer.site a { color: var(--ink-2); text-decoration: none; }
footer.site a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
footer.site p { max-width: 78ch; line-height: 1.55; }

.dim { color: var(--ink-3); }

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

@media (min-width: 900px) {
  .workbench { grid-template-columns: minmax(0, 1fr) 328px; align-items: start; }
  .panel { position: sticky; top: 80px; }
}

@media (max-width: 899px) {
  .nav { display: none; }
  /* Longhand again: a padding shorthand here silently removed the shell's side padding and
     pushed the hero text against the screen edge on every phone. */
  .hero { padding-top: 30px; padding-bottom: 16px; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  /* Mascot first on small screens: the character is what makes it feel like an app, and it
     reads badly crammed beside a 30px headline. */
  .hero__mascot { order: -1; width: 104px; }
  .dropzone { min-height: 220px; padding: 30px 18px; }
  .dropzone.is-compact { flex-wrap: nowrap; }
  .dropzone.is-compact .dz-types { display: none; }
  .dropzone.is-compact .dropzone__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dropzone.is-compact .dropzone__hint { min-width: 0; flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .row {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 10px 10px;
    padding: 12px 14px;
  }
  .row__thumb { width: 38px; height: 38px; }
  .row__out { grid-column: 2 / 3; grid-row: 2; }
  .row__state { grid-column: 3 / 4; grid-row: 2; justify-self: end; font-size: 12px; }
  .row__actions { grid-column: 3 / 4; grid-row: 1; }

  .panel { margin-top: 2px; }

  .actionbar {
    display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  .workbench.is-loaded ~ .actionbar,
  .is-loaded .actionbar { display: block; }
  .actionbar .btn { width: 100%; height: 46px; }
  body:has(.workbench.is-loaded) { padding-bottom: 78px; }
}

@media (max-width: 560px) {
  .shell { padding: 0 16px; }
  .batch__head { flex-wrap: wrap; }
  .dz-types li:nth-child(n+5) { display: none; }
  .trust { grid-template-columns: 1fr; }
  /* The whole strip is clickable, so the "or browse" prompt can go rather than
     render as "or browse yo..." at 360px. */
  .dropzone.is-compact .dropzone__hint { display: none; }
  .row { padding: 10px 12px; gap: 8px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

@media print {
  .appbar, .actionbar, .dropzone, .panel, footer.site nav { display: none !important; }
  body::before { display: none; }
}

/* 9 ------------------------------------------------------------ older browsers

   color-mix() is used throughout for translucent surfaces. It is supported from Chrome 111,
   Safari 16.2 and Firefox 113; in anything older those declarations are dropped outright,
   which would leave cards and the workspace with no background at all. This block gives every
   surface it affects a solid colour instead, so an older browser renders a plainer page rather
   than a broken one. Nothing here overrides a modern browser: it never matches. */
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  .appbar { background: var(--surface); }
  .dropzone { background: var(--surface); }
  .dropzone:hover { background: var(--acc-soft); }
  .batch__head { background: var(--surface-2); }
  .row:hover { background: var(--surface-2); }
  .row--result { background: var(--acc-soft); }
  .chip.is-active { background: var(--acc-soft); }
  .card { background: var(--surface); }
  .trust__item { background: var(--surface); }
  .panel { background: var(--surface); }
  .privacy-strip { background: var(--acc-soft); }
  .actionbar { background: var(--surface); }
  /* :has() arrived later still (Safari 15.4, Firefox 121, Chrome 105). Without it the phone
     action bar has no bottom padding reserved, so this keeps the last row reachable. */
  @media (max-width: 860px) {
    body { padding-bottom: 78px; }
  }
}

/* ------------------------------------------------------------------ update notice
   Shown only when a service worker has taken over a page that was already controlled, so a
   visitor is never silently running old code, and never loses a conversion in progress to a
   forced reload. Bottom-left on desktop, full width above the phone action bar. */
.bf-update {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100% - 32px);
  padding: 10px 12px 10px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 8px 28px rgb(0 0 0 / 18%);
  font-size: 0.92rem;
  line-height: 1.35;
}
.bf-update-btn {
  flex: none;
  padding: 7px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--acc);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.bf-update-btn:hover { background: var(--acc-strong, var(--acc)); }
.bf-update-btn:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }

@media (max-width: 860px) {
  .bf-update { left: 10px; right: 10px; bottom: 88px; max-width: none; }
}

/* Cancel button: shown only while a conversion is running, in the workspace and on tool pages. */
.bf-cancel {
  margin-left: 12px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.bf-cancel:hover:not(:disabled) { border-color: var(--acc); color: var(--acc); }
.bf-cancel:disabled { opacity: 0.6; cursor: default; }
.bf-cancel:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.bf-cancel[hidden] { display: none; }
