:root {
    color-scheme: light;
    --ink: #0a1733;
    --ink-soft: #1d3158;
    --muted: #566580;
    --line: #e2e8f3;
    --line-soft: #edf0f7;
    --panel: #ffffff;
    --soft: #f4f6f8;
    --canvas: #f2f5f9;
    --blue: #3446ff;
    --blue-dark: #2635d6;
    --blue-soft: #eef0ff;
    --green: #e8fbf0;
    --green-text: #0d6b45;
    --red: #ff355d;
    --orange: #ff8b2b;
    --purple: #7a4cff;
    --teal: #12b5a5;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 4px 14px rgba(24, 39, 75, 0.06);
    --shadow: 0 14px 36px rgba(24, 39, 75, 0.10);
    --shadow-lg: 0 24px 64px rgba(24, 39, 75, 0.14);
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
    font-family: 'IBM Plex Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--canvas);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

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

::selection {
    background: rgba(52, 70, 255, 0.18);
}

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

.page-shell {
    position: relative;
    isolation: isolate;
    width: min(100% - 28px, 1380px);
    margin: 22px auto;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: var(--shadow-lg);
}

.site-header {
    position: relative;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    height: 68px;
    padding: 0 56px;
    border-bottom: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    font-weight: 800;
    font-size: 23px;
    letter-spacing: -0.01em;
}

.nav {
    display: flex;
    align-items: center;
    gap: 34px;
    font-size: 14px;
    font-weight: 700;
}

.nav > a {
    position: relative;
    color: var(--ink-soft);
    transition: color 160ms var(--ease);
}

.nav > a::after {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -22px;
    height: 2px;
    border-radius: 2px;
    background: var(--blue);
    content: "";
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 200ms var(--ease);
}

.nav > a:hover {
    color: var(--blue);
}

.nav > a:hover::after {
    transform: scaleX(1);
}

.nav details {
    position: relative;
    z-index: 1001;
}

.nav summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    list-style: none;
    color: var(--ink-soft);
    transition: color 160ms var(--ease);
}

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

.nav > details:hover > summary,
.nav > details[open] > summary {
    color: var(--blue);
}

.nav > details > summary::after {
    content: "⌄";
    font-size: 13px;
    line-height: 1;
}

.nav-menu {
    display: grid;
    gap: 8px;
    position: absolute;
    z-index: 1002;
    top: 30px;
    left: 0;
    width: 294px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow);
    animation: menu-in 180ms var(--ease);
}

.page-shell > main {
    position: relative;
    z-index: 0;
}

@keyframes menu-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.nav-menu-category {
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    background: var(--panel);
}

.nav-menu-category > summary {
    display: flex;
    justify-content: space-between;
    min-height: 44px;
    padding: 0 11px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.nav-menu-category > summary::after {
    color: var(--muted);
    content: "⌄";
    font-size: 13px;
    line-height: 1;
    transition: transform 160ms var(--ease);
}

.nav-menu-category[open] > summary::after {
    transform: rotate(180deg);
}

.nav-menu-category:hover,
.nav-menu-category[open] {
    border-color: var(--line);
}

.nav-menu-category:hover > summary,
.nav-menu-category[open] > summary {
    color: var(--blue);
}

.nav-menu-group {
    display: grid;
    gap: 6px;
    max-height: min(360px, calc(100vh - 220px));
    overflow-y: auto;
    padding: 0 7px 7px;
}

.nav-menu-group a,
.nav-menu-all {
    display: grid;
    gap: 3px;
    padding: 11px;
    border-radius: var(--radius-sm);
    transition: background 140ms var(--ease);
}

.nav-menu-all {
    border: 1px solid var(--line-soft);
    background: var(--soft);
}

.nav-menu-group a:hover,
.nav-menu-all:hover {
    background: var(--soft);
}

.nav-menu-all:hover {
    border-color: var(--line);
}

.nav-menu-group small,
.nav-menu-all small {
    color: var(--muted);
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    font-weight: 700;
    font-size: 14px;
}

.header-actions > a:not(.btn) {
    color: var(--ink-soft);
    transition: color 160ms var(--ease);
}

.header-actions > a:not(.btn):hover {
    color: var(--blue);
}

.language-switch {
    position: relative;
    z-index: 1001;
    font-size: 14px;
    font-weight: 700;
}

.language-switch summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-soft);
    cursor: pointer;
    list-style: none;
    transition: color 160ms var(--ease);
}

.language-switch summary::-webkit-details-marker {
    display: none;
}

.language-switch summary::after {
    content: "⌄";
    font-size: 13px;
    line-height: 1;
}

.language-switch:hover summary,
.language-switch[open] summary {
    color: var(--blue);
}

.language-menu {
    display: grid;
    gap: 4px;
    position: absolute;
    z-index: 1002;
    top: 46px;
    right: 0;
    min-width: 176px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow);
    animation: menu-in 180ms var(--ease);
}

.language-menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px;
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    transition: background 140ms var(--ease), color 140ms var(--ease);
}

.language-menu a:hover {
    background: var(--soft);
    color: var(--ink);
}

.language-menu a[aria-current="true"] {
    background: var(--blue);
    color: white;
}

.language-menu a[aria-current="true"] strong {
    color: white;
}

.mobile-menu {
    display: none;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    cursor: pointer;
    transition: background 140ms var(--ease);
}

.mobile-menu:hover {
    background: var(--soft);
}

.mobile-menu span,
.mobile-menu::before,
.mobile-menu::after {
    display: block;
    width: 22px;
    height: 2px;
    margin: 5px auto;
    content: "";
    background: var(--ink);
    border-radius: 2px;
    transition: transform 220ms var(--ease), opacity 180ms var(--ease);
}

.mobile-menu[aria-expanded="true"] span {
    opacity: 0;
}

.mobile-menu[aria-expanded="true"]::before {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu[aria-expanded="true"]::after {
    transform: translateY(-7px) rotate(-45deg);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 24px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: white;
    color: var(--ink);
    font-weight: 700;
    cursor: pointer;
    transition: background 160ms var(--ease), border-color 160ms var(--ease), box-shadow 160ms var(--ease), color 160ms var(--ease);
}

.btn-primary {
    background: var(--blue);
    color: white;
    box-shadow: 0 6px 18px rgba(52, 70, 255, 0.24);
}

.btn-primary:hover {
    background: var(--blue-dark);
    box-shadow: 0 8px 22px rgba(52, 70, 255, 0.30);
}

.upload-panel > .btn-primary[type="submit"],
.form-grid > .btn-primary[type="submit"] {
    width: 100%;
}

.btn-secondary {
    border-color: #dde3ef;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    border-color: #b8c4d8;
    background: var(--soft);
}

.btn.is-disabled,
.btn.is-disabled:hover {
    border-color: #dde3ef;
    background: #eef2f7;
    color: #7b8798;
    box-shadow: none;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-arrow {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    transition: transform 200ms var(--ease);
}

.btn:hover .btn-arrow,
.billing-cancel-link:hover .btn-arrow {
    transform: translateX(2px);
}

.hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(440px, 1.05fr);
    gap: 56px;
    min-height: 520px;
    padding: 88px 72px 64px;
    background: linear-gradient(180deg, #ffffff 0%, var(--soft) 100%);
}

.hero-copy {
    max-width: 620px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 28px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    background: var(--green);
    color: #06452d;
    font-size: 12px;
    font-weight: 700;
}

.pill::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #1aa86a;
    box-shadow: 0 0 0 3px rgba(26, 168, 106, 0.22);
}

.hero h1,
.tool-hero h1 {
    margin: 26px 0 18px;
    font-size: clamp(42px, 5vw, 60px);
    line-height: 1.08;
    letter-spacing: -0.025em;
    font-weight: 800;
}

.hero p,
.tool-hero p {
    max-width: 560px;
    margin: 0;
    color: var(--ink-soft);
    font-size: 19px;
    line-height: 1.55;
}

.hero-actions {
    display: flex;
    gap: 16px;
    margin-top: 32px;
}

.trust-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid var(--line-soft);
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 13px;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
}

.trust-icon {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 11px;
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 16px;
}

.trust-icon svg {
    display: block;
}

.hero-visual {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding-top: 12px;
}

/* hero-app-panel: clean mock-UI replacing old decorative hero elements */
.hero-app-panel {
    width: min(100%, 420px);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.hap-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 42px;
    padding: 0 18px;
    border-bottom: 1px solid var(--line-soft);
    background: var(--soft);
}

.hap-privacy {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--green-text);
    font-size: 12px;
    font-weight: 600;
}

.hap-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #1aa86a;
    box-shadow: 0 0 0 3px rgba(26, 168, 106, 0.20);
    flex-shrink: 0;
}

.hap-drop {
    display: grid;
    place-items: center;
    gap: 0;
    padding: 24px;
    border-bottom: 1px solid var(--line-soft);
    text-align: center;
}

.hap-drop-inner {
    display: grid;
    place-items: center;
    width: 100%;
    padding: 22px 16px;
    border: 1.5px dashed #c4cfe3;
    border-radius: var(--radius-sm);
    background: var(--soft);
}

