/* BACKGROUND REMOVER TOOL */

.site-header-light {
    background: #ffffff;
    color: #000000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.site-header-light .brand,
.site-header-light .nav-item > a {
    color: #000000;
}

.site-header-light .btn-dark {
    background: #eeeeee;
    color: #000000;
}

.site-header-light .btn-light {
    background: #000000;
    color: #ffffff;
}

.site-header-light .menu-toggle {
    background: #f2f2f2;
}

.site-header-light .menu-toggle span {
    background: #000000;
}

.background-remover-page [hidden] {
    display: none !important;
}

.tool-page {
    background: #ffffff;
    color: #000000;
    min-height: 100vh;
    letter-spacing: 0.055em;
}

.tool-hero {
    padding: 26px 28px 14px;
    background: #ffffff;
}

.tool-hero-inner {
    width: min(100%, 1080px);
    margin: 0 auto;
    text-align: center;
}

.tool-kicker {
    margin: 0 0 10px;
    color: rgba(0, 0, 0, 0.48);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.tool-hero h1 {
    margin: 0;
    color: #000000;
    font-size: clamp(1.7rem, 3vw, 3.3rem);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: 0.045em;
}

.tool-hero p {
    width: min(100%, 720px);
    margin: 10px auto 0;
    color: rgba(0, 0, 0, 0.62);
    font-size: 0.88rem;
    line-height: 1.6;
    font-weight: 500;
    letter-spacing: 0.045em;
}

.tool-workspace-section {
    padding: 10px 28px 70px;
    background: #ffffff;
}

.tool-workspace-layout {
    width: min(100%, 1240px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: clamp(24px, 4vw, 48px);
    align-items: start;
}

.tool-main-column {
    min-width: 0;
}

.tool-side-column {
    display: block;
}

.tool-side-sticky {
    position: sticky;
    top: 110px;
}

.bg-remover-card {
    display: grid;
    grid-template-columns: minmax(320px, 0.8fr) minmax(420px, 1.2fr);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.08);
}

.bg-upload-panel,
.bg-preview-panel {
    padding: 24px;
    min-width: 0;
}

.bg-upload-panel {
    background: #ffffff;
}

.bg-preview-panel {
    background: #f6f6f6;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
}

.step-heading {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 18px;
}

.step-heading span {
    color: rgba(0, 0, 0, 0.42);
    font-size: 0.82rem;
    font-weight: 700;
}

.step-heading h2 {
    margin: 0;
    color: #000000;
    font-size: 1rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 0.055em;
}

.bg-dropzone {
    min-height: 260px;
    padding: 24px;
    border: 1px dashed rgba(0, 0, 0, 0.28);
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(0, 0, 0, 0.035), transparent),
        #fafafa;
    display: grid;
    place-items: center;
    gap: 10px;
    text-align: center;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;
}

.bg-dropzone:hover,
.bg-dropzone.is-dragover {
    transform: translateY(-1px);
    border-color: rgba(0, 0, 0, 0.62);
    background: #ffffff;
}

.bg-dropzone input {
    display: none;
}

.bg-drop-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: #000000;
    color: #ffffff;
    display: grid;
    place-items: center;
    font-size: 0.78rem;
    font-weight: 800;
}

.bg-dropzone strong {
    color: #000000;
    font-size: 0.94rem;
    line-height: 1.35;
}

.bg-dropzone small {
    max-width: 320px;
    color: rgba(0, 0, 0, 0.52);
    font-size: 0.68rem;
    line-height: 1.6;
}

.bg-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-top: 16px;
}

.tool-primary-button,
.tool-secondary-button {
    min-height: 50px;
    border: 0;
    border-radius: 16px;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.055em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    cursor: pointer;
    text-decoration: none;
    transition:
        transform 0.18s ease,
        opacity 0.18s ease;
}

.tool-primary-button {
    background: #000000;
    color: #ffffff;
}

.tool-secondary-button {
    padding: 0 18px;
    background: #eeeeee;
    color: #000000;
}

.tool-primary-button:hover,
.tool-secondary-button:hover {
    transform: translateY(-1px);
}

.tool-primary-button:disabled,
.tool-secondary-button:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    transform: none;
}

.tool-status {
    margin: 12px 0 0;
    color: rgba(0, 0, 0, 0.52);
    font-size: 0.68rem;
    line-height: 1.55;
    font-weight: 500;
}

.tool-status[data-status="error"] {
    color: #b00020;
}

