/* ============================================================
   GIF Upscaler - stylesheet (rebuilt 2026-09-30, Icon Resizer family)
   Replaces gif-upscaler.css. Everything is scoped under .gup / .gup-*;
   the shared header, footer, FAQ and related-tools pills come from
   styles/custom_styles.css. Green accent (#339966, enhancement tools),
   single colours, no gradients, no 4px side borders. Dark mode via
   [data-theme="dark"], light is the default.
   ============================================================ */

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

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

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

/* ---------- error ---------- */
.gup .gup-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(--gup-text-1);
}
.gup .gup-error > svg { width: 20px; height: 20px; color: #e64e4e; flex-shrink: 0; margin-top: 2px; }
.gup .gup-error > div { flex: 1; min-width: 0; }
.gup .gup-error p { margin: 0; font-size: 0.9rem; line-height: 1.55; }
.gup .gup-error p + p { margin-top: 0.3rem; color: var(--gup-muted); }
.gup .gup-error a { color: var(--gup-red); font-weight: 600; }
.gup .gup-error-close { background: none; border: none; padding: 2px; color: var(--gup-muted); cursor: pointer; }
.gup .gup-error-close svg { width: 16px; height: 16px; }

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

/* ---------- editor ---------- */
.gup .gup-editor {
    background: var(--gup-sunk);
    border: 1px solid var(--gup-line);
    border-radius: 20px;
    padding: 1rem;
}
.gup .gup-filebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.875rem;
    padding: 0.55rem 0.6rem 0.55rem 0.6rem;
    background: var(--gup-card);
    border: 1px solid var(--gup-line);
    border-radius: 12px;
}
.gup .gup-file { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.gup .gup-file-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gup-sunk);
    border: 1px solid var(--gup-line);
}
.gup .gup-file-thumb img { max-width: 100%; max-height: 100%; display: block; }
.gup .gup-file-text { display: flex; flex-direction: column; min-width: 0; }
.gup .gup-file-text strong { font-size: 0.92rem; color: var(--gup-text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gup .gup-file-text span { font-size: 0.78rem; color: var(--gup-muted); }
.gup .gup-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(--gup-accent-strong);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}
[data-theme="dark"] .gup .gup-text-btn { color: var(--gup-accent); }
.gup .gup-text-btn:hover { background: var(--gup-accent-soft); }
.gup .gup-text-btn svg { width: 15px; height: 15px; }

.gup .gup-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 0.875rem;
    align-items: start;
}
.gup .gup-col-main,
.gup .gup-col-side { min-width: 0; }
.gup .gup-card {
    background: var(--gup-card);
    border: 1px solid var(--gup-line);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    min-width: 0;
}
.gup .gup-card + .gup-card { margin-top: 0.875rem; }
.gup .gup-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    margin-bottom: 0.8rem;
}
.gup .gup-h {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gup-text-1);
}
.gup .gup-h svg { width: 17px; height: 17px; color: var(--gup-accent); }
.gup .gup-detect {
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: var(--gup-accent-soft);
    color: var(--gup-accent-strong);
    font-size: 0.72rem;
    font-weight: 700;
}
[data-theme="dark"] .gup .gup-detect { color: var(--gup-accent); }

/* method cards */
.gup .gup-methods { display: flex; flex-direction: column; gap: 0.45rem; }
.gup .gup-method {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--gup-line);
    border-radius: 12px;
    background: var(--gup-card);
    color: var(--gup-text-2);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}
