    .tool-hero {
        padding: 44px 0 8px;
    }

    .crumb {
        font-size: 13px;
        color: var(--muted);
        margin: 0 0 14px;
    }

    .crumb a {
        text-decoration: none;
        color: var(--muted);
    }

    .crumb a:hover {
        color: var(--ink);
    }

    .tool-sub {
        font-size: 16px;
        color: var(--muted);
        max-width: 60ch;
        margin: 0;
    }

    main {
        padding-bottom: 60px;
    }

    /* Upload dropzone */
    .dropzone {
        margin-top: 28px;
        border: 1.5px dashed var(--line);
        border-radius: 14px;
        background: var(--paper-raise);
        padding: 40px 24px;
        text-align: center;
        cursor: pointer;
        transition: border-color .15s ease, background .15s ease;
    }

    .dropzone.drag {
        border-color: var(--teal);
        background: var(--tag-bg);
    }

    .dropzone .dz-icon {
        font-size: 30px;
        margin-bottom: 10px;
    }

    .dropzone h3 {
        margin: 0 0 6px;
        font-size: 17px;
    }

    .dropzone p {
        margin: 0;
        color: var(--muted);
        font-size: 14px;
    }

    .dropzone input[type="file"] {
        display: none;
    }

    /* Selected-file row (replaces dropzone once a file is chosen) */
    .file-card {
        display: none;
        margin-top: 28px;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        flex-wrap: wrap;
        background: var(--paper-raise);
        border: 1px solid var(--line);
        border-radius: 14px;
        padding: 18px 22px;
    }

    .file-card.on {
        display: flex;
    }

    .file-card .fc-info {
        display: flex;
        align-items: center;
        gap: 12px;
        min-width: 0;
    }

    .file-card .fc-icon {
        font-size: 26px;
        flex-shrink: 0;
    }

    .file-card .fc-name {
        font-weight: 700;
        font-size: 15px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 46ch;
    }

    .file-card .fc-size {
        font-size: 13px;
        color: var(--muted);
        margin-top: 2px;
    }

    .file-card .fc-remove {
        background: none;
        border: 1px solid var(--line);
        color: var(--ink-soft);
        border-radius: 8px;
        padding: 8px 14px;
        font-size: 13.5px;
        font-weight: 700;
        cursor: pointer;
        font-family: inherit;
    }

    /* Status line while rendering / exporting */
    .status-line {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-top: 16px;
        font-size: 14px;
        color: var(--muted);
        min-height: 20px;
    }

    .spinner {
        width: 14px;
        height: 14px;
        border-radius: 50%;
        border: 2px solid var(--line);
        border-top-color: var(--teal);
        animation: spin .7s linear infinite;
        display: none;
    }

    .spinner.on {
        display: inline-block;
    }

    @keyframes spin {
        to {
            transform: rotate(360deg);
        }
    }

    /* Disabled states for the toolbar buttons */
    .btn-primary:disabled {
        opacity: .45;
        cursor: not-allowed;
    }

    .btn-ghost:disabled {
        opacity: .45;
        cursor: not-allowed;
    }

    /* Pages toolbar (Select all + Download selected) */
    .pages-section {
        display: none;
        margin-top: 34px;
    }

    .pages-section.on {
        display: block;
    }

    .pages-toolbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        flex-wrap: wrap;
    }

    .pages-toolbar h2 {
        font-size: 19px;
        margin: 0;
    }

    .pages-toolbar .hint {
        font-size: 13px;
        color: var(--muted);
        margin: 2px 0 0;
    }

    .toolbar-actions {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        align-items: center;
    }

    /* Selectable page grid */
    .page-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 14px;
        margin-top: 18px;
        padding: 0;
        list-style: none;
    }

    .page-card {
        background: var(--paper-raise);
        border: 1.5px solid var(--line);
        border-radius: 12px;
        padding: 10px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        transition: border-color .15s ease, background .15s ease;
    }

    .page-card.sel {
        border-color: var(--teal);
        background: var(--tag-bg);
    }

    .pc-thumb {
        position: relative;
        display: block;
        cursor: pointer;
    }

    .pc-thumb img {
        width: 100%;
        display: block;
        border-radius: 6px;
        border: 1px solid var(--line);
        background: #fff;
    }

    .pc-check {
        position: absolute;
        top: 8px;
        left: 8px;
        width: 20px;
        height: 20px;
        margin: 0;
        accent-color: var(--teal);
        cursor: pointer;
    }

    .pc-num {
        position: absolute;
        bottom: 8px;
        right: 8px;
        background: var(--ink);
        color: var(--paper);
        font-size: 11px;
        font-weight: 700;
        padding: 2px 7px;
        border-radius: 6px;
    }

    .pc-dl {
        background: #fff;
        color: var(--teal-deep);
        border: 1px solid var(--line);
        border-radius: 8px;
        padding: 8px 10px;
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
        font-family: inherit;
    }

    .pc-dl:disabled {
        opacity: .5;
        cursor: not-allowed;
    }

    /* Responsive tweaks for the new elements */
    @media (max-width:640px) {
        .page-grid {
            grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        }
    }