:root {
    --tool-red: #ef2f2c;
    --tool-red-dark: #d91f1c;
    --tool-ink: #34333f;
    --tool-muted: #7c7a88;
    --tool-line: #d9d9e3;
    --tool-stage: #f7f7fb;
    --tool-sidebar: #ffffff;
    --tool-soft-red: #fff0ee;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body.pdf-tool-page {
    margin: 0;
    min-height: 100vh;
    overflow: hidden;
    color: var(--tool-ink);
    background: var(--tool-stage);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tool-header {
    height: 72px;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 26px;
    background: #fff;
    border-bottom: 1px solid var(--tool-line);
    white-space: nowrap;
}

.tool-logo img {
    display: block;
    width: auto;
    height: 44px;
    max-width: 210px;
    object-fit: contain;
}

.tool-logo-fallback {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    color: #111827;
    font-size: 28px;
    font-weight: 950;
    letter-spacing: -.04em;
    line-height: 1;
}

.tool-logo-fallback::before {
    content: "";
    width: 30px;
    height: 36px;
    margin-right: 8px;
    border-radius: 8px;
    background:
        linear-gradient(90deg, transparent 44%, #ffffff 44% 56%, transparent 56%),
        linear-gradient(#ffffff 0 0) 8px 10px / 15px 4px no-repeat,
        linear-gradient(#ffffff 0 0) 8px 18px / 12px 4px no-repeat,
        linear-gradient(#ffffff 0 0) 8px 26px / 16px 4px no-repeat,
        var(--tool-red);
    box-shadow: 0 10px 20px rgba(239,47,44,.18);
}

.tool-logo-fallback b {
    color: var(--tool-red);
    font: inherit;
}

.tool-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    overflow-x: auto;
}

.tool-nav a {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: #191822;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .01em;
    text-decoration: none;
    text-transform: uppercase;
    padding: 12px 10px;
}

.tool-nav a:hover,
.tool-nav a.active {
    color: var(--tool-red);
}

.tool-header-spacer {
    flex: 1 1 auto;
}

.tool-auth {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.tool-login {
    color: #1f1e29;
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
}

.tool-register {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    border-radius: 8px;
    padding: 0 16px;
    background: var(--tool-red);
    color: #fff;
    font-size: 14px;
    font-weight: 850;
    text-decoration: none;
}

.tool-grid-dot {
    width: 28px;
    height: 32px;
    display: grid;
    grid-template-columns: repeat(3, 4px);
    grid-auto-rows: 4px;
    gap: 6px;
    align-content: center;
    justify-content: center;
}

.tool-grid-dot span {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: #34333f;
}

.tool-workbench {
    height: calc(100vh - 72px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 440px;
}

.tool-stage {
    position: relative;
    min-width: 0;
    overflow: auto;
    display: grid;
    place-items: center;
    padding: 48px 42px;
    background: var(--tool-stage);
}

.tool-stage-inner {
    width: min(980px, 100%);
    min-height: 420px;
    display: grid;
    place-items: center;
}

.drop-zone {
    position: relative;
    width: min(560px, 100%);
    min-height: 235px;
    display: grid;
    place-items: center;
    padding: 34px;
    border: 2px dashed #c8c8d4;
    border-radius: 8px;
    background: #fff;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 14px 40px rgba(34,34,46,.07);
    transition: border-color .15s, background .15s, transform .15s;
}

.drop-zone:hover,
.drop-zone.dragging {
    border-color: var(--tool-red);
    background: #fff8f7;
    transform: translateY(-1px);
}

.drop-zone input {
    position: absolute;
    inset: 0;
    cursor: pointer;
    opacity: 0;
}

.drop-icon {
    width: 68px;
    height: 68px;
    display: inline-grid;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 50%;
    background: var(--tool-red);
    color: #fff;
    font-size: 38px;
    font-weight: 950;
    box-shadow: 0 14px 30px rgba(239,47,44,.24);
}

.drop-zone strong {
    display: block;
    margin-bottom: 7px;
    color: #2d2c38;
    font-size: 20px;
    font-weight: 900;
}

.drop-zone em {
    display: block;
    color: var(--tool-muted);
    font-size: 14px;
    font-style: normal;
    line-height: 1.5;
}

.preview-board {
    width: 100%;
    display: none;
    justify-content: center;
    align-content: start;
    gap: 18px;
    padding: 20px 70px 40px;
}

body.has-files .preview-board {
    display: flex;
    flex-wrap: wrap;
}

body.has-files .drop-zone {
    display: none;
}

.pdf-card {
    width: 198px;
    min-height: 282px;
    position: relative;
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 8px;
    padding: 14px 10px 10px;
    border: 1px solid #ececf3;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 5px 16px rgba(31,31,43,.08);
}

.pdf-card.is-reorderable {
    cursor: grab;
    touch-action: none;
}

.pdf-card.is-reorderable:active {
    cursor: grabbing;
}

body.is-reordering-pdf {
    cursor: grabbing;
    user-select: none;
}

.preview-board.drag-active .pdf-card:not(.pdf-card-placeholder):not(.pdf-drag-source) {
    transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.pdf-drag-source {
    opacity: 0 !important;
}

.pdf-card-placeholder {
    min-height: 282px;
    border: 1.5px dashed var(--tool-red) !important;
    background: rgba(239,47,44,.035) !important;
    box-shadow: none !important;
    opacity: 1 !important;
    overflow: hidden;
}

.pdf-card-placeholder::before {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px dashed rgba(239,47,44,.42);
    border-radius: 6px;
    background: repeating-linear-gradient(
        135deg,
        rgba(239,47,44,.06) 0,
        rgba(239,47,44,.06) 8px,
        transparent 8px,
        transparent 16px
    );
}

.pdf-drag-ghost {
    position: fixed !important;
    z-index: 99999 !important;
    pointer-events: none !important;
    opacity: .78;
    transform: rotate(-2deg) scale(.98);
    box-shadow: 0 24px 55px rgba(39,38,51,.28) !important;
    border: 1px dashed rgba(239,47,44,.45) !important;
    background: rgba(255,255,255,.86) !important;
    backdrop-filter: blur(2px);
}

.pdf-drag-ghost .pdf-remove,
.pdf-drag-ghost .pdf-rotate {
    display: none;
}

.pdf-thumb {
    width: 100%;
    height: 218px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 4px;
    background: #f4f4f7;
}

.pdf-thumb canvas,
.pdf-thumb img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
}

.pdf-thumb-fallback {
    width: 98px;
    height: 132px;
    display: grid;
    place-items: center;
    border: 2px solid #e4e4ec;
    border-radius: 5px;
    color: var(--tool-red);
    font-size: 28px;
    font-weight: 950;
    background: #fff;
}

.pdf-card-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #34333f;
    font-size: 12px;
    text-align: center;
}

.pdf-card-number {
    position: absolute;
    left: 50%;
    bottom: -24px;
    transform: translateX(-50%);
    color: #34333f;
    font-size: 12px;
}

.pdf-remove {
    position: absolute;
    right: -10px;
    top: -10px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: var(--tool-red);
    color: #fff;
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
    box-shadow: 0 3px 10px rgba(239,47,44,.25);
}

.floating-actions {
    position: fixed;
    right: 462px;
    top: 220px;
    display: none;
    flex-direction: column;
    gap: 12px;
    z-index: 10;
}

body.has-files .floating-actions {
    display: flex;
}

.floating-actions button {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: var(--tool-red);
    color: #fff;
    cursor: pointer;
    font-size: 21px;
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(239,47,44,.25);
}

.floating-actions button.secondary {
    background: #fff;
    color: #34333f;
    border: 1px solid var(--tool-line);
}

.tool-sidebar {
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--tool-sidebar);
    border-left: 1px solid var(--tool-line);
}

.sidebar-title {
    min-height: 74px;
    display: grid;
    place-items: center;
    border-bottom: 1px solid var(--tool-line);
    padding: 0 18px;
    text-align: center;
}

.sidebar-title h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1;
    letter-spacing: 0;
}

.sidebar-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 16px 22px 120px;
}

.sidebar-help {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 14px;
    border-radius: 8px;
    background: #dff2ff;
    color: #34333f;
    font-size: 13px;
    line-height: 1.45;
}

.sidebar-help strong {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 2px solid #1593dc;
    color: #1593dc;
    font-size: 12px;
}

.split-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid var(--tool-line);
}

.split-tabs button {
    min-height: 104px;
    border: 0;
    border-right: 1px solid var(--tool-line);
    background: #fff;
    color: #9a99a7;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 750;
}

.split-tabs button.active {
    color: #191822;
    box-shadow: inset 0 3px 0 var(--tool-red);
}

.split-icon {
    display: block;
    margin-bottom: 9px;
    font-size: 27px;
}

.control-group {
    margin-top: 24px;
}

.control-title {
    margin: 0 0 12px;
    color: #34333f;
    font-size: 15px;
    font-weight: 850;
}

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

.segmented button {
    min-height: 58px;
    border: 1px solid #eeeef5;
    border-radius: 8px;
    background: #f5f5fa;
    color: #8a8897;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.segmented button.active {
    border-color: var(--tool-red);
    background: #fff;
    color: var(--tool-red);
}

.range-row {
    display: grid;
    grid-template-columns: 1fr 18px 1fr;
    gap: 10px;
    align-items: end;
}

.field {
    display: grid;
    gap: 6px;
}

.field label {
    color: #5e5c69;
    font-size: 12px;
    font-weight: 750;
}

.field input,
.field select {
    width: 100%;
    height: 46px;
    border: 1px solid #aaaab8;
    border-radius: 5px;
    padding: 0 10px;
    background: #fff;
    color: #252432;
    font: inherit;
}

.range-separator {
    padding-bottom: 13px;
    text-align: center;
    color: #5e5c69;
    font-size: 13px;
    font-weight: 900;
}

.check-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 22px;
    color: #34333f;
    font-size: 14px;
}