.hap-drop-inner .file-glyph {
    margin-bottom: 12px;
}

.hap-drop-inner strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 4px;
}

.hap-drop-inner span {
    color: var(--blue);
    font-size: 12px;
    font-weight: 600;
}

.hap-formats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line-soft);
}

.hap-fmt {
    padding: 3px 8px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--soft);
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.hap-progress {
    padding: 14px 18px 18px;
    display: grid;
    gap: 7px;
}

.hap-progress-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 700;
}

.hap-filename {
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.hap-pct {
    color: var(--blue);
    flex-shrink: 0;
}

.hap-savings {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

.file-glyph {
    position: relative;
    width: 44px;
    height: 56px;
    margin: 0 auto 18px;
    border: 2px solid #b7c2d7;
    border-radius: 8px;
    background: linear-gradient(135deg, #f6f8ff 0 74%, #dce5f6 75% 100%);
}

.progress-card-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 800;
}

.progress-track {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8ecf5;
}

.progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), #6d7cff);
    transition: width 250ms var(--ease);
}


.section {
    padding: 56px 72px 64px;
}

.section-heading {
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
}

.section-heading h2 {
    margin: 0;
    font-size: 32px;
    letter-spacing: -0.01em;
}

.section-heading p {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.55;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 36px;
}

.tool-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 200ms var(--ease), border-color 200ms var(--ease);
}

.tool-card:hover {
    border-color: var(--blue);
    box-shadow: 0 8px 24px rgba(29, 48, 91, 0.10);
}

.tool-card > span:nth-child(2) {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 5px;
}

.tool-card > span:last-child {
    flex-shrink: 0;
    align-self: center;
    display: flex;
    align-items: center;
    color: var(--muted);
    transition: transform 200ms var(--ease), color 200ms var(--ease);
}

.tool-card:hover > span:last-child {
    color: var(--blue);
    transform: translateX(2px);
}

.tool-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--blue-soft);
    color: var(--blue);
    font-weight: 900;
    font-size: 15px;
    transition: transform 200ms var(--ease);
}

.tool-card:hover .tool-icon {
    opacity: 0.88;
}

