/* File Convert — landing page and batch converter.
   Light-only design system: white surfaces, one red accent, slate ink,
   generous whitespace and a centred content column. */

:root {
    --brand: #e5322d;
    --brand-dark: #c9261f;
    --brand-darker: #ab1f19;
    --brand-tint: rgba(229, 50, 45, 0.07);
    --brand-ring: rgba(229, 50, 45, 0.28);

    --ink: #2c3e50;
    --ink-strong: #1f2d3d;
    --body: #56657a;
    --muted: #8b98a8;
    --faint: #aab4c0;

    --border: #e5e9ef;
    --border-strong: #ccd4de;
    --surface: #ffffff;
    --surface-alt: #f7f9fb;
    --surface-tint: #fafbfd;

    --radius-sm: 4px;
    --radius: 6px;
    --radius-lg: 10px;

    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow: 0 2px 10px rgba(16, 24, 40, 0.06);
    --shadow-card: 0 1px 3px rgba(16, 24, 40, 0.06), 0 12px 32px rgba(16, 24, 40, 0.07);
    --shadow-menu: 0 8px 28px rgba(16, 24, 40, 0.16);

    --shell: 1140px;
    --column: 860px;

    --header-h: 66px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
    margin: 0;
    overflow-x: hidden;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--body);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
}

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

ul, ol {
    list-style: none;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
}

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

.is-hidden {
    display: none !important;
}

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

.skip-link {
    position: absolute;
    top: -60px;
    left: 12px;
    z-index: 100;
    padding: 10px 16px;
    font-weight: 600;
    color: #fff;
    background: var(--brand);
    border-radius: var(--radius);
    transition: top 0.15s ease;
}

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

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

/* ---------------------------------------------------------------- Header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--border);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 24px;
    max-width: var(--shell);
    min-height: var(--header-h);
    margin: 0 auto;
    padding: 0 20px;
}

.brand {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 10px;
    font-size: 1.1875rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--ink-strong);
}

.brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
    color: #fff;
    background: var(--brand);
    border-radius: 8px;
}

.brand__word strong {
    font-weight: 700;
}

.site-nav {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.nav-links {
    display: flex;
    gap: 30px;
    margin-left: 16px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--body);
}

.nav-links a {
    display: inline-block;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-links a:hover {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 0.9375rem;
    font-weight: 500;
}

.nav-auth__login {
    color: var(--body);
    transition: color 0.15s ease;
}

.nav-auth__login:hover {
    color: var(--brand);
}

.nav-toggle {
    display: none;
    margin-left: auto;
    padding: 8px 10px;
    font-size: 1.125rem;
    color: var(--ink);
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
}

/* ------------------------------------------------------------------ Hero */

.hero {
    max-width: var(--shell);
    margin: 0 auto;
    padding: 72px 20px 64px;
    text-align: center;
}

.hero__title {
    font-size: clamp(2.125rem, 5.2vw, 3.25rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.025em;
    color: var(--ink-strong);
}

.hero__lede {
    max-width: 660px;
    margin: 18px auto 0;
    font-size: 1.0625rem;
    color: var(--muted);
}

/* --------------------------------------------------------------- Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 20px;
    font-weight: 600;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
    background: var(--surface-alt);
}

.btn--primary {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
    box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
    color: #fff;
    background: var(--brand-dark);
    border-color: var(--brand-dark);
}

.btn--primary:disabled {
    color: #fff;
    background: var(--border-strong);
    border-color: var(--border-strong);
    box-shadow: none;
    cursor: not-allowed;
}

.btn--sm {
    padding: 7px 16px;
    font-size: 0.9375rem;
}

.btn--lg {
    padding: 13px 30px;
    font-size: 1.0625rem;
}

.btn--link {
    padding: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted);
    background: none;
    border: 0;
    cursor: pointer;
    transition: color 0.15s ease;
}

.btn--link:hover {
    color: var(--brand);
    background: none;
}

.select,
.number {
    padding: 8px 10px;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
}

.select:focus,
.number:focus {
    border-color: var(--brand);
    outline: 0;
    box-shadow: 0 0 0 3px var(--brand-ring);
}

/* -------------------------------------------------------- Converter card */

.converter {
    max-width: var(--column);
    margin: 40px auto 0;
    text-align: left;
}

.dropzone {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.dropzone--active {
    background: var(--brand-tint);
    border-color: var(--brand);
    border-style: dashed;
}

.empty-state {
    padding: 76px 24px 68px;
    text-align: center;
}

.empty-state__hint {
    margin-top: 20px;
    font-size: 0.9375rem;
    color: var(--muted);
}

/* The signature split button: big red action + caret that opens a source menu. */
.picker {
    position: relative;
    display: inline-flex;
    isolation: isolate;
}

.picker__main,
.picker__caret {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--brand);
    border: 0;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.picker__main {
    gap: 11px;
    padding: 17px 34px;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: var(--radius) 0 0 var(--radius);
}

.picker__main:hover {
    background: var(--brand-dark);
}

.picker__caret {
    width: 52px;
    font-size: 1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.picker__caret:hover,
.picker__caret[aria-expanded="true"] {
    background: var(--brand-darker);
}

.picker__main:focus-visible,
.picker__caret:focus-visible {
    outline: 2px solid var(--ink-strong);
    outline-offset: 2px;
}

/* Menu is toggled by JS via .is-hidden on [data-source-menu]. */
.source-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 20;
    min-width: 236px;
    padding: 6px;
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-menu);
}

.source-menu__item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--ink);
    text-align: left;
    background: none;
    border: 0;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.source-menu__item:hover {
    color: var(--brand);
    background: var(--surface-alt);
}

