/* ============================================================
   AVIF Background Remover - stylesheet (rebuilt 2026-10-02)
   Replaces style.css. Everything is scoped under .abr / .abr-*;
   the shared header, footer, FAQ and related-tools pills come from
   styles/custom_styles.css. Green accent like the other background
   removers, single colours, no gradients, no 4px side borders.
   Dark mode via [data-theme="dark"], light is the default.
   ============================================================ */

.abr {
    --abr-accent: #339966;
    --abr-accent-strong: #2b8557;
    --abr-accent-soft: rgba(51, 153, 102, 0.10);
    --abr-accent-line: rgba(51, 153, 102, 0.45);
    --abr-go: #2b8557;
    --abr-go-hover: #1f6b45;
    --abr-card: var(--bg-elevated, #fff);
    --abr-sunk: var(--card-tertiary, #f1f5f9);
    --abr-open: var(--bg-secondary, #f8fafc);
    --abr-line: var(--border-color, #e2e8f0);
    --abr-text-1: var(--text-primary, #1e293b);
    --abr-text-2: var(--text-secondary, #555);
    --abr-muted: var(--text-muted, #64748b);
    --abr-checker: #e5e7eb;
    --abr-checker-bg: #fff;
    --abr-warn: #b45309;
    --abr-red: #c23b3b;
}
[data-theme="dark"] .abr {
    --abr-accent: #4ade80;
    --abr-accent-strong: #86efac;
    --abr-accent-soft: rgba(74, 222, 128, 0.12);
    --abr-accent-line: rgba(74, 222, 128, 0.45);
    --abr-sunk: #172033;
    --abr-open: #1a2438;
    --abr-checker: #334155;
    --abr-checker-bg: #1e293b;
    --abr-warn: #fbbf24;
    --abr-red: #f87171;
}

.abr.tool-container { max-width: 1100px; margin: 0 auto; padding: 2rem; }
.abr [hidden] { display: none !important; }
.abr button { width: auto; font: inherit; }
.abr .faq-question { width: 100%; }
@media (max-width: 600px) {
    html.abr-editing .back-to-top-wrapper { display: none; }
}

/* ---------- title ---------- */
.abr .tool-header { text-align: center; margin-bottom: 1.75rem; }
.abr .tool-title-row { display: flex; align-items: center; justify-content: center; gap: 0.9rem; margin-bottom: 0.9rem; }
.abr .abr-title-icon {
    width: 56px; height: 56px; border-radius: 16px;
    background: var(--abr-accent); color: #fff;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
[data-theme="dark"] .abr .abr-title-icon { color: #0f172a; }
.abr .abr-title-icon svg { width: 30px; height: 30px; display: block; }
.abr .tool-title { margin: 0; font-size: 2rem; font-weight: 700; color: var(--abr-accent); line-height: 1.2; }
.abr .tool-description { max-width: 800px; margin: 0 auto; font-size: 1.05rem; line-height: 1.65; color: var(--abr-text-2); }
.abr .tool-description a { color: var(--abr-accent-strong); font-weight: 500; }
[data-theme="dark"] .abr .tool-description a { color: var(--abr-accent); }

/* ---------- error ---------- */
.abr .abr-error {
    display: flex; align-items: flex-start; gap: 0.7rem;
    margin: 0 0 1rem; padding: 0.9rem 1rem; border-radius: 12px;
    border: 1px solid rgba(230, 78, 78, 0.35); background: rgba(230, 78, 78, 0.08);
    color: var(--abr-text-1);
}
.abr .abr-error > svg { width: 20px; height: 20px; color: #e64e4e; flex-shrink: 0; margin-top: 2px; }
.abr .abr-error > div { flex: 1; min-width: 0; }
.abr .abr-error p { margin: 0; font-size: 0.9rem; line-height: 1.55; }
.abr .abr-error p + p { margin-top: 0.3rem; color: var(--abr-muted); }
.abr .abr-error a { color: var(--abr-red); font-weight: 600; }
.abr .abr-error-close { background: none; border: none; padding: 2px; color: var(--abr-muted); cursor: pointer; }
.abr .abr-error-close svg { width: 16px; height: 16px; }

/* ---------- shared bits ---------- */
.abr .abr-h { display: inline-flex; align-items: center; gap: 0.45rem; margin: 0; font-size: 0.95rem; font-weight: 700; color: var(--abr-text-1); }
.abr .abr-h svg { width: 17px; height: 17px; color: var(--abr-accent); }
.abr .abr-hint { margin: 0.5rem 0 0; font-size: 0.78rem; line-height: 1.5; color: var(--abr-muted); }
.abr .abr-hint.is-warn { color: var(--abr-warn); font-weight: 600; }
.abr .abr-label { display: block; font-size: 0.82rem; font-weight: 700; color: var(--abr-text-1); }
.abr .abr-text-btn {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.45rem 0.7rem; border: none; border-radius: 8px; background: none;
    color: var(--abr-accent-strong); font-size: 0.85rem; font-weight: 600; cursor: pointer; flex-shrink: 0;
}
[data-theme="dark"] .abr .abr-text-btn { color: var(--abr-accent); }
.abr .abr-text-btn:hover { background: var(--abr-accent-soft); }
.abr .abr-text-btn svg { width: 15px; height: 15px; }
.abr .abr-bg-checker,
.abr .abr-sw-checker {
    background-color: var(--abr-checker-bg);
    background-image:
        linear-gradient(45deg, var(--abr-checker) 25%, transparent 25%),
        linear-gradient(-45deg, var(--abr-checker) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--abr-checker) 75%),
        linear-gradient(-45deg, transparent 75%, var(--abr-checker) 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.abr .abr-sw-checker { background-size: 8px 8px; background-position: 0 0, 0 4px, 4px -4px, -4px 0; }
.abr .abr-bg-white { background: #fff; }
.abr .abr-bg-black { background: #111; }
.abr .abr-bg-pink { background: #ff4fd8; }
.abr .abr-sw {
    display: inline-block; width: 18px; height: 18px; border-radius: 50%;
    border: 1px solid var(--abr-line); flex-shrink: 0; vertical-align: middle;
}

/* ---------- upload ---------- */
.abr .abr-upload {
    background: var(--abr-card); border: 1px solid var(--abr-line);
    border-radius: 20px; padding: 1.25rem; box-shadow: var(--shadow-sm);
}
.abr .abr-drop {
    display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
    padding: 2.6rem 1.25rem 2.2rem; border: 2px dashed var(--abr-accent-line); border-radius: 14px;
    background: var(--abr-sunk); text-align: center; cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}
.abr .abr-drop:hover, .abr .abr-drop:focus-visible, .abr .abr-drop.dragover { border-color: var(--abr-accent); background: var(--abr-accent-soft); outline: none; }
.abr .abr-drop-icon {
    width: 64px; height: 64px; border-radius: 16px; background: var(--abr-accent); color: #fff;
    display: flex; align-items: center; justify-content: center; margin-bottom: 0.4rem;
}
[data-theme="dark"] .abr .abr-drop-icon { color: #0f172a; }
.abr .abr-drop-icon svg { width: 30px; height: 30px; }
.abr .abr-drop-title { font-size: 1.3rem; font-weight: 700; color: var(--abr-text-1); }
.abr .abr-drop-sub { font-size: 0.925rem; color: var(--abr-muted); }
.abr .abr-drop-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem; margin-top: 0.8rem; }
.abr .abr-drop-chips span {
    padding: 0.2rem 0.6rem; border-radius: 999px; border: 1px solid var(--abr-line);
    background: var(--abr-card); font-size: 0.72rem; font-weight: 700; color: var(--abr-muted);
}
.abr .abr-upload-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.8rem 0.25rem 0; }
.abr .abr-samples { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.9rem; }
.abr .abr-samples-label { font-size: 0.82rem; color: var(--abr-muted); }
.abr .abr-link-btn {
    display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.1rem;
    background: none; border: none; color: var(--abr-accent-strong); font-size: 0.875rem; font-weight: 600; cursor: pointer;
}
[data-theme="dark"] .abr .abr-link-btn { color: var(--abr-accent); }
.abr .abr-link-btn:hover { text-decoration: underline; }
.abr .abr-link-btn:disabled { opacity: 0.5; cursor: wait; }
.abr .abr-link-btn svg { width: 16px; height: 16px; }
.abr .abr-upload-note { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--abr-muted); }
.abr .abr-upload-note svg { width: 15px; height: 15px; color: var(--abr-accent); }

/* recent */
.abr .abr-recent { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--abr-line); }
.abr .abr-recent-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.6rem; }
.abr .abr-recent-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 0.6rem; }
.abr .abr-recent-item {
    position: relative; display: flex; flex-direction: column; gap: 0.3rem; min-width: 0;
    padding: 0.4rem; border: 1px solid var(--abr-line); border-radius: 10px; background: var(--abr-card);
}
.abr .abr-recent-thumb { display: flex; align-items: center; justify-content: center; height: 80px; border-radius: 7px; overflow: hidden; }
.abr .abr-recent-thumb img { max-width: 100%; max-height: 100%; display: block; }
.abr .abr-recent-name { font-size: 0.72rem; font-weight: 600; color: var(--abr-text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.abr .abr-recent-meta { font-size: 0.68rem; color: var(--abr-muted); }
.abr .abr-recent-dl {
    position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; padding: 0;
    border: none; border-radius: 8px; background: var(--abr-go); color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.abr .abr-recent-dl:hover { background: var(--abr-go-hover); }
.abr .abr-recent-dl svg { width: 15px; height: 15px; }

/* ---------- editor ---------- */
.abr .abr-editor { background: var(--abr-sunk); border: 1px solid var(--abr-line); border-radius: 20px; padding: 1rem; }
.abr .abr-filebar {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    margin-bottom: 0.875rem; padding: 0.5rem; background: var(--abr-card);
    border: 1px solid var(--abr-line); border-radius: 12px;
}
.abr .abr-strip { display: flex; gap: 0.45rem; overflow-x: auto; min-width: 0; padding: 2px; scrollbar-width: thin; }
.abr .abr-thumb {
    position: relative; flex: 0 0 auto; width: 56px; height: 56px; padding: 0;
    border: 2px solid var(--abr-line); border-radius: 10px; overflow: hidden; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.abr .abr-thumb img { max-width: 100%; max-height: 100%; display: block; }
.abr .abr-thumb.active { border-color: var(--abr-accent); box-shadow: 0 0 0 3px var(--abr-accent-soft); }
.abr .abr-thumb-badge {
    position: absolute; left: 3px; bottom: 3px; padding: 0 4px; border-radius: 4px;
    background: rgba(15, 23, 42, 0.78); color: #fff; font-size: 0.58rem; font-weight: 700; line-height: 1.5;
}
.abr .abr-thumb-x {
    position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; padding: 0;
    border: none; border-radius: 50%; background: rgba(15, 23, 42, 0.78); color: #fff;
    display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: opacity 0.15s;
}
.abr .abr-thumb:hover .abr-thumb-x, .abr .abr-thumb.active .abr-thumb-x, .abr .abr-thumb-x:focus-visible { opacity: 1; }
.abr .abr-thumb-x svg { width: 11px; height: 11px; }

.abr .abr-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 0.875rem; align-items: start; }
.abr .abr-col-preview, .abr .abr-col-side { min-width: 0; }
.abr .abr-col-preview { position: sticky; top: 12px; }
.abr .abr-card { background: var(--abr-card); border: 1px solid var(--abr-line); border-radius: 12px; padding: 1rem 1.1rem; min-width: 0; }
.abr .abr-card + .abr-card { margin-top: 0.875rem; }
.abr .abr-card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.25rem 0.75rem; margin-bottom: 0.8rem; }

/* preview */
.abr .abr-preview-card { background: var(--abr-card); border: 1px solid var(--abr-line); border-radius: 12px; padding: 0.6rem; }
.abr .abr-compare {
    position: relative; width: 100%; height: 440px; border-radius: 9px;
    border: 1px solid var(--abr-line); overflow: hidden; user-select: none;
}
.abr .abr-stage-wrap { position: absolute; inset: 0; display: flex; overflow: hidden; }
.abr .abr-compare.is-zoomed .abr-stage-wrap { overflow: auto; overscroll-behavior: contain; }
.abr .abr-stage { position: relative; margin: auto; flex-shrink: 0; }
.abr .abr-compare-layer { position: absolute; inset: 0; }
.abr .abr-compare-layer img, .abr .abr-compare-layer canvas { width: 100%; height: 100%; display: block; }
.abr .abr-compare-tag {
    position: absolute; top: 10px; z-index: 3; padding: 0.2rem 0.55rem; border-radius: 999px;
    background: rgba(15, 23, 42, 0.72); color: #fff; font-size: 0.7rem; font-weight: 700; pointer-events: none;
}
.abr .abr-tag-before { left: 10px; }
.abr .abr-tag-after { right: 10px; }
.abr .abr-compare-range {
    position: absolute; inset: 0; z-index: 5; width: 100%; height: 100%; margin: 0;
    opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none;
}
.abr .abr-compare.is-picking .abr-compare-range { pointer-events: none; }
.abr .abr-compare.is-brushing .abr-compare-before,
.abr .abr-compare.is-brushing .abr-compare-range,
.abr .abr-compare.is-brushing .abr-compare-line,
.abr .abr-compare.is-brushing .abr-compare-tag { display: none; }
.abr .abr-compare.is-brushing .abr-stage { cursor: none; touch-action: none; }
.abr .abr-compare.is-panning .abr-stage { cursor: grab; }
.abr .abr-brush-cursor {
    position: absolute; z-index: 6; display: none; border-radius: 50%; pointer-events: none;
    border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.7), inset 0 0 0 1px rgba(15, 23, 42, 0.35);
    transform: translate(-50%, -50%);
}
.abr .abr-brush-cursor.is-erase { background: rgba(230, 78, 78, 0.18); }
.abr .abr-brush-cursor.is-restore { background: rgba(51, 153, 102, 0.2); }
.abr .abr-brush-cursor.is-on { display: block; }
.abr .abr-compare.is-picking { cursor: crosshair; }
.abr .abr-compare-line {
    position: absolute; top: 0; bottom: 0; left: 50%; z-index: 4; width: 2px; margin-left: -1px;
    background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); pointer-events: none;
}
.abr .abr-compare-knob {
    position: absolute; top: 50%; left: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px;
    border-radius: 50%; background: #fff; color: #1e293b; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex; align-items: center; justify-content: center;
}
.abr .abr-compare-knob svg { width: 18px; height: 18px; }
.abr .abr-preview-busy {
    position: absolute; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center;
    padding: 1rem; background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(2px);
}
.abr .abr-busy-card {
    display: flex; flex-direction: column; align-items: center; gap: 0.35rem; width: 100%; max-width: 300px;
    padding: 1.1rem; border-radius: 14px; background: var(--abr-card); border: 1px solid var(--abr-line);
    text-align: center; box-shadow: var(--shadow-md);
}
.abr .abr-busy-card strong { font-size: 0.95rem; color: var(--abr-text-1); }
.abr .abr-busy-card span { font-size: 0.78rem; line-height: 1.45; color: var(--abr-muted); }
.abr .abr-preview-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 0.75rem; padding: 0.6rem 0.15rem 0.1rem; }
.abr .abr-backdrops { display: inline-flex; gap: 0.3rem; }
.abr .abr-backdrops button {
    width: 32px; height: 32px; padding: 0; border: 1px solid var(--abr-line); border-radius: 8px;
    background: var(--abr-card); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.abr .abr-backdrops button.active { border-color: var(--abr-accent); box-shadow: 0 0 0 2px var(--abr-accent-soft); }
.abr .abr-pick-btn {
    display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.4rem 0.7rem;
    border: 1px solid var(--abr-line); border-radius: 8px; background: var(--abr-card);
    color: var(--abr-text-2); font-size: 0.82rem; font-weight: 600; cursor: pointer;
}
.abr .abr-pick-btn.active { border-color: var(--abr-accent); background: var(--abr-accent-soft); color: var(--abr-accent-strong); }
[data-theme="dark"] .abr .abr-pick-btn.active { color: var(--abr-accent); }
.abr .abr-pick-btn svg { width: 15px; height: 15px; }
.abr .abr-preview-note { margin-left: auto; font-size: 0.76rem; color: var(--abr-muted); }

/* touch-up brush bar */
.abr .abr-touch { margin-top: 0.6rem; padding: 0.7rem 0.15rem 0.1rem; border-top: 1px solid var(--abr-line); }
.abr .abr-touch-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 0.6rem; }
.abr .abr-touch-row + .abr-touch-row { margin-top: 0.6rem; }
.abr .abr-touch-label { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.82rem; font-weight: 700; color: var(--abr-text-1); }
.abr .abr-touch-label svg { width: 16px; height: 16px; color: var(--abr-accent); }
.abr .abr-tool-seg { display: inline-flex; gap: 0.25rem; padding: 3px; border: 1px solid var(--abr-line); border-radius: 10px; background: var(--abr-sunk); }
.abr .abr-tool-seg button {
    display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.38rem 0.65rem; border: none; border-radius: 7px;
    background: none; color: var(--abr-text-2); font-size: 0.8rem; font-weight: 600; cursor: pointer;
}
.abr .abr-tool-seg button svg { width: 15px; height: 15px; }
.abr .abr-tool-seg button:hover:not(:disabled) { color: var(--abr-text-1); }
.abr .abr-tool-seg button.active { background: var(--abr-card); color: var(--abr-accent-strong); box-shadow: var(--shadow-sm); }
[data-theme="dark"] .abr .abr-tool-seg button.active { color: var(--abr-accent); }
.abr .abr-tool-seg button:disabled { opacity: 0.4; cursor: not-allowed; }
.abr .abr-touch-actions { display: inline-flex; gap: 0.25rem; margin-left: auto; }
.abr .abr-touch-actions button, .abr .abr-zoom button {
    width: 32px; height: 32px; padding: 0; border: 1px solid var(--abr-line); border-radius: 8px; background: var(--abr-card);
    color: var(--abr-text-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.abr .abr-touch-actions button svg, .abr .abr-zoom button svg { width: 16px; height: 16px; }
.abr .abr-touch-actions button:hover:not(:disabled), .abr .abr-zoom button:hover:not(:disabled) { border-color: var(--abr-accent-line); color: var(--abr-text-1); }
.abr .abr-touch-actions button:disabled, .abr .abr-zoom button:disabled { opacity: 0.4; cursor: not-allowed; }
.abr .abr-brush-size { display: flex; align-items: center; gap: 0.5rem; flex: 1; min-width: 180px; font-size: 0.8rem; font-weight: 600; color: var(--abr-text-2); }
.abr .abr-brush-size input { flex: 1; min-width: 0; }
.abr .abr-brush-size strong { min-width: 48px; text-align: right; font-size: 0.8rem; color: var(--abr-accent-strong); font-variant-numeric: tabular-nums; }
[data-theme="dark"] .abr .abr-brush-size strong { color: var(--abr-accent); }
.abr .abr-zoom { display: inline-flex; align-items: center; gap: 0.35rem; }
.abr .abr-zoom strong { min-width: 34px; text-align: center; font-size: 0.8rem; color: var(--abr-text-1); font-variant-numeric: tabular-nums; }
.abr .abr-touch .abr-hint { margin-top: 0.55rem; }

/* logo loader (ConvertICO rings) */
.abr .abr-loader { width: 54px; height: 54px; margin-bottom: 0.2rem; }
.abr .abr-loader circle { fill: none; stroke-linecap: round; transform-origin: 50px 50px; }
.abr .abr-loader-track { stroke: var(--abr-sunk); stroke-width: 7; }
.abr .abr-loader-r { stroke: #e64e4e; stroke-width: 7; stroke-dasharray: 90 200; animation: abr-spin 1.3s linear infinite; }
.abr .abr-loader-g { stroke: #339966; stroke-width: 6; stroke-dasharray: 60 120; animation: abr-spin 2.1s linear infinite reverse; }
.abr .abr-loader-b { fill: #3399cc !important; stroke: none; animation: abr-breathe 1.6s ease-in-out infinite; }
@keyframes abr-spin { to { transform: rotate(360deg); } }
@keyframes abr-breathe { 50% { transform: scale(0.78); } }
@media (prefers-reduced-motion: reduce) {
    .abr .abr-loader-r { animation-duration: 4s; }
    .abr .abr-loader-g { animation-duration: 6s; }
    .abr .abr-loader-b { animation: none; }
}

/* presets */
.abr .abr-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.abr .abr-chip {
    display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.35rem 0.7rem;
    border: 1px solid var(--abr-line); border-radius: 999px; background: var(--abr-card);
    color: var(--abr-text-2); font-size: 0.8rem; font-weight: 600; cursor: pointer;
}
.abr .abr-chip:hover { border-color: var(--abr-accent-line); }
.abr .abr-chip.active { border-color: var(--abr-accent); background: var(--abr-accent-soft); color: var(--abr-accent-strong); }
[data-theme="dark"] .abr .abr-chip.active { color: var(--abr-accent); }
.abr .abr-chip.is-user { padding-right: 0.35rem; }
.abr .abr-chip-x { display: inline-flex; width: 18px; height: 18px; border-radius: 50%; align-items: center; justify-content: center; color: var(--abr-muted); }
.abr .abr-chip-x:hover { background: var(--abr-sunk); color: var(--abr-red); }
.abr .abr-chip-x svg { width: 12px; height: 12px; }
.abr .abr-preset-save { display: flex; gap: 0.35rem; margin-top: 0.6rem; }
.abr .abr-preset-save input {
    flex: 1; min-width: 0; padding: 0.45rem 0.6rem; border: 1px solid var(--abr-line); border-radius: 8px;
    background: var(--abr-card); color: var(--abr-text-1); font: inherit; font-size: 0.85rem;
}
.abr .abr-preset-save input:focus { outline: none; border-color: var(--abr-accent); box-shadow: 0 0 0 3px var(--abr-accent-soft); }

/* method cards */
.abr .abr-methods { display: flex; flex-direction: column; gap: 0.45rem; }
.abr .abr-method {
    display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 0.65rem 0.8rem;
    border: 1px solid var(--abr-line); border-radius: 12px; background: var(--abr-card);
    color: var(--abr-text-2); text-align: left; cursor: pointer; transition: border-color 0.15s, background-color 0.15s;
}
.abr .abr-method:hover { border-color: var(--abr-accent-line); }
.abr .abr-method.active { border-color: var(--abr-accent); background: var(--abr-accent-soft); }
.abr .abr-method:disabled { opacity: 0.45; cursor: not-allowed; }
.abr .abr-method-ic {
    width: 36px; height: 36px; border-radius: 10px; background: var(--abr-sunk); color: var(--abr-accent);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.abr .abr-method.active .abr-method-ic { background: var(--abr-accent); color: #fff; }
[data-theme="dark"] .abr .abr-method.active .abr-method-ic { color: #0f172a; }
.abr .abr-method-ic svg { width: 18px; height: 18px; }
.abr .abr-method-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.abr .abr-method-txt strong { font-size: 0.9rem; color: var(--abr-text-1); }
.abr .abr-method-txt small { font-size: 0.76rem; color: var(--abr-muted); }
.abr .abr-rec { padding: 0.12rem 0.5rem; border-radius: 999px; background: var(--abr-accent); color: #fff; font-size: 0.66rem; font-weight: 700; flex-shrink: 0; }
[data-theme="dark"] .abr .abr-rec { color: #0f172a; }
.abr .abr-mode-opts { margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--abr-line); }
.abr .abr-colors { margin-bottom: 0.9rem; }
.abr .abr-color-list { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-top: 0.45rem; }
.abr .abr-color-chip {
    display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.25rem 0.3rem 0.25rem 0.35rem;
    border: 1px solid var(--abr-line); border-radius: 999px; background: var(--abr-card);
    font-size: 0.75rem; font-weight: 600; color: var(--abr-text-2); font-variant-numeric: tabular-nums;
}
.abr .abr-color-chip button { display: inline-flex; width: 18px; height: 18px; padding: 0; border: none; border-radius: 50%; background: none; color: var(--abr-muted); cursor: pointer; align-items: center; justify-content: center; }
.abr .abr-color-chip button:hover { color: var(--abr-red); background: var(--abr-sunk); }
.abr .abr-color-chip button svg { width: 12px; height: 12px; }
.abr .abr-color-add {
    position: relative; display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.6rem;
    border: 1px dashed var(--abr-accent-line); border-radius: 999px; color: var(--abr-accent-strong);
    font-size: 0.75rem; font-weight: 600; cursor: pointer; overflow: hidden;
}
[data-theme="dark"] .abr .abr-color-add { color: var(--abr-accent); }
.abr .abr-color-add svg { width: 13px; height: 13px; }
.abr .abr-color-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.abr .abr-field + .abr-field { margin-top: 1rem; }
.abr .abr-slider-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.35rem; }
.abr .abr-slider-head strong { font-size: 0.82rem; color: var(--abr-accent-strong); font-variant-numeric: tabular-nums; }
[data-theme="dark"] .abr .abr-slider-head strong { color: var(--abr-accent); }
.abr input.abr-range { width: 100%; margin: 0; accent-color: var(--abr-accent); cursor: pointer; }

/* collapsed option rows (Image Resizer pattern) */
.abr .abr-adv-options { padding: 0; overflow: hidden; }
.abr .abr-adv-row + .abr-adv-row { border-top: 1px solid var(--abr-line); }
.abr .abr-adv-head {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    width: 100% !important; min-height: 52px; padding: 0.6rem 1rem; border: none; background: none;
    color: var(--abr-text-1); text-align: left; cursor: pointer;
}
.abr .abr-adv-head:hover { background: var(--abr-open); }
.abr .abr-adv-left { display: flex; align-items: center; gap: 0.65rem; min-width: 0; }
.abr .abr-adv-left > svg { width: 17px; height: 17px; color: var(--abr-accent); flex-shrink: 0; }
.abr .abr-adv-text { display: flex; flex-direction: column; min-width: 0; }
.abr .abr-adv-title { font-size: 0.88rem; font-weight: 700; }
.abr .abr-adv-hint { font-size: 0.74rem; color: var(--abr-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.abr .abr-adv-right { display: flex; align-items: center; gap: 0.45rem; flex-shrink: 0; }
.abr .abr-adv-value {
    padding: 0.15rem 0.55rem; border-radius: 999px; background: var(--abr-accent-soft);
    color: var(--abr-accent-strong); font-size: 0.72rem; font-weight: 700; white-space: nowrap;
}
[data-theme="dark"] .abr .abr-adv-value { color: var(--abr-accent); }
.abr .abr-chevron { width: 16px; height: 16px; color: var(--abr-muted); transition: transform 0.2s; }
.abr .abr-adv-row.open .abr-chevron { transform: rotate(180deg); }
.abr .abr-adv-row.open .abr-adv-head, .abr .abr-adv-row.open .abr-adv-body { background: var(--abr-open); }
.abr .abr-adv-body { padding: 0.25rem 1rem 1rem; }

/* switch - override the global checkbox styling in custom_styles.css */
.abr .abr-switch-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.9rem; margin-top: 1rem; cursor: pointer; }
.abr .abr-switch-txt { display: flex; flex-direction: column; gap: 0.15rem; }
.abr .abr-switch-txt strong { font-size: 0.85rem; color: var(--abr-text-1); }
.abr .abr-switch-txt small { font-size: 0.75rem; line-height: 1.45; color: var(--abr-muted); }
.abr .abr-switch-wrap { display: inline-flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.abr .abr-switch-wrap em { font-style: normal; font-size: 0.7rem; font-weight: 700; color: var(--abr-muted); min-width: 24px; }
.tool-container input[type="checkbox"].abr-switch,
input[type="checkbox"].abr-switch {
    -webkit-appearance: none !important; appearance: none !important; position: relative !important;
    width: 42px !important; min-width: 42px !important; max-width: 42px !important; height: 24px !important;
    margin: 0 !important; padding: 0 !important; border: none !important; border-radius: 999px !important;
    background: var(--abr-line, #cbd5e1) !important; background-color: var(--abr-line, #cbd5e1) !important;
    box-shadow: none !important; cursor: pointer; transition: background-color 0.2s; flex-shrink: 0;
}
.tool-container input[type="checkbox"].abr-switch::after,
input[type="checkbox"].abr-switch::after {
    content: '' !important; position: absolute !important; top: 3px !important; left: 3px !important;
    right: auto !important; bottom: auto !important; width: 18px !important; height: 18px !important;
    border-radius: 50% !important; background: #fff !important; font-size: 0 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transform: none !important; transition: left 0.2s;
}
.tool-container input[type="checkbox"].abr-switch:checked,
input[type="checkbox"].abr-switch:checked { background: var(--abr-go, #2b8557) !important; background-color: var(--abr-go, #2b8557) !important; }
.tool-container input[type="checkbox"].abr-switch:checked::after,
input[type="checkbox"].abr-switch:checked::after { left: 21px !important; }
.abr input.abr-switch:focus-visible { outline: 2px solid var(--abr-accent); outline-offset: 2px; }

/* background + format */
.abr .abr-bg-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.35rem; }
.abr .abr-bg-grid > button, .abr .abr-bg-custom {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
    padding: 0.55rem 0.3rem; border: 1px solid var(--abr-line); border-radius: 10px; background: var(--abr-card);
    color: var(--abr-text-2); font-size: 0.76rem; font-weight: 600; cursor: pointer; overflow: hidden;
}
.abr .abr-bg-grid > .active { border-color: var(--abr-accent); background: var(--abr-accent-soft); color: var(--abr-accent-strong); }
[data-theme="dark"] .abr .abr-bg-grid > .active { color: var(--abr-accent); }
.abr .abr-bg-custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.abr .abr-seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0.35rem; }
.abr .abr-seg button {
    padding: 0.55rem 0.4rem; border: 1px solid var(--abr-line); border-radius: 10px; background: var(--abr-card);
    color: var(--abr-text-2); font-size: 0.84rem; font-weight: 600; cursor: pointer; transition: border-color 0.15s, background-color 0.15s;
}
.abr .abr-seg button:hover { border-color: var(--abr-accent-line); }
.abr .abr-seg button.active { border-color: var(--abr-accent); background: var(--abr-accent-soft); color: var(--abr-accent-strong); }
[data-theme="dark"] .abr .abr-seg button.active { color: var(--abr-accent); }
.abr .abr-seg + .abr-field { margin-top: 1rem; }

/* ---------- action bar ---------- */
.abr .abr-actionbar {
    position: sticky; bottom: 12px; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    margin-top: 0.875rem; padding: 0.7rem 0.75rem 0.7rem 1.1rem; background: var(--abr-card);
    border: 1px solid var(--abr-line); border-radius: 14px; box-shadow: var(--shadow-md);
}
.abr .abr-summary { display: flex; flex-direction: column; min-width: 0; }
.abr .abr-summary strong { font-size: 0.95rem; color: var(--abr-text-1); }
.abr .abr-summary span { font-size: 0.78rem; color: var(--abr-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.abr .abr-actionbar-btns { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.abr .abr-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; padding: 0.65rem 1.1rem;
    border: 1px solid transparent; border-radius: 10px; font-size: 0.92rem; font-weight: 600;
    text-decoration: none; cursor: pointer; transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.abr .abr-btn svg { width: 18px; height: 18px; }
.abr .abr-btn-small { padding: 0.4rem 0.75rem; font-size: 0.82rem; min-height: 0 !important; }
.abr .abr-btn-ghost { background: none; color: var(--abr-muted); }
.abr .abr-btn-ghost:hover { color: var(--abr-text-1); border-color: var(--abr-line); background: var(--abr-sunk); }
.abr .abr-go, .abr .abr-btn-download { background: var(--abr-go); color: #fff; min-height: 46px; font-weight: 700; }
.abr .abr-go:hover:not(:disabled), .abr .abr-btn-download:hover:not(:disabled) { background: var(--abr-go-hover); color: #fff; }
.abr .abr-go:disabled, .abr .abr-btn-download:disabled { opacity: 0.5; cursor: not-allowed; }
.abr .abr-btn-secondary { background: var(--abr-sunk); color: var(--abr-text-2); border-color: var(--abr-line); }
.abr .abr-btn-secondary:hover { color: var(--abr-text-1); border-color: var(--abr-accent-line); }

/* ---------- processing overlay ---------- */
.abr .abr-overlay {
    position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center;
    padding: 1rem; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px);
}
.abr .abr-overlay-card {
    width: 100%; max-width: 440px; min-width: min(340px, 100%); padding: 1.5rem 1.5rem 1.1rem;
    border-radius: 18px; border: 1px solid var(--abr-line); background: var(--abr-card); box-shadow: var(--shadow-lg); text-align: center;
}
.abr .abr-overlay-title { margin: 0 0 1.1rem; font-size: 1.1rem; font-weight: 700; color: var(--abr-text-1); }
.abr .abr-stages { display: flex; align-items: flex-start; justify-content: center; margin-bottom: 1.1rem; }
.abr .abr-stage { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; min-width: 58px; }
.abr .abr-stage > span:last-child { font-size: 0.7rem; font-weight: 600; color: var(--abr-muted); }
.abr .abr-stage-dot {
    width: 32px; height: 32px; padding: 6px; border-radius: 50%; background: var(--abr-sunk); color: var(--abr-muted);
    display: flex; align-items: center; justify-content: center; transition: background-color 0.2s, color 0.2s, transform 0.2s;
}
.abr .abr-stage-dot svg { width: 20px; height: 20px; }
.abr .abr-stage.active .abr-stage-dot { background: var(--abr-accent); color: #fff; transform: scale(1.1); }
.abr .abr-stage.done .abr-stage-dot { background: var(--abr-accent-soft); color: var(--abr-accent-strong); }
[data-theme="dark"] .abr .abr-stage.active .abr-stage-dot { color: #0f172a; }
.abr .abr-stage.active > span:last-child { color: var(--abr-accent-strong); }
.abr .abr-stage-conn { width: 28px; height: 2px; margin-top: 16px; background: var(--abr-line); }
.abr .abr-progress { display: block; height: 8px; border-radius: 999px; background: var(--abr-sunk); overflow: hidden; }
.abr .abr-progress-sm { width: 100%; height: 6px; margin-top: 0.4rem; }
.abr .abr-progress span { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--abr-accent); transition: width 0.3s; }
.abr .abr-progress-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin: 0.5rem 0 0.8rem; font-size: 0.82rem; }
.abr .abr-progress-row strong { color: var(--abr-text-1); font-variant-numeric: tabular-nums; }
.abr .abr-progress-row span { color: var(--abr-muted); text-align: right; }

/* ---------- results ---------- */
.abr .abr-result { background: var(--abr-card); border: 1px solid var(--abr-line); border-radius: 20px; padding: 1.4rem; box-shadow: var(--shadow-sm); }
.abr .abr-result-head { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 1rem; }
.abr .abr-result-icon {
    width: 44px; height: 44px; border-radius: 50%; background: var(--abr-accent); color: #fff;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
[data-theme="dark"] .abr .abr-result-icon { color: #0f172a; }
.abr .abr-result-icon svg { width: 24px; height: 24px; }
.abr .abr-result-title { margin: 0; font-size: 1.2rem; font-weight: 700; color: var(--abr-text-1); }
.abr .abr-result-meta { margin: 0.15rem 0 0; font-size: 0.85rem; color: var(--abr-muted); }
.abr .abr-notes { margin-bottom: 1rem; padding: 0.7rem 0.9rem; border-radius: 10px; background: var(--abr-sunk); border: 1px solid var(--abr-line); }
.abr .abr-notes p { display: flex; gap: 0.5rem; margin: 0; font-size: 0.82rem; line-height: 1.5; color: var(--abr-text-2); }
.abr .abr-notes p + p { margin-top: 0.35rem; }
.abr .abr-notes svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; color: var(--abr-accent); }
.abr .abr-result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.8rem; margin-bottom: 1.1rem; }
.abr .abr-result-grid.is-single { grid-template-columns: minmax(0, 1fr); }
.abr .abr-res {
    display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--abr-line);
    border-radius: 12px; overflow: hidden; background: var(--abr-card);
}
.abr .abr-res-img { display: flex; align-items: center; justify-content: center; height: 200px; padding: 0.5rem; }
.abr .abr-result-grid.is-single .abr-res-img { height: 380px; }
.abr .abr-res-img img { max-width: 100%; max-height: 100%; display: block; }
.abr .abr-res-body { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.6rem 0.7rem; border-top: 1px solid var(--abr-line); }
.abr .abr-res-text { display: flex; flex-direction: column; min-width: 0; }
.abr .abr-res-text strong { font-size: 0.82rem; color: var(--abr-text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.abr .abr-res-text span { font-size: 0.74rem; color: var(--abr-muted); }
.abr .abr-res-text.is-failed span { color: var(--abr-red); white-space: normal; }
.abr .abr-res-dl {
    display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.45rem 0.7rem; border-radius: 8px;
    background: var(--abr-go); color: #fff !important; font-size: 0.8rem; font-weight: 700; text-decoration: none; flex-shrink: 0;
}
.abr .abr-res-dl:hover { background: var(--abr-go-hover); }
.abr .abr-res-dl svg { width: 15px; height: 15px; }
.abr .abr-result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }

/* ---------- related + content ---------- */
.abr .related-tools { margin-top: 1.5rem; }
.abr .related-link svg { width: 16px; height: 16px; }
.abr .abr-info { display: flex; flex-direction: column; gap: 1.25rem; margin-top: 1.5rem; }
.abr .abr-info .info-card { background: var(--abr-card); border: 1px solid var(--abr-line); box-shadow: none; }
.abr .abr-info .info-card h2 svg { width: 22px; height: 22px; color: var(--abr-accent); }
.abr .abr-info p { margin: 0 0 0.8rem; line-height: 1.7; color: var(--abr-text-2); }
.abr .abr-info p:last-child { margin-bottom: 0; }
.abr .abr-info a { color: var(--abr-accent-strong); font-weight: 500; }
[data-theme="dark"] .abr .abr-info a { color: var(--abr-accent); }
.abr .abr-steps { margin: 0 0 1rem; padding: 0; list-style: none; counter-reset: abr; display: flex; flex-direction: column; gap: 0.7rem; }
.abr .abr-steps li { counter-increment: abr; position: relative; padding-left: 2.4rem; line-height: 1.6; color: var(--abr-text-2); }
.abr .abr-steps li::before {
    content: counter(abr); position: absolute; left: 0; top: 0; width: 1.7rem; height: 1.7rem; border-radius: 50%;
    background: var(--abr-accent); color: #fff; font-size: 0.8rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
[data-theme="dark"] .abr .abr-steps li::before { color: #0f172a; }
.abr .abr-steps strong, .abr .abr-list strong { color: var(--abr-text-1); }
.abr .abr-list { margin: 0 0 1rem; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.6rem; line-height: 1.6; color: var(--abr-text-2); }
.abr .abr-list:last-child { margin-bottom: 0; }
.abr .abr-table-wrap { overflow-x: auto; margin: 0.4rem 0 1rem; border: 1px solid var(--abr-line); border-radius: 10px; }
.abr .abr-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.abr .abr-table th, .abr .abr-table td { padding: 0.6rem 0.8rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--abr-line); }
.abr .abr-table tr:last-child td { border-bottom: none; }
.abr .abr-table th { background: var(--abr-sunk); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--abr-muted); }
.abr .abr-table td { color: var(--abr-text-2); }
.abr .abr-table td:first-child { font-weight: 600; color: var(--abr-text-1); white-space: nowrap; }
.abr .faq-question svg { width: 20px; height: 20px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .abr .abr-layout { grid-template-columns: minmax(0, 1fr); }
    .abr .abr-col-preview { position: static; }
    .abr .abr-compare { height: 340px; }
}
@media (max-width: 600px) {
    .abr.tool-container { padding: 1rem; }
    .abr .tool-title { font-size: 1.55rem; }
    .abr .abr-title-icon { width: 46px; height: 46px; border-radius: 13px; }
    .abr .abr-title-icon svg { width: 24px; height: 24px; }
    .abr .abr-editor { padding: 0.6rem; border-radius: 16px; }
    .abr .abr-upload { padding: 0.8rem; }
    .abr .abr-drop { padding: 2rem 0.8rem 1.8rem; }
    .abr .abr-drop-title { font-size: 1.1rem; }
    .abr .abr-card { padding: 0.85rem; }
    .abr .abr-adv-options { padding: 0; }
    .abr .abr-compare { height: 280px; }
    .abr .abr-text-btn span { display: none; }
    .abr .abr-preview-note { display: none; }
    .abr .abr-tool-seg button span { display: none; }
    .abr .abr-tool-seg button { padding: 0.45rem 0.6rem; }
    .abr .abr-actionbar { bottom: 8px; padding: 0.6rem; flex-wrap: wrap; }
    .abr .abr-summary { display: none; }
    .abr .abr-actionbar-btns { width: 100%; }
    .abr .abr-actionbar-btns .abr-go { flex: 1; }
    .abr .abr-actionbar-btns .abr-btn-ghost span { display: none; }
    .abr .abr-result { padding: 1rem; }
    .abr .abr-result-actions .abr-btn { flex: 1 1 100%; }
    .abr .abr-result-grid.is-single .abr-res-img { height: 260px; }
    .abr .abr-table td:first-child { white-space: normal; }
}