.tool-icon.red { background: #fff0f2; color: var(--red); }
.tool-icon.orange { background: #fff4e9; color: var(--orange); }
.tool-icon.green { background: #e8fbf0; color: #0baa69; }
.tool-icon.purple { background: #f2edff; color: var(--purple); }
.tool-icon.teal { background: #e9fbf8; color: var(--teal); }

.tool-card strong {
    font-size: 17px;
    letter-spacing: -0.01em;
}

.tool-card > span:nth-child(2) > span {
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.4;
}

.section-action {
    display: flex;
    justify-content: center;
    margin-top: 28px;
}

.security-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 38px;
    padding: 56px 72px;
    background: var(--soft);
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
}

.security-item {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 16px;
    align-items: center;
}

.security-badge {
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: white;
    color: var(--blue);
    font-weight: 900;
    font-size: 22px;
    box-shadow: var(--shadow-sm);
    transition: transform 200ms var(--ease), color 200ms var(--ease);
}

.security-item:hover .security-badge {
    color: var(--blue-dark);
}

.security-item strong {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
    letter-spacing: -0.01em;
}

.security-item p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.55;
}

.pricing-section {
    background: linear-gradient(180deg, #ffffff 0%, #f7f9fe 100%);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 28px;
    align-items: stretch;
}

.pricing-card {
    position: relative;
    display: grid;
    align-content: start;
    gap: 14px;
    padding: 30px 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow-sm);
    transition: transform 200ms var(--ease), box-shadow 200ms var(--ease), border-color 200ms var(--ease);
}

.pricing-card:hover {
    border-color: #c5d0e6;
    box-shadow: 0 10px 32px rgba(29, 48, 91, 0.10);
}

.pricing-card.featured {
    border-color: var(--blue);
    box-shadow: 0 26px 56px rgba(52, 70, 255, 0.2);
    background: linear-gradient(180deg, #ffffff 0%, #f5f7ff 100%);
}

.pricing-card.featured:hover {
    box-shadow: 0 16px 44px rgba(52, 70, 255, 0.22);
}

.pricing-badge {
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 14px;
    border-radius: var(--radius-sm);
    background: var(--blue);
    color: white;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(52, 70, 255, 0.30);
}

.pricing-kicker {
    color: var(--green-text);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.pricing-card.featured .pricing-kicker {
    color: var(--blue);
}

.pricing-card h3,
.pricing-card p {
    margin: 0;
}

.pricing-card h3 {
    font-size: 22px;
    letter-spacing: -0.01em;
}

.pricing-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 2px;
}

.pricing-amount {
    color: var(--ink);
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
}

.pricing-period {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.pricing-desc {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
    min-height: 42px;
}

.pricing-features {
    display: grid;
    gap: 11px;
    margin: 6px 0 8px;
    padding: 18px 0 4px;
    border-top: 1px solid var(--line-soft);
    list-style: none;
}

.pricing-features li {
    position: relative;
    padding-left: 28px;
    color: var(--ink-soft);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.45;
}

.pricing-features li::before {
    position: absolute;
    left: 0;
    top: 1px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: var(--green);
    color: var(--green-text);
    content: "✓";
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 900;
}

.pricing-card.featured .pricing-features li::before {
    background: var(--blue-soft);
    color: var(--blue);
}

.pricing-card form {
    margin-top: auto;
}

.pricing-card .btn {
    width: 100%;
}

.faq-section {
    background: white;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 32px;
}

.faq-grid article {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--soft);
}

.faq-grid h3 {
    margin: 0 0 10px;
    font-size: 18px;
    letter-spacing: -0.01em;
}

.faq-grid p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.6;
}

.faq-section-action {
    display: flex;
    justify-content: center;
    margin-top: 28px;
}

.faq-page {
    padding: 64px 72px 84px;
    background: var(--panel);
}

.tools-page {
    padding: 64px 72px 84px;
    background:
        radial-gradient(circle at 82% 12%, rgba(52, 70, 255, 0.07), transparent 26%),
        linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
}

.tools-hero {
    max-width: 760px;
}

.tools-hero h1 {
    margin: 18px 0 0;
    color: var(--ink);
    font-size: clamp(42px, 5vw, 60px);
    line-height: 1.05;
    letter-spacing: -0.025em;
    font-weight: 800;
}

.tools-hero p {
    max-width: 680px;
    margin: 18px 0 0;
    color: var(--ink-soft);
    font-size: 18px;
    line-height: 1.6;
}

.tools-directory {
    display: grid;
    gap: 36px;
    margin-top: 44px;
}

.tools-category {
    display: grid;
    gap: 16px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.tools-category:first-child {
    padding-top: 0;
    border-top: 0;
}

.tools-category-heading span {
    color: var(--blue);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tools-category .tool-grid {
    margin-top: 0;
}

.faq-hero {
    max-width: 760px;
}

.faq-hero h1 {
    margin: 18px 0 0;
    color: var(--ink);
    font-size: clamp(42px, 5vw, 60px);
    line-height: 1.05;
    letter-spacing: -0.025em;
    font-weight: 800;
}

.faq-hero p {
    max-width: 680px;
    margin: 18px 0 0;
    color: var(--ink-soft);
    font-size: 18px;
    line-height: 1.6;
}

.faq-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 38px;
}

.faq-summary article {
    display: grid;
    gap: 7px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--soft);
}

.faq-summary strong {
    color: var(--ink);
    font-size: 28px;
    line-height: 1;
    letter-spacing: -0.02em;
}

.faq-summary span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

.faq-list {
    display: grid;
    gap: 38px;
    margin-top: 52px;
}

.faq-group {
    display: grid;
    grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
    gap: 36px;
    padding-top: 34px;
    border-top: 1px solid var(--line);
}

.faq-group-heading {
    display: grid;
    align-content: start;
    gap: 8px;
}

.faq-group-heading span {
    color: var(--blue);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.faq-group-heading h2 {
    margin: 0;
    color: var(--ink);
    font-size: 26px;
    line-height: 1.15;
    letter-spacing: -0.015em;
}

.faq-items {
    display: grid;
    gap: 12px;
}

.faq-items article {
    padding: 22px 24px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background: var(--panel);
}

.faq-items h3 {
    margin: 0;
    color: var(--ink);
    font-size: 18px;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.faq-items p {
    margin: 10px 0 0;
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1.65;
}

.tool-page {
    padding: 64px 72px 80px;
    background:
        radial-gradient(circle at 82% 12%, rgba(52, 70, 255, 0.09), transparent 26%),
        radial-gradient(circle at 12% 88%, rgba(122, 76, 255, 0.06), transparent 30%),
        linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
}

.tool-hero {
    display: grid;
    gap: 34px;
    align-items: stretch;
}

.tool-hero > div:first-child {
    max-width: 780px;
}

.tool-hero h1 {
    margin-top: 22px;
}

.upload-panel,
.job-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
}

.upload-panel {
    padding: 30px;
}

.tool-hero > .upload-panel {
    width: min(100%, 880px);
    margin-inline: auto;
}

.form-grid {
    display: grid;
    gap: 22px;
}

.dropzone {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 220px;
    padding: 28px;
    border: 2px dashed #c4cfe3;
    border-radius: var(--radius);
    background: #fbfcff;
    text-align: center;
    transition: border-color 200ms var(--ease), background 200ms var(--ease), transform 200ms var(--ease);
}

.dropzone:hover {
    border-color: var(--blue);
    background: var(--blue-soft);
}

.dropzone.is-dragging {
    border-color: var(--blue);
    background: var(--blue-soft);
    transform: scale(1.01);
}

.dropzone.is-uploading {
    border-color: var(--blue);
    background: var(--blue-soft);
}

.dropzone input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.dropzone.is-uploading input {
    pointer-events: none;
}

.dropzone strong {
    display: block;
    margin-top: 14px;
}

.dropzone span {
    display: block;
    margin-top: 8px;
    color: var(--blue);
    font-weight: 800;
}

.dropzone-progress {
    width: min(100%, 320px);
    height: 8px;
    margin-top: 18px;
    overflow: hidden;
    border-radius: 999px;
    background: #dbe3f0;
}

.dropzone-progress-bar {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: #16a34a;
    transition: width 120ms var(--ease);
}

.dropzone-compact {
    min-height: 118px;
    padding: 18px;
}

.dropzone-compact .file-glyph {
    width: 30px;
    height: 38px;
    margin-bottom: 10px;
    border-radius: 6px;
}

.control-group {
    display: grid;
    gap: 10px;
}

.control-label {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.control-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.control-checkbox input {
    width: 18px;
    height: 18px;
}

.control-divider {
    width: 100%;
    height: 1px;
    margin: 4px 0;
    border: 0;
    background: var(--line, rgba(0, 0, 0, 0.12));
}

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

.segmented input {
    position: absolute;
    opacity: 0;
}

.segmented span {
    display: grid;
    place-items: center;
    gap: 4px;
    min-height: 48px;
    padding: 13px;
    border: 1px solid #dbe3f0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 160ms var(--ease), background 160ms var(--ease), box-shadow 160ms var(--ease);
}

.segmented span:hover {
    border-color: #bcc8de;
    background: var(--soft);
}

.segmented input:checked + span {
    border-color: var(--blue);
    background: var(--blue-soft);
    box-shadow: inset 0 0 0 1px var(--blue);
}

.segmented small {
    color: var(--muted);
    line-height: 1.35;
}

.target-row {
    display: grid;
    grid-template-columns: 1fr 110px;
    gap: 10px;
}

.field,
.control-group > input:not([type="radio"]):not([type="checkbox"]),
.control-group > select,
.control-group > textarea {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid #dbe3f0;
    border-radius: var(--radius-sm);
    background: white;
    transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.field:focus,
.control-group > input:not([type="radio"]):not([type="checkbox"]):focus,
.control-group > select:focus,
.control-group > textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(52, 70, 255, 0.14);
}

.form-note {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.55;
    opacity: 0.75;
}

.merge-tool-page {
    min-height: calc(100vh - 84px);
}

.merge-editor-panel {
    gap: 18px;
}

.merge-hero > .merge-editor-panel {
    width: min(100%, 1120px);
}

.merge-dropzone {
    min-height: 150px;
    margin-bottom: 4px;
}

.merge-editor-panel.is-dragging .merge-dropzone {
    border-color: var(--blue);
    background: var(--blue-soft);
}

.merge-workspace {
    display: grid;
    gap: 12px;
    min-height: 430px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--soft);
}

.merge-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.merge-toolbar strong {
    font-size: 15px;
    letter-spacing: -0.01em;
}

.merge-toolbar span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.merge-empty {
    display: grid;
    place-items: center;
    min-height: 210px;
    border: 1px dashed #cbd6e8;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-weight: 800;
}

.merge-empty[hidden] {
    display: none;
}

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

.merge-page {
    display: grid;
    grid-template-rows: 82px auto 34px;
    gap: 10px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: white;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 180ms var(--ease), transform 180ms var(--ease);
}

.merge-page:hover {
    box-shadow: 0 14px 30px rgba(29, 48, 91, 0.1);
    transform: translateY(-2px);
}

.merge-page.is-dragging {
    opacity: 0.55;
}

.merge-page-preview {
    display: grid;
    place-items: center;
    overflow: hidden;
    width: 100%;
    min-width: 0;
    border: 1px solid #e1e7f2;
    border-radius: 7px;
    background: #eef3fb;
    cursor: zoom-in;
}

button.merge-page-preview {
    padding: 0;
}

.merge-page-preview canvas,
.merge-page-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: white;
}

.merge-page-icon {
    position: relative;
    width: 34px;
    height: 44px;
    border: 2px solid #8fa0bf;
    border-radius: 4px;
    background: white;
}

.merge-page-icon::before {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    border-bottom: 2px solid #8fa0bf;
    border-left: 2px solid #8fa0bf;
    border-radius: 0 3px 0 3px;
    background: #eef3fb;
    content: "";
}

.merge-page-meta {
    min-width: 0;
    text-align: center;
}

.merge-page-meta strong,
.merge-page-meta span {
    display: block;
}

.merge-page-meta strong {
    margin-bottom: 4px;
    font-size: 13px;
}

.merge-page-meta span {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.merge-page-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.merge-page-actions button {
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 32px;
    border: 1px solid #d5deec;
    border-radius: 7px;
    background: white;
    color: var(--ink-soft);
    cursor: pointer;
    font-size: 18px;
    font-weight: 900;
    transition: border-color 140ms var(--ease), color 140ms var(--ease), background 140ms var(--ease);
}

.merge-page-actions button:hover {
    border-color: var(--blue);
    color: var(--blue);
    background: var(--blue-soft);
}

.merge-zoom-dialog::backdrop {
    background: rgba(11, 22, 44, 0.62);
    backdrop-filter: blur(3px);
}

.merge-zoom-dialog {
    width: min(100%, 980px);
    height: auto;
    max-height: min(92vh, 980px);
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: var(--radius);
    background: white;
    box-shadow: 0 30px 90px rgba(11, 22, 44, 0.4);
}

.merge-zoom-dialog[open] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    animation: dialog-in 200ms var(--ease);
}

@keyframes dialog-in {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.merge-zoom-dialog header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    min-height: 58px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}

.merge-zoom-dialog header strong {
    min-width: 0;
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.merge-zoom-dialog header button {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid #d5deec;
    border-radius: 9px;
    background: white;
    color: var(--ink-soft);
    cursor: pointer;
    font-size: 22px;
    font-weight: 900;
    transition: background 140ms var(--ease), color 140ms var(--ease);
}

.merge-zoom-dialog header button:hover {
    background: var(--soft);
    color: var(--blue);
}

.merge-zoom-body {
    display: grid;
    place-items: center;
    overflow: auto;
    min-height: 320px;
    padding: 22px;
    background: #eef3fb;
}

.merge-zoom-body canvas,
.merge-zoom-body img {
    max-width: 100%;
    height: auto;
    background: white;
    box-shadow: 0 12px 28px rgba(29, 48, 91, 0.16);
}

.flash-error,
.alert {
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
}

.flash-error {
    background: #fff0f2;
    color: #a60d2d;
    border: 1px solid #ffd9df;
}

.alert {
    background: #fff8e8;
    color: #77520d;
    border: 1px solid #ffe9b8;
}

.alert[hidden] {
    display: none;
}

.job-panel {
    width: min(100%, 680px);
    margin: 64px auto 0;
    padding: 40px;
}

.job-panel h1 {
    margin: 18px 0 10px;
    font-size: 34px;
    letter-spacing: -0.02em;
}

.job-meta {
    margin: 0 0 24px;
    color: var(--muted);
}

.job-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.account-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
    gap: 56px;
    min-height: 470px;
    padding: 72px 72px 48px;
    background:
        radial-gradient(circle at 88% 12%, rgba(52, 70, 255, 0.07), transparent 36%),
        linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
}

.account-copy h1 {
    margin: 26px 0 12px;
    font-size: clamp(40px, 5vw, 56px);
    line-height: 1.1;
    letter-spacing: -0.025em;
    font-weight: 800;
}

.account-copy p {
    max-width: 560px;
    margin: 0;
    color: var(--ink-soft);
    font-size: 19px;
    line-height: 1.55;
}

.account-trust {
    max-width: 560px;
}

.account-visual {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 4px;
}

.profile-card {
    display: grid;
    grid-template-columns: 82px 1fr;
    gap: 18px;
    align-items: center;
    width: 100%;
    min-height: 110px;
    padding: 24px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius);
}

.profile-card img,
.profile-avatar {
    width: 76px;
    height: 76px;
    border-radius: 50%;
}

.profile-card img {
    object-fit: cover;
}

.profile-avatar {
    display: inline-grid;
    place-items: center;
    background: linear-gradient(135deg, var(--blue), #6d7cff);
    color: white;
    font-size: 30px;
    font-weight: 800;
}

.profile-card strong {
    display: block;
    margin-bottom: 6px;
    font-size: 20px;
    letter-spacing: -0.01em;
}

.profile-card span,
.retention-note span {
    display: block;
    color: var(--muted);
    line-height: 1.45;
}

.account-plan-card {
    padding: 22px 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow-sm);
}

.account-plan-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.account-plan-detail {
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

.account-plan-limits {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.plan-limit-item {
    display: grid;
    gap: 2px;
    padding: 12px;
    background: var(--soft);
    border-radius: var(--radius-sm);
}

.plan-limit-item strong {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.plan-limit-item span {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.account-history-section {
    padding-top: 48px;
    background: white;
}

.flash-message {
    width: min(100%, 560px);
    margin: 18px 0 0;
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 800;
}

.flash-message.success {
    background: var(--green);
    color: var(--green-text);
    border: 1px solid #c7f0d8;
}

.flash-message.error {
    background: #fff0f2;
    color: #a60d2d;
    border: 1px solid #ffd9df;
}

.auth-shell {
    display: grid;
    place-items: center;
    min-height: 640px;
    padding: 72px 24px;
    background:
        radial-gradient(circle at 18% 18%, rgba(18, 181, 165, 0.08), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
}

.auth-panel {
    width: min(100%, 520px);
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow);
}

.auth-panel h1 {
    margin: 18px 0 10px;
    font-size: 34px;
    line-height: 1.15;
    font-weight: 800;
}

.auth-panel > p {
    margin: 0 0 22px;
    color: var(--muted);
    line-height: 1.55;
}

.auth-provider-grid,
.auth-form {
    display: grid;
    gap: 12px;
}

.auth-provider {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 12px;
    align-items: center;
    min-height: 54px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--ink);
    font-weight: 800;
    transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), transform 160ms var(--ease);
}

.auth-provider:hover {
    border-color: #c8d3e6;
    box-shadow: var(--shadow-sm);
}

.auth-provider span {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--ink);
    color: white;
    font-weight: 900;
}

.auth-divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: center;
    margin: 22px 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    background: var(--line);
}

.auth-form label {
    display: grid;
    gap: 8px;
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 800;
}

.auth-form input {
    min-height: 48px;
    width: 100%;
    border: 1px solid #d5deec;
    border-radius: var(--radius-sm);
    padding: 0 14px;
    background: white;
    color: var(--ink);
}

.auth-form button {
    margin-top: 6px;
}

.auth-switch {
    margin-top: 18px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.auth-switch a {
    color: var(--blue);
    font-weight: 900;
}

.billing-section {
    padding-top: 38px;
    padding-bottom: 38px;
    background: var(--canvas);
}

.billing-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 28px;
    align-items: start;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow-sm);
}

.billing-usage {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.billing-usage-item {
    padding: 14px 16px;
    background: var(--soft);
    border-radius: var(--radius-sm);
}

.usage-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.usage-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.02em;
    line-height: 1;
}

.usage-limit {
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0;
}

.billing-cancel-wrap {
    margin-top: 4px;
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
}

.billing-cancel-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 160ms var(--ease);
}

