:root {
    --ink: #172033;
    --muted: #667085;
    --line: #d8dee9;
    --paper: #ffffff;
    --canvas: #f4f7fb;
    --blue: #2457d6;
    --blue-dark: #193e9f;
    --blue-soft: #edf3ff;
    --green: #087a55;
    --green-soft: #e9f8f1;
    --amber: #9a5a00;
    --amber-soft: #fff6df;
    --red: #b42318;
    --red-soft: #fff0ee;
    --shadow: 0 18px 55px rgba(27, 39, 66, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: linear-gradient(180deg, #eef4ff 0, #f8faff 26rem, var(--canvas) 55rem);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

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

button,
select,
input[type="checkbox"],
input[type="radio"] {
    cursor: pointer;
}

a {
    color: var(--blue);
}

.hidden {
    display: none !important;
}

.site-header {
    width: min(1180px, calc(100% - 32px));
    height: 70px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: inline-flex;
}

.brand img {
    width: auto;
    height: 32px;
}

.header-note {
    color: var(--blue);
    background: var(--blue-soft);
    border: 1px solid #cad9ff;
    border-radius: 999px;
    padding: 5px 11px;
    font-size: 0.82rem;
    font-weight: 700;
}

.hero {
    width: min(860px, calc(100% - 32px));
    margin: 54px auto 42px;
    text-align: center;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--blue);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero h1 {
    margin: 0;
    font-size: clamp(2.25rem, 5.5vw, 4.35rem);
    line-height: 1.03;
    letter-spacing: -0.045em;
}

.hero-copy {
    max-width: 720px;
    margin: 22px auto 18px;
    color: var(--muted);
    font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.privacy-promise {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--green);
    background: var(--green-soft);
    border: 1px solid #bfe6d7;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: 650;
}

.app-shell {
    width: min(1240px, calc(100% - 24px));
    margin: 0 auto;
}

.restore-banner {
    margin-bottom: 14px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--amber-soft);
    border: 1px solid #efd59b;
    border-radius: 14px;
}

.restore-banner span {
    display: block;
    color: #74501b;
    font-size: 0.9rem;
}

.job-summary {
    min-height: 54px;
    padding: 11px 16px;
    display: flex;
    align-items: center;
    gap: 18px;
    color: #3e4c64;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 15px 15px 0 0;
    box-shadow: 0 8px 25px rgba(27, 39, 66, 0.06);
    font-size: 0.9rem;
}

.job-summary > :nth-last-child(2) {
    margin-left: auto;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.78rem;
    font-weight: 800;
}

.status-waiting {
    color: var(--amber);
    background: var(--amber-soft);
}

.status-ready {
    color: var(--green);
    background: var(--green-soft);
}

.status-error {
    color: var(--red);
    background: var(--red-soft);
}

.workbench {
    display: grid;
    grid-template-columns: minmax(0, 1.03fr) minmax(420px, 0.97fr);
    align-items: start;
    gap: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 18px 18px;
    box-shadow: var(--shadow);
    overflow: clip;
}

.decision-stack {
    min-width: 0;
    padding: 22px;
}

.decision-card {
    margin-bottom: 12px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 13px;
    overflow: hidden;
}

.decision-card.active {
    border-color: #9db8f7;
    box-shadow: 0 0 0 3px rgba(36, 87, 214, 0.08);
}

.decision-card.complete .step-number {
    color: #fff;
    background: var(--green);
}

.decision-card.locked {
    opacity: 0.67;
}

.decision-card.locked .card-body {
    display: none;
}

.decision-card.complete:not(.active) .card-body {
    display: none;
}

.card-heading {
    min-height: 78px;
    padding: 15px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.card-heading h2 {
    margin: 1px 0 2px;
    font-size: 1.03rem;
}

.card-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.step-number {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    display: grid;
    place-items: center;
    color: var(--blue);
    background: var(--blue-soft);
    border-radius: 50%;
    font-size: 0.82rem;
    font-weight: 800;
}

.edit-button {
    margin-left: auto;
    color: var(--blue);
    background: transparent;
    border: 0;
    font-size: 0.82rem;
    font-weight: 800;
}

.card-body {
    padding: 0 16px 18px 56px;
}

label,
legend {
    color: #344054;
    font-size: 0.85rem;
    font-weight: 700;
}

textarea,
select,
input[type="number"] {
    width: 100%;
    margin-top: 6px;
    padding: 10px 11px;
    color: var(--ink);
    background: #fff;
    border: 1px solid #bdc6d4;
    border-radius: 8px;
}

textarea {
    resize: vertical;
    min-height: 150px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.87rem;
}

textarea:focus,
select:focus,
input:focus,
button:focus-visible {
    outline: 3px solid rgba(36, 87, 214, 0.2);
    outline-offset: 2px;
}

.input-actions,
.button-row {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.input-actions {
    justify-content: space-between;
}

.button {
    min-height: 42px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 800;
}

.button-primary {
    color: #fff;
    background: var(--blue);
}

.button-primary:hover {
    background: var(--blue-dark);
}

.button-secondary {
    color: var(--blue);
    background: var(--blue-soft);
    border-color: #c9d7fb;
}

.button-quiet {
    color: #46556d;
    background: #fff;
    border-color: var(--line);
}

.button-large {
    width: 100%;
    min-height: 50px;
}

.file-button input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.local-note,
.body-copy {
    color: var(--muted);
    font-size: 0.82rem;
}

.local-note {
    margin: 12px 0 0;
}

.text-button {
    padding: 0;
    color: var(--blue);
    background: none;
    border: 0;
    text-decoration: underline;
}

.row-count-line {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.check-label,
.radio-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 600;
}

.sample-table-wrap {
    max-height: 190px;
    margin-bottom: 14px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.sample-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.sample-table th,
.sample-table td {
    padding: 7px 9px;
    border-bottom: 1px solid #edf0f5;
    text-align: left;
    white-space: nowrap;
}

.sample-table th {
    position: sticky;
    top: 0;
    background: #f7f9fc;
}

.field-grid {
    margin: 12px 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.field-grid.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

fieldset {
    margin: 0;
    padding: 8px 11px 10px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.custom-fields {
    margin-top: 12px;
    padding: 12px;
    background: #f8faff;
    border: 1px solid #dce5f7;
    border-radius: 9px;
}

.issue-box,
.inline-error,
.help-box,
.print-contract {
    margin: 12px 0;
    padding: 11px 12px;
    border-radius: 9px;
    font-size: 0.85rem;
}

.issue-box {
    color: #704800;
    background: var(--amber-soft);
    border: 1px solid #edcf8e;
}

.issue-box.blocking,
.inline-error {
    color: var(--red);
    background: var(--red-soft);
    border: 1px solid #f1bdb7;
}

.issue-list {
    margin: 8px 0 0;
    padding-left: 20px;
}

.issue-row {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.placement-map {
    width: min(100%, 360px);
    margin: 14px auto;
    display: grid;
    gap: 5px;
}

.placement-cell {
    min-width: 0;
    aspect-ratio: 1.7;
    display: grid;
    place-items: center;
    color: #536078;
    background: #fff;
    border: 1px solid #aeb8c8;
    border-radius: 4px;
    font-size: 0.68rem;
}

.placement-cell.used {
    color: #8993a4;
    background: #dce1e9;
    text-decoration: line-through;
}

.placement-cell.selected {
    color: #fff;
    background: var(--blue);
    border-color: var(--blue);
}

.placement-cell.to-print {
    background: #dff4eb;
    border-color: #75b99e;
}

.capacity-message {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
}

.capacity-message.error {
    color: var(--red);
    font-weight: 700;
}

.help-box {
    color: #4d5565;
    background: #f5f7fa;
    border: 1px solid var(--line);
}

.print-contract {
    background: var(--green-soft);
    border: 1px solid #b9dfd0;
}

.print-contract ul {
    margin: 5px 0 0;
    padding-left: 20px;
}

.print-warning {
    color: #6f4c16;
    font-size: 0.83rem;
}

.proof-panel {
    min-width: 0;
    min-height: 720px;
    padding: 24px;
    position: sticky;
    top: 0;
    background: #edf2f9;
    border-left: 1px solid var(--line);
}

.proof-heading {
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.proof-heading h2 {
    margin: 0;
    font-size: 1.3rem;
}

.proof-toggle {
    display: none;
}

.proof-actions {
    display: flex;
    gap: 7px;
}

.proof-empty {
    padding: 50px 20px;
    color: var(--muted);
    text-align: center;
}

.empty-sheet {
    width: 180px;
    height: 235px;
    margin: 0 auto 18px;
    background:
        repeating-linear-gradient(0deg, transparent 0 20px, #e6ebf2 21px 22px),
        repeating-linear-gradient(90deg, transparent 0 50px, #e6ebf2 51px 52px),
        #fff;
    border: 1px solid #ccd4df;
    box-shadow: 0 12px 25px rgba(27, 39, 66, 0.11);
}

.sheet-preview-wrap {
    padding: 12px;
    overflow: auto;
    background: #dde5f0;
    border-radius: 12px;
}

.sheet-preview-wrap.zoomed .sheet-preview {
    width: 760px;
    max-width: none;
}

.sheet-preview {
    width: min(100%, 470px);
    aspect-ratio: var(--page-ratio, 0.707);
    margin: 0 auto;
    position: relative;
    background: #fff;
    box-shadow: 0 8px 22px rgba(27, 39, 66, 0.16);
}

.preview-label {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1%;
    padding: 1%;
    overflow: hidden;
    background: #fff;
    border: 1px dashed #b9c1ce;
}

.preview-label.used {
    background: repeating-linear-gradient(135deg, #e8ebf0 0 5px, #d9dee6 5px 10px);
}

.preview-label img {
    width: auto;
    max-width: 86%;
    max-height: 86%;
    image-rendering: pixelated;
}

.preview-label.with-text img {
    max-width: 76%;
    max-height: 70%;
}

.preview-text {
    max-width: 94%;
    width: 94%;
    overflow: hidden;
    color: #111;
    font-size: clamp(5px, 0.8vw, 9px);
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
}

.preview-label.fit-error {
    border: 2px solid var(--red);
    background: var(--red-soft);
}

.proof-facts {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.proof-fact {
    padding: 9px 10px;
    background: #fff;
    border: 1px solid #d4dce8;
    border-radius: 8px;
    font-size: 0.79rem;
}

.proof-fact strong {
    display: block;
    color: var(--ink);
}

.after-tool {
    width: min(860px, calc(100% - 32px));
    margin: 80px auto;
    padding: 38px;
    text-align: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
}

.mobile-download {
    display: none;
}

.seo-content {
    width: min(1080px, calc(100% - 32px));
    margin: 80px auto 0;
}

.seo-intro {
    max-width: 760px;
    margin-bottom: 28px;
}

.seo-intro h2,
.seo-grid h2,
.faq-section h2 {
    margin: 0 0 12px;
    font-size: clamp(1.65rem, 3vw, 2.35rem);
    line-height: 1.15;
}

.seo-intro p,
.seo-grid p,
.seo-grid li,
.faq-section p {
    color: var(--muted);
}

.seo-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.seo-steps article,
.seo-grid article,
.faq-section {
    padding: 24px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.seo-steps span {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--blue);
    border-radius: 50%;
    font-weight: 800;
}

.seo-steps h3 {
    margin: 14px 0 6px;
}

.seo-steps p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

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

.seo-grid ul {
    margin: 16px 0 0;
    padding-left: 20px;
}

.seo-grid li + li {
    margin-top: 8px;
}

.faq-section {
    margin-top: 18px;
}

.faq-section details {
    border-top: 1px solid var(--line);
    padding: 15px 0;
}

.faq-section summary {
    cursor: pointer;
    font-weight: 750;
}

.faq-section details p {
    margin-bottom: 0;
}

.after-tool h2 {
    margin-top: 0;
}

.after-tool p {
    color: var(--muted);
}

.after-tool .button {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

footer {
    padding: 30px 16px 45px;
    color: var(--muted);
    text-align: center;
    font-size: 0.83rem;
}

footer p {
    margin: 5px;
}

@media (max-width: 900px) {
    .job-summary {
        flex-wrap: wrap;
    }

    .job-summary > :nth-last-child(2) {
        margin-left: 0;
    }

    .workbench {
        display: flex;
        flex-direction: column;
    }

    .proof-panel {
        order: -1;
        min-height: 0;
        position: sticky;
        top: 0;
        z-index: 5;
        border-top: 1px solid var(--line);
        border-left: 0;
        box-shadow: 0 8px 18px rgba(27, 39, 66, 0.08);
    }

    .proof-toggle {
        display: inline-flex;
    }

    .mobile-download {
        min-height: 50px;
        padding: 12px 18px;
        display: block;
        position: fixed;
        right: 14px;
        bottom: 14px;
        left: 14px;
        z-index: 20;
        color: #fff;
        background: var(--blue);
        border: 0;
        border-radius: 10px;
        box-shadow: 0 12px 30px rgba(27, 39, 66, 0.28);
        font-weight: 800;
    }

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

@media (max-width: 620px) {
    .hero {
        margin-top: 28px;
    }

    .privacy-promise {
        align-items: flex-start;
        border-radius: 12px;
        text-align: left;
    }

    .restore-banner,
    .job-summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }

    .decision-stack,
    .proof-panel {
        padding: 13px;
    }

    .card-heading {
        padding: 13px;
    }

    .card-body {
        padding: 0 13px 15px;
    }

    .card-heading p,
    .local-note,
    .body-copy,
    .capacity-message,
    .proof-fact {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .edit-button {
        min-width: 44px;
        min-height: 44px;
    }

    .field-grid,
    .field-grid.compact {
        grid-template-columns: 1fr;
    }

    .seo-steps,
    .seo-grid {
        grid-template-columns: 1fr;
    }

    .row-count-line {
        flex-direction: column;
    }

    .input-actions .button {
        width: 100%;
    }

    .after-tool {
        padding: 25px 18px;
    }
}

@media print {
    .site-header,
    .hero,
    .decision-stack,
    .job-summary,
    .after-tool,
    footer {
        display: none;
    }
}