.gup .gup-method:hover { border-color: var(--gup-accent-line); }
.gup .gup-method.active { border-color: var(--gup-accent); background: var(--gup-accent-soft); }
.gup .gup-method-ic {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--gup-sunk);
    color: var(--gup-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.gup .gup-method.active .gup-method-ic { background: var(--gup-accent); color: #fff; }
[data-theme="dark"] .gup .gup-method.active .gup-method-ic { color: #0f172a; }
.gup .gup-method-ic svg { width: 19px; height: 19px; }
.gup .gup-method-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.gup .gup-method-txt strong { font-size: 0.9rem; color: var(--gup-text-1); }
.gup .gup-method-txt small { font-size: 0.76rem; color: var(--gup-muted); }
.gup .gup-rec {
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    background: var(--gup-accent);
    color: #fff;
    font-size: 0.66rem;
    font-weight: 700;
    flex-shrink: 0;
}
[data-theme="dark"] .gup .gup-rec { color: #0f172a; }

/* mini preview */
.gup .gup-compare-mini {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--gup-line);
}
.gup .gup-compare-mini figure { margin: 0; text-align: center; }
.gup .gup-compare-mini figcaption { margin-top: 0.3rem; font-size: 0.7rem; font-weight: 600; color: var(--gup-muted); }
.gup .gup-mini-box { display: block; width: 96px; height: 96px; border-radius: 8px; overflow: hidden; border: 1px solid var(--gup-line); }
.gup .gup-mini-box canvas { width: 96px; height: 96px; display: block; image-rendering: pixelated; }
.gup .gup-mini-hint { margin: 0; font-size: 0.74rem; line-height: 1.5; color: var(--gup-muted); }
.gup .gup-checker {
    background-color: var(--gup-card);
    background-image:
        linear-gradient(45deg, var(--gup-checker) 25%, transparent 25%),
        linear-gradient(-45deg, var(--gup-checker) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--gup-checker) 75%),
        linear-gradient(-45deg, transparent 75%, var(--gup-checker) 75%);
    background-size: 14px 14px;
    background-position: 0 0, 0 7px, 7px -7px, -7px 0;
}

/* size */
.gup .gup-newsize { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.82rem; color: var(--gup-muted); }
.gup .gup-newsize strong { color: var(--gup-text-1); }
.gup .gup-newsize svg { width: 14px; height: 14px; color: var(--gup-accent); }
.gup .gup-seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0.35rem; }
.gup .gup-seg button {
    padding: 0.55rem 0.4rem;
    border: 1px solid var(--gup-line);
    border-radius: 10px;
    background: var(--gup-card);
    color: var(--gup-text-2);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}
.gup .gup-seg button:hover:not(:disabled) { border-color: var(--gup-accent-line); }
.gup .gup-seg button.active { border-color: var(--gup-accent); background: var(--gup-accent-soft); color: var(--gup-accent-strong); }
[data-theme="dark"] .gup .gup-seg button.active { color: var(--gup-accent); }
.gup .gup-seg button:disabled { opacity: 0.4; cursor: not-allowed; }
.gup .gup-size-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; margin-top: 0.7rem; }
.gup .gup-inline-field { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.78rem; font-weight: 600; color: var(--gup-muted); }
.gup .gup-input-wrap {
    display: flex;
    align-items: center;
    border: 1px solid var(--gup-line);
    border-radius: 10px;
    background: var(--gup-card);
    overflow: hidden;
}
.gup .gup-input-wrap:focus-within { border-color: var(--gup-accent); box-shadow: 0 0 0 3px var(--gup-accent-soft); }
.gup .gup-input-wrap input {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 0.6rem;
    border: none;
    background: none;
    color: var(--gup-text-1);
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    outline: none;
}
.gup .gup-input-wrap em { padding: 0 0.6rem; font-style: normal; font-size: 0.8rem; color: var(--gup-muted); }
.gup .gup-hint { margin: 0.5rem 0 0; font-size: 0.78rem; line-height: 1.5; color: var(--gup-muted); }
.gup .gup-hint.is-warn { color: var(--gup-warn); font-weight: 600; }