.billing-cancel-link:hover {
    color: var(--red);
}

.billing-cancel-note {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.billing-panel h2 {
    margin: 18px 0 8px;
    font-size: 28px;
    letter-spacing: -0.02em;
}

.billing-panel p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.billing-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
}

.btn-icon-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--muted);
    cursor: pointer;
    transition: border-color 160ms var(--ease), color 160ms var(--ease), background 160ms var(--ease);
}

.btn-icon-delete:hover {
    border-color: #ffd9df;
    color: var(--red);
    background: #fff0f2;
}

.conversion-grid {
    display: grid;
    gap: 16px;
    margin-top: 28px;
}

.conversion-card {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(360px, 1.25fr) auto;
    gap: 20px;
    align-items: center;
    min-height: 122px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow-sm);
    transition: transform 200ms var(--ease), box-shadow 200ms var(--ease), border-color 200ms var(--ease);
}

.conversion-card:hover {
    transform: translateY(-3px);
    border-color: #c5d0e6;
    box-shadow: 0 18px 40px rgba(29, 48, 91, 0.1);
}

.conversion-main {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
}

.conversion-main strong,
.conversion-main span {
    display: block;
}

.conversion-main strong {
    margin-bottom: 6px;
    font-size: 17px;
    letter-spacing: -0.01em;
}

.conversion-main span {
    overflow-wrap: anywhere;
    color: var(--ink-soft);
    font-size: 14px;
}

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

.conversion-details span {
    display: grid;
    gap: 6px;
    color: var(--ink-soft);
    font-size: 13px;
}

.conversion-details strong {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 4px;
    font-style: normal;
    font-weight: 700;
    font-size: 12px;
}

.status-pill.succeeded {
    background: var(--green);
    color: var(--green-text);
}

.status-pill.processing {
    background: var(--blue-soft);
    color: var(--blue);
}

.status-pill.processing::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--blue);
    animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.status-pill.failed,
.status-pill.expired {
    background: #fff0f2;
    color: #a60d2d;
}

.conversion-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.download-unavailable {
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.empty-history {
    display: grid;
    place-items: center;
    gap: 12px;
    width: min(100%, 620px);
    margin: 28px auto 0;
    padding: 48px 38px;
    border: 1px dashed #cfd8e8;
    border-radius: var(--radius);
    background: var(--soft);
    text-align: center;
}

.empty-history h3,
.empty-history p {
    margin: 0;
}

.empty-history h3 {
    font-size: 20px;
    letter-spacing: -0.01em;
}

.empty-history p {
    max-width: 420px;
    color: var(--muted);
    line-height: 1.55;
}

.legal-page {
    max-width: 820px;
    padding: 68px 72px 88px;
}

.legal-page h1 {
    margin-top: 0;
    font-size: 42px;
    letter-spacing: -0.025em;
    font-weight: 800;
}

.legal-page p,
.legal-page li {
    color: var(--ink-soft);
    line-height: 1.7;
}

.legal-page p {
    font-size: 16px;
}

.legal-page ul {
    padding-left: 4px;
    list-style: none;
}

.legal-page li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 12px;
    font-size: 16px;
}

.legal-page li::before {
    position: absolute;
    left: 0;
    top: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--green);
    color: var(--green-text);
    content: "✓";
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 900;
}

.site-footer {
    padding: 56px 72px 36px;
    border-top: 1px solid var(--line-soft);
    background: #ffffff;
}

.footer-top {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}

.footer-brand .brand {
    font-size: 22px;
}

.footer-brand p {
    max-width: 380px;
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

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

.footer-links div {
    display: grid;
    gap: 10px;
}

.footer-links strong {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink);
    margin-bottom: 4px;
}

.footer-links a {
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    transition: color 140ms var(--ease);
}

.footer-links a:hover {
    color: var(--blue);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--line-soft);
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.workflow-page {
    display: grid;
    gap: 34px;
    padding: 54px 72px 72px;
}

.workflow-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 28px;
}

.workflow-head h1 {
    max-width: 780px;
    margin: 14px 0 12px;
    color: var(--ink);
    font-size: clamp(40px, 5vw, 58px);
    font-weight: 800;
    line-height: 0.98;
}

.workflow-head p {
    max-width: 680px;
    margin: 0;
    color: var(--ink-soft);
    font-size: 18px;
    line-height: 1.55;
}

.workflow-section,
.workflow-builder,
.workflow-empty,
.workflow-run-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow-sm);
}

.workflow-section {
    display: grid;
    gap: 18px;
    padding: 24px;
}

.workflow-section h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
}

.workflow-grid {
    display: grid;
    gap: 12px;
}

.workflow-card {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    background: var(--soft);
}

.workflow-card > div:first-child {
    display: grid;
    gap: 8px;
}

.workflow-card strong {
    color: var(--ink);
    font-size: 17px;
}

.workflow-card span,
.workflow-run-list em {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.workflow-card-chain {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.workflow-card-chain span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 800;
}

.workflow-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.workflow-card-actions form {
    margin: 0;
}

.workflow-empty {
    display: grid;
    gap: 6px;
    padding: 32px;
    text-align: center;
}

.workflow-empty span {
    color: var(--muted);
}

.workflow-run-list {
    display: grid;
    gap: 8px;
}

.workflow-run-list a {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    transition: background 160ms var(--ease), border-color 160ms var(--ease);
}

.workflow-run-list a:hover {
    border-color: var(--line);
    background: var(--soft);
}

.workflow-builder {
    display: grid;
    gap: 22px;
    padding: 24px;
}

.workflow-name-field {
    max-width: 560px;
}

.workflow-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    background: var(--soft);
}

.workflow-summary span {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 12px 14px;
    border-left: 1px solid var(--line-soft);
}

.workflow-summary span:first-child {
    border-left: 0;
}