.check-row input {
    width: 24px;
    height: 24px;
    accent-color: var(--tool-red);
}

.file-list {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}

.file-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--tool-line);
    border-radius: 8px;
    background: #fff;
}

.file-row strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.file-row span {
    color: var(--tool-muted);
    font-size: 12px;
}

.tool-status {
    min-height: 22px;
    margin-top: 14px;
    color: var(--tool-muted);
    font-size: 13px;
    line-height: 1.45;
}

.tool-status.error {
    color: #b91c1c;
}

.tool-status.success {
    color: #047857;
}

.sidebar-footer {
    position: sticky;
    bottom: 0;
    padding: 22px;
    background: linear-gradient(180deg, rgba(255,255,255,.78), #fff 34%);
}

.tool-button {
    width: 100%;
    min-height: 82px;
    border: 0;
    border-radius: 8px;
    background: var(--tool-red);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 22px;
    font-weight: 950;
    box-shadow: 0 8px 20px rgba(239,47,44,.26);
}

.tool-button:hover {
    background: var(--tool-red-dark);
}

.tool-button:disabled {
    cursor: not-allowed;
    opacity: .45;
    box-shadow: none;
}

.tool-clear {
    width: 100%;
    min-height: 42px;
    margin-top: 10px;
    border: 1px solid var(--tool-line);
    border-radius: 8px;
    background: #fff;
    color: #34333f;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.tool-clear:disabled {
    opacity: .5;
    cursor: not-allowed;
}

@media (max-width: 980px) {
    body.pdf-tool-page {
        overflow: auto;
    }

    .tool-header {
        height: auto;
        min-height: 70px;
        flex-wrap: wrap;
        padding: 12px 16px;
    }

    .tool-auth {
        display: none;
    }

    .tool-workbench {
        height: auto;
        min-height: calc(100vh - 70px);
        grid-template-columns: 1fr;
    }

    .tool-stage {
        min-height: 54vh;
        padding: 24px 16px;
    }

    .preview-board {
        padding: 18px 0 42px;
    }

    .floating-actions {
        position: fixed;
        right: 16px;
        top: auto;
        bottom: 118px;
    }

    .tool-sidebar {
        border-left: 0;
        border-top: 1px solid var(--tool-line);
    }

    .sidebar-title {
        min-height: 62px;
    }
}

@media (max-width: 560px) {
    .tool-logo img {
        height: 38px;
    }

    .tool-nav {
        width: 100%;
    }

    .tool-nav a {
        font-size: 12px;
        padding: 9px 8px;
    }

    .pdf-card {
        width: 150px;
        min-height: 226px;
    }

    .pdf-thumb {
        height: 166px;
    }

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

    .range-separator {
        display: none;
    }
}

/* ===== OnlyEditPDF tools identity v3 ===== */
:root {
    --oep-red: #ef3b32;
    --oep-red-deep: #c91f1a;
    --oep-ink: #272633;
    --oep-blue: #1677c8;
    --oep-green: #17a974;
    --oep-paper: #ffffff;
    --oep-line: #dedee8;
    --oep-stage: #f5f6fb;
}

body.pdf-tool-page {
    background:
        linear-gradient(90deg, rgba(39,38,51,.035) 1px, transparent 1px),
        linear-gradient(180deg, rgba(39,38,51,.035) 1px, transparent 1px),
        var(--oep-stage);
    background-size: 34px 34px, 34px 34px, auto;
}

.tool-header {
    height: 76px;
    gap: 20px;
    border-bottom: 1px solid rgba(39,38,51,.10);
    box-shadow: 0 12px 30px rgba(39,38,51,.06);
}

.tool-logo {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding-right: 16px;
}

.tool-logo::after {
    content: "";
    position: absolute;
    right: 0;
    top: 12px;
    width: 1px;
    height: 30px;
    background: linear-gradient(180deg, transparent, #d7d7e3, transparent);
}

.tool-nav {
    gap: 4px;
    scrollbar-width: none;
}

.tool-nav::-webkit-scrollbar {
    display: none;
}

.tool-nav a {
    position: relative;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    border-radius: 10px;
    color: #242330;
    transition: color .18s ease, background .18s ease, transform .18s ease;
}

.tool-nav a::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 6px;
    height: 2px;
    border-radius: 999px;
    background: var(--oep-red);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .18s ease;
}

.tool-nav a:hover {
    background: #f4f5f9;
    color: var(--oep-red-deep);
    transform: translateY(-1px);
}

.tool-nav a:hover::after,
.tool-nav a.active::after {
    transform: scaleX(1);
}

.tool-nav a.active {
    color: var(--oep-red);
    background: #fff3f2;
}

.tool-login {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    border-radius: 10px;
    padding: 0 12px;
    color: #34333f;
    font-weight: 800;
    transition: background .18s ease, transform .18s ease;
}

.tool-login:hover {
    background: #f4f5f9;
    transform: translateY(-1px);
}

.tool-register {
    border-radius: 10px;
    background: #272633;
    color: #fff;
    box-shadow: inset 0 -2px 0 rgba(255,255,255,.08), 0 10px 18px rgba(39,38,51,.12);
    transition: transform .18s ease, background .18s ease;
}

.tool-register:hover {
    background: var(--oep-red);
    transform: translateY(-1px);
}

.tool-mark {
    width: 42px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #e0e1ea;
    border-radius: 10px;
    color: var(--oep-blue);
    background:
        linear-gradient(135deg, rgba(22,119,200,.08), rgba(239,59,50,.08)),
        #fff;
    font-size: 11px;
    font-weight: 950;
}

.tool-workbench {
    height: calc(100dvh - 76px);
    grid-template-columns: minmax(0, 1fr) clamp(360px, 28vw, 450px);
}

.tool-stage {
    align-items: start;
    padding: clamp(28px, 5vw, 74px) clamp(18px, 5vw, 64px);
    background:
        radial-gradient(circle at 1px 1px, rgba(39,38,51,.08) 1px, transparent 0),
        linear-gradient(135deg, rgba(239,59,50,.045), transparent 28%),
        var(--oep-stage);
    background-size: 24px 24px, auto, auto;
}

.tool-stage::before {
    content: "OnlyEditPDF Studio";
    position: absolute;
    left: clamp(18px, 3vw, 44px);
    top: clamp(18px, 3vw, 34px);
    color: rgba(39,38,51,.38);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.tool-stage-inner {
    width: 100%;
    max-width: none;
    min-height: calc(100dvh - 180px);
    align-content: center;
}

body.has-files .tool-stage-inner {
    align-content: start;
}

.drop-zone {
    overflow: hidden;
    border: 1px solid rgba(39,38,51,.10);
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(135deg, rgba(239,59,50,.9), rgba(22,119,200,.65)) border-box;
    box-shadow: 0 22px 70px rgba(39,38,51,.12);
    animation: oepRise .34s ease both;
}

.drop-zone::before {
    content: "";
    position: absolute;
    inset: -1px;
    background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,.0) 36%, rgba(239,59,50,.08) 50%, transparent 64%);
    transform: translateX(-80%);
    transition: transform .5s ease;
}