/* enhance */
.gup .gup-switch-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.9rem;
    padding-bottom: 0.9rem;
    margin-bottom: 0.9rem;
    border-bottom: 1px solid var(--gup-line);
    cursor: pointer;
}
.gup .gup-switch-row.is-off,
.gup .gup-field.is-off { opacity: 0.55; }
.gup .gup-switch-row.is-off { cursor: default; }
.gup .gup-switch-txt { display: flex; flex-direction: column; gap: 0.15rem; }
.gup .gup-switch-txt strong { font-size: 0.88rem; color: var(--gup-text-1); }
.gup .gup-switch-txt small { font-size: 0.76rem; line-height: 1.45; color: var(--gup-muted); }
/* custom_styles.css restyles every checkbox in .tool-container - out-specify it */
.gup input.gup-switch {
    -webkit-appearance: none !important;
    appearance: none !important;
    position: relative !important;
    width: 42px !important;
    height: 24px !important;
    min-width: 42px !important;
    margin: 2px 0 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 999px !important;
    background: var(--gup-line) !important;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
}
.gup input.gup-switch::before {
    content: '' !important;
    position: absolute !important;
    top: 3px !important;
    left: 3px !important;
    width: 18px !important;
    height: 18px !important;
    border-radius: 50% !important;
    background: #fff !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s;
    border: none !important;
}
.gup input.gup-switch::after { display: none !important; }
.gup input.gup-switch:checked { background: var(--gup-go) !important; }
.gup input.gup-switch:checked::before { transform: translateX(18px); }
.gup input.gup-switch:focus-visible { outline: 2px solid var(--gup-accent); outline-offset: 2px; }
.gup input.gup-switch:disabled { cursor: not-allowed; }
.gup .gup-field + .gup-field { margin-top: 1rem; }
.gup .gup-label { display: block; margin-bottom: 0.45rem; font-size: 0.82rem; font-weight: 700; color: var(--gup-text-1); }

/* ---------- sticky action bar ---------- */
.gup .gup-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(--gup-card);
    border: 1px solid var(--gup-line);
    border-radius: 14px;
    box-shadow: var(--shadow-md);
}
.gup .gup-summary { display: flex; flex-direction: column; min-width: 0; }
.gup .gup-summary strong { font-size: 0.95rem; color: var(--gup-text-1); }
.gup .gup-summary span { font-size: 0.78rem; color: var(--gup-muted); }
.gup .gup-actionbar-btns { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.gup .gup-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;
}
.gup .gup-btn svg { width: 18px; height: 18px; }
.gup .gup-btn-ghost { background: none; color: var(--gup-muted); }
.gup .gup-btn-ghost:hover { color: var(--gup-text-1); border-color: var(--gup-line); background: var(--gup-sunk); }
.gup .gup-go,
.gup .gup-btn-download { background: var(--gup-go); color: #fff; min-height: 46px; font-weight: 700; }
.gup .gup-go:hover:not(:disabled),
.gup .gup-btn-download:hover { background: var(--gup-go-hover); color: #fff; }
.gup .gup-go:disabled { opacity: 0.5; cursor: not-allowed; }
.gup .gup-btn-secondary { background: var(--gup-sunk); color: var(--gup-text-2); border-color: var(--gup-line); }
.gup .gup-btn-secondary:hover { color: var(--gup-text-1); border-color: var(--gup-accent-line); }

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

/* ---------- result ---------- */
.gup .gup-result {
    background: var(--gup-card);
    border: 1px solid var(--gup-line);
    border-radius: 20px;
    padding: 1.4rem;
    box-shadow: var(--shadow-sm);
}
.gup .gup-result-head { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 1rem; }
.gup .gup-result-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gup-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
[data-theme="dark"] .gup .gup-result-icon { color: #0f172a; }
.gup .gup-result-icon svg { width: 24px; height: 24px; }
.gup .gup-result-title { margin: 0; font-size: 1.2rem; font-weight: 700; color: var(--gup-text-1); }
.gup .gup-result-meta { margin: 0.15rem 0 0; font-size: 0.85rem; color: var(--gup-muted); }
.gup .gup-notes { margin-bottom: 1rem; padding: 0.7rem 0.9rem; border-radius: 10px; background: var(--gup-sunk); border: 1px solid var(--gup-line); }
.gup .gup-notes p { display: flex; gap: 0.5rem; margin: 0; font-size: 0.82rem; line-height: 1.5; color: var(--gup-text-2); }
.gup .gup-notes p + p { margin-top: 0.35rem; }
.gup .gup-notes svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; color: var(--gup-accent); }

.gup .gup-compare {
    position: relative;
    width: 100%;
    max-height: 560px;
    margin: 0 auto;
    border-radius: 12px;
    border: 1px solid var(--gup-line);
    overflow: hidden;
    user-select: none;
}
.gup .gup-compare-layer { position: absolute; inset: 0; }
.gup .gup-compare-layer img,
.gup .gup-compare-layer video { width: 100%; height: 100%; object-fit: contain; display: block; }
.gup .gup-compare.is-pixel .gup-compare-after img { image-rendering: pixelated; }
.gup .gup-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;
}
.gup .gup-tag-before { left: 10px; }
.gup .gup-tag-after { right: 10px; }
.gup .gup-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;
}
.gup .gup-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;
}
.gup .gup-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;
}
.gup .gup-compare-knob svg { width: 18px; height: 18px; }
.gup .gup-compare-hint { text-align: center; }