.source-menu__icon {
    flex: none;
    width: 20px;
    font-size: 1rem;
    color: var(--muted);
    text-align: center;
}

.source-menu__item:hover .source-menu__icon {
    color: var(--brand);
}

.source-menu__sep {
    height: 1px;
    margin: 6px 8px;
    background: var(--border);
}

/* ------------------------------------------------------------- File rows */
/* Rows below are injected at runtime by javascripts/form.js. */

.filelist > li + li {
    border-top: 1px solid var(--border);
}

.filerow {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    transition: background-color 0.15s ease;
}

.filerow:hover {
    background: var(--surface-tint);
}

.filerow:first-child {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.filerow__icon {
    flex: none;
    width: 24px;
    font-size: 1.1875rem;
    text-align: center;
}

.filerow__label {
    flex: 1 1 auto;
    min-width: 0;
}

.filerow__name {
    overflow: hidden;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--ink);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filerow__meta {
    font-size: 0.8125rem;
    color: var(--faint);
}

.filerow__to {
    flex: none;
    font-size: 0.875rem;
    color: var(--faint);
}

.filerow__remove {
    flex: none;
    padding: 5px 7px;
    font-size: 1rem;
    color: var(--faint);
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.filerow__remove:hover {
    color: var(--brand);
    background: var(--brand-tint);
}

/* Type tints, keyed by the category form.js assigns to each file. */
.icon--image    { color: #8b5cf6; }
.icon--video    { color: #f43f5e; }
.icon--audio    { color: #f59e0b; }
.icon--document { color: #0ea5e9; }
.icon--ebook    { color: #14b8a6; }
.icon--data     { color: #10b981; }
.icon--geo      { color: #65a30d; }
.icon--model    { color: #6366f1; }
.icon--archive  { color: #f97316; }
.icon--font     { color: #d946ef; }
.icon--other    { color: var(--faint); }

.filebar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    font-size: 0.875rem;
    color: var(--muted);
    background: var(--surface-alt);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.filebar__count {
    font-weight: 600;
    color: var(--ink);
}

.filebar__actions {
    display: flex;
    gap: 20px;
}

/* ------------------------------------------------------- Batch controls */

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: 20px;
}

.controls__group {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: flex-end;
}

.field__label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.number {
    width: 92px;
}

.checkbox {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-bottom: 9px;
    font-size: 0.9375rem;
}

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

.trust {
    max-width: var(--column);
    margin: 26px auto 0;
    font-size: 0.875rem;
    color: var(--muted);
    text-align: center;
}

.trust i {
    margin-right: 7px;
    color: var(--faint);
}

/* -------------------------------------- Runtime UI built by form.js */
/* Everything below this banner is injected at runtime by
   javascripts/form.js — it never appears in index.php. */

[hidden] {
    display: none !important;
}

/* Status line under the picker ("Dropbox is not configured…"). */
.source-status {
    max-width: 420px;
    margin: 16px auto 0;
    padding: 9px 14px;
    font-size: 0.875rem;
    color: var(--ink);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* Per-row gear that opens the options dialog. */
.filerow__options {
    flex: none;
    padding: 5px 8px;
    font-size: 0.9375rem;
    color: var(--faint);
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.filerow__options:hover {
    color: var(--brand);
    background: var(--brand-tint);
}

/* Modal dialog (URL source, per-file options). */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(31, 45, 61, 0.45);
}

.modal__dialog {
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 24px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-menu);
}

.modal__title {
    padding-right: 32px;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--ink-strong);
}

.modal__close {
    float: right;
    margin: -6px -6px 0 0;
    padding: 6px 9px;
    font-size: 1rem;
    color: var(--faint);
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.modal__close:hover {
    color: var(--ink);
    background: var(--surface-alt);
}

.modal__body {
    margin-top: 18px;
    font-size: 0.9375rem;
}

.modal__actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
}

.optionsgrid {
    display: grid;
    gap: 16px;
}

.text {
    width: 100%;
    padding: 9px 11px;
    font: inherit;
    font-size: 0.9375rem;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
}

.text:focus {
    border-color: var(--brand);
    outline: 0;
    box-shadow: 0 0 0 3px var(--brand-ring);
}

.color {
    width: 56px;
    height: 36px;
    padding: 2px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    cursor: pointer;
}

.field__help {
    margin-top: 6px;
    font-size: 0.8125rem;
    color: var(--muted);
}

.field__error {
    margin-top: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--brand-dark);
}

/* Upload / conversion progress. */
.progress {
    max-width: var(--column);
    margin: 20px auto 0;
}

.progress__bar {
    height: 8px;
    overflow: hidden;
    background: var(--border);
    border-radius: 999px;
}

.progress__fill {
    width: 0;
    height: 100%;
    background: var(--brand);
    border-radius: 999px;
    transition: width 0.2s ease;
}

.progress__text {
    margin-top: 9px;
    font-size: 0.875rem;
    color: var(--muted);
    text-align: center;
}

/* Upload finished, conversion still running: there is no percentage left to
   show, so the fill spans the track and sweeps instead of sitting still. */
.progress--indeterminate .progress__fill {
    background: linear-gradient(90deg,
        var(--brand-tint) 0%,
        var(--brand) 42%,
        var(--brand) 58%,
        var(--brand-tint) 100%);
    background-size: 220% 100%;
    transition: none;
    animation: progress-sweep 1.2s linear infinite;
}

@keyframes progress-sweep {
    from { background-position: 130% 0; }
    to { background-position: -130% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .progress--indeterminate .progress__fill {
        animation: none;
        background: var(--brand);
    }
}

/* Result panel after a successful conversion. */
.results {
    max-width: var(--column);
    margin: 24px auto 0;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.results__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--ink-strong);
}

.results__meta {
    margin-top: 4px;
    font-size: 0.875rem;
    color: var(--muted);
}

.results__error {
    margin-top: 6px;
    font-size: 0.9375rem;
    color: var(--brand-dark);
}

.results__list {
    margin-top: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.results__list > li + li {
    border-top: 1px solid var(--border);
}

.resultrow {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
}

.resultrow__name {
    min-width: 0;
    overflow: hidden;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--ink);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resultrow__meta {
    font-size: 0.8125rem;
    color: var(--faint);
}

.results__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

/* Fallback picker form.js builds when the markup has no source menu. */
.source-picker {
    position: relative;
    display: inline-flex;
}

.source-picker__toggle {
    padding-left: 16px;
    padding-right: 16px;
}

/* -------------------------------------------------------------- Sections */

.section {
    padding: 72px 0;
    border-top: 1px solid var(--border);
}

.section--tint {
    background: var(--surface-alt);
}

.section__title {
    font-size: clamp(1.5rem, 3vw, 1.875rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink-strong);
    text-align: center;
}

.section__lede {
    max-width: 620px;
    margin: 12px auto 0;
    font-size: 1rem;
    color: var(--muted);
    text-align: center;
}

/* How it works */

.steps {
    display: grid;
    gap: 32px;
    margin-top: 44px;
}

.step__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-size: 1.0625rem;
    color: var(--brand);
    background: var(--brand-tint);
    border-radius: 50%;
}

.step__title {
    margin-top: 16px;
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--ink-strong);
}

.step__text {
    margin-top: 6px;
    font-size: 0.9375rem;
    color: var(--muted);
}

/* Format categories */

.cats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-top: 44px;
}

.cat {
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.cat:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.cat__icon {
    font-size: 1.25rem;
    color: var(--brand);
}

.cat__title {
    margin-top: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink-strong);
}

.cat__text {
    margin-top: 4px;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--muted);
}

/* Popular conversions grid */

.convgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    margin-top: 40px;
}

.convgrid__link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 11px 12px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.convgrid__link:hover {
    color: var(--brand);
    background: var(--surface);
    border-color: var(--brand);
}

.convgrid__arrow {
    font-size: 0.75rem;
    color: var(--faint);
}

.convgrid__link:hover .convgrid__arrow {
    color: var(--brand);
}

/* Rating strip */

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

.rating__stars {
    display: flex;
    gap: 4px;
    justify-content: center;
    font-size: 1.25rem;
    color: #f5a623;
}

.rating__score {
    margin-top: 12px;
    font-size: 0.9375rem;
    color: var(--muted);
}

.rating__score strong {
    color: var(--ink-strong);
}

.rating__quote {
    margin-top: 22px;
    font-size: 1.1875rem;
    line-height: 1.55;
    color: var(--ink);
}

.rating__by {
    margin-top: 16px;
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--faint);
}

/* ---------------------------------------------------------------- Footer */

.site-footer {
    padding: 56px 0 28px;
    background: var(--surface-alt);
    border-top: 1px solid var(--border);
}

.site-footer__inner {
    display: grid;
    gap: 40px;
}

.site-footer__blurb {
    max-width: 260px;
    margin-top: 14px;
    font-size: 0.875rem;
    color: var(--muted);
}

.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 28px;
}

.footer-col__title {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-strong);
}

.footer-col ul {
    display: grid;
    gap: 9px;
    margin-top: 14px;
    font-size: 0.9375rem;
    color: var(--muted);
}

.footer-col a {
    transition: color 0.15s ease;
}

.footer-col a:hover {
    color: var(--brand);
}

.site-footer__bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    justify-content: space-between;
    margin-top: 44px;
    padding-top: 22px;
    font-size: 0.8125rem;
    color: var(--faint);
    border-top: 1px solid var(--border);
}

/* ------------------------------------------------------------ Responsive */

@media (min-width: 641px) {
    .steps {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 901px) {
    .site-footer__inner {
        grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr);
        align-items: start;
    }
}

@media (max-width: 900px) {
    .nav-toggle {
        display: inline-flex;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 12px 20px 20px;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
    }

    /* JS flips [data-site-nav] open; the CSS-only fallback is the checkbox-free
       :target-less approach below, driven by aria-expanded on the toggle. */
    .site-header__inner {
        position: relative;
        flex-wrap: wrap;
    }

    /* JS may set aria-expanded / .is-open on the hook; :focus-within is the
       CSS-only fallback so the menu still opens without any script. */
    .nav-toggle[aria-expanded="true"] + .site-nav,
    .site-nav.is-open,
    .site-header__inner:focus-within .site-nav {
        display: flex;
    }

    .nav-links {
        flex-direction: column;
        gap: 2px;
        margin-left: 0;
    }

    .nav-links a {
        display: block;
        padding: 10px 0;
        border-bottom: 1px solid var(--border);
    }

    .nav-links a:hover {
        border-bottom-color: var(--border);
    }

    .nav-auth {
        justify-content: space-between;
        margin-top: 16px;
    }

    .nav-auth .btn {
        flex: 1 1 auto;
        max-width: 200px;
    }
}

@media (max-width: 640px) {
    .hero {
        padding: 48px 16px 44px;
    }

    .shell {
        padding: 0 16px;
    }

    .section {
        padding: 52px 0;
    }

    .empty-state {
        padding: 52px 16px 48px;
    }

    .picker {
        width: 100%;
    }

    .picker__main {
        flex: 1 1 auto;
        padding: 15px 18px;
        font-size: 1.0625rem;
    }

    .picker__caret {
        width: 48px;
    }

    .source-menu {
        left: 0;
        min-width: 0;
    }

    .filerow {
        flex-wrap: wrap;
        gap: 10px;
    }

    .filerow__label {
        flex-basis: calc(100% - 90px);
    }

    .filerow__to {
        display: none;
    }

    .filerow .select {
        flex: 1 1 auto;
    }

    .filebar {
        flex-direction: column;
        align-items: flex-start;
    }

    .filebar__actions {
        flex-wrap: wrap;
        gap: 8px 18px;
    }

    .controls,
    .controls__group {
        align-items: stretch;
    }

    .controls .btn--primary {
        width: 100%;
    }

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

    .site-footer__bar {
        justify-content: flex-start;
    }
}

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

    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }

    .cat:hover {
        transform: none;
    }
}