.tool-status[data-status="success"] {
    color: #067a46;
}

.bg-privacy-note {
    margin-top: 14px;
    padding: 14px;
    border-radius: 16px;
    background: #f4f4f4;
    color: rgba(0, 0, 0, 0.62);
    font-size: 0.66rem;
    line-height: 1.6;
}

.bg-privacy-note strong {
    color: #000000;
}

.bg-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.bg-preview-box {
    min-width: 0;
}

.bg-preview-title {
    margin-bottom: 8px;
    color: rgba(0, 0, 0, 0.52);
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.bg-preview-canvas {
    position: relative;
    min-height: 420px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: grid;
    place-items: center;
}

.bg-preview-canvas span {
    color: rgba(0, 0, 0, 0.38);
    font-size: 0.72rem;
    font-weight: 700;
}

.bg-preview-canvas img {
    width: 100%;
    height: 100%;
    max-height: 420px;
    object-fit: contain;
    display: block;
}

.bg-transparent-grid {
    background-color: #ffffff;
    background-image:
        linear-gradient(45deg, #e8e8e8 25%, transparent 25%),
        linear-gradient(-45deg, #e8e8e8 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e8e8e8 75%),
        linear-gradient(-45deg, transparent 75%, #e8e8e8 75%);
    background-size: 24px 24px;
    background-position: 0 0, 0 12px, 12px -12px, -12px 0px;
}

.bg-download-panel {
    margin-top: 16px;
}

.bg-download-panel .tool-primary-button {
    width: 100%;
}

/* ADS */

.ad-label {
    font-size: 10px;
    line-height: 1;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.45);
    margin-bottom: 10px;
    text-align: center;
}

.ad-slot {
    background:
        repeating-linear-gradient(
            -45deg,
            #f2f2f2 0,
            #f2f2f2 8px,
            #e9e9e9 8px,
            #e9e9e9 16px
        );
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.52);
    text-align: center;
}

.ad-section-horizontal {
    width: 100%;
    margin: clamp(28px, 5vw, 56px) auto;
}

.ad-slot-horizontal {
    width: 100%;
    min-height: 90px;
    display: block;
    border-radius: 18px;
    overflow: hidden;
}

.ad-slot-horizontal .adsbygoogle {
    display: block;
    width: 100%;
    min-height: 90px;
}

.ad-slot-vertical {
    width: 300px;
    min-height: 600px;
    margin: 0 auto;
    border-radius: 24px;
    overflow: hidden;
}

.ad-slot-adsense {
    display: block;
    background: transparent;
}

/* INFO / AEO / FAQ / MORE */

.tool-info-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 20px;
    overflow: hidden;
    background: #ffffff;
}

.tool-info-card {
    min-height: 150px;
    padding: 22px;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.tool-info-card:last-child {
    border-right: 0;
}

.tool-info-card span {
    width: 34px;
    height: 34px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: #f1f1f1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #000000;
    font-size: 1rem;
}

.tool-info-card h2 {
    margin: 0 0 10px;
    color: #000000;
    font-size: 0.88rem;
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: 0.045em;
}

.tool-info-card p {
    margin: 0;
    color: rgba(0, 0, 0, 0.56);
    font-size: 0.66rem;
    line-height: 1.65;
    font-weight: 500;
    letter-spacing: 0.035em;
}

.tool-aeo-block,
.tool-faq {
    margin-top: 0;
    padding: 28px;
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.tool-aeo-block {
    margin-bottom: 26px;
}

.tool-aeo-block h2,
.tool-faq h2,
.more-tools h2 {
    margin: 0 0 18px;
    color: #000000;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    line-height: 1.25;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.055em;
}

.tool-aeo-block p {
    margin: 0 0 14px;
    color: rgba(0, 0, 0, 0.62);
    font-size: 0.78rem;
    line-height: 1.75;
    font-weight: 300;
    letter-spacing: 0.035em;
}

.tool-aeo-block p:last-child {
    margin-bottom: 0;
}

.faq-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 18px;
}

.faq-list details {
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 14px;
    background: #fafafa;
    overflow: hidden;
}

.faq-list summary {
    min-height: 46px;
    padding: 13px 44px 13px 15px;
    color: #000000;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.04em;
    cursor: pointer;
    position: relative;
    list-style: none;
}

.faq-list summary::-webkit-details-marker {
    display: none;
}

.faq-list summary::after {
    content: "+";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #000000;
    font-size: 1rem;
    font-weight: 700;
}

.faq-list details[open] summary::after {
    content: "−";
}

.faq-list p {
    margin: 0;
    padding: 0 15px 15px;
    color: rgba(0, 0, 0, 0.56);
    font-size: 0.66rem;
    line-height: 1.6;
    font-weight: 500;
    letter-spacing: 0.035em;
}

.more-tools {
    margin-top: 26px;
}

.more-tools-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.more-tools-grid a {
    min-height: 96px;
    padding: 18px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: #000000;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.more-tools-grid span {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: #f2f2f2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
}

.more-tools-grid em {
    font-style: normal;
    font-size: 1.1rem;
}

/* RESPONSIVE */

@media (max-width: 1180px) {
    .tool-workspace-layout {
        grid-template-columns: 1fr;
    }

    .tool-side-column {
        display: none;
    }

    .bg-remover-card {
        grid-template-columns: 1fr;
    }

    .bg-preview-panel {
        border-left: 0;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }

    .tool-info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tool-info-card:nth-child(2) {
        border-right: 0;
    }

    .tool-info-card:nth-child(1),
    .tool-info-card:nth-child(2) {
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }
}

@media (max-width: 768px) {
    .tool-hero {
        padding: 24px 18px 12px;
    }

    .tool-workspace-section {
        padding: 8px 18px 54px;
    }

    .bg-preview-grid {
        grid-template-columns: 1fr;
    }

    .bg-preview-canvas {
        min-height: 320px;
    }

    .bg-preview-canvas img {
        max-height: 320px;
    }

    .ad-slot-horizontal,
    .ad-slot-horizontal .adsbygoogle {
        min-height: 250px;
    }

    .faq-list {
        grid-template-columns: 1fr;
    }

    .more-tools-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

@media (max-width: 560px) {
    .tool-page {
        letter-spacing: 0.045em;
    }

    .tool-hero {
        padding-top: 18px;
    }

    .tool-hero h1 {
        font-size: clamp(1.4rem, 7.5vw, 2rem);
    }

    .tool-hero p {
        font-size: 0.72rem;
    }

    .bg-remover-card {
        border-radius: 18px;
    }

    .bg-upload-panel,
    .bg-preview-panel {
        padding: 16px;
    }

    .bg-dropzone {
        min-height: 220px;
        padding: 18px;
    }

    .bg-actions {
        grid-template-columns: 1fr;
    }

    .tool-info-grid {
        grid-template-columns: 1fr;
        border-radius: 18px;
    }

    .tool-info-card {
        min-height: auto;
        padding: 17px;
        border-right: 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }

    .tool-info-card:last-child {
        border-bottom: 0;
    }

    .tool-aeo-block,
    .tool-faq {
        padding: 18px;
        border-radius: 18px;
    }

    .tool-aeo-block h2,
    .tool-faq h2,
    .more-tools h2 {
        text-align: left;
        font-size: 1.05rem;
    }

    .tool-aeo-block p,
    .faq-list p {
        font-size: 0.62rem;
    }

    .faq-list summary {
        font-size: 0.66rem;
    }
}
/* EDITOR / RETOUCH FIX */

.bg-preview-canvas canvas[data-bg-editor-canvas] {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 420px;
    object-fit: contain;
    border-radius: 20px;
    touch-action: none;
    cursor: none;
}

.bg-transparent-grid canvas[data-bg-editor-canvas] {
    background: transparent;
}

.bg-edit-panel {
    margin-top: 16px;
    padding: 14px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.bg-edit-toolbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.bg-tool-button {
    min-height: 38px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 12px;
    background: #f0f0f0;
    color: #000000;
    font-family: inherit;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.045em;
    cursor: pointer;
}

.bg-tool-button.is-active,
.bg-tool-button:hover {
    background: #000000;
    color: #ffffff;
}

.bg-edit-brush {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.bg-edit-brush label,
.bg-edit-brush span {
    font-size: 0.62rem;
    font-weight: 800;
    color: #000000;
}

.bg-edit-brush input[type="range"] {
    width: 100%;
    accent-color: #000000;
}

.bg-edit-help {
    margin: 0;
    color: rgba(0, 0, 0, 0.62);
    font-size: 0.62rem;
    line-height: 1.55;
    letter-spacing: 0.035em;
}

@media (max-width: 768px) {
    .bg-preview-canvas canvas[data-bg-editor-canvas] {
        max-height: 320px;
    }

    .bg-edit-toolbar {
        grid-template-columns: 1fr;
    }

    .bg-edit-brush {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}
/* BACKGROUND REMOVER V2 */

.bg-remover-card-v2 {
    grid-template-columns: minmax(320px, 0.72fr) minmax(460px, 1.28fr);
}

.bg-result-panel {
    padding: 24px;
    background: #f6f6f6;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    min-width: 0;
}

.bg-result-stage {
    min-height: 520px;
    border-radius: 24px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: grid;
    place-items: center;
    position: relative;
}

.bg-result-empty {
    width: min(100%, 360px);
    padding: 30px;
    text-align: center;
    display: grid;
    place-items: center;
    gap: 10px;
}

.bg-result-empty span {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: #000000;
    color: #ffffff;
    display: grid;
    place-items: center;
    font-size: 0.78rem;
    font-weight: 900;
}

.bg-result-empty strong {
    color: #000000;
    font-size: 1rem;
    line-height: 1.35;
}

.bg-result-empty small {
    color: rgba(0, 0, 0, 0.58);
    font-size: 0.68rem;
    line-height: 1.6;
}

.bg-result-stage img[data-bg-original] {
    display: none !important;
}

.bg-result-stage img[data-bg-result] {
    width: 100%;
    max-width: 100%;
    max-height: 520px;
    object-fit: contain;
}

.bg-result-stage canvas[data-bg-editor-canvas] {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 520px;
    object-fit: contain;
    border-radius: 24px;
    touch-action: none;
    cursor: none;
}

.bg-result-actions {
    margin-top: 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.bg-result-actions .tool-primary-button {
    width: 100%;
}

.bg-edit-panel {
    margin-top: 14px;
    padding: 14px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.bg-edit-toolbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.bg-tool-button {
    min-height: 38px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 12px;
    background: #f0f0f0;
    color: #000000;
    font-family: inherit;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.045em;
    cursor: pointer;
}

.bg-tool-button.is-active,
.bg-tool-button:hover {
    background: #000000;
    color: #ffffff;
}

.bg-edit-brush {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.bg-edit-brush label,
.bg-edit-brush span {
    font-size: 0.62rem;
    font-weight: 800;
    color: #000000;
}

.bg-edit-brush input[type="range"] {
    width: 100%;
    accent-color: #000000;
}

.bg-edit-help {
    margin: 0;
    color: rgba(0, 0, 0, 0.62);
    font-size: 0.62rem;
    line-height: 1.55;
    letter-spacing: 0.035em;
}

/* MODAL IA */

.bg-processing-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 24px;
}

.bg-processing-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(16px);
}

.bg-processing-card {
    width: min(100%, 460px);
    position: relative;
    z-index: 1;
    padding: 28px;
    border-radius: 28px;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.18), transparent 36%),
        #050505;
    color: #ffffff;
    text-align: center;
    overflow: hidden;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}

.bg-processing-card::before {
    content: "";
    position: absolute;
    inset: -40%;
    background:
        conic-gradient(
            from 0deg,
            transparent,
            rgba(255, 255, 255, 0.18),
            transparent,
            rgba(255, 255, 255, 0.12),
            transparent
        );
    animation: bgSpin 5s linear infinite;
    opacity: 0.55;
}

.bg-processing-card > * {
    position: relative;
    z-index: 1;
}

.bg-ai-orb {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    position: relative;
    background: #ffffff;
    box-shadow:
        0 0 30px rgba(255, 255, 255, 0.45),
        0 0 80px rgba(255, 255, 255, 0.16);
}

.bg-ai-orb span {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.28);
    animation: bgPulse 1.8s ease-in-out infinite;
}

.bg-ai-orb span:nth-child(1) {
    width: 20px;
    height: 20px;
}

.bg-ai-orb span:nth-child(2) {
    width: 38px;
    height: 38px;
    animation-delay: 0.2s;
}

.bg-ai-orb span:nth-child(3) {
    width: 56px;
    height: 56px;
    animation-delay: 0.4s;
}

.bg-processing-preview {
    width: 100%;
    aspect-ratio: 4 / 3;
    margin: 0 auto 18px;
    border-radius: 22px;
    overflow: hidden;
    position: relative;
    background: #111111;
    display: grid;
    place-items: center;
}

.bg-processing-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.85;
    filter: saturate(0.85) contrast(1.05);
}

.bg-ai-scan {
    position: absolute;
    left: 0;
    right: 0;
    top: -30%;
    height: 28%;
    background:
        linear-gradient(
            to bottom,
            transparent,
            rgba(255, 255, 255, 0.4),
            transparent
        );
    animation: bgScan 1.65s ease-in-out infinite;
    mix-blend-mode: screen;
}

.bg-ai-spark {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 18px #ffffff;
    animation: bgSpark 1.6s ease-in-out infinite;
}

.spark-1 {
    left: 18%;
    top: 24%;
}

.spark-2 {
    right: 20%;
    top: 40%;
    animation-delay: 0.35s;
}

.spark-3 {
    left: 52%;
    bottom: 24%;
    animation-delay: 0.7s;
}

.bg-processing-card h2 {
    margin: 0 0 10px;
    font-size: 1.12rem;
    line-height: 1.35;
    letter-spacing: 0.055em;
}

.bg-processing-card p {
    margin: 0;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.72rem;
    line-height: 1.6;
}

@keyframes bgSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes bgPulse {
    0%, 100% {
        transform: scale(0.92);
        opacity: 0.55;
    }

    50% {
        transform: scale(1.08);
        opacity: 1;
    }
}

@keyframes bgScan {
    0% {
        top: -35%;
    }

    100% {
        top: 110%;
    }
}

@keyframes bgSpark {
    0%, 100% {
        transform: scale(0.65);
        opacity: 0.35;
    }

    50% {
        transform: scale(1.4);
        opacity: 1;
    }
}

@media (max-width: 1180px) {
    .bg-remover-card-v2 {
        grid-template-columns: 1fr;
    }

    .bg-result-panel {
        border-left: 0;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }
}

@media (max-width: 768px) {
    .bg-result-stage {
        min-height: 390px;
    }

    .bg-result-stage canvas[data-bg-editor-canvas],
    .bg-result-stage img[data-bg-result] {
        max-height: 390px;
    }

    .bg-result-actions {
        grid-template-columns: 1fr;
    }

    .bg-edit-toolbar {
        grid-template-columns: 1fr;
    }

    .bg-edit-brush {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .bg-processing-card {
        padding: 22px;
        border-radius: 24px;
    }
}
/* BRUSH VISUAL CURSOR */

.bg-brush-cursor {
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    border: 2px solid #000000;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.72),
        0 8px 24px rgba(0, 0, 0, 0.18);
    pointer-events: none;
    z-index: 5;
    transform: translate(-9999px, -9999px);
    mix-blend-mode: difference;
}

.bg-brush-cursor.is-restore {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.28);
}

.bg-brush-cursor.is-erase {
    border-color: #000000;
    background: rgba(0, 0, 0, 0.08);
}
/* VISUAL BACKGROUND OPTIONS */

.bg-view-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
}

.bg-view-controls span {
    color: rgba(0, 0, 0, 0.55);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bg-view-button {
    min-height: 30px;
    padding: 0 11px;
    border: 1px solid rgba(0, 0, 0, 0.16);
    border-radius: 999px;
    background: #ffffff;
    color: #000000;
    font-family: inherit;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.045em;
    cursor: pointer;
}

.bg-view-button:hover,
.bg-view-button.is-active {
    background: #000000;
    color: #ffffff;
}

.bg-result-stage[data-bg-view-mode="transparent"] {
    background-color: #ffffff;
    background-image:
        linear-gradient(45deg, #e8e8e8 25%, transparent 25%),
        linear-gradient(-45deg, #e8e8e8 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e8e8e8 75%),
        linear-gradient(-45deg, transparent 75%, #e8e8e8 75%);
    background-size: 24px 24px;
    background-position: 0 0, 0 12px, 12px -12px, -12px 0px;
}

.bg-result-stage[data-bg-view-mode="white"] {
    background: #ffffff;
}

.bg-result-stage[data-bg-view-mode="black"] {
    background: #050505;
}

.bg-result-stage[data-bg-view-mode="color"] {
    background:
        radial-gradient(circle at top left, rgba(255, 204, 112, 0.75), transparent 38%),
        radial-gradient(circle at bottom right, rgba(105, 167, 255, 0.75), transparent 42%),
        #f3f3f3;
}

.bg-result-stage[data-bg-view-mode="black"] .bg-result-empty,
.bg-result-stage[data-bg-view-mode="black"] .bg-result-empty strong,
.bg-result-stage[data-bg-view-mode="black"] .bg-result-empty small {
    color: #ffffff;
}
/* VIEW BACKGROUND NOTE - PRO */

.bg-view-controls {
    display: grid;
    gap: 10px;
    margin: 0 0 14px;
}

.bg-view-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
}

.bg-view-header span {
    color: rgba(0, 0, 0, 0.58);
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.bg-view-header small {
    max-width: 360px;
    color: rgba(0, 0, 0, 0.48);
    font-size: 0.6rem;
    line-height: 1.45;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: right;
}

.bg-view-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.bg-view-button {
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid rgba(0, 0, 0, 0.16);
    border-radius: 999px;
    background: #ffffff;
    color: #000000;
    font-family: inherit;
    font-size: 0.6rem;
    font-weight: 900;
    letter-spacing: 0.045em;
    cursor: pointer;
    transition:
        background 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease;
}

.bg-view-button:hover {
    transform: translateY(-1px);
}

.bg-view-button:hover,
.bg-view-button.is-active {
    background: #000000;
    color: #ffffff;
}

@media (max-width: 768px) {
    .bg-view-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .bg-view-header small {
        max-width: 100%;
        text-align: left;
    }

    .bg-view-buttons {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bg-view-button {
        width: 100%;
    }
}
/* HEADER CLARO SOLO EN HERRAMIENTAS */

.site-header-light {
    background: #ffffff;
    color: #000000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.site-header-light .brand,
.site-header-light .nav-item > a {
    color: #000000;
}

.site-header-light .nav-item > a {
    opacity: 0.88;
}

.site-header-light .nav-item:hover > a,
.site-header-light .nav-item.is-open > a {
    opacity: 1;
}

.site-header-light .btn-dark {
    background: #eeeeee;
    color: #000000;
}

.site-header-light .btn-light {
    background: #000000;
    color: #ffffff;
}

.site-header-light .menu-toggle {
    background: #f2f2f2;
}

.site-header-light .menu-toggle span {
    background: #000000;
}

/* Dropdown desktop en herramientas */

.site-header-light .dropdown {
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.site-header-light .dropdown::after {
    background: rgba(255, 255, 255, 0.52);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.site-header-light .dropdown a {
    color: rgba(0, 0, 0, 0.78);
}

.site-header-light .dropdown a:hover {
    color: #000000;
}

.site-header-light .dropdown-cta {
    background: #000000 !important;
    color: #ffffff !important;
}
@media (max-width: 900px) {
    .site-header-light {
        background: #ffffff;
    }

    body.menu-open .site-header-light {
        background: #ffffff;
    }

    body.menu-open .site-header-light .main-nav {
        background: #ffffff;
    }

    body.menu-open .site-header-light::before {
        background: rgba(255, 255, 255, 0.62);
    }

    .site-header-light .main-nav {
        background: #ffffff;
    }

    .site-header-light .nav-item > a {
        color: #000000;
    }

    .site-header-light .dropdown a {
        color: rgba(0, 0, 0, 0.74);
    }

    .site-header-light .dropdown a:hover {
        color: #000000;
    }

    .site-header-light .dropdown-cta {
        background: transparent !important;
        color: rgba(0, 0, 0, 0.74) !important;
    }
}
/* READABILITY PATCH - HERRAMIENTAS */

.tool-page p {
    font-size: 0.88rem;
    line-height: 1.75;
    font-weight: 500;
}

/* Textos largos SEO / AEO */
.tool-aeo-block p {
    font-size: 0.9rem;
    line-height: 1.8;
    font-weight: 500;
}

/* Cards informativas */
.tool-info-card p {
    font-size: 0.78rem;
    line-height: 1.7;
    font-weight: 500;
}

/* FAQs */
.faq-list p {
    font-size: 0.78rem;
    line-height: 1.7;
    font-weight: 500;
}

/* Notas y estados, siguen pequeños pero legibles */
.tool-status,
.tool-note,
.bg-edit-help,
.bg-privacy-note {
    font-size: 0.74rem;
    line-height: 1.6;
    font-weight: 500;
}
@media (max-width: 560px) {
    .tool-page p {
        font-size: 0.82rem;
        line-height: 1.7;
    }

    .tool-aeo-block p,
    .faq-list p,
    .tool-info-card p {
        font-size: 0.78rem;
    }

    .tool-status,
    .tool-note,
    .bg-edit-help,
    .bg-privacy-note {
        font-size: 0.7rem;
    }
}