@font-face {
    font-family: Manrope;
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("/fonts/manrope-cyrillic.woff2") format("woff2");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: Manrope;
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("/fonts/manrope-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: Manrope;
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("/fonts/manrope-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --bg: #f3f6f5;
    --surface: #ffffff;
    --surface-muted: #eef3f1;
    --text: #17211f;
    --text-muted: #5c6a66;
    --brand: #0e6b62;
    --brand-hover: #0b564f;
    --brand-soft: #e7f3f1;
    --border: #e1e8e5;
    --warning: #8a5a24;
    --warning-bg: #fbf6ee;
    --danger: #8d3030;
    --danger-bg: #f8f1f1;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --header: 56px;
    --shadow: 0 1px 2px rgba(23, 33, 31, 0.04);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Manrope, "Segoe UI", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

button, input { font-family: inherit; }

.skip {
    position: absolute;
    left: 12px;
    top: -40px;
    background: var(--surface);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    z-index: 5;
}
.skip:focus { top: 8px; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.shell {
    width: min(1180px, calc(100% - 40px));
    margin-inline: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 4;
    height: var(--header);
    background: var(--bg);
}

.top {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.wordmark {
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.045em;
}

.dot { color: var(--brand); }

.help {
    width: 32px;
    height: 32px;
    margin-left: auto;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 650;
    font-weight: 600;
}

.help:focus-visible,
.back:focus-visible,
.btn:focus-visible,
.btn-quiet:focus-visible,
.another:focus-visible,
.surface:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
}

#again-wrap[hidden] { display: none; }

.back {
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.back:hover { background: var(--surface-muted); }

body.is-result .help,
body.is-working .help,
body.is-error .help { display: none; }

.hero {
    display: flex;
    flex-direction: column;
    padding-top: 8px;
}

h1 {
    margin: 0;
    font-size: 2.125rem;
    line-height: 1.15;
    letter-spacing: -0.03em;
    font-weight: 650;
}

.lead {
    margin: 12px 0 0;
    max-width: 34em;
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.45;
}

#uploader { margin-top: 24px; }

.surface {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 16px 16px;
    text-align: center;
}

.surface.is-over {
    border-color: var(--brand);
    background: #f4fbfa;
}

.sheet-stack {
    position: relative;
    width: 120px;
    height: 148px;
    margin: 2px auto 0;
}

.sheet-stack::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 8px;
    width: 120px;
    height: 148px;
    background: #fbfcfc;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.sheet {
    position: relative;
    z-index: 1;
    width: 120px;
    height: 148px;
    padding: 22px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fff;
    border: 1px solid #d5deda;
    border-radius: 8px;
    overflow: hidden;
}

.ln {
    display: block;
    position: relative;
    height: 4px;
    width: 100%;
    border-radius: 2px;
    background: #d5deda;
}

.ln.w2 { width: 88%; }
.ln.w3 { width: 76%; }
.ln.w4 { width: 62%; }
.ln.mid { width: 64%; }
.ln.short { width: 46%; }

.ln.mute { opacity: 0.4; }

.ln.mute::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 1.5px;
    height: 1px;
    background: #7f918c;
}

.ln.key {
    height: 5px;
    background: var(--brand);
}

.ear {
    position: absolute;
    top: 0;
    right: 0;
    width: 14px;
    height: 14px;
    background: linear-gradient(225deg, var(--surface-muted) 50%, #dfe7e4 50%);
}

.sheet-home .ln.mute { animation: hush 5s ease-in-out infinite; }
.sheet-scan .ln.mute { animation: hush 2.6s ease-in-out infinite; }
.sheet-scan .ln.key { animation: none; }

.scan {
    position: absolute;
    left: 10px;
    right: 10px;
    height: 2px;
    border-radius: 2px;
    background: var(--brand);
    box-shadow: 0 8px 12px rgba(14, 107, 98, 0.18);
    animation: scan 1.9s ease-in-out infinite;
}

@keyframes hush {
    0%, 20% { opacity: 1; }
    48%, 76% { opacity: 0.22; }
    100% { opacity: 1; }
}

@keyframes lift {
    0%, 100% { opacity: 0.45; }
    40%, 70% { opacity: 1; }
}

@keyframes scan {
    0% { top: 18px; opacity: 0; }
    14% { opacity: 1; }
    86% { opacity: 1; }
    100% { top: calc(100% - 18px); opacity: 0; }
}

.surface-title {
    margin: 16px 0 0;
    font-size: 16px;
    font-weight: 650;
    font-weight: 600;
}

.meta {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 13px;
}

.btn {
    width: 100%;
    height: 54px;
    margin-top: 16px;
    border: 0;
    border-radius: var(--radius-md);
    background: var(--brand);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.btn:hover,
.btn:active { background: var(--brand-hover); }

.btn:active { transform: translateY(1px); }

.btn-quiet {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 44px;
    margin-top: 4px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.btn-quiet svg {
    width: 18px;
    height: 18px;
}

.btn-quiet:hover { background: rgba(23, 33, 31, 0.04); }

.trust-block { margin-top: 16px; }

.trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    font-size: 14px;
}

.trust svg {
    width: 16px;
    height: 16px;
    color: var(--brand);
    flex: none;
}

.trust-sub {
    margin: 2px 0 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.error {
    margin-top: 16px;
    padding: 14px 16px;
    background: var(--danger-bg);
    border-radius: var(--radius-md);
    font-size: 15px;
    line-height: 1.45;
}

.error:focus { outline: none; }

.error p { margin: 0; }

.error .request-id { margin-top: 8px; }

#error[hidden],
#progress[hidden],
#result[hidden] { display: none !important; }

.fit {
    margin: 24px 0 0;
    max-width: 38em;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.45;
}

.demo { margin-top: 48px; max-width: 440px; }

.demo h2 {
    margin: 0 0 16px;
    font-size: 22px;
    line-height: 1.2;
    letter-spacing: -0.03em;
    font-weight: 700;
}

.demo-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 16px 8px;
}

.demo-type {
    margin: 0 0 12px;
    color: var(--text-muted);
    font-size: 13px;
}

.page-lines { display: flex; flex-direction: column; gap: 8px; }

.page-lines span {
    display: block;
    position: relative;
    height: 5px;
    width: 100%;
    border-radius: 3px;
    background: #d5deda;
}

.page-lines .dim { width: 92%; opacity: 0.45; }
.page-lines .short { width: 58%; opacity: 0.45; }

.page-lines .dim::after,
.page-lines .short::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 2px;
    height: 1px;
    background: #8b9c97;
}

.turn {
    margin: 14px 0 4px;
    color: var(--brand);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.demo-facts {
    list-style: none;
    margin: 10px 0 0;
    padding: 2px 0 2px 12px;
    border-left: 3px solid var(--brand);
}

.demo-facts li {
    padding: 10px 0;
    border-top: 1px solid var(--border);
}

.demo-facts strong {
    display: block;
    font-size: 18px;
    letter-spacing: -0.02em;
    font-weight: 700;
}

.demo-facts span {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 13px;
}

.caption {
    margin: 10px 0 0;
    color: var(--text-muted);
    font-size: 13px;
}

#progress {
    text-align: center;
    padding: 8px 0 24px;
}

.progress-title {
    margin: 20px 0 0;
    font-size: 22px;
    letter-spacing: -0.03em;
    font-weight: 700;
}

.progress-note {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 15px;
}

.steps {
    list-style: none;
    width: min(280px, 100%);
    margin: 24px auto 0;
    padding: 0;
    text-align: left;
}

.steps li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    color: var(--text-muted);
    font-size: 15px;
}

.steps li[data-state="done"],
.steps li[data-state="active"] { color: var(--text); }

.steps li[data-state="active"] { font-weight: 600; }

.mark {
    width: 18px;
    height: 18px;
    border: 1.5px solid #cfd8d4;
    border-radius: 50%;
    flex: none;
    background: var(--surface);
    display: grid;
    place-items: center;
}

.mark svg { display: none; width: 11px; height: 11px; }

.steps li[data-state="done"] .mark {
    border-color: var(--brand);
    background: var(--brand);
}

.steps li[data-state="done"] .mark svg { display: block; }

.steps li[data-state="active"] .mark {
    border-color: var(--brand);
    box-shadow: inset 0 0 0 4px var(--brand);
}

.file-meta {
    margin: 20px 0 0;
    color: var(--text-muted);
    font-size: 14px;
}

#file-size:not(:empty)::before { content: " · "; }

#result {
    max-width: 680px;
    margin-inline: auto;
    padding: 4px 0 8px;
    scroll-margin-top: 72px;
}

#result:focus { outline: none; }

.doc-type {
    margin: 4px 0 0;
    font-size: 26px;
    line-height: 1.15;
    letter-spacing: -0.03em;
    font-weight: 700;
}

.doc-issuer {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 15px;
}

.confidence {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 13px;
}

.summary {
    margin-top: 20px;
    padding: 14px 16px 16px;
    background: var(--brand-soft);
    border-left: 3px solid var(--brand);
    border-radius: 0 12px 12px 0;
}

.kicker {
    margin: 0;
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.summary-amount {
    margin: 8px 0 0;
    font-size: 32px;
    line-height: 1.1;
    letter-spacing: -0.03em;
    font-weight: 700;
}

.summary .hint { margin-top: 2px; }

.summary-text {
    margin: 10px 0 0;
    font-size: 17px;
    line-height: 1.45;
}

.block { margin-top: 28px; }

.block h2 {
    margin: 0 0 10px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.block > p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
}

.facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.facts li:nth-child(even) {
    padding-left: 16px;
    border-left: 1px solid var(--border);
}

.facts li:nth-child(odd) { padding-right: 12px; }

.figure-value {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-weight: 700;
}

.figure-value.is-long { font-size: 16px; }

.hint {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.35;
}

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

.actions li {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 4px 8px;
    padding: 14px 0;
    border-top: 1px solid var(--border);
}

.actions li:last-child { border-bottom: 1px solid var(--border); }

.num {
    color: var(--brand);
    font-weight: 700;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    padding-top: 1px;
}

.action-title {
    margin: 0;
    font-size: 16px;
    font-weight: 650;
    font-weight: 600;
}

.actions p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.45;
}

.actions .action-title { color: var(--text); }

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

.lines.warn { display: flex; flex-direction: column; gap: 8px; }

.lines.warn li {
    padding: 12px 14px;
    background: var(--warning-bg);
    border-radius: 12px;
    color: var(--text);
    font-size: 15px;
    line-height: 1.45;
}

.lines.gaps li {
    padding: 10px 0;
    border-top: 1px solid var(--border);
    font-size: 15px;
    line-height: 1.45;
}

.request-id {
    margin: 16px 0 0;
    color: var(--text-muted);
    font-size: 12px;
}

.another {
    margin-top: 20px;
    padding: 8px 0;
    border: 0;
    background: none;
    color: var(--brand);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.site-footer {
    margin-top: 48px;
    padding: 16px 0 28px;
    border-top: 1px solid var(--border);
}

.footer-brand,
.fine {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.45;
}

.fine { margin-top: 4px; }

body.is-working .hero,
body.is-working .fit,
body.is-working .demo,
body.is-working .site-footer,
body.is-result .hero,
body.is-result .fit,
body.is-result .demo,
body.is-error .hero,
body.is-error .fit,
body.is-error .demo,
body.is-error .site-footer { display: none; }

body.is-working #progress {
    min-height: calc(100dvh - var(--header));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-bottom: 48px;
}

body.is-error main {
    min-height: calc(100dvh - var(--header));
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 32px;
}

body.is-error #error {
    width: min(420px, 100%);
    margin: 0 auto;
}

@media (min-width: 960px) {
    .shell { width: min(1180px, calc(100% - 64px)); }

    .hero {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
        grid-template-areas:
            "intro upload"
            "trust upload";
        column-gap: 48px;
        row-gap: 16px;
        align-items: center;
        padding: 36px 0 8px;
    }

    .intro { grid-area: intro; }
    #uploader { grid-area: upload; margin-top: 0; }
    .trust-block {
        grid-area: trust;
        margin-top: 8px;
        align-self: start;
    }

    h1 { font-size: 2.5rem; max-width: 11em; }

    .trust,
    .trust-sub { justify-content: flex-start; text-align: left; }

    .surface { padding: 28px 24px 20px; }

    .sheet-stack,
    .sheet,
    .sheet-stack::before {
        width: 140px;
        height: 172px;
    }

    .sheet { padding-top: 22px; gap: 8px; }

    .fit { margin-top: 32px; }
    .demo { margin-top: 48px; }
}

@media (min-width: 700px) and (max-width: 959px) {
    .hero,
    .fit,
    .demo {
        max-width: 480px;
        margin-inline: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ln,
    .scan { animation: none !important; }
    .ln.key { background: var(--brand); opacity: 1; }
    .ln.mute { opacity: 0.35; }
    .btn:active { transform: none; }
}
