/* ============================================================
   Facebook GIF Downloader - scoped under .fgd / .fgd-* (rebuilt 2026-10-12)
   Same look as the Giphy / Tenor downloaders and the GIF editing tools
   (accent #3399cc). Single colours, no gradients, no thick side borders.
   Light default, dark via [data-theme="dark"] on <html>.
   ============================================================ */
.fgd {
    --tool-accent: #3399cc;
    --fgd-accent: #3399cc;
    --fgd-accent-strong: #237a9f;
    --fgd-accent-soft: rgba(51, 153, 204, 0.09);
    --fgd-accent-line: rgba(51, 153, 204, 0.45);
    --fgd-go: #237a9f;
    --fgd-go-hover: #1b6183;
    --fgd-card: var(--bg-elevated, #fff);
    --fgd-sunk: var(--card-tertiary, #f1f5f9);
    --fgd-open: var(--card-secondary, #f8f9fa);
    --fgd-line: var(--border-color, #e2e8f0);
    --fgd-text-1: var(--text-primary, #1e293b);
    --fgd-text-2: var(--text-secondary, #555);
    --fgd-muted: var(--text-muted, #64748b);
    --fgd-ok: #2f855a;
    --fgd-ok-soft: rgba(51, 153, 102, 0.1);
    --fgd-ok-line: rgba(51, 153, 102, 0.35);
    --fgd-warn: #b45309;
    --fgd-warn-soft: rgba(217, 119, 6, 0.1);
    --fgd-red: #c23b3b;
}
[data-theme="dark"] .fgd {
    --fgd-accent: #60a5fa;
    --fgd-accent-strong: #93c5fd;
    --fgd-accent-soft: rgba(96, 165, 250, 0.12);
    --fgd-accent-line: rgba(96, 165, 250, 0.45);
    --fgd-go: #2563eb;
    --fgd-go-hover: #1d4ed8;
    --fgd-card: #1e293b;
    --fgd-sunk: #172033;
    --fgd-open: #1a2438;
    --fgd-line: #334155;
    --fgd-text-1: #e2e8f0;
    --fgd-text-2: #cbd5e1;
    --fgd-muted: #94a3b8;
    --fgd-ok: #4ade80;
    --fgd-ok-soft: rgba(74, 222, 128, 0.1);
    --fgd-ok-line: rgba(74, 222, 128, 0.35);
    --fgd-warn: #fbbf24;
    --fgd-warn-soft: rgba(251, 191, 36, 0.12);
    --fgd-red: #f87171;
}

.fgd.tool-container { max-width: 1100px; margin: 0 auto; padding: 2rem; box-sizing: border-box; }
.fgd [hidden] { display: none !important; }
.fgd *, .fgd *::before, .fgd *::after { box-sizing: border-box; }
.fgd button { font: inherit; }

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

/* ---------- error ---------- */
.fgd .fgd-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(--fgd-text-1); }
.fgd .fgd-error > svg { width: 20px; height: 20px; color: #e64e4e; flex-shrink: 0; margin-top: 2px; }
.fgd .fgd-error > div { flex: 1; min-width: 0; }
.fgd .fgd-error p { margin: 0; font-size: 0.92rem; line-height: 1.55; overflow-wrap: anywhere; }
.fgd .fgd-error p + p { margin-top: 0.3rem; color: var(--fgd-muted); font-size: 0.86rem; }
.fgd .fgd-error a { color: var(--fgd-red); font-weight: 600; }
.fgd .fgd-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(--fgd-muted); cursor: pointer; padding: 0; }
.fgd .fgd-x:hover { background: rgba(100, 116, 139, 0.12); color: var(--fgd-text-1); }
.fgd .fgd-x svg { width: 17px; height: 17px; }

/* ---------- cards ---------- */
.fgd .fgd-card { background: var(--fgd-card); border: 1px solid var(--fgd-line); border-radius: 20px; padding: 1.25rem; box-shadow: var(--shadow-sm); margin-bottom: 1.25rem; min-width: 0; }
.fgd .fgd-hint { margin: 0.55rem 0 0; font-size: 0.8rem; line-height: 1.5; color: var(--fgd-muted); overflow-wrap: anywhere; }
.fgd .fgd-caption { display: block; margin: 0 0 0.45rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fgd-muted); }
.fgd .fgd-caption-gap { margin-top: 0.9rem; }

/* ---------- buttons ---------- */
.fgd .fgd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; min-height: 44px; padding: 0.6rem 1.1rem; border-radius: 12px; border: 1px solid transparent; font-size: 0.95rem; font-weight: 700; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background 0.15s, border-color 0.15s, color 0.15s; width: auto; }
.fgd .fgd-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.fgd .fgd-go { background: var(--fgd-go); color: #fff; }
.fgd .fgd-go:hover:not(:disabled) { background: var(--fgd-go-hover); color: #fff; }
.fgd .fgd-go:disabled { opacity: 0.55; cursor: not-allowed; }
.fgd .fgd-btn-lg { min-height: 50px; padding: 0.65rem 1.5rem; font-size: 1rem; }
.fgd .fgd-btn-sm { min-height: 36px; padding: 0.4rem 0.8rem; font-size: 0.85rem; border-radius: 10px; }
.fgd .fgd-btn-sm svg { width: 16px; height: 16px; }
.fgd .fgd-btn-ghost { background: var(--fgd-sunk); color: var(--fgd-text-2); border-color: var(--fgd-line); }
.fgd .fgd-btn-ghost:hover:not(:disabled) { color: var(--fgd-text-1); border-color: var(--fgd-accent-line); }
.fgd .fgd-btn-ok { background: var(--fgd-ok-soft); color: var(--fgd-ok); border-color: var(--fgd-ok-line); }
.fgd .fgd-btn-ok:hover { background: rgba(51, 153, 102, 0.18); color: var(--fgd-ok); text-decoration: none; }
.fgd .fgd-text-btn { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.4rem 0.6rem; border: none; border-radius: 8px; background: none; color: var(--fgd-accent-strong); font-size: 0.85rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
[data-theme="dark"] .fgd .fgd-text-btn { color: var(--fgd-accent); }
.fgd .fgd-text-btn:hover { background: var(--fgd-accent-soft); }
.fgd .fgd-text-btn svg { width: 15px; height: 15px; }
.fgd .fgd-link-btn { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0; border: none; background: none; cursor: pointer; color: var(--fgd-accent-strong); font-size: 0.82rem; font-weight: 600; }
[data-theme="dark"] .fgd .fgd-link-btn { color: var(--fgd-accent); }
.fgd .fgd-link-btn:hover { text-decoration: underline; }
.fgd .fgd-link-btn svg { width: 15px; height: 15px; }

/* ---------- link box ---------- */
.fgd .fgd-urlbar { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.4rem 0.4rem 0.8rem; border-radius: 14px; border: 1.5px solid var(--fgd-line); background: var(--input-bg, #fff); margin: 0; }
[data-theme="dark"] .fgd .fgd-urlbar { background: #0f172a; }
.fgd .fgd-urlbar:focus-within { border-color: var(--fgd-accent); box-shadow: 0 0 0 3px var(--fgd-accent-soft); }
.fgd .fgd-urlbar-icon svg { width: 18px; height: 18px; color: var(--fgd-muted); display: block; }
.fgd .fgd-url { flex: 1; min-width: 0; height: 44px; border: none !important; outline: none; background: none !important; color: var(--fgd-text-1); font: inherit; font-size: 0.98rem; padding: 0; margin: 0; box-shadow: none !important; }
.fgd .fgd-under { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 0.6rem; margin-top: 0.85rem; }
.fgd .fgd-pill { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.22rem 0.65rem; border-radius: 999px; background: var(--fgd-sunk); border: 1px solid var(--fgd-line); font-size: 0.78rem; font-weight: 600; color: var(--fgd-text-2); }
.fgd .fgd-pill svg { width: 14px; height: 14px; color: var(--fgd-accent); }

/* ---------- ConvertICO ring loader ---------- */
.fgd .fgd-reading { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.85rem; font-size: 0.85rem; font-weight: 600; color: var(--fgd-text-2); }
.fgd .fgd-loader { display: block; width: 32px; height: 32px; flex-shrink: 0; overflow: visible; --cico-outer: #f2534e; --cico-outer-soft: #f8d3d1; --cico-mid: #31ae77; --cico-mid-soft: #d0e7dd; --cico-inner: #2b9edb; }
[data-theme="dark"] .fgd .fgd-loader { --cico-outer-soft: rgba(242, 83, 78, 0.22); --cico-mid-soft: rgba(49, 174, 119, 0.22); }
.fgd .fgd-loader circle { fill: none; stroke-width: 72; transform-box: fill-box; transform-origin: center; }
.fgd .fgd-loader .bp { stroke: var(--cico-outer-soft); }
.fgd .fgd-loader .gp { stroke: var(--cico-mid-soft); }
.fgd .fgd-loader .b { stroke: var(--cico-outer); stroke-linecap: round; stroke-dasharray: 35.3 100; animation: fgdSpinL 1.3s linear infinite; }
.fgd .fgd-loader .g { stroke: var(--cico-mid); stroke-linecap: round; stroke-dasharray: 75.8 100; animation: fgdSpinR 2.1s linear infinite; }
.fgd .fgd-loader .r { stroke: var(--cico-inner); animation: fgdBreathe 1.3s ease-in-out infinite; }
@keyframes fgdSpinL { from { transform: rotate(117deg); } to { transform: rotate(-243deg); } }
@keyframes fgdSpinR { from { transform: rotate(36deg); } to { transform: rotate(396deg); } }
@keyframes fgdBreathe { 50% { transform: scale(0.9); } }

/* ---------- one item ---------- */
.fgd .fgd-one-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; }
.fgd .fgd-col { min-width: 0; }
@media (min-width: 861px) { .fgd .fgd-one-grid > .fgd-col:first-child { position: sticky; top: 84px; align-self: start; } }
.fgd .fgd-preview { display: flex; align-items: center; justify-content: center; min-height: 220px; max-height: 440px; padding: 0.5rem; border-radius: 14px; border: 1px solid var(--fgd-line); background: var(--fgd-sunk); overflow: hidden; }
.fgd .fgd-preview img { display: block; max-width: 100%; max-height: 420px; object-fit: contain; border-radius: 8px; }
.fgd .fgd-noprev { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; color: var(--fgd-muted); font-size: 0.85rem; }
.fgd .fgd-noprev svg { width: 40px; height: 40px; }
.fgd .fgd-facts { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
.fgd .fgd-fact { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.28rem 0.62rem; border-radius: 999px; background: var(--fgd-sunk); border: 1px solid var(--fgd-line); font-size: 0.79rem; font-weight: 600; color: var(--fgd-text-2); }
.fgd .fgd-fact svg { width: 14px; height: 14px; color: var(--fgd-accent); }
.fgd .fgd-post-title { margin: 0; font-size: 1.15rem; line-height: 1.35; color: var(--fgd-text-1); overflow-wrap: anywhere; }
.fgd .fgd-post-meta { margin: 0.3rem 0 0; font-size: 0.84rem; color: var(--fgd-muted); overflow-wrap: anywhere; }
.fgd .fgd-post-meta:empty { display: none; }
.fgd .fgd-formats { display: grid; gap: 0.35rem; }
.fgd .fgd-fmt { display: flex; align-items: center; gap: 0.65rem; min-height: 50px; padding: 0.4rem 0.75rem; border-radius: 11px; border: 1.5px solid var(--fgd-line); background: var(--fgd-card); cursor: pointer; outline: none; min-width: 0; }
.fgd .fgd-fmt:hover { border-color: var(--fgd-accent-line); }
.fgd .fgd-fmt:focus-visible { box-shadow: 0 0 0 3px var(--fgd-accent-soft); }
.fgd .fgd-fmt.is-active { border-color: var(--fgd-accent); background: var(--fgd-accent-soft); }
.fgd .fgd-radio { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--fgd-line); flex-shrink: 0; }
.fgd .fgd-fmt.is-active .fgd-radio { border: 5px solid var(--fgd-accent); }
.fgd .fgd-fmt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.fgd .fgd-fmt-main strong { font-size: 0.9rem; color: var(--fgd-text-1); }
.fgd .fgd-fmt-main small { font-size: 0.76rem; color: var(--fgd-muted); }
.fgd .fgd-fmt-ext { font-size: 0.78rem; font-weight: 700; color: var(--fgd-muted); }
.fgd .fgd-name-row { display: flex; align-items: stretch; }
.fgd .fgd-input { flex: 1; min-width: 0; height: 42px; padding: 0 0.7rem; margin: 0; border: 1px solid var(--fgd-line); border-radius: 9px 0 0 9px; border-right: none; background: var(--input-bg, #fff); color: var(--fgd-text-1); font-size: 0.9rem; }
[data-theme="dark"] .fgd .fgd-input { background: #0f172a; }
.fgd .fgd-input:focus { outline: none; border-color: var(--fgd-accent); }
.fgd .fgd-ext { display: inline-flex; align-items: center; padding: 0 0.7rem; border-radius: 0 9px 9px 0; border: 1px solid var(--fgd-line); background: var(--fgd-sunk); color: var(--fgd-muted); font-size: 0.85rem; font-weight: 600; }

/* ---------- GIF settings: presets + main setting + compact rows ---------- */
.fgd .fgd-gifset { margin-top: 0.9rem; }
.fgd .fgd-block { background: var(--fgd-card); border: 1px solid var(--fgd-line); border-radius: 14px; padding: 0.85rem 1rem; margin-bottom: 0.75rem; }
.fgd .fgd-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.fgd .fgd-chips:empty { display: none; }
.fgd .fgd-user-presets { margin-top: 0.4rem; }
.fgd .fgd-presets .fgd-link-btn { margin-top: 0.55rem; }
.fgd .fgd-chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.7rem; border-radius: 999px; border: 1px solid var(--fgd-line); background: var(--fgd-sunk); color: var(--fgd-text-2); font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.fgd .fgd-chip svg { width: 14px; height: 14px; color: var(--fgd-accent); }
.fgd .fgd-chip:hover { border-color: var(--fgd-accent-line); color: var(--fgd-text-1); }
.fgd .fgd-chip.is-active { background: var(--fgd-accent-soft); border-color: var(--fgd-accent); color: var(--fgd-accent-strong); }
[data-theme="dark"] .fgd .fgd-chip.is-active { color: var(--fgd-accent); }
.fgd .fgd-uchip { padding: 0; overflow: hidden; }
.fgd .fgd-uchip button { display: inline-flex; align-items: center; gap: 0.35rem; border: none; background: none; color: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; padding: 0.35rem 0.3rem 0.35rem 0.7rem; }
.fgd .fgd-uchip .fgd-uchip-x { padding: 0.35rem 0.55rem 0.35rem 0.2rem; color: var(--fgd-muted); }
.fgd .fgd-uchip .fgd-uchip-x:hover { color: var(--fgd-red); }
.fgd .fgd-uchip .fgd-uchip-x svg { width: 13px; height: 13px; color: inherit; }
.fgd .fgd-main-label { display: flex; align-items: center; gap: 0.45rem; margin: 0 0 0.55rem; font-size: 0.95rem; font-weight: 700; color: var(--fgd-text-1); }
.fgd .fgd-main-label svg { width: 18px; height: 18px; color: var(--fgd-accent); }
.fgd .fgd-quick { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.fgd .fgd-qchip { padding: 0.28rem 0.65rem; border-radius: 999px; border: 1px solid var(--fgd-line); background: none; color: var(--fgd-text-2); font-size: 0.78rem; font-weight: 600; cursor: pointer; }
.fgd .fgd-qchip:hover { border-color: var(--fgd-accent-line); color: var(--fgd-text-1); }
.fgd .fgd-qchip.is-active { background: var(--fgd-accent-soft); border-color: var(--fgd-accent); color: var(--fgd-accent-strong); }
[data-theme="dark"] .fgd .fgd-qchip.is-active { color: var(--fgd-accent); }
.fgd .fgd-num-row { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.6rem; font-size: 0.82rem; color: var(--fgd-muted); }
.fgd .fgd-num, .fgd .fgd-field input { width: 6.5rem; min-height: 40px; padding: 0.4rem 0.6rem; margin: 0; border-radius: 10px; border: 1px solid var(--fgd-line); background: var(--input-bg, #fff); color: var(--fgd-text-1); font: inherit; font-size: 0.9rem; }
[data-theme="dark"] .fgd .fgd-num, [data-theme="dark"] .fgd .fgd-field input { background: #0f172a; }
.fgd .fgd-num:focus, .fgd .fgd-field input:focus { outline: none; border-color: var(--fgd-accent); box-shadow: 0 0 0 3px var(--fgd-accent-soft); }
.fgd .fgd-options { background: var(--fgd-card); border: 1px solid var(--fgd-line); border-radius: 14px; overflow: hidden; }
.fgd .fgd-row + .fgd-row { border-top: 1px solid var(--fgd-line); }
.fgd .fgd-row-head { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.75rem; padding: 0.6rem 0.9rem; min-height: 52px; background: none; border: none; cursor: pointer; text-align: left; color: var(--fgd-text-1); }
.fgd .fgd-row-head:hover, .fgd .fgd-row.open .fgd-row-head, .fgd .fgd-row.open .fgd-row-body { background: var(--fgd-open); }
.fgd .fgd-row-head:focus-visible { outline: 2px solid var(--fgd-accent); outline-offset: -2px; }
.fgd .fgd-row-left { display: inline-flex; align-items: center; gap: 0.6rem; min-width: 0; }
.fgd .fgd-row-left > svg { width: 17px; height: 17px; color: var(--fgd-accent); flex-shrink: 0; }
.fgd .fgd-row-text { display: flex; flex-direction: column; min-width: 0; }
.fgd .fgd-row-title { font-size: 0.87rem; font-weight: 700; color: var(--fgd-text-1); }
.fgd .fgd-row-hint { font-size: 0.74rem; color: var(--fgd-muted); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fgd .fgd-row-right { display: inline-flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.fgd .fgd-value { font-size: 0.76rem; font-weight: 700; color: var(--fgd-accent-strong); background: var(--fgd-accent-soft); border-radius: 6px; padding: 0.15rem 0.5rem; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-theme="dark"] .fgd .fgd-value { color: var(--fgd-accent); }
.fgd .fgd-chevron { width: 17px; height: 17px; color: var(--fgd-muted); transition: transform 0.2s ease; }
.fgd .fgd-row.open .fgd-chevron { transform: rotate(180deg); }
.fgd .fgd-row-body { padding: 0.2rem 0.9rem 0.9rem; display: flex; flex-direction: column; gap: 0.55rem; min-width: 0; }
.fgd .fgd-row-body .fgd-hint { margin: 0; }
.fgd .fgd-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.6rem; }
.fgd .fgd-field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; font-size: 0.78rem; font-weight: 600; color: var(--fgd-text-2); }
.fgd .fgd-field input { width: 100%; }
.fgd .fgd-range { width: 100%; accent-color: var(--fgd-accent); margin: 0; }
.fgd .fgd-range-ends { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--fgd-muted); }

/* ---------- action bar, done box ---------- */
.fgd .fgd-actionbar { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--fgd-line); }
.fgd .fgd-actionbar .fgd-go { margin-left: auto; }
.fgd .fgd-done { margin-top: 1rem; padding: 0.95rem 1rem 1.1rem; border-radius: 14px; border: 1px solid var(--fgd-ok-line); background: var(--fgd-ok-soft); }
.fgd .fgd-done-head { display: flex; align-items: flex-start; gap: 0.65rem; }
.fgd .fgd-done-head > svg { width: 22px; height: 22px; color: var(--fgd-ok); flex-shrink: 0; margin-top: 1px; }
.fgd .fgd-done-text { flex: 1; min-width: 0; }
.fgd .fgd-done-text strong { display: block; font-size: 0.95rem; color: var(--fgd-text-1); }
.fgd .fgd-done-text span { display: block; margin-top: 0.15rem; font-size: 0.83rem; line-height: 1.5; color: var(--fgd-text-2); }
.fgd .fgd-done-text span:empty { display: none; }
.fgd .fgd-files { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.4rem; }
.fgd .fgd-file { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 0.65rem; padding: 0.45rem 0.5rem 0.45rem 0.7rem; border-radius: 10px; background: var(--fgd-card); border: 1px solid var(--fgd-line); min-width: 0; }
.fgd .fgd-file.is-sub { opacity: 0.85; }
.fgd .fgd-file > svg { width: 18px; height: 18px; color: var(--fgd-accent); flex-shrink: 0; }
.fgd .fgd-file-name { flex: 1; min-width: 0; font-size: 0.84rem; font-weight: 600; color: var(--fgd-text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fgd .fgd-file-size { flex-shrink: 0; font-size: 0.78rem; color: var(--fgd-muted); font-variant-numeric: tabular-nums; }
.fgd .fgd-file-acts { display: inline-flex; flex-wrap: wrap; gap: 0.35rem; margin-left: auto; }
.fgd .fgd-note { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.7rem 0.9rem; margin-top: 0.8rem; border-radius: 12px; font-size: 0.85rem; line-height: 1.5; color: var(--fgd-text-1); background: var(--fgd-card); border: 1px solid var(--fgd-accent-line); }
.fgd .fgd-note > svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; color: var(--fgd-accent); }
.fgd .fgd-note p { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* Edit this GIF */
.fgd .fgd-ec { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 0.65rem; margin-top: 0.8rem; min-width: 0; }
.fgd .fgd-ec-label { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.84rem; font-weight: 700; color: var(--fgd-text-1); white-space: nowrap; }
.fgd .fgd-ec-label svg { width: 16px; height: 16px; color: var(--fgd-accent); }
.fgd .fgd-ec-links { display: flex; flex-wrap: wrap; gap: 0.35rem; min-width: 0; }
.fgd a.fgd-ec-link { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 34px; padding: 0.3rem 0.75rem; border-radius: 999px; border: 1px solid var(--fgd-line); background: var(--fgd-card); color: var(--fgd-text-2); font-size: 0.82rem; font-weight: 600; text-decoration: none; }
.fgd a.fgd-ec-link svg { width: 15px; height: 15px; color: var(--fgd-accent); flex-shrink: 0; }
.fgd a.fgd-ec-link:hover, .fgd a.fgd-ec-link:focus-visible { border-color: var(--fgd-accent-line); color: var(--fgd-text-1); text-decoration: none; }
.fgd a.fgd-ec-link.fgd-ec-more { border-style: dashed; color: var(--fgd-muted); }
.fgd .fgd-ec[aria-busy="true"] a.fgd-ec-link { opacity: 0.55; pointer-events: none; }
.fgd .fgd-ec-msg { flex-basis: 100%; margin: 0; font-size: 0.85rem; line-height: 1.5; color: var(--fgd-muted); }
.fgd .fgd-ec-msg.is-bad { padding: 0.55rem 0.75rem; border-radius: 10px; background: var(--fgd-warn-soft); color: var(--fgd-text-1); }
.fgd .fgd-ec-msg a { color: var(--fgd-accent-strong); }

/* ---------- gallery ---------- */
.fgd .fgd-many-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.9rem; }
.fgd .fgd-many-head > div { min-width: 0; }
.fgd .fgd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.6rem; }
.fgd .fgd-tile { position: relative; display: flex; flex-direction: column; border: 2px solid var(--fgd-line); border-radius: 12px; overflow: hidden; background: var(--fgd-sunk); cursor: pointer; outline: none; min-width: 0; }
.fgd .fgd-tile.is-on { border-color: var(--fgd-accent); }
.fgd .fgd-tile:focus-visible { box-shadow: 0 0 0 3px var(--fgd-accent-soft); }
.fgd .fgd-tile-img { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; overflow: hidden; color: var(--fgd-muted); }
.fgd .fgd-tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fgd .fgd-tile-img svg { width: 32px; height: 32px; }
.fgd .fgd-tile:not(.is-on) .fgd-tile-img { opacity: 0.55; }
.fgd .fgd-tile-check { position: absolute; top: 0.45rem; right: 0.45rem; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(15, 23, 42, 0.45); color: transparent; border: 2px solid #fff; }
.fgd .fgd-tile.is-on .fgd-tile-check { background: var(--fgd-go); color: #fff; }
.fgd .fgd-tile-check svg { width: 15px; height: 15px; }
.fgd .fgd-tile-bar { display: flex; align-items: center; gap: 0.35rem; padding: 0.4rem 0.5rem; background: var(--fgd-card); font-size: 0.72rem; min-width: 0; }
.fgd .fgd-tile-badge { padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--fgd-accent-soft); color: var(--fgd-accent-strong); font-weight: 700; }
[data-theme="dark"] .fgd .fgd-tile-badge { color: var(--fgd-accent); }
.fgd .fgd-tile-dim { color: var(--fgd-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fgd .fgd-tile-opt { margin-left: auto; padding: 0.15rem 0.45rem; border-radius: 6px; border: 1px solid var(--fgd-line); background: none; color: var(--fgd-text-2); font-size: 0.72rem; font-weight: 600; cursor: pointer; }
.fgd .fgd-tile-opt:hover { border-color: var(--fgd-accent-line); color: var(--fgd-text-1); }

/* ---------- progress overlay (compress-gif standard) ---------- */
.fgd .fgd-overlay { position: fixed; inset: 0; z-index: 9000; background: rgba(0, 0, 0, 0.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.fgd .fgd-ov-card { min-width: 340px; max-width: 420px; width: 100%; padding: 1.5rem; border-radius: 18px; background: var(--fgd-card); border: 1px solid var(--fgd-line); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3); text-align: center; }
.fgd .fgd-ov-stages { display: flex; align-items: flex-start; justify-content: center; gap: 0.35rem; margin-bottom: 1rem; }
.fgd .fgd-ov-stage { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; min-width: 64px; color: var(--fgd-muted); }
.fgd .fgd-ov-stage svg { width: 20px; height: 20px; padding: 8px; box-sizing: content-box; border-radius: 50%; background: var(--fgd-sunk); border: 1px solid var(--fgd-line); }
.fgd .fgd-ov-stage small { font-size: 0.72rem; font-weight: 600; }
.fgd .fgd-ov-stage.is-on { color: var(--fgd-accent-strong); }
.fgd .fgd-ov-stage.is-on svg { border-color: var(--fgd-accent); background: var(--fgd-accent-soft); color: var(--fgd-accent); }
.fgd .fgd-ov-stage.is-done { color: var(--fgd-ok); }
.fgd .fgd-ov-stage.is-done svg { border-color: var(--fgd-ok-line); background: var(--fgd-ok-soft); color: var(--fgd-ok); }
.fgd .fgd-ov-link { width: 28px; height: 2px; margin-top: 18px; background: var(--fgd-line); border-radius: 2px; }
.fgd .fgd-ov-title { margin: 0 0 0.8rem; font-size: 1.05rem; color: var(--fgd-text-1); }
.fgd .fgd-ov-bar { height: 8px; border-radius: 999px; background: var(--fgd-line); overflow: hidden; }
.fgd .fgd-ov-fill { height: 100%; width: 0; background: var(--fgd-go); border-radius: 999px; transition: width 0.35s ease; }
.fgd .fgd-ov-row { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; margin-top: 0.55rem; text-align: left; }
.fgd .fgd-ov-msg { font-size: 0.84rem; color: var(--fgd-text-2); min-width: 0; }
.fgd .fgd-ov-pct { font-size: 0.95rem; font-weight: 800; color: var(--fgd-text-1); font-variant-numeric: tabular-nums; }

/* ---------- content ---------- */
.fgd .fgd-info { margin-top: 2rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
.fgd .fgd-info > * { min-width: 0; }
.fgd .fgd-info .info-card { background: var(--fgd-card); border: 1px solid var(--fgd-line); border-radius: 12px; padding: 1.4rem 1.5rem; box-shadow: none; }
.fgd .fgd-info .info-card h2 { display: flex; align-items: center; gap: 0.55rem; margin: 0 0 0.9rem; font-size: 1.25rem; line-height: 1.35; color: var(--fgd-text-1); }
.fgd .fgd-info .info-card h2 svg { width: 22px; height: 22px; color: var(--fgd-accent); flex-shrink: 0; }
.fgd .fgd-info .info-card p, .fgd .fgd-info .info-card li { color: var(--fgd-text-2); line-height: 1.65; font-size: 0.97rem; }
.fgd .fgd-info .info-card p { margin: 0.8rem 0 0; }
.fgd .fgd-info .info-card h2 + p { margin-top: 0; }
.fgd .fgd-info a { color: var(--fgd-accent-strong); font-weight: 500; }
[data-theme="dark"] .fgd .fgd-info a { color: var(--fgd-accent); }
.fgd .fgd-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.fgd .fgd-feature { min-width: 0; padding: 0.9rem 1rem; border-radius: 12px; border: 1px solid var(--fgd-line); }
.fgd .fgd-feature strong { display: flex; align-items: center; gap: 0.45rem; font-size: 0.95rem; color: var(--fgd-text-1); }
.fgd .fgd-feature strong svg { width: 18px; height: 18px; color: var(--fgd-accent); flex-shrink: 0; }
.fgd .fgd-info .fgd-feature p { margin: 0.35rem 0 0; font-size: 0.88rem; line-height: 1.55; }
.fgd .related-tools { margin-top: 1.5rem; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
    .fgd .fgd-one-grid { grid-template-columns: minmax(0, 1fr); }
    .fgd .fgd-features { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
    .fgd.tool-container { padding: 1.1rem 16px; }
    .fgd .tool-title { font-size: 1.6rem; }
    .fgd .fgd-title-icon { width: 46px; height: 46px; border-radius: 13px; }
    .fgd .fgd-title-icon svg { width: 25px; height: 25px; }
    .fgd .tool-description { font-size: 0.98rem; }
    .fgd .fgd-card { padding: 1rem; border-radius: 16px; }
    .fgd .fgd-urlbar { flex-wrap: wrap; padding: 0.5rem; }
    .fgd .fgd-urlbar-icon { display: none; }
    .fgd .fgd-url { flex-basis: 100%; padding: 0 0.3rem; }
    .fgd .fgd-urlbar .fgd-btn { flex: 1; }
    .fgd .fgd-actionbar .fgd-go { flex: 1 1 100%; margin-left: 0; order: -1; }
    .fgd .fgd-actionbar .fgd-btn-ghost { flex: 1; }
    .fgd .fgd-file-acts { width: 100%; margin-left: 0; }
    .fgd .fgd-file-acts .fgd-btn { flex: 1; }
    .fgd .fgd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fgd .fgd-two { grid-template-columns: minmax(0, 1fr); }
    .fgd .fgd-ov-card { min-width: 0; padding: 1.2rem 1rem; }
    .fgd .fgd-ec-label { width: 100%; }
    .fgd .fgd-info .info-card { padding: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
    .fgd .fgd-loader .b { animation-duration: 4s; }
    .fgd .fgd-loader .g { animation-duration: 6s; }
    .fgd .fgd-loader .r { animation: none; }
}