.workflow-summary strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workflow-summary small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.workflow-builder-grid {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.workflow-tool-picker,
.workflow-lane-panel {
    display: grid;
    gap: 14px;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background: var(--soft);
}

.workflow-tool-picker {
    position: sticky;
    top: 78px;
    max-height: calc(100vh - 110px);
}

.workflow-panel-heading {
    display: grid;
    gap: 10px;
}

.workflow-panel-heading strong {
    font-size: 14px;
    font-weight: 800;
    color: var(--ink);
}

.workflow-tool-list {
    display: grid;
    gap: 8px;
    overflow: auto;
    padding-right: 2px;
}

.workflow-tool-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: inherit;
    cursor: grab;
    text-align: left;
    transition: border-color 160ms var(--ease), background 160ms var(--ease);
}

.workflow-tool-option:hover {
    border-color: #b8c4d8;
    background: #ffffff;
}

.workflow-tool-option.is-disabled {
    cursor: not-allowed;
    opacity: 0.48;
    filter: grayscale(0.35);
}

.workflow-tool-option.is-disabled:hover {
    border-color: var(--line);
    background: var(--panel);
}

.workflow-tool-option span:last-child,
.workflow-node-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.workflow-tool-option strong,
.workflow-node-copy strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 14px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workflow-tool-option small,
.workflow-node-copy small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.workflow-mobile-add {
    display: none;
}

.workflow-lane {
    display: grid;
    gap: 10px;
    min-height: 188px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.workflow-lane-empty {
    display: grid;
    place-items: center;
    min-height: 188px;
    padding: 28px;
    border: 1px dashed #b8c4d8;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.62);
    color: var(--muted);
    text-align: center;
}

.workflow-lane-empty strong {
    color: var(--ink);
    font-size: 16px;
}

.workflow-lane-empty span {
    max-width: 360px;
    font-size: 14px;
    line-height: 1.45;
}

.workflow-node {
    display: grid;
    grid-template-columns: auto auto auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #ffffff;
}

.workflow-node-index {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.workflow-node-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, auto));
    gap: 6px;
    justify-content: flex-end;
}