.drop-zone:hover::before,
.drop-zone.dragging::before {
    transform: translateX(80%);
}

.drop-zone:hover,
.drop-zone.dragging {
    transform: translateY(-3px);
    box-shadow: 0 28px 80px rgba(39,38,51,.16);
}

.drop-icon {
    border-radius: 18px;
    background: linear-gradient(135deg, var(--oep-red), #ff7a45);
    transform: rotate(-3deg);
    transition: transform .2s ease;
}

.drop-zone:hover .drop-icon {
    transform: rotate(0deg) scale(1.04);
}

.preview-board {
    display: none;
    width: min(1240px, 100%);
    grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
    justify-content: center;
    align-items: start;
    gap: 8px;
    padding: 20px 8px 54px;
    margin: 0 auto;
}

body.has-files .preview-board {
    display: grid;
    flex-wrap: initial;
}

.pdf-card {
    width: 100%;
    min-width: 0;
    min-height: 244px;
    gap: 7px;
    padding: 30px 10px 10px;
    border: 0;
    border-radius: 12px;
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(160deg, rgba(239,59,50,.32), rgba(22,119,200,.22)) border-box;
    box-shadow: 0 10px 28px rgba(39,38,51,.10);
    animation: oepCardIn .28s ease both;
    transition: transform .18s ease, box-shadow .18s ease;
}

.pdf-card:hover {
    transform: translateY(-4px) rotate(-.4deg);
    box-shadow: 0 18px 36px rgba(39,38,51,.15);
}

.pdf-card::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 10px;
    width: 34px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--oep-red), var(--oep-blue));
    opacity: .85;
}

