.tu-page {
    max-width: 820px;
    margin: 0 auto;
    padding: 30px 20px 10px
}

.tu-card {
    padding: 26px 28px
}

.tu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(200px,1fr));
    gap: 0 18px
}

/* pill choice buttons */
.tu-seg {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 6px
}

    .tu-seg label {
        position: relative;
        cursor: pointer;
        margin: 0
    }

    .tu-seg input {
        position: absolute;
        opacity: 0;
        inset: 0
    }

    .tu-seg span {
        display: block;
        padding: 9px 20px;
        border-radius: 999px;
        border: 2px solid var(--border);
        background: var(--surface-2);
        font-weight: 800;
        color: var(--text)
    }

    .tu-seg input:checked + span {
        background: var(--sun);
        border-color: var(--sun-deep);
        color: #3a2a00
    }

    .tu-seg input:focus-visible + span {
        outline: 3px solid color-mix(in srgb,var(--sun) 70%,transparent)
    }

/* results */
.tu-out {
    margin-top: 24px;
    padding: 6px 22px;
    border-radius: 18px;
    background: color-mix(in srgb,var(--blue) 8%,var(--surface))
}

.tu-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 18px;
    padding: 11px 0;
    border-bottom: 2px dashed var(--border)
}

    .tu-row:last-of-type {
        border-bottom: 0
    }

    .tu-row span {
        color: var(--text);
        font-weight: 700
    }

    .tu-row b {
        font-family: var(--font-head);
        color: var(--blue);
        text-align: right
    }

    .tu-row.big b {
        font-size: 1.5rem
    }

.tu-bar {
    height: 14px;
    border-radius: 99px;
    background: var(--sun);
    overflow: hidden;
    margin: 14px 0 6px
}

    .tu-bar i {
        display: block;
        height: 100%;
        background: var(--blue);
        border-radius: 99px 0 0 99px
    }

.tu-hint {
    margin: 10px 0;
    color: var(--muted);
    font-size: .95rem
}

.tu-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px
}

@media (max-width:560px) {
    .tu-card {
        padding: 20px 18px
    }

    .tu-row {
        flex-direction: column;
        gap: 2px
    }

        .tu-row b {
            text-align: left
        }
}
/* text diff + textareas */
.tu-card textarea {
    width: 100%;
    min-height: 160px;
    resize: vertical;
    box-sizing: border-box
}

.tu-diff {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.75;
    font-weight: 600;
    color: var(--text);
    padding: 14px 0
}

    .tu-diff ins {
        background: #bff0cf;
        color: #0b4a22;
        text-decoration: none;
        border-radius: 4px;
        padding: 0 2px
    }

    .tu-diff del {
        background: #ffd0d0;
        color: #7a1212;
        border-radius: 4px;
        padding: 0 2px
    }

    .tu-diff .ln {
        display: block;
        padding: 2px 10px;
        border-radius: 6px
    }

        .tu-diff .ln.add {
            background: #bff0cf;
            color: #0b4a22
        }

        .tu-diff .ln.del {
            background: #ffd0d0;
            color: #7a1212
        }

[data-theme="dark"] .tu-diff ins, [data-theme="dark"] .tu-diff .ln.add {
    background: #1d5a3a;
    color: #d6ffe6
}