.workflow-drag-handle,
.workflow-node-action {
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.workflow-node-action:hover,
.workflow-drag-handle:hover {
    border-color: #b8c4d8;
    background: #ffffff;
}

.workflow-drag-handle {
    display: grid;
    place-items: center;
    width: 36px;
    padding: 0;
    cursor: grab;
}

.workflow-node-copy small {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.workflow-node-copy small span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workflow-node-io {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 2px 0;
}

.workflow-io-pill {
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--surface-2, rgba(0, 0, 0, 0.05));
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.workflow-io-arrow {
    color: var(--muted);
    font-weight: 800;
}

.workflow-io-shape {
    padding: 1px 7px;
    border-radius: 999px;
    border: 1px solid var(--line, rgba(0, 0, 0, 0.12));
    color: var(--ink);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.workflow-tool-shape {
    display: inline-block;
    margin-top: 2px;
    opacity: 0.75;
}

.workflow-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.workflow-dialog {
    width: min(100% - 28px, 560px);
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.workflow-dialog::backdrop {
    background: rgba(10, 23, 51, 0.28);
}

.workflow-dialog-body {
    display: grid;
    gap: 18px;
    padding: 22px;
}

.workflow-dialog-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

.workflow-step-list {
    display: grid;
    gap: 8px;
    margin: 18px 0 0;
}

.workflow-step-list span {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.workflow-step-list strong {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    background: var(--soft);
    color: var(--ink-soft);
    font-size: 12px;
}

.workflow-step-list .is-current {
    border-color: var(--blue);
    background: var(--blue-soft);
    color: var(--ink);
}

.workflow-step-list .is-done {
    border-color: var(--green);
    background: var(--green);
    color: var(--green-text);
}

@media (max-width: 980px) {
    body {
        overflow-x: hidden;
    }

    body.is-mobile-menu-open {
        overflow: hidden;
    }

    .page-shell {
        width: 100%;
        min-height: 100vh;
        margin: 0;
        overflow-x: hidden;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .site-header {
        height: 58px;
        padding: 0 22px;
    }

    .workflow-page {
        gap: 24px;
        padding: 34px 18px 48px;
    }

    .workflow-head {
        display: grid;
        align-items: start;
    }

    .workflow-head h1 {
        font-size: 42px;
    }

    .workflow-head p {
        font-size: 16px;
    }

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

    .workflow-summary span {
        border-top: 1px solid var(--line-soft);
    }

    .workflow-summary span:nth-child(-n + 2) {
        border-top: 0;
    }

    .workflow-summary span:nth-child(odd) {
        border-left: 0;
    }

    .workflow-builder-grid {
        grid-template-columns: 1fr;
    }

    .workflow-tool-picker {
        display: none;
    }

    .workflow-mobile-add {
        display: inline-flex;
    }

    .workflow-card {
        display: grid;
    }

    .workflow-card-actions,
    .workflow-card-actions .btn,
    .workflow-card-actions form {
        width: 100%;
    }

    .workflow-card-actions .btn {
        justify-content: center;
    }

    .workflow-node {
        grid-template-columns: auto auto auto minmax(0, 1fr);
        align-items: start;
    }

    .workflow-node-actions {
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: stretch;
    }

    .workflow-node-action {
        min-height: 44px;
    }

    .nav,
    .header-actions,
    .language-switch {
        display: none;
    }

    .mobile-menu {
        display: block;
    }

    .site-header.is-menu-open {
        position: fixed;
        inset: 0;
        z-index: 3000;
        height: 100dvh;
        min-height: 100dvh;
        flex-wrap: wrap;
        align-content: start;
        align-items: center;
        gap: 0;
        overflow-y: auto;
        padding: 0 22px 24px;
        border-bottom: 0;
        background: var(--panel);
        box-shadow: none;
    }

    .site-header.is-menu-open .brand {
        order: 1;
        min-height: 58px;
    }

    .site-header.is-menu-open .mobile-menu {
        order: 2;
        margin-left: auto;
        background: var(--soft);
    }

    .site-header.is-menu-open .nav,
    .site-header.is-menu-open .header-actions,
    .site-header.is-menu-open .language-switch {
        display: flex;
        flex: 1 0 100%;
        align-items: stretch;
        width: 100%;
        min-width: 0;
    }

    .site-header.is-menu-open .nav {
        flex-direction: column;
        gap: 0;
        order: 3;
        padding: 16px 0 0;
        text-align: left;
    }

    .site-header.is-menu-open .nav > a,
    .site-header.is-menu-open .nav > details > summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 52px;
        padding: 0;
        border-top: 1px solid var(--line);
        color: var(--ink);
        font-size: 16px;
        line-height: 1.2;
    }

    .site-header.is-menu-open .nav > a::after {
        display: none;
    }

    .site-header.is-menu-open .nav > details {
        width: 100%;
    }

    .site-header.is-menu-open .nav > details > summary::after,
    .site-header.is-menu-open .language-switch summary::after {
        color: var(--muted);
    }

    .site-header.is-menu-open .nav-menu {
        position: static;
        width: 100%;
        margin: 0 0 12px;
        padding: 10px;
        border-color: var(--line);
        background: var(--soft);
        box-shadow: none;
    }

    .site-header.is-menu-open .nav-menu-category {
        border-color: var(--line);
        background: var(--panel);
    }

    .site-header.is-menu-open .nav-menu-category > summary {
        min-height: 50px;
        padding: 0 12px;
    }

    .site-header.is-menu-open .nav-menu-group a,
    .site-header.is-menu-open .nav-menu-all {
        min-height: 58px;
        padding: 12px;
        background: var(--panel);
    }

    .site-header.is-menu-open .nav-menu-group {
        max-height: none;
        padding: 0 8px 8px;
    }

    .site-header.is-menu-open .nav-menu-group a {
        background: var(--soft);
    }

    .site-header.is-menu-open .header-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        order: 4;
        padding: 18px 0;
        border-top: 1px solid var(--line);
    }

    .site-header.is-menu-open .header-actions > a:not(.btn) {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 46px;
        padding: 0 12px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: var(--panel);
        color: var(--ink);
        text-align: center;
    }

    .site-header.is-menu-open .header-actions .btn {
        grid-column: 1 / -1;
        width: 100%;
        min-height: 50px;
        box-sizing: border-box;
    }

    .site-header.is-menu-open .header-actions > a:first-child:nth-last-child(2):not(.btn) {
        grid-column: 1 / -1;
    }

    .site-header.is-menu-open .language-switch {
        display: block;
        order: 5;
        padding: 0;
        border-top: 1px solid var(--line);
    }

    .site-header.is-menu-open .language-switch summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 52px;
        padding: 0;
        color: var(--ink);
        font-size: 16px;
    }

    .site-header.is-menu-open .language-menu {
        position: static;
        width: 100%;
        margin: 0 0 8px;
        padding: 10px;
        border-color: var(--line);
        background: var(--soft);
        box-shadow: none;
    }

    .site-header.is-menu-open .language-menu a {
        min-height: 48px;
        padding: 0 12px;
        background: var(--panel);
    }

    .brand {
        font-size: 20px;
    }

    .hero,
    .account-hero {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 26px 22px 38px;
        min-height: auto;
        overflow: hidden;
        text-align: center;
    }

    .hero-copy,
    .account-copy,
    .account-visual,
    .tool-hero > div:first-child,
    .tool-hero p {
        max-width: 100%;
        margin: 0 auto;
        min-width: 0;
    }

    .hero h1,
    .account-copy h1,
    .tool-hero h1 {
        font-size: 36px;
        line-height: 1.15;
    }

    .account-copy h1,
    .account-copy p {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .hero p,
    .account-copy p,
    .tool-hero p {
        max-width: 100%;
        font-size: 16px;
    }

    .hero-actions {
        display: grid;
        gap: 12px;
        width: min(100%, 420px);
        margin: 28px auto 0;
    }

    .hero-actions .btn {
        width: 100%;
        min-width: 0;
    }

    .trust-row {
        grid-template-columns: 1fr;
        width: min(100%, 360px);
        margin: 28px auto 0;
        text-align: left;
        gap: 16px;
    }

    .hero-visual {
        display: none;
    }

    .account-visual {
        width: 100%;
        margin-top: 8px;
    }

    .section,
    .tool-page,
    .legal-page,
    .faq-page,
    .tools-page {
        padding: 34px 22px 42px;
    }

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

    .pricing-grid,
    .faq-grid,
    .faq-summary,
    .billing-panel {
        grid-template-columns: 1fr;
    }

    .section-action,
    .faq-section-action {
        justify-content: stretch;
    }

    .section-action .btn,
    .faq-section-action .btn {
        width: 100%;
    }

    .faq-hero h1 {
        font-size: 36px;
        line-height: 1.15;
    }

    .faq-hero p,
    .tools-hero p {
        font-size: 16px;
    }

    .tools-hero h1 {
        font-size: 36px;
        line-height: 1.15;
    }

    .tools-directory {
        gap: 30px;
        margin-top: 34px;
    }

    .faq-list {
        gap: 28px;
        margin-top: 36px;
    }

    .faq-group {
        grid-template-columns: 1fr;
        gap: 18px;
        padding-top: 28px;
    }

    .pricing-card {
        min-height: 0;
    }

    .pricing-card.featured {
        margin-top: 14px;
    }

    .billing-actions {
        justify-content: stretch;
    }

    .billing-actions form,
    .billing-actions .btn {
        width: 100%;
    }

    .section-heading p {
        display: none;
    }

    .security-strip {
        grid-template-columns: 1fr;
        padding: 36px 22px;
    }

    .tool-hero {
        gap: 24px;
        text-align: left;
    }

    .tool-hero > .upload-panel {
        width: 100%;
        min-width: 0;
    }

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

    .job-panel {
        margin-top: 32px;
        padding: 22px;
    }

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

    .merge-pages {
        grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
    }

    .profile-card {
        grid-template-columns: 70px minmax(0, 1fr);
        text-align: left;
    }

    .profile-card > div,
    .account-plan-card,
    .billing-panel,
    .conversion-card {
        min-width: 0;
    }

    .profile-card strong,
    .profile-card span,
    .account-plan-detail {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .profile-card img,
    .profile-avatar {
        width: 64px;
        height: 64px;
    }

    .conversion-card {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

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

    .conversion-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .site-footer {
        padding: 40px 22px 28px;
    }

    .footer-top {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-links {
        gap: 24px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 6px;
    }
}

@media (max-width: 640px) {
    .site-header {
        padding: 0 18px;
    }

    .hero,
    .account-hero {
        padding-inline: 18px;
    }

    .account-copy h1 {
        font-size: clamp(28px, 8.5vw, 34px);
    }

    .account-plan-card {
        padding: 18px;
    }

    .account-plan-header {
        display: grid;
        justify-items: start;
        gap: 8px;
    }

    .account-plan-limits,
    .billing-usage {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .plan-limit-item,
    .billing-usage-item {
        min-width: 0;
        padding: 12px 7px;
        text-align: center;
    }

    .plan-limit-item {
        justify-items: center;
    }

    .plan-limit-item strong {
        font-size: 21px;
    }

    .plan-limit-item span,
    .usage-label {
        font-size: 10px;
        line-height: 1.25;
        letter-spacing: 0.04em;
    }

    .plan-limit-item:first-child span {
        white-space: nowrap;
    }

    .billing-panel {
        padding: 26px 18px;
    }

    .billing-actions {
        justify-content: stretch;
    }

    .auth-shell {
        padding-inline: 18px;
    }

    .auth-panel {
        padding: 26px 20px;
    }

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

    .conversion-details {
        grid-template-columns: 1fr;
    }

    .pricing-card .btn,
    .pricing-card form {
        width: 100%;
    }

}

/* ── Scanner / Camera-to-PDF ── */

.scan-editor {
    padding: 0;
    overflow: hidden;
}

.scan-phase {
    padding: 32px 30px;
}

.scan-phase-error {
    margin: 22px 30px 0;
}

/* Landing */
.scan-landing-title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.scan-landing-sub {
    margin: 0 0 28px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.5;
}

.scan-landing-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.scan-source-btn {
    position: relative;
    display: grid;
    gap: 6px;
    padding: 30px 20px;
    border: 2px dashed #c4cfe3;
    border-radius: var(--radius);
    background: #fbfcff;
    text-align: center;
    cursor: pointer;
    font: inherit;
    color: var(--ink);
    transition: border-color 200ms var(--ease), background 200ms var(--ease), transform 200ms var(--ease);
}

.scan-source-btn:hover {
    border-color: var(--blue);
    background: var(--blue-soft);
    transform: translateY(-2px);
}

.scan-source-icon {
    display: block;
    font-size: 34px;
    line-height: 1;
    margin-bottom: 4px;
}

.scan-source-btn strong {
    display: block;
    font-size: 16px;
    font-weight: 800;
}

.scan-source-btn > span:not(.scan-source-icon) {
    color: var(--muted);
    font-size: 13px;
}

.scan-landing-note {
    text-align: center;
}

/* Camera */
.scan-camera-wrap {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #0c0f18;
    display: flex;
    flex-direction: column;
}

.scan-camera-video {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    background: #0c0f18;
}

.scan-camera-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scan-camera-frame {
    width: 82%;
    aspect-ratio: 0.707;
    border: 2px solid rgba(255, 255, 255, 0.55);
    border-radius: 6px;
    box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.28);
}

.scan-camera-controls {
    display: flex;
    gap: 14px;
    padding: 18px 22px;
    background: rgba(12, 15, 24, 0.85);
    backdrop-filter: blur(8px);
    justify-content: center;
}

.scan-capture-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 160px;
    background: white;
    color: var(--ink);
    font-weight: 900;
    border: none;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}

.scan-capture-btn:hover {
    background: var(--blue);
    color: white;
}

.scan-shutter {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.4), 0 0 0 5px currentColor;
    flex-shrink: 0;
}

.scan-camera-cancel {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: white;
}

.scan-camera-cancel:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.45);
    color: white;
}

/* Adjust workspace */
.scan-phase-adjust {
    padding: 18px 18px 28px;
}

.scan-workspace {
    display: grid;
    grid-template-columns: 1fr 290px;
    gap: 18px;
    align-items: start;
}

.scan-sidebar {
    display: grid;
    gap: 16px;
}

.scan-canvas-wrap {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #0c0f18;
    cursor: crosshair;
    touch-action: none;
    min-height: min(60vh, 520px);
    display: flex;
    flex-direction: column;
}

.scan-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
    flex: 1;
    touch-action: none;
}

.scan-canvas-hint {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    padding: 6px 14px;
    background: rgba(12, 15, 24, 0.72);
    backdrop-filter: blur(6px);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 12px;
    font-weight: 700;
    pointer-events: none;
    transition: opacity 300ms var(--ease);
}

.scan-canvas-wrap.is-dragging .scan-canvas-hint {
    opacity: 0;
}

.scan-control-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
}

.scan-preview-card {
    display: grid;
    gap: 10px;
}

.scan-preview-label {
    font-size: 13px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.scan-preview-canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    background: #f5f8ff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.scan-filter-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.scan-rotate-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(92px, 1fr));
    gap: 8px;
}

.scan-no-crop-control {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.scan-no-crop-control input {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    cursor: pointer;
}

.scan-no-crop-hint {
    margin: 6px 0 0;
}

.scan-canvas-wrap.is-no-crop {
    cursor: default;
}

.scan-filter-btn {
    display: grid;
    place-items: center;
    min-height: 40px;
    border: 1px solid #dbe3f0;
    border-radius: var(--radius-sm);
    background: white;
    color: var(--ink-soft);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 150ms var(--ease), background 150ms var(--ease), color 150ms var(--ease), box-shadow 150ms var(--ease);
}

.scan-filter-btn:hover {
    border-color: #bcc8de;
    background: var(--soft);
    color: var(--ink);
}

.scan-filter-btn.is-active {
    border-color: var(--blue);
    background: var(--blue-soft);
    color: var(--blue);
    box-shadow: inset 0 0 0 1px var(--blue);
}

.scan-manual-filters {
    display: grid;
    gap: 12px;
}

.scan-range-control {
    display: grid;
    grid-template-columns: 84px minmax(120px, 1fr) 46px;
    gap: 10px;
    align-items: center;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 800;
}

.scan-range-control input {
    width: 100%;
    accent-color: var(--blue);
}

.scan-range-control output {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-align: right;
}

.scan-sidebar-actions {
    display: grid;
    gap: 10px;
}

/* Pages */
.scan-phase-pages {
    padding: 24px 28px;
}

.scan-pages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.scan-pages-header strong {
    font-size: 16px;
    letter-spacing: -0.01em;
}

.scan-pages-header .scan-no-crop-all {
    margin-left: auto;
    flex: 0 0 auto;
}

.scan-batch-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 18px;
}

.scan-batch-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.scan-batch-filter .control-label {
    margin: 0;
}

.scan-batch-filter .scan-filter-row {
    grid-template-columns: repeat(4, minmax(64px, 1fr));
}

.scan-page-strip.is-reprocessing {
    opacity: 0.55;
    pointer-events: none;
}

.scan-upload-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.scan-upload-progress-track {
    flex: 1;
    height: 8px;
    border-radius: 999px;
    background: var(--line);
    overflow: hidden;
}

.scan-upload-progress-bar {
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: var(--accent, #3446ff);
    transition: width 200ms var(--ease);
}

.scan-upload-progress .form-note {
    flex: 0 0 auto;
    margin: 0;
}

.scan-page-strip {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 22px;
    min-height: 148px;
    scrollbar-width: thin;
    scrollbar-color: #c8d3e8 transparent;
}

.scan-page-strip::-webkit-scrollbar {
    height: 4px;
}

.scan-page-strip::-webkit-scrollbar-track {
    background: transparent;
}

.scan-page-strip::-webkit-scrollbar-thumb {
    background: #c8d3e8;
    border-radius: 2px;
}

.scan-page-thumb-wrap {
    flex: 0 0 auto;
    position: relative;
    width: 88px;
    animation: scan-page-in 240ms var(--ease);
    cursor: pointer;
}

.scan-page-thumb-wrap:focus-visible {
    outline: 3px solid rgba(52, 70, 255, 0.42);
    outline-offset: 4px;
}

@keyframes scan-page-in {
    from { opacity: 0; transform: scale(0.88) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.scan-page-thumb {
    display: block;
    width: 88px;
    height: 118px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: white;
    box-shadow: var(--shadow-sm);
}

.scan-page-number {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 23, 51, 0.68);
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 4px;
    pointer-events: none;
    white-space: nowrap;
}

.scan-page-remove {
    position: absolute;
    top: -7px;
    right: -7px;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 50%;
    background: #e8102a;
    color: white;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    line-height: 1;
    box-shadow: 0 3px 8px rgba(232, 16, 42, 0.45);
    transition: transform 150ms var(--ease), background 150ms var(--ease);
}

.scan-page-remove:hover {
    transform: scale(1.15);
    background: #c00b22;
}

.scan-bottom-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
}

.scan-add-more-label {
    position: relative;
    cursor: pointer;
}

@media (max-width: 860px) {
    .scan-workspace {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .scan-phase {
        padding: 24px 20px;
    }

    .scan-phase-adjust {
        padding: 12px 12px 24px;
    }

    .scan-canvas-wrap {
        min-height: min(55vh, 480px);
    }

    .scan-range-control {
        grid-template-columns: 78px minmax(110px, 1fr) 44px;
    }

    .scan-landing-options {
        grid-template-columns: 1fr;
    }

    .scan-source-btn {
        place-items: center;
        min-height: 150px;
        padding: 24px 18px;
    }

    .scan-source-btn > * {
        min-width: 0;
    }

    .scan-phase-camera {
        padding: 12px;
    }

    .scan-camera-wrap {
        padding-bottom: 104px;
    }

    .scan-camera-video {
        max-height: 380px;
    }

    .scan-camera-overlay {
        bottom: 104px;
        z-index: 1;
    }

    .scan-camera-controls {
        position: absolute;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 4;
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px;
    }

    .scan-capture-btn,
    .scan-camera-cancel,
    .scan-bottom-bar,
    .scan-bottom-bar .btn {
        width: 100%;
        min-width: 0;
    }
}

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

/* ── New tool editors: redact / sign / image editor ───────────────── */
.flash-note {
    border: 1px solid #d8c46a;
    background: #fdf7e2;
    color: #6b5a16;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.9rem;
}

.control-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pdf-canvas-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    max-height: 640px;
    overflow-y: auto;
    padding: 12px;
    background: #f3f4f8;
    border-radius: 12px;
}

.pdf-page {
    position: relative;
    box-shadow: 0 2px 10px rgba(17, 25, 58, 0.16);
    background: #fff;
}

.pdf-page canvas {
    display: block;
    width: 100%;
    height: auto;
}

.pdf-page-overlay {
    position: absolute;
    inset: 0;
    cursor: crosshair;
    touch-action: none;
}

.pdf-box {
    position: absolute;
    box-sizing: border-box;
    cursor: pointer;
}

.pdf-box-redact {
    background: rgba(17, 17, 17, 0.85);
    border: 1px solid #000;
}

.pdf-box-sign,
.pdf-box-crop {
    border: 2px dashed #4f6bed;
    background: rgba(79, 107, 237, 0.12);
}

.pdf-box-signed {
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-color: rgba(79, 107, 237, 0.6);
}

/* PDF editor */
/* When a PDF is loaded the panel breaks out to the full tool width so there is
   room to actually write on the page. */
.tool-hero > .upload-panel.is-editing {
    width: 100%;
    max-width: none;
}

.pdf-editor-stage {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.pdf-editor-stage[hidden] {
    display: none;
}

.pdf-editor-toolbar {
    position: sticky;
    top: 76px;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #e3e6f0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(17, 25, 58, 0.08);
    width: 100%;
    margin: 12px auto 0;
}

.pdf-editor-toolbar [hidden] {
    display: none !important;
}

.pdf-editor-tool-menu,
.pdf-editor-panel-group {
    position: relative;
    min-width: 132px;
}

.pdf-editor-tool-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 38px;
    border: 1px solid #d3d7e6;
    background: #fff;
    padding: 6px 10px;
    border-radius: 8px;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 800;
    color: #232a45;
    cursor: pointer;
}

.pdf-editor-tool-trigger:hover,
.pdf-editor-tool-trigger[aria-expanded="true"] {
    border-color: #4f6bed;
    background: #eef1ff;
    color: #2635d6;
}

.pdf-editor-tool-trigger-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-editor-tool-trigger-caret {
    font-size: 1rem;
    line-height: 1;
}

.pdf-editor-tool-list {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 20;
    display: none;
    min-width: 158px;
    padding: 4px;
    border: 1px solid #d7dcef;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(17, 25, 58, 0.16);
}

.pdf-editor-tool-list.is-open {
    display: grid;
    gap: 3px;
}

.pdf-editor-mode {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 38px;
    border: 0;
    background: transparent;
    padding: 6px 10px;
    border-radius: 8px;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    color: #444a63;
    cursor: pointer;
}

.pdf-editor-mode:hover {
    background: #e7eaf3;
}

.pdf-editor-mode.is-active {
    background: #4f6bed;
    color: #fff;
}

.pdf-editor-mode-glyph {
    font-size: 1.05rem;
    line-height: 1;
}

.pdf-editor-sep {
    width: 1px;
    align-self: stretch;
    margin: 2px 2px;
    background: #e3e6f0;
}

.pdf-editor-panel-group {
    display: contents;
}

.pdf-editor-panel-toggle {
    display: none;
    min-width: 100%;
}

.pdf-editor-panel {
    display: contents;
}

.pdf-editor-spacer {
    flex: 1 1 auto;
}

.pdf-editor-field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #444a63;
}

.pdf-editor-field-label {
    white-space: nowrap;
}

.pdf-editor-select {
    height: 38px;
    padding: 0 28px 0 10px;
    border: 1px solid #d3d7e6;
    border-radius: 8px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23697089' d='M2 4l4 4 4-4z'/%3E%3C/svg%3E") no-repeat right 9px center;
    font: inherit;
    font-size: 0.85rem;
    color: #232a45;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.pdf-editor-font-select {
    min-width: 118px;
}

.pdf-editor-select:focus-visible {
    outline: 2px solid var(--blue, #4f6bed);
    outline-offset: 1px;
}

.pdf-editor-field input[type="color"] {
    width: 40px;
    height: 38px;
    padding: 2px;
    border: 1px solid #d3d7e6;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.pdf-editor-field input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.pdf-editor-field input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 5px;
}

.pdf-editor-style {
    gap: 4px;
}

.pdf-editor-toggle {
    width: 38px;
    height: 38px;
    border: 1px solid #d3d7e6;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 0.95rem;
    color: #333;
}

.pdf-editor-toggle.is-active {
    background: #4f6bed;
    border-color: #4f6bed;
    color: #fff;
}

.pdf-editor-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid #d3d7e6;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1;
    color: #333;
}

.pdf-editor-icon-btn:hover {
    background: #f3f4f8;
}

.pdf-editor-zoom {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pdf-editor-zoom-level {
    min-width: 46px;
    text-align: center;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    color: #444a63;
}

.pdf-editor-autosave {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 92px;
    min-height: 1.2em;
    color: #5b647c;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: right;
}

/* Always keep the autosave slot present so status text appearing/clearing
   never reflows the toolbar and pushes the document down. */
.pdf-editor-autosave:empty::after {
    content: '\00a0';
}

.pdf-editor-restore {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #d7dcef;
    border-radius: 10px;
    background: #f8faff;
}

.pdf-editor-restore[hidden] {
    display: none;
}

.pdf-editor-restore > div:first-child {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.pdf-editor-restore strong {
    font-size: 0.9rem;
}

.pdf-editor-restore span {
    color: #5b647c;
    font-size: 0.82rem;
}

.pdf-editor-restore-actions {
    display: inline-flex;
    gap: 8px;
    flex: 0 0 auto;
}

.pdf-editor-preview {
    max-height: min(72vh, 900px);
}

.pdf-editor-preview .pdf-page {
    container-type: inline-size;
    max-width: none;
    flex: 0 0 auto;
}

.pdf-editor-ink {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.pdf-editor-item {
    position: absolute;
    box-sizing: border-box;
    border: 1px solid transparent;
    touch-action: none;
}

.pdf-editor-item.is-selected {
    border-color: #4f6bed;
    box-shadow: 0 0 0 2px rgba(79, 107, 237, 0.25);
}

.pdf-editor-text-body {
    min-width: 24px;
    min-height: 1em;
    padding: 1px 3px;
    outline: none;
    line-height: 1.2;
    white-space: pre-wrap;
    word-break: break-word;
    cursor: text;
}

.pdf-editor-image {
    cursor: move;
}

.pdf-editor-image img {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
    user-select: none;
}

.pdf-editor-stamp {
    cursor: move;
}

.pdf-editor-stamp svg {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Drawing/placing modes route all pointers to the overlay. */
.pdf-page-overlay.is-drawing .pdf-editor-item,
.pdf-page-overlay.is-placing .pdf-editor-item {
    pointer-events: none;
}

.pdf-page-overlay.is-drawing,
.pdf-page-overlay.is-placing {
    cursor: crosshair;
}

.pdf-editor-handle {
    position: absolute;
    width: 16px;
    height: 16px;
    background: #4f6bed;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    opacity: 0;
    touch-action: none;
}

.pdf-editor-item.is-selected .pdf-editor-handle {
    opacity: 1;
}

.pdf-editor-handle-move {
    top: -9px;
    left: -9px;
    cursor: move;
}

.pdf-editor-handle-resize {
    bottom: -9px;
    right: -9px;
    cursor: nwse-resize;
}

/* Fullscreen: keep the editor below the site header/menu area. */
body.pdf-editor-fullscreen-lock {
    overflow: hidden;
}

.upload-panel.is-fullscreen {
    position: fixed;
    inset: 78px 0 0;
    z-index: 900;
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: 0;
    padding: 10px;
    background: #eef1f8;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upload-panel.is-fullscreen .dropzone,
.upload-panel.is-fullscreen [data-pdf-editor-submit],
.upload-panel.is-fullscreen .carry-banner,
.upload-panel.is-fullscreen .flash-error {
    display: none;
}

.upload-panel.is-fullscreen .pdf-editor-stage {
    flex: 1 1 auto;
    min-height: 0;
}

.upload-panel.is-fullscreen .pdf-editor-toolbar {
    top: 12px;
}

.upload-panel.is-fullscreen .pdf-editor-preview {
    flex: 1 1 auto;
    max-height: none;
}

/* Desktop: the toolbar scrolls with the document (no sticky) when not in
   fullscreen; in fullscreen it stays pinned but is capped to the site-header
   content width (56px side gutters) instead of spanning edge to edge. */
@media (min-width: 641px) {
    .pdf-editor-toolbar {
        position: static;
        top: auto;
    }

    .upload-panel.is-fullscreen .pdf-editor-toolbar {
        position: sticky;
        top: 12px;
        width: auto;
        max-width: calc(100vw - 112px);
        margin-inline: auto;
    }
}

@media (max-width: 640px) {
    .pdf-editor-toolbar {
        top: 66px;
    }

    .upload-panel.is-fullscreen {
        inset: 58px 0 0;
    }

    .pdf-editor-toolbar {
        gap: 6px;
        padding: 7px 8px;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: start;
        width: 100%;
        margin-top: 0;
    }

    .pdf-editor-tool-menu {
        grid-column: 1 / -1;
        width: 100%;
    }

    .pdf-editor-panel-group {
        display: block;
        position: relative;
        min-width: 0;
        width: 100%;
    }

    .pdf-editor-tool-trigger {
        gap: 5px;
        min-height: 44px;
        padding-inline: 6px;
        font-size: 0.8rem;
    }

    .pdf-editor-tool-list {
        min-width: min(260px, calc(100vw - 44px));
        width: min(260px, calc(100vw - 44px));
    }

    .pdf-editor-panel {
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        z-index: 20;
        display: none;
        min-width: min(260px, calc(100vw - 44px));
        width: min(260px, calc(100vw - 44px));
        border: 1px solid #d7dcef;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 12px 28px rgba(17, 25, 58, 0.16);
    }

    .pdf-editor-panel-group-end .pdf-editor-panel {
        right: 0;
        left: auto;
    }

    .pdf-editor-mode {
        min-height: 44px;
        padding: 6px 8px;
    }

    .pdf-editor-panel-toggle {
        display: inline-flex;
    }

    .pdf-editor-panel-toggle[aria-expanded="true"] {
        border-color: #4f6bed;
        background: #eef1ff;
        color: #2635d6;
    }

    .pdf-editor-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        padding: 7px;
    }

    .pdf-editor-panel.is-open {
        display: grid;
    }

    .pdf-editor-field,
    .pdf-editor-style,
    .pdf-editor-zoom {
        min-height: 44px;
    }

    .pdf-editor-field {
        justify-content: center;
        width: 100%;
    }

    .pdf-editor-select {
        height: 44px;
        width: 100%;
    }

    .pdf-editor-font-select {
        max-width: none;
        min-width: 108px;
    }

    .pdf-editor-icon-btn,
    .pdf-editor-toggle {
        width: 44px;
        height: 44px;
    }

    .pdf-editor-style {
        grid-column: 1 / -1;
        justify-content: center;
        width: 100%;
    }

    .pdf-editor-style .pdf-editor-select {
        width: min(150px, 100%);
    }

    .pdf-editor-toolbar > .pdf-editor-icon-btn {
        width: 100%;
    }

    .pdf-editor-autosave {
        grid-column: 1 / -1;
        min-width: 0;
        text-align: left;
    }

    .pdf-editor-restore {
        display: grid;
        gap: 10px;
    }

    .pdf-editor-restore-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .pdf-editor-restore-actions .btn {
        justify-content: center;
        min-height: 44px;
        width: 100%;
    }

    .pdf-editor-spacer {
        display: none;
    }

    .pdf-editor-field-label {
        display: none;
    }

    .pdf-editor-sep {
        display: none;
    }

    .pdf-editor-preview {
        padding: 6px;
    }
}

.signature-pad {
    width: 100%;
    max-width: 600px;
    height: auto;
    aspect-ratio: 3 / 1;
    border: 1px dashed #aab;
    border-radius: 10px;
    background: #fff;
    touch-action: none;
}

.signature-pad.has-upload-preview {
    border-style: solid;
}

.signature-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.image-edit-stage {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    background: #f3f4f8;
    border-radius: 12px;
    min-height: 280px;
    overflow: hidden;
}

.image-edit-canvas {
    position: relative;
    display: block;
    max-width: 100%;
    max-height: 560px;
    touch-action: none;
}

.image-edit-canvas img {
    display: block;
    position: absolute;
    left: 50%;
    top: 50%;
    max-width: none;
    max-height: none;
    height: auto;
    transform-origin: center;
}

.image-edit-canvas.is-active {
    cursor: crosshair;
}

.video-gif-preview {
    display: grid;
    gap: 16px;
}

.video-gif-window {
    width: 100%;
    max-height: 360px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #081120;
}

.video-gif-window video {
    display: block;
    width: 100%;
    max-height: 360px;
    border-radius: inherit;
    background: #081120;
}

.video-gif-range-grid {
    display: grid;
    gap: 14px;
}

.video-gif-range-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 700;
}

.video-gif-range-label output {
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.video-gif-summary {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}