.pdf-thumb {
    height: 176px;
    border: 1px solid #ececf3;
    background:
        linear-gradient(135deg, #fbfbfd, #f1f3f8);
}

.pdf-card-name {
    min-height: 18px;
    font-size: 11px;
    line-height: 1.25;
}

.pdf-card-number {
    left: 44px;
    top: 9px;
    bottom: auto;
    transform: none;
    min-width: 26px;
    min-height: 22px;
    padding: 0 8px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #272633;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    z-index: 6;
    box-shadow: 0 6px 14px rgba(39,38,51,.20);
}

.pdf-remove {
    right: 8px;
    top: 8px;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #272633;
    font-size: 15px;
    font-weight: 900;
    z-index: 7;
    transition: transform .16s ease, background .16s ease;
}

.pdf-remove:hover {
    background: var(--oep-red);
    transform: scale(1.06);
}

.pdf-rotate {
    position: absolute;
    right: 36px;
    top: 8px;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: var(--oep-red);
    color: #fff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
    z-index: 7;
    box-shadow: 0 8px 16px rgba(239,59,50,.26);
    transition: transform .16s ease, background .16s ease;
}

.pdf-rotate:hover {
    background: #ff574a;
    transform: scale(1.06) rotate(12deg);
}

.pdf-rotate.solo {
    right: 8px;
}

.pdf-card.is-split-page .pdf-remove {
    right: 8px;
    top: 8px;
    display: grid;
    background: #272633;
}

.pdf-card.is-split-page .pdf-rotate {
    right: 38px;
    top: 8px;
}

.floating-actions {
    right: calc(clamp(360px, 28vw, 450px) + 22px);
    top: 210px;
    padding: 7px;
    border: 1px solid rgba(39,38,51,.08);
    border-radius: 999px;
    background: rgba(255,255,255,.78);
    box-shadow: 0 14px 28px rgba(39,38,51,.12);
    backdrop-filter: blur(12px);
}

.floating-actions button {
    border-radius: 14px;
    background: #272633;
    box-shadow: none;
    transition: transform .16s ease, background .16s ease;
}

.floating-actions button:hover {
    background: var(--oep-red);
    transform: translateY(-2px);
}

.tool-sidebar {
    position: relative;
    border-left: 0;
    background:
        linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.94)),
        #fff;
    box-shadow: -18px 0 40px rgba(39,38,51,.08);
}