[data-theme="dark"] .tu-diff del, [data-theme="dark"] .tu-diff .ln.del {
    background: #6a2424;
    color: #ffdede
}
/* ===== Batch 3 additions ===== */
.tu-f {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 700;
    font-size: .92rem
}

    .tu-f[hidden], .b3-sec[hidden] {
        display: none
    }

    .tu-f input, .tu-f select {
        font: inherit;
        font-weight: 600;
        padding: 11px 14px;
        border-radius: 14px;
        border: 2px solid rgba(31,95,174,.22);
        background: var(--surface,#fff);
        color: var(--text,#17324d);
        width: 100%;
        min-width: 0
    }

        .tu-f input:focus, .tu-f select:focus {
            outline: none;
            border-color: var(--blue,#1f5fae);
            box-shadow: 0 0 0 4px rgba(31,95,174,.15)
        }

.b3-out {
    margin-top: 18px;
    display: grid;
    gap: 8px
}

.b3-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 14px;
    background: var(--surface-2,#f1fbfe)
}

    .b3-row span {
        font-weight: 700;
        opacity: .8
    }

    .b3-row b {
        font-family: var(--font-head,inherit);
        font-size: 1.05rem;
        text-align: right
    }

    .b3-row.big {
        background: var(--sun,#ffc933);
        color: #17324d
    }

        .b3-row.big span {
            opacity: .9
        }

        .b3-row.big b {
            font-size: 1.3rem
        }

.b3-bar {
    height: 12px;
    border-radius: 99px;
    background: rgba(31,95,174,.15);
    overflow: hidden;
    margin-top: 4px
}

    .b3-bar i {
        display: block;
        height: 100%;
        border-radius: 99px;
        background: linear-gradient(90deg,var(--green,#1fa38a),var(--blue,#1f5fae));
        transition: width .3s
    }

.b3-note {
    font-size: .88rem;
    opacity: .85;
    margin: 6px 2px 0
}

.b3-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(260px,1fr));
    gap: 16px
}

.b3-box {
    border-radius: 20px;
    padding: 16px;
    background: var(--surface-2,#f1fbfe);
    border: 3px solid transparent
}

    .b3-box h2 {
        margin: 0 0 12px;
        font-size: 1.15rem
    }

    .b3-box .b3-out {
        margin-top: 14px
    }

    .b3-box .b3-row {
        background: var(--surface,#fff)
    }

        .b3-box .b3-row.big {
            background: var(--sun,#ffc933)
        }

.b3-win {
    border-color: var(--green,#1fa38a)
}

.b3-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px
}
/* ===== PDF tools ===== */
.pt-drop {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    padding: 28px 18px;
    border: 3px dashed rgba(31,95,174,.35);
    border-radius: 22px;
    background: var(--surface-2,#f1fbfe);
    cursor: pointer;
    transition: .2s
}

    .pt-drop:hover, .pt-drop.over, .pt-drop:focus-within {
        border-color: var(--green,#1fa38a);
        background: rgba(31,163,138,.09)
    }

    .pt-drop input {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        pointer-events: none
    }

    .pt-drop svg {
        width: 44px;
        height: 44px;
        color: var(--blue,#1f5fae)
    }

    .pt-drop strong {
        font-family: var(--font-head,inherit);
        font-size: 1.15rem
    }

    .pt-drop span {
        opacity: .75;
        font-size: .9rem
    }

.pt-list {
    list-style: none;
    margin: 14px 0;
    padding: 0;
    display: grid;
    gap: 8px
}

    .pt-list:empty {
        display: none
    }

.pt-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 14px;
    background: var(--surface-2,#f1fbfe)
}

    .pt-item img {
        width: 44px;
        height: 44px;
        object-fit: cover;
        border-radius: 8px;
        flex: none
    }

.pt-ico {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: #e5484d;
    color: #fff;
    font-weight: 800;
    font-size: .8rem
}

.pt-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700
}

.pt-size {
    opacity: .7;
    font-size: .85rem;
    white-space: nowrap
}

.pt-ctl {
    display: flex;
    gap: 4px;
    flex: none
}

    .pt-ctl button {
        width: 32px;
        height: 32px;
        border-radius: 10px;
        border: 0;
        background: var(--surface,#fff);
        color: inherit;
        cursor: pointer;
        font-weight: 800;
        font-size: 1rem
    }

        .pt-ctl button:hover {
            background: var(--sun,#ffc933);
            color: #17324d
        }

.pt-info {
    margin: 12px 0 0;
    padding: 10px 14px;
    border-radius: 14px;
    background: var(--surface-2,#f1fbfe);
    font-weight: 700
}

    .pt-info[hidden], .pt-status[hidden] {
        display: none
    }

.pt-btn {
    font-family: var(--font-head,inherit);
    font-size: 1rem;
    font-weight: 600;
    padding: 12px 26px;
    border-radius: 99px;
    border: 0;
    background: var(--sun,#ffc933);
    color: #17324d;
    box-shadow: 0 4px 0 var(--sun-deep,#e8a200);
    cursor: pointer;
    transition: transform .1s,box-shadow .1s
}

    .pt-btn:active {
        transform: translateY(3px);
        box-shadow: 0 1px 0 var(--sun-deep,#e8a200)
    }

    .pt-btn[disabled] {
        opacity: .5;
        cursor: not-allowed;
        box-shadow: none
    }

    .pt-btn.ghost {
        background: transparent;
        color: inherit;
        border: 2px solid rgba(31,95,174,.3);
        box-shadow: none
    }

    .pt-btn.busy {
        opacity: .7;
        cursor: progress
    }

.pt-status {
    margin: 14px 0 0;
    padding: 11px 14px;
    border-radius: 14px;
    font-weight: 700;
    background: var(--surface-2,#f1fbfe)
}

    .pt-status.ok {
        background: rgba(31,163,138,.18)
    }

    .pt-status.err {
        background: rgba(224,80,80,.18)
    }

.pt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(150px,1fr));
    gap: 12px;
    margin-top: 16px
}

    .pt-grid:empty {
        display: none
    }

    .pt-grid figure {
        margin: 0;
        padding: 8px;
        border-radius: 14px;
        background: var(--surface-2,#f1fbfe);
        text-align: center
    }

    .pt-grid img {
        width: 100%;
        height: auto;
        border-radius: 8px;
        background: #fff;
        display: block
    }

    .pt-grid figcaption {
        margin-top: 6px;
        font-weight: 700;
        font-size: .9rem
    }

    .pt-grid a {
        color: var(--blue,#1f5fae)
    }

.tu-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px
}