/*
 * Styles for /pdf-text-cleaner/ only. Every selector is scoped to new class
 * names (pdf-*) so no other page changes. The shared stylesheet supplies the
 * tool container, text boxes, sample chips, metrics cards and the ws-* marks.
 */

.pdf-tool .tool-container {
    min-width: 0;
}

.pdf-areas {
    margin-bottom: 18px;
}

.pdf-areas .input-section,
.pdf-areas .output-section {
    min-width: 0;
}

.pdf-areas .text-input,
.pdf-areas .text-output {
    min-height: 280px;
}

.pdf-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.pdf-btn {
    min-height: 44px;
    padding: 9px 16px;
    border: 1px solid #b9cde4;
    border-radius: 10px;
    color: #005bbf;
    background: #fff;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
}

.pdf-btn:hover:not(:disabled) {
    border-color: #007aff;
    background: #eef5ff;
}

.pdf-btn:focus-visible,
.pdf-check input:focus-visible,
.pdf-separator input:focus-visible,
.pdf-inline-check input:focus-visible {
    outline: 3px solid rgba(0, 122, 255, 0.4);
    outline-offset: 2px;
}

.pdf-btn:disabled {
    border-color: #e1e5e9;
    color: #6c757d;
    background: #f1f3f5;
    cursor: not-allowed;
}

.pdf-btn-primary {
    border-color: transparent;
    color: #fff;
    background: linear-gradient(135deg, #0066d6, #5856d6);
}

.pdf-btn-primary:hover:not(:disabled) {
    border-color: transparent;
    background: linear-gradient(135deg, #005bbf, #4b49c2);
}

.pdf-btn-primary:disabled {
    color: #6c757d;
    background: #e9ecef;
}

.pdf-status {
    min-height: 1.6em;
    margin: 14px 0 0;
    color: #253246;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.5;
}

.pdf-error,
.pdf-notice {
    margin: 12px 0 0;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.55;
}

.pdf-error {
    border: 1px solid #f1b4b4;
    color: #8a1c1c;
    background: #fdeeee;
}

.pdf-notice {
    border: 1px solid #f0c9a0;
    color: #6b3410;
    background: #fff6ea;
}

.pdf-notice a {
    color: #8a3f00;
    font-weight: 700;
    text-decoration: underline;
}

.pdf-privacy-note {
    margin: 12px 0 22px;
    color: #667386;
    font-size: 0.84rem;
    line-height: 1.55;
}

.pdf-settings {
    min-width: 0;
    margin: 0 0 24px;
    padding: 18px 20px 20px;
    border: 1px solid #dce6f2;
    border-radius: 16px;
    background: #fbfdff;
}

.pdf-settings legend {
    padding: 0 8px;
    color: #1f2937;
    font-size: 1.05rem;
    font-weight: 700;
}

.pdf-setting-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 24px;
    margin-bottom: 16px;
}

.pdf-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    cursor: pointer;
}

.pdf-check input,
.pdf-inline-check input,
.pdf-separator input {
    flex: none;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: #0066d6;
}

.pdf-check strong {
    display: block;
    color: #253246;
    font-size: 0.94rem;
    line-height: 1.4;
}

.pdf-check small,
.pdf-separator small {
    display: block;
    color: #5b6778;
    font-size: 0.82rem;
    line-height: 1.5;
}

.pdf-separator {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 22px;
    margin-bottom: 16px;
    padding-top: 14px;
    border-top: 1px solid #e4eaf2;
}

.pdf-separator label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #253246;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
}

.pdf-separator input {
    margin-top: 0;
}

.pdf-setting-title {
    color: #253246;
    font-size: 0.94rem;
    font-weight: 700;
}

.pdf-separator small {
    flex: 1 1 100%;
}

.pdf-stat-detail {
    margin-top: 8px;
    color: #5b6778;
    font-size: 0.84rem;
    line-height: 1.55;
}

.pdf-stat-detail:empty {
    display: none;
}

.pdf-review {
    margin: 26px 0 0;
    padding: 20px;
    border: 1px solid #dce6f2;
    border-radius: 16px;
    background: #fff;
}

.pdf-review-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 18px;
    margin-bottom: 10px;
}

.pdf-review-head h2 {
    color: #1f2937;
    font-size: 1.25rem;
    line-height: 1.25;
}

.pdf-review-note {
    margin: 0 0 12px;
    color: #526071;
    font-size: 0.92rem;
    line-height: 1.6;
}

.pdf-inline-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: #253246;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.pdf-inline-check input {
    margin-top: 0;
}

.pdf-candidates,
.pdf-changes {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pdf-cand,
.pdf-change {
    min-width: 0;
    padding: 14px;
    border: 1px solid #e4eaf2;
    border-radius: 12px;
    background: #fbfdff;
}

.pdf-cand-meta,
.pdf-change-title {
    margin: 0 0 6px;
    color: #253246;
    font-size: 0.84rem;
    font-weight: 700;
}

.pdf-cand-context {
    margin: 0 0 10px;
    padding: 10px 12px;
    border: 1px solid #e4eaf2;
    border-radius: 8px;
    color: #223044;
    background: #fff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.86rem;
    line-height: 1.7;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.pdf-eol {
    display: inline-block;
    margin: 0 3px;
    padding: 0 4px;
    border-radius: 3px;
    color: #0b6b3a;
    background: rgba(22, 163, 74, 0.16);
    font-weight: 700;
}

.pdf-cand-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pdf-decision {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    max-width: 100%;
    text-align: left;
}

.pdf-decision-label {
    font-size: 0.9rem;
}

.pdf-decision-hint {
    color: #5b6778;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.78rem;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.pdf-decision.is-selected {
    border-color: #0066d6;
    color: #004a99;
    background: #e6f0ff;
    box-shadow: inset 0 0 0 1px #0066d6;
}

.pdf-undo {
    align-self: stretch;
}

.pdf-cand-state {
    margin: 10px 0 0;
    color: #5b6778;
    font-size: 0.84rem;
    line-height: 1.5;
}

.pdf-cand-state.is-confirmed {
    color: #0b5a31;
    font-weight: 600;
}

.pdf-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-top: 14px;
}

.pdf-pager[hidden],
.pdf-error[hidden],
.pdf-notice[hidden] {
    display: none;
}

.pdf-pager-text {
    color: #526071;
    font-size: 0.88rem;
}

.pdf-change-notes {
    margin: 0 0 10px;
    color: #526071;
    font-size: 0.84rem;
    line-height: 1.5;
}

.pdf-diff {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.pdf-diff-pane {
    min-width: 0;
}

.pdf-diff-label {
    margin: 0 0 4px;
    color: #667386;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.pdf-diff-text {
    max-height: 260px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #e4eaf2;
    border-radius: 8px;
    color: #223044;
    background: #fff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.82rem;
    line-height: 1.7;
    overflow: auto;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.pdf-more {
    color: #667386;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.pdf-review .ws-space {
    color: #5b6b80;
}

@media (max-width: 768px) {
    .pdf-setting-grid,
    .pdf-diff {
        grid-template-columns: 1fr;
    }

    .pdf-areas .text-input,
    .pdf-areas .text-output {
        min-height: 220px;
    }

    .pdf-settings,
    .pdf-review {
        padding: 16px 14px;
    }
}

@media (max-width: 520px) {
    .pdf-actions .pdf-btn {
        flex: 1 1 calc(50% - 5px);
    }

    .pdf-cand-actions .pdf-btn {
        flex: 1 1 100%;
    }

    .pdf-review-head .pdf-btn,
    #pdf-changes-more {
        width: 100%;
    }
}