.tool-sidebar::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, var(--oep-red), var(--oep-blue), var(--oep-green));
}

.sidebar-title {
    place-items: end start;
    min-height: 96px;
    padding: 22px 28px;
    text-align: left;
    background:
        linear-gradient(135deg, rgba(239,59,50,.08), rgba(22,119,200,.08)),
        #fff;
}

.sidebar-title h1 {
    font-size: clamp(26px, 3vw, 34px);
}

.sidebar-title h1::after {
    content: "";
    display: block;
    width: 54px;
    height: 4px;
    margin-top: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--oep-red), var(--oep-blue));
}

.sidebar-body {
    padding: 18px 26px 122px;
}

.sidebar-help {
    border: 1px solid rgba(22,119,200,.18);
    background: #eef8ff;
    box-shadow: inset 4px 0 0 var(--oep-blue);
}

.split-tabs {
    padding-left: 5px;
    background: #fff;
}

.split-tabs button {
    position: relative;
    min-height: 92px;
    transition: background .18s ease, color .18s ease;
}

.split-tabs button.active {
    color: var(--oep-red);
    box-shadow: inset 0 -3px 0 var(--oep-red);
}

.segmented button {
    border-radius: 12px;
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.segmented button:hover {
    transform: translateY(-2px);
}

.segmented button.active {
    background: #fff7f6;
    box-shadow: 0 10px 22px rgba(239,59,50,.10);
}

.field input,
.field select {
    border-radius: 10px;
    border-color: #d3d3df;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: var(--oep-blue);
    box-shadow: 0 0 0 3px rgba(22,119,200,.13);
}

.file-row {
    border-radius: 12px;
    background: #fafbff;
}

.sidebar-footer {
    padding: 20px 26px 24px;
    background: linear-gradient(180deg, rgba(255,255,255,.2), #fff 28%);
}

.tool-button {
    position: relative;
    overflow: hidden;
    min-height: 76px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--oep-red), #ff574a);
    box-shadow: 0 16px 28px rgba(239,59,50,.25);
    transition: transform .18s ease, box-shadow .18s ease;
}

.tool-button::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent, rgba(255,255,255,.24), transparent);
    transform: translateX(-100%);
    transition: transform .5s ease;
}