.gup .gup-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem 1.2rem;
    margin: 1.1rem 0;
    padding: 0.8rem;
    border-radius: 12px;
    background: var(--gup-sunk);
}
.gup .gup-stats > div { display: flex; flex-direction: column; align-items: center; min-width: 110px; }
.gup .gup-stats span { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gup-muted); }
.gup .gup-stats strong { font-size: 1rem; color: var(--gup-text-1); }
.gup .gup-stats small { font-size: 0.78rem; color: var(--gup-muted); }
.gup .gup-stats > svg { width: 20px; height: 20px; color: var(--gup-accent); }
.gup .gup-result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--gup-line); }

/* ---------- toast ---------- */
.gup-toast {
    position: fixed;
    right: 20px;
    bottom: 90px;
    z-index: 9500;
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    max-width: 360px;
    padding: 0.9rem 0.9rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--border-color, #e2e8f0);
    background: var(--bg-elevated, #fff);
    color: var(--text-primary, #1e293b);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
}
.gup-toast.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.gup-toast.is-hiding { opacity: 0; transform: translateY(12px); }
.gup-toast-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #339966;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.gup-toast-icon svg { width: 18px; height: 18px; }
.gup-toast-body { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.82rem; line-height: 1.45; color: var(--text-secondary, #555); }
.gup-toast-body strong { font-size: 0.9rem; color: var(--text-primary, #1e293b); }
.gup-toast-close { width: auto; padding: 2px; border: none; background: none; color: var(--text-muted, #64748b); cursor: pointer; }
.gup-toast-close svg { width: 16px; height: 16px; }
.gup-toast-progress { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: #339966; }

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

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .gup .gup-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
    .gup.tool-container { padding: 1rem; }
    .gup .tool-title { font-size: 1.6rem; }
    .gup .gup-title-icon { width: 46px; height: 46px; border-radius: 13px; }
    .gup .gup-title-icon svg { width: 24px; height: 24px; }
    .gup .gup-editor { padding: 0.6rem; border-radius: 16px; }
    .gup .gup-upload { padding: 0.8rem; }
    .gup .gup-drop { padding: 2rem 0.8rem 1.8rem; }
    .gup .gup-drop-title { font-size: 1.1rem; }
    .gup .gup-card { padding: 0.85rem; }
    .gup .gup-text-btn span { display: none; }
    .gup .gup-compare-mini { grid-template-columns: auto auto; }
    .gup .gup-mini-hint { grid-column: 1 / -1; }
    .gup .gup-actionbar { bottom: 8px; padding: 0.6rem; flex-wrap: wrap; }
    .gup .gup-summary { display: none; }
    .gup .gup-actionbar-btns { width: 100%; }
    .gup .gup-actionbar-btns .gup-go { flex: 1; }
    .gup .gup-actionbar-btns .gup-btn-ghost span { display: none; }
    .gup .gup-result { padding: 1rem; }
    .gup .gup-result-actions .gup-btn { flex: 1 1 100%; }
    .gup .gup-table td:first-child { white-space: normal; }
    .gup-toast { left: 12px; right: 12px; bottom: 80px; max-width: none; }
}

/* ============================================================
   2026-10-05: AI upscale method, logo loader, done box
   ============================================================ */
.gup .gup-new { font-style: normal; margin-left: 0.3rem; padding: 0.05rem 0.4rem; border-radius: 999px; background: #339966; color: #fff; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.03em; vertical-align: 2px; }
[data-theme="dark"] .gup .gup-new { color: #0f172a; background: #4ade80; }
.gup .gup-ai-est { display: flex; align-items: center; gap: 0.45rem; margin: 0.75rem 0 0; padding: 0.55rem 0.7rem; border-radius: 10px; background: var(--gup-accent-soft); color: var(--gup-text-1); font-size: 0.82rem; font-weight: 600; }
.gup .gup-ai-est svg { width: 16px; height: 16px; color: var(--gup-accent); flex-shrink: 0; }
.gup .gup-ai-est.is-warn { background: rgba(217, 119, 6, 0.1); }
.gup .gup-ai-est.is-warn svg { color: var(--gup-warn); }
.gup .gup-seg button:disabled { text-decoration: line-through; }
.gup .gup-loader {
    display: block; width: 56px; height: 56px; margin: 0 auto 0.8rem; overflow: visible;
    --cico-outer: #f2534e; --cico-outer-soft: #f8d3d1; --cico-mid: #31ae77; --cico-mid-soft: #d0e7dd; --cico-inner: #2b9edb;
}
[data-theme="dark"] .gup .gup-loader { --cico-outer-soft: rgba(242, 83, 78, 0.22); --cico-mid-soft: rgba(49, 174, 119, 0.22); }
.gup .gup-loader circle { fill: none; stroke-width: 72; transform-box: fill-box; transform-origin: center; }
.gup .gup-loader .bp { stroke: var(--cico-outer-soft); }
.gup .gup-loader .gp { stroke: var(--cico-mid-soft); }
.gup .gup-loader .b { stroke: var(--cico-outer); stroke-linecap: round; stroke-dasharray: 35.3 100; animation: gupSpinL 1.3s linear infinite; }
.gup .gup-loader .g { stroke: var(--cico-mid); stroke-linecap: round; stroke-dasharray: 75.8 100; animation: gupSpinR 2.1s linear infinite; }
.gup .gup-loader .r { stroke: var(--cico-inner); animation: gupBreathe 1.3s ease-in-out infinite; }
@keyframes gupSpinL { from { transform: rotate(117deg); } to { transform: rotate(-243deg); } }
@keyframes gupSpinR { from { transform: rotate(36deg); } to { transform: rotate(396deg); } }
@keyframes gupBreathe { 50% { transform: scale(0.9); } }
@media (prefers-reduced-motion: reduce) { .gup .gup-loader .b { animation-duration: 4s; } .gup .gup-loader .g { animation-duration: 6s; } .gup .gup-loader .r { animation: none; } }
.gup .gup-done {
    position: relative; margin-top: 1rem; padding: 0.95rem 1rem 1.1rem; border-radius: 14px; overflow: hidden;
    border: 1px solid rgba(51, 153, 102, 0.35); background: rgba(51, 153, 102, 0.1); transition: opacity 0.35s ease, transform 0.35s ease;
}
.gup .gup-done.is-leaving { opacity: 0; transform: translateY(-4px); }
.gup .gup-done-head { display: flex; align-items: flex-start; gap: 0.65rem; }
.gup .gup-done-head > svg { width: 22px; height: 22px; color: #2f855a; flex-shrink: 0; margin-top: 1px; }
[data-theme="dark"] .gup .gup-done-head > svg { color: #4ade80; }
.gup .gup-done-text { flex: 1; min-width: 0; }
.gup .gup-done-text strong { display: block; font-size: 0.95rem; color: var(--gup-text-1); }
.gup .gup-done-text span { display: block; margin-top: 0.15rem; font-size: 0.83rem; line-height: 1.5; color: var(--gup-text-2); overflow-wrap: anywhere; }
.gup .gup-x { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex-shrink: 0; border: none; border-radius: 8px; background: none; color: var(--gup-muted); cursor: pointer; padding: 0; }
.gup .gup-x:hover { background: rgba(100, 116, 139, 0.12); color: var(--gup-text-1); }
.gup .gup-x svg { width: 17px; height: 17px; }
.gup .gup-done-timer { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: #339966; opacity: 0.55; transform-origin: left; }
.gup .gup-done-timer.run { animation: gupTimer linear forwards; }
.gup .gup-done:focus-within .gup-done-timer.run, .gup .gup-done:hover .gup-done-timer.run { animation-play-state: paused; }
@keyframes gupTimer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
