/* ==========================================================================
   HostV Convert
   Built on the HostV design system: the same colours, type and motion as
   hostv.co.uk. Brand colours, type and spacing are all set in :root below.
   ========================================================================== */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-stretch: 100% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #141a33;
  --ink-2: #1c2342;
  --ink-line: #2e3660;
  --fiber: #ffc629;
  --fiber-hover: #ffd451;
  --fiber-soft: #fff4cf;
  --mist: #f4f5f9;
  --paper: #ffffff;
  --line: #dde0ea;
  --line-2: #c5c9d8;
  --slate: #4f5675;
  --on-dark-2: #a8aeca;
  --danger-on-dark: #ff9b9b;
  --danger: #b42318;
  --danger-soft: #fde8e8;

  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --wide: 118%;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --radius-field: 12px;
  --header-h: 72px;
  --gutter: clamp(20px, 5vw, 48px);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
[hidden] { display: none !important; }
::selection { background: var(--fiber); color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
[data-theme="dark"] :focus-visible { outline-color: var(--fiber); }
[tabindex="-1"]:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -64px; z-index: 200; padding: 12px 18px; border-radius: 10px; background: var(--ink); color: #fff; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; }
.wrap { width: min(1280px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Buttons ---------- */
.btn {
  --b-bg: var(--fiber);
  --b-fg: var(--ink);
  --b-border: transparent;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 28px;
  border: 2px solid var(--b-border); border-radius: 999px;
  background: var(--b-bg); color: var(--b-fg);
  font-weight: 700; font-stretch: 110%; font-size: 1rem; line-height: 1;
  text-decoration: none; white-space: nowrap;
  transition: background-color .2s, color .2s, border-color .2s, translate .35s var(--ease);
}
.btn:hover { --b-bg: var(--fiber-hover); }
.btn:active { scale: .97; }
.btn-ghost { --b-bg: transparent; --b-border: var(--ink); }
.btn-ghost:hover { --b-bg: var(--ink); --b-fg: #fff; }
.btn-ink { --b-bg: var(--ink); --b-fg: #fff; }
.btn-ink:hover { --b-bg: #252d58; }
.btn-sm { min-height: 42px; padding: 0 18px; font-size: .92rem; gap: 8px; }
.btn-xs { min-height: 36px; padding: 0 14px; font-size: .86rem; gap: 6px; }
.btn-sm .icon, .btn-xs .icon { width: 17px; height: 17px; }
.btn[disabled] { cursor: not-allowed; opacity: .55; }
.btn.is-busy { cursor: progress; opacity: 1; }
.btn .spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.btn.is-busy .spinner { display: block; }
[data-theme="dark"] .btn-ghost { --b-fg: #fff; --b-border: rgba(255, 255, 255, .45); }
[data-theme="dark"] .btn-ghost:hover { --b-bg: #fff; --b-fg: var(--ink); --b-border: #fff; }
[data-magnetic] { will-change: transform; }

/* ---------- Status LEDs: lit means on, selected or done ---------- */
.led {
  width: 12px; height: 12px; flex: none;
  border-radius: 50%;
  border: 2px solid #9da3bc;
  background: transparent;
  transition: background-color .25s, border-color .25s, box-shadow .25s;
}
.led.on { background: var(--fiber); border-color: var(--ink); }
.led.live { background: var(--fiber); border-color: var(--ink); animation: pulse 2.4s ease-in-out infinite; }
.led.err { background: #f97066; border-color: var(--danger); }
[data-theme="dark"] .led { border-color: #5a6290; }
[data-theme="dark"] .led.on { border-color: var(--fiber); box-shadow: 0 0 0 4px rgba(255, 198, 41, .16), 0 0 14px rgba(255, 198, 41, .55); }

.chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 15px 8px 12px; border-radius: 999px;
  background: var(--paper); box-shadow: 0 0 0 1px var(--line);
  font-size: .9rem; font-weight: 600; line-height: 1.2;
}

/* ---------- Logo (the rack builds itself, the letters rise, the CONVERT tag slides in) ---------- */
.logo { display: block; width: 300px; flex: none; color: inherit; }
.logo-svg { width: 100%; height: auto; overflow: visible; }
.u { transform-box: fill-box; }
.u-tl, .u-ml { --dx: -70%; }
.u-tr, .u-mr { --dx: 70%; }
.u-base { --dy: 80%; --d: .05s; }
.u-ml, .u-mr { --d: .17s; }
.u-tl, .u-tr { --d: .29s; }
.u-tag { --dx: 40%; --d: .42s; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  height: var(--header-h);
  transition: background-color .3s, box-shadow .3s;
}
.site-header.is-scrolled {
  background: rgba(244, 245, 249, .88);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.header-inner { height: 100%; display: flex; align-items: center; gap: 16px; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.menu-btn {
  display: none; align-items: center; justify-content: center;
  width: 46px; height: 46px; flex: none;
  border: 0; border-radius: 12px;
  background: var(--ink); color: #fff;
}
.menu-icon { position: relative; width: 20px; height: 14px; }
.menu-icon i { position: absolute; left: 0; right: 0; height: 4px; border-radius: 2px; background: currentColor; }
.menu-icon i:first-child { top: 0; }
.menu-icon i:last-child { top: 10px; }

/* ---------- Intro ---------- */
.intro { padding: clamp(14px, 3vw, 36px) 0 clamp(22px, 3vw, 34px); }
.title {
  margin: 16px 0 12px;
  font-size: clamp(2.5rem, 1.4rem + 4.2vw, 4.9rem); line-height: .95;
  font-weight: 800; font-stretch: var(--wide); letter-spacing: -0.03em;
  text-wrap: balance;
}
.title .dot { color: var(--fiber); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
.line { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.line > span { display: block; }
.lead { max-width: 60ch; color: var(--slate); font-size: 1.1rem; text-wrap: pretty; }

/* ---------- Layout ---------- */
.layout {
  display: grid; grid-template-columns: minmax(270px, 320px) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 36px); align-items: start;
  padding-bottom: 64px;
}
.sidebar { position: sticky; top: calc(var(--header-h) + 12px); min-width: 0; }
.side-panel {
  max-height: calc(100vh - var(--header-h) - 28px);
  max-height: calc(100dvh - var(--header-h) - 28px);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 18px; border-radius: 22px; background: var(--paper); box-shadow: 0 0 0 1px var(--line);
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.stage { display: grid; gap: 18px; min-width: 0; }
.view { display: grid; gap: 18px; min-width: 0; }

.panel { min-width: 0; padding: clamp(18px, 3vw, 30px); border-radius: 22px; background: var(--paper); box-shadow: 0 0 0 1px var(--line); }
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; min-width: 0; }
.panel-head h2 { font-size: 1.22rem; line-height: 1.2; font-weight: 760; font-stretch: 112%; letter-spacing: -0.01em; min-width: 0; }
.panel-head .hint { margin-left: auto; font-size: .88rem; font-weight: 500; color: var(--slate); text-align: right; }
.field-label { display: block; margin-bottom: 10px; font-weight: 650; font-size: .95rem; }

/* ---------- Converter menu (sidebar, home and phone drawer) ---------- */
.menu-search { position: relative; margin-bottom: 14px; }
.menu-search .icon { position: absolute; left: 15px; top: 50%; translate: 0 -50%; color: var(--slate); pointer-events: none; }
.input {
  width: 100%; min-width: 0; min-height: 50px; padding: 11px 16px;
  border: 1.5px solid var(--line); border-radius: var(--radius-field);
  background: var(--mist); color: var(--ink);
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.input::placeholder { color: #8a90aa; }
.input:hover { border-color: var(--line-2); }
.input:focus { outline: none; border-color: var(--ink); background: var(--paper); box-shadow: 0 0 0 4px rgba(255, 198, 41, .4); }
.menu-search .input { padding-left: 44px; }
.menu-search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.menu-groups { display: grid; gap: 16px; }
.mg-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.mg-head h3 { font-size: .98rem; font-weight: 760; font-stretch: 110%; line-height: 1.2; }
.mg-head span { font-size: .8rem; font-weight: 600; color: var(--slate); }
.mg-items { display: flex; flex-wrap: wrap; gap: 6px; }
.mi {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 36px; padding: 0 12px; border: 0; border-radius: 999px;
  background: var(--mist); box-shadow: inset 0 0 0 1px var(--line);
  font-size: .88rem; font-weight: 650; line-height: 1.1; text-decoration: none; white-space: nowrap;
  transition: background-color .2s, box-shadow .2s;
}
.mi:hover { background: #e8eaf2; }
.mi[aria-current="page"] { background: var(--fiber); box-shadow: inset 0 0 0 1.5px var(--ink); }
.mi small { font-size: .78rem; font-weight: 600; color: var(--slate); }
.mi[aria-current="page"] small { color: rgba(20, 26, 51, .75); }
.menu-results { display: grid; gap: 6px; }
.mr {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 48px; padding: 8px 14px; border: 0; border-radius: 14px;
  background: var(--mist); text-align: left; text-decoration: none;
  font-weight: 650; font-size: .95rem; line-height: 1.25;
  transition: background-color .2s;
}
.mr:hover, .mr:focus-visible { background: var(--fiber-soft); }
.mr .arrow { color: var(--slate); font-weight: 600; }
.mr small { margin-left: auto; color: var(--slate); font-weight: 500; font-size: .82rem; }
.menu-empty { padding: 14px; border-radius: 14px; background: var(--mist); color: var(--slate); font-size: .95rem; }

/* ---------- Home ---------- */
.popular { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 8px; }
.pop {
  display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 14px;
  border: 0; border-radius: 14px; background: var(--mist); box-shadow: inset 0 0 0 1px var(--line);
  text-align: left; font-weight: 700; font-stretch: 108%; line-height: 1.2; text-decoration: none;
  transition: background-color .2s, box-shadow .2s, translate .35s var(--ease);
}
.pop:hover { background: var(--fiber-soft); box-shadow: inset 0 0 0 1.5px var(--ink); }
.pop .from, .pop .to { display: inline-grid; place-items: center; min-width: 52px; padding: 5px 8px; border-radius: 8px; font-size: .82rem; letter-spacing: .02em; }
.pop .from { background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.pop .to { background: var(--fiber); box-shadow: inset 0 0 0 1.5px var(--ink); }
.pop .arr { display: grid; color: var(--slate); }
.pop .arr .icon { width: 18px; height: 18px; }

/* ---------- Drop zones ---------- */
.dropzone {
  position: relative; display: grid; place-items: center;
  min-height: 210px; padding: 26px 18px;
  border: 2px dashed var(--line-2); border-radius: 18px;
  background: var(--mist); text-align: center; cursor: pointer;
  transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.dropzone:hover { border-color: var(--ink); }
.dropzone:focus-visible { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(255, 198, 41, .45); }
.dropzone.is-over { border-style: solid; border-color: var(--ink); background: var(--fiber-soft); box-shadow: 0 0 0 4px rgba(255, 198, 41, .45); }
.dz-inner { display: grid; justify-items: center; gap: 4px; pointer-events: none; }
.dz-icon { width: 46px; height: 46px; margin-bottom: 6px; fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; transition: translate .35s var(--ease); }
.dropzone.is-over .dz-icon { translate: 0 -6px; }
.dz-title { font-size: 1.3rem; font-weight: 780; font-stretch: 112%; line-height: 1.2; letter-spacing: -0.01em; }
.dz-sub { color: var(--slate); font-size: .98rem; }
.dz-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; pointer-events: auto; }
.dz-btn { margin-top: 14px; pointer-events: auto; }
.dz-actions .dz-btn { margin-top: 0; }
.tool-panel .dropzone { min-height: 190px; margin-top: 20px; }

/* ---------- Targets (convert to) ---------- */
.targets { display: flex; flex-wrap: wrap; gap: 8px; }
.t-opt { position: relative; display: block; }
.t-opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.t-opt span {
  display: grid; place-items: center; min-width: 64px; min-height: 48px; padding: 6px 16px;
  border-radius: 12px; background: var(--mist); box-shadow: inset 0 0 0 1.5px var(--line);
  font-weight: 720; font-stretch: 110%; line-height: 1.1; text-align: center;
  transition: background-color .2s, box-shadow .2s;
}
.t-opt span small { display: block; margin-top: 2px; font-size: .72rem; font-weight: 600; font-stretch: 100%; color: var(--slate); }
.t-opt:hover span { box-shadow: inset 0 0 0 1.5px var(--line-2); background: #eceef4; }
.t-opt input:checked + span { background: var(--fiber); box-shadow: inset 0 0 0 2px var(--ink); }
.t-opt input:checked + span small { color: rgba(20, 26, 51, .75); }
.t-opt input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.target-note { margin-top: 12px; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--mist); color: var(--slate); font-size: .92rem; line-height: 1.45; }
.target-note .led { margin-top: 4px; }

/* ---------- Settings ---------- */
.settings { margin-top: 18px; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line); }
.settings-toggle {
  width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 16px 18px; border: 0; border-radius: 16px; background: none; text-align: left;
}
.settings-title { font-weight: 700; font-stretch: 108%; }
.settings-sum { min-width: 0; color: var(--slate); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.faq-icon { position: relative; width: 14px; height: 14px; }
.faq-icon::before, .faq-icon::after { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .3s var(--ease); }
.faq-icon::after { transform: rotate(90deg); }
.settings-toggle[aria-expanded="true"] .faq-icon::after { transform: rotate(0deg); }
.settings-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 4px 18px 20px; }
.opt { display: grid; gap: 8px; align-content: start; min-width: 0; }
.opt.full { grid-column: 1 / -1; }
.opt > label, .opt > .opt-label { font-weight: 600; font-size: .92rem; }
.opt-note { color: var(--slate); font-size: .84rem; line-height: 1.4; }
.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 18px; top: 50%;
  width: 8px; height: 8px; border-right: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
select.input { -webkit-appearance: none; appearance: none; padding-right: 46px; font-weight: 600; cursor: pointer; text-overflow: ellipsis; }
.range-row { display: flex; align-items: center; gap: 12px; min-height: 50px; }
.range-row output { min-width: 3.4ch; font-weight: 750; font-variant-numeric: tabular-nums; text-align: right; }
input[type="range"] { flex: 1; min-width: 0; accent-color: var(--ink); height: 28px; }
input[type="color"].input { padding: 6px; height: 50px; cursor: pointer; }
.switch { display: flex; align-items: center; gap: 12px; min-height: 50px; cursor: pointer; font-weight: 600; font-size: .95rem; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { position: relative; width: 48px; height: 28px; flex: none; border-radius: 999px; background: var(--line-2); transition: background-color .2s; }
.switch .track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(20, 26, 51, .3); transition: translate .25s var(--ease); }
.switch input:checked + .track { background: var(--ink); }
.switch input:checked + .track::after { translate: 20px 0; background: var(--fiber); }
.switch input:focus-visible + .track { outline: 3px solid var(--ink); outline-offset: 2px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.checks label { position: relative; }
.checks input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.checks span { display: inline-grid; place-items: center; min-height: 40px; padding: 0 12px; border-radius: 10px; background: var(--mist); box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 650; font-size: .88rem; }
.checks input:checked + span { background: var(--fiber); box-shadow: inset 0 0 0 2px var(--ink); }
.checks input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }

/* ---------- File queue ---------- */
.files { display: grid; }
.file {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 14px; align-items: start;
  padding: 16px 0; border-top: 1px solid var(--line);
}
.file:first-child { border-top: 0; padding-top: 0; }
.file > .led { margin-top: 7px; }
.file.is-working > .led { background: var(--fiber); border-color: var(--ink); animation: pulse 1.2s ease-in-out infinite; }
.file.is-done > .led { background: var(--fiber); border-color: var(--ink); }
.file.is-error > .led { background: #f97066; border-color: var(--danger); }
.file-enter { animation: item-in .45s var(--ease) both; }
.file-name { font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.file-meta { color: var(--slate); font-size: .88rem; }
.file-meta .tag { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 6px; background: var(--mist); box-shadow: inset 0 0 0 1px var(--line); font-size: .76rem; font-weight: 700; color: var(--ink); vertical-align: 1px; }
.bar { position: relative; height: 6px; margin-top: 10px; border-radius: 99px; background: #e6e8f0; overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; width: calc(var(--p, 0) * 100%); border-radius: inherit; background: var(--ink); transition: width .25s linear; }
.bar.is-indeterminate i { width: 35%; animation: indet 1.2s var(--ease) infinite; }
.file-msg { margin-top: 6px; font-size: .88rem; color: var(--slate); line-height: 1.4; }
.file-msg.is-error { color: var(--danger); font-weight: 600; }
.file-msg a, .file-msg button.link { color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--fiber); text-decoration-thickness: 2px; text-underline-offset: 3px; background: none; border: 0; padding: 0; }
.remove { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--slate); transition: background-color .2s, color .2s; }
.remove:hover { background: var(--danger-soft); color: var(--danger); }
.outputs { display: grid; gap: 8px; margin-top: 12px; }
.out {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 10px 10px 10px 12px; border-radius: 14px; background: var(--mist); box-shadow: inset 0 0 0 1px var(--line);
}
.out-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.out-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; background: var(--fiber); color: var(--ink); font-size: .68rem; font-weight: 800; font-stretch: 112%; letter-spacing: .02em; }
.out-text { min-width: 0; line-height: 1.3; }
.out-text strong { display: block; font-weight: 700; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.out-text span { display: block; font-size: .84rem; color: var(--slate); }
.out-actions { display: flex; gap: 6px; }
.out-more { justify-self: start; border: 0; background: none; padding: 4px 0; font-size: .88rem; font-weight: 700; text-decoration: underline; text-decoration-color: var(--fiber); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.queue-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
#convertBtn { min-width: 200px; }

/* ---------- Password prompt ---------- */
.pw-dialog { width: min(420px, calc(100% - 32px)); padding: 26px; border: 0; border-radius: 22px; background: var(--paper); color: var(--ink); box-shadow: 0 30px 70px -20px rgba(20, 26, 51, .5); }
.pw-dialog::backdrop { background: rgba(20, 26, 51, .6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.pw-dialog h2 { font-size: 1.3rem; font-weight: 780; font-stretch: 112%; line-height: 1.2; }
.pw-dialog p { margin: 8px 0 16px; color: var(--slate); font-size: .95rem; overflow-wrap: anywhere; }
.pw-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* ---------- Footer ---------- */
.site-footer { padding: 8px 0 44px; font-size: .9rem; color: var(--slate); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.site-footer a { color: var(--ink); font-weight: 650; text-decoration-color: var(--fiber); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* ---------- Phone drawer ---------- */
.drawer {
  position: fixed; inset: 0; z-index: 90;
  display: flex; flex-direction: column;
  background: var(--mist); overflow: hidden;
  padding-top: env(safe-area-inset-top);
}
.drawer:not([hidden]) { animation: menu-in .35s var(--ease) both; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: var(--header-h); flex: none; }
.drawer-head h2 { font-size: 1.5rem; font-weight: 800; font-stretch: var(--wide); letter-spacing: -0.02em; }
.drawer-close { width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 12px; background: var(--ink); color: #fff; }
.drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
.drawer-body .menu-search { position: sticky; top: 0; z-index: 2; margin: 0 0 16px; padding-bottom: 4px; background: var(--mist); }
.drawer-body .mi { min-height: 42px; padding: 0 15px; font-size: .95rem; background: var(--paper); }
.drawer-body .mi[aria-current="page"] { background: var(--fiber); }
.drawer-body .mr { background: var(--paper); }
.menu-open { overflow: hidden; }

/* ---------- Phone action bar ---------- */
.mobile-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  display: none; align-items: center; gap: 14px;
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  background: var(--ink); color: #fff;
  box-shadow: 0 -12px 30px -14px rgba(20, 26, 51, .55);
}
.mb-text { min-width: 0; }
.mobile-bar small { display: block; font-size: .8rem; font-weight: 600; color: var(--on-dark-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mobile-bar strong { display: block; font-size: 1.25rem; line-height: 1.15; font-weight: 800; font-stretch: var(--wide); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mobile-bar .btn { margin-left: auto; min-height: 50px; padding: 0 22px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 95; display: grid; gap: 10px; width: min(380px, calc(100% - 24px)); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 12px; pointer-events: auto;
  padding: 11px 16px 11px 11px; border-radius: 18px;
  background: rgba(255, 255, 255, .98); color: var(--ink);
  box-shadow: 0 14px 30px -10px rgba(20, 26, 51, .45), 0 0 0 1px rgba(20, 26, 51, .07);
  animation: toast-in .5s var(--ease) both;
}
.toast.is-leaving { animation: toast-out .35s var(--ease) forwards; }
.toast-icon { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--fiber); color: var(--ink); }
.toast.is-error .toast-icon { background: var(--danger-soft); color: var(--danger); }
.toast-text { min-width: 0; line-height: 1.3; }
.toast-text strong { display: block; font-weight: 700; }
.toast-text span { display: block; font-size: .86rem; color: var(--slate); overflow-wrap: anywhere; }

/* ---------- Custom cursor (mouse and trackpad only), as on hostv.co.uk ---------- */
.cursor { display: none; }
.has-cursor .cursor { display: block; }
.has-cursor *, .has-cursor *::before, .has-cursor *::after { cursor: none !important; }
.has-cursor input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]), .has-cursor textarea { cursor: text !important; }
.has-cursor select { cursor: default !important; }
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; z-index: 1000; pointer-events: none; opacity: 0; transition: opacity .25s; will-change: transform; }
.cursor.is-visible .cursor-dot, .cursor.is-visible .cursor-ring { opacity: 1; }
.cursor.is-hidden .cursor-dot, .cursor.is-hidden .cursor-ring { opacity: 0; }
.cursor-dot span { display: block; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--fiber); box-shadow: 0 0 0 2px var(--ink); transition: transform .25s var(--ease); }
.cursor-ring span { display: block; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; border: 1.5px solid rgba(20, 26, 51, .5); transition: transform .4s var(--ease), background-color .25s, border-color .25s; }
.cursor.is-hover .cursor-ring span { transform: scale(1.6); background: rgba(255, 198, 41, .2); border-color: var(--fiber); }
.cursor.is-hover .cursor-dot span { transform: scale(.6); }
.cursor.is-down .cursor-ring span { transform: scale(.8); }
.cursor.on-dark .cursor-ring span { border-color: rgba(255, 255, 255, .55); }
.cursor.on-dark.is-hover .cursor-ring span { border-color: var(--fiber); }
.cursor.on-dark .cursor-dot span { box-shadow: 0 0 0 2px var(--ink), 0 0 14px rgba(255, 198, 41, .8); }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .logo-svg .u { animation: unit-in .9s var(--ease) var(--d) both; }
  .js .logo-svg .led-dot { animation: led-on 1s linear .9s both; }
  .js .logo-svg .g { transform-box: fill-box; animation: glyph-in .75s var(--ease) both; animation-delay: calc(.3s + var(--i) * .05s); }
  .js .line > span { animation: rise 1s var(--ease) both; animation-delay: calc(.25s + var(--i) * .09s); }
  .js .rise-1 { animation: fade-up .9s var(--ease) .15s both; }
  .js .rise-2 { animation: fade-up .9s var(--ease) .5s both; }
  .js .is-loading .panel, .js .is-loading .side-panel { animation: fade-up .9s var(--ease) var(--rd, .4s) both; }
  .title.is-swapping .line > span { animation: rise .7s var(--ease) both; animation-delay: 0s; }
}
@keyframes unit-in { from { opacity: 0; transform: translate(var(--dx, 0), var(--dy, 0)); } }
@keyframes led-on { 0% { fill: #3a4166; opacity: 0; } 20% { fill: #3a4166; opacity: 1; } 40% { fill: #ffc629; } 55% { fill: #3a4166; } 70%, 100% { fill: #ffc629; opacity: 1; } }
@keyframes glyph-in { from { opacity: 0; transform: translateY(40%); } }
@keyframes rise { from { transform: translateY(108%); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(18px); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.94); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes menu-in { from { opacity: 0; transform: translateY(-10px); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 198, 41, .6); } 55% { box-shadow: 0 0 0 7px rgba(255, 198, 41, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes item-in { from { opacity: 0; transform: translateY(-10px); } }
@keyframes indet { from { translate: -100% 0; } to { translate: 300% 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 999px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding-bottom: 120px; }
  .sidebar { display: none; }
  .menu-btn { display: inline-flex; }
  .header-chip { display: none; }
  .has-tool .mobile-bar { display: flex; }
  .toasts { left: 12px; right: 12px; width: auto; bottom: calc(92px + env(safe-area-inset-bottom)); }
  .site-footer { padding-bottom: 110px; }
  .queue-foot #convertBtn { display: none; }
}
@media (min-width: 1000px) {
  .change-btn { display: none; }
  .catalogue-panel { display: none; }
  .drawer { display: none !important; }
}
@media (max-width: 699px) {
  .settings-body { grid-template-columns: minmax(0, 1fr); }
  .panel-head .hint { display: none; }
  .dropzone { min-height: 170px; }
  .out { grid-template-columns: auto minmax(0, 1fr); }
  .out-actions { grid-column: 1 / -1; }
  .out-actions .btn { flex: 1; }
  .queue-foot .btn { flex: 1 1 auto; }
}
@media (max-width: 559px) {
  :root { --header-h: 64px; }
  .logo { width: min(250px, calc(100vw - 2 * var(--gutter) - 62px)); }
  .t-opt span { min-width: 58px; min-height: 46px; padding: 6px 12px; }
}