.tool-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(239,59,50,.32);
}

.tool-button:hover::after {
    transform: translateX(100%);
}

.tool-clear {
    border-radius: 12px;
}

@keyframes oepRise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes oepCardIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 1100px) {
    .tool-workbench {
        grid-template-columns: minmax(0, 1fr) 390px;
    }

    .floating-actions {
        right: 412px;
    }
}

@media (max-width: 980px) {
    body.pdf-tool-page {
        overflow: auto;
    }

    .tool-header {
        position: sticky;
        top: 0;
        z-index: 50;
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 10px 14px;
    }

    .tool-logo::after,
    .tool-header-spacer,
    .tool-auth {
        display: none;
    }

    .tool-nav {
        width: 100%;
        padding-bottom: 2px;
    }

    .tool-workbench {
        min-height: calc(100dvh - 92px);
        grid-template-columns: 1fr;
    }

    .tool-stage {
        min-height: 50dvh;
        padding: 56px 14px 24px;
    }

    .tool-stage::before {
        left: 16px;
        top: 18px;
        font-size: 10px;
    }

    .tool-stage-inner {
        min-height: 320px;
    }

    .drop-zone {
        width: min(100%, 520px);
        min-height: 210px;
    }

    .tool-sidebar {
        border-top: 1px solid var(--oep-line);
        box-shadow: 0 -14px 32px rgba(39,38,51,.08);
    }

    .tool-sidebar::before {
        right: 0;
        bottom: auto;
        width: auto;
        height: 5px;
    }

    .sidebar-title {
        min-height: 76px;
        padding: 18px 20px;
    }

    .sidebar-body {
        padding: 16px 18px 18px;
    }

    .sidebar-footer {
        position: sticky;
        bottom: 0;
        z-index: 15;
        padding: 14px 16px 16px;
        box-shadow: 0 -12px 26px rgba(39,38,51,.08);
    }

    .tool-button {
        min-height: 62px;
        font-size: 18px;
    }

    .floating-actions {
        right: 14px;
        bottom: 96px;
        top: auto;
        flex-direction: row;
        border-radius: 18px;
    }
}

@media (max-width: 640px) {
    .tool-logo img {
        height: 34px;
        max-width: 180px;
    }

    .tool-nav a {
        min-height: 36px;
        font-size: 11px;
        padding: 8px 9px;
    }

    .drop-zone {
        padding: 24px 18px;
    }

    .drop-icon {
        width: 58px;
        height: 58px;
        font-size: 32px;
    }

    .preview-board {
        justify-content: flex-start;
        gap: 14px;
        overflow-x: auto;
        flex-wrap: nowrap !important;
        padding: 12px 12px 44px;
        scroll-snap-type: x proximity;
    }

    .pdf-card {
        flex: 0 0 152px;
        width: 152px;
        min-height: 226px;
        scroll-snap-align: center;
    }

    .pdf-card-placeholder {
        min-height: 226px;
        flex: 0 0 152px;
    }

    .pdf-drag-ghost {
        max-width: 152px;
    }

    .pdf-thumb {
        height: 164px;
    }

    .split-tabs button {
        min-height: 74px;
        font-size: 12px;
    }

    .split-icon {
        margin-bottom: 4px;
        font-size: 21px;
    }

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

    .segmented button {
        min-height: 44px;
    }

    .range-row {
        grid-template-columns: 1fr 1fr;
    }

    .range-separator {
        display: none;
    }
}

@media (max-width: 390px) {
    .tool-nav a {
        font-size: 10px;
    }

    .sidebar-title h1 {
        font-size: 24px;
    }
}

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