/* ============================================================
   Stackaris Image to Base64 Converter — style.css
   Scoped to .img64, no external dependencies
   ============================================================ */

/* ── Custom properties: dark theme (default) ──────────────── */
.img64 {
    --img64-bg:         #0d1117;
    --img64-bg2:        #161b22;
    --img64-panel:      #1c2130;
    --img64-panel2:     #212736;
    --img64-border:     rgba(240, 246, 252, 0.08);
    --img64-border2:    rgba(240, 246, 252, 0.14);

    --img64-primary:    #7c6fff;
    --img64-primary-h:  #9585ff;
    --img64-primary-bg: rgba(124, 111, 255, 0.12);

    --img64-text:       #e6edf3;
    --img64-muted:      #8b949e;
    --img64-faint:      #484f58;

    --img64-success:    #3fb950;
    --img64-danger:     #f85149;
    --img64-warning:    #e3b341;

    --img64-blue:       #58a6ff;
    --img64-purple:     #bc8cff;
    --img64-green:      #3fb950;
    --img64-orange:     #e3b341;
    --img64-cyan:       #39c5cf;
    --img64-pink:       #f778ba;
    --img64-yellow:     #d29922;

    --img64-code-bg:    #0d1117;
    --img64-code-text:  #79c0ff;

    --img64-shadow:     0 8px 32px rgba(0, 0, 0, 0.5);
    --img64-shadow-sm:  0 2px 8px  rgba(0, 0, 0, 0.4);
    --img64-radius:     14px;
    --img64-radius-sm:  8px;
    --img64-radius-xs:  5px;

    --img64-font:  system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
    --img64-mono:  "Cascadia Code", "JetBrains Mono", "Fira Code", "SF Mono", Consolas, "Liberation Mono", monospace;

    /* layout */
    background: var(--img64-bg);
    color: var(--img64-text);
    font-family: var(--img64-font);
    font-size: 15px;
    line-height: 1.6;
    margin-left: 0;
    margin-right: 0;
    overflow-x: hidden;
    width: 100%;
}

/* ── Light theme ──────────────────────────────────────────── */
.img64[data-theme="light"] {
    --img64-bg:         #f3f4f6;
    --img64-bg2:        #ffffff;
    --img64-panel:      #ffffff;
    --img64-panel2:     #f8fafc;
    --img64-border:     rgba(0, 0, 0, 0.08);
    --img64-border2:    rgba(0, 0, 0, 0.14);

    --img64-primary:    #6d62e8;
    --img64-primary-h:  #5b52d0;
    --img64-primary-bg: rgba(109, 98, 232, 0.08);

    --img64-text:       #111827;
    --img64-muted:      #6b7280;
    --img64-faint:      #d1d5db;

    --img64-code-bg:    #1e2433;
    --img64-code-text:  #79c0ff;

    --img64-shadow:     0 8px 32px rgba(0, 0, 0, 0.1);
    --img64-shadow-sm:  0 2px 8px  rgba(0, 0, 0, 0.06);
}

/* ── Reset ────────────────────────────────────────────────── */
.img64,
.img64 *,
.img64 *::before,
.img64 *::after {
    box-sizing: border-box;
}

.img64 h1,
.img64 h2,
.img64 h3,
.img64 p,
.img64 ul,
.img64 dl {
    margin-top: 0;
}

.img64 ul {
    padding-left: 1.3em;
}

.img64 li {
    margin-bottom: 0.4em;
}

.img64 code {
    font-family: var(--img64-mono);
    font-size: 0.85em;
    background: var(--img64-primary-bg);
    color: var(--img64-primary);
    padding: 0.1em 0.4em;
    border-radius: 4px;
}

.img64 pre {
    background: var(--img64-code-bg);
    border: 1px solid var(--img64-border);
    border-radius: var(--img64-radius-sm);
    padding: 1rem 1.2rem;
    overflow-x: auto;
    margin: 0.75rem 0;
}

.img64 pre code {
    background: transparent;
    color: var(--img64-code-text);
    padding: 0;
    font-size: 0.82em;
    line-height: 1.7;
}

.img64 kbd {
    display: inline-block;
    font-family: var(--img64-mono);
    font-size: 0.78em;
    padding: 0.1em 0.45em;
    background: var(--img64-panel2);
    border: 1px solid var(--img64-border2);
    border-bottom-width: 2px;
    border-radius: 4px;
    color: var(--img64-muted);
}

/* ── Kicker / eyebrow ─────────────────────────────────────── */
.img64-kicker {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--img64-primary);
    margin-bottom: 0.6rem;
}

/* ── Hero ─────────────────────────────────────────────────── */
.img64-hero {
    background:
        radial-gradient(ellipse 70% 50% at 50% 0%, rgba(124, 111, 255, 0.18), transparent 65%),
        linear-gradient(180deg, var(--img64-bg2) 0%, var(--img64-bg) 100%);
    padding: 64px 20px 36px;
    text-align: center;
    border-bottom: 1px solid var(--img64-border);
}

.img64-hero__inner {
    margin: 0 auto;
    max-width: 780px;
}

.img64-hero__title {
    font-size: clamp(1.75rem, 4.5vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.img64[data-theme="light"] .img64-hero__title {
    background: linear-gradient(135deg, #111827 0%, #374151 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.img64-hero__desc {
    font-size: 1rem;
    color: var(--img64-muted);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.img64-hero__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.img64-hero__badges span {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.25em 0.75em;
    border-radius: 999px;
    background: var(--img64-primary-bg);
    color: var(--img64-primary);
    border: 1px solid rgba(124, 111, 255, 0.25);
}

/* ── Ad Banner ────────────────────────────────────────────── */
.img64-ad {
    background: var(--img64-bg2);
    border-bottom: 1px solid var(--img64-border);
    padding: 12px 20px;
}

.img64-ad__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    max-width: 1280px;
    margin: 0 auto;
}

.img64-ad__label {
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--img64-faint);
}

.img64-ad__slot {
    width: 100%;
    max-width: 728px;
    height: 90px;
    background: var(--img64-panel);
    border: 1px dashed var(--img64-border2);
    border-radius: var(--img64-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--img64-faint);
}

.img64-ad__slot::after {
    content: "728 × 90 Ad Unit";
}

/* ── Workspace wrapper ────────────────────────────────────── */
.img64-workspace {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 20px 48px;
}

/* ── Toolbar ──────────────────────────────────────────────── */
.img64-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 20px;
    background: var(--img64-panel);
    border: 1px solid var(--img64-border);
    border-radius: var(--img64-radius);
    padding: 10px 14px;
}

.img64-toolbar__left,
.img64-toolbar__right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* ── Buttons ──────────────────────────────────────────────── */
.img64-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--img64-font);
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.55em 1.1em;
    border: 1px solid transparent;
    border-radius: var(--img64-radius-sm);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s, opacity 0.15s;
    white-space: nowrap;
    text-decoration: none;
}

.img64-btn:active { transform: scale(0.97); }
.img64-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.img64-btn:disabled:active { transform: none; }

.img64-btn--sm { font-size: 0.78rem; padding: 0.42em 0.9em; }
.img64-btn--lg { font-size: 0.95rem; padding: 0.7em 1.4em; }
.img64-btn--full { width: 100%; justify-content: center; }
.img64-btn--icon { padding: 0.55em 0.55em; }

.img64-btn--primary {
    background: var(--img64-primary);
    color: #fff;
    border-color: var(--img64-primary);
}
.img64-btn--primary:hover { background: var(--img64-primary-h); border-color: var(--img64-primary-h); }

.img64-btn--outline {
    background: transparent;
    color: var(--img64-muted);
    border-color: var(--img64-border2);
}
.img64-btn--outline:hover { color: var(--img64-text); border-color: var(--img64-primary); }

.img64-btn--ghost {
    background: transparent;
    color: var(--img64-muted);
    border-color: var(--img64-border);
}
.img64-btn--ghost:hover { background: var(--img64-primary-bg); color: var(--img64-primary); border-color: var(--img64-primary); }

.img64-btn--danger {
    background: rgba(248, 81, 73, 0.1);
    color: var(--img64-danger);
    border-color: rgba(248, 81, 73, 0.25);
}
.img64-btn--danger:hover { background: rgba(248, 81, 73, 0.18); }

.img64-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--img64-border);
    border-radius: var(--img64-radius-xs);
    color: var(--img64-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.img64-icon-btn:hover { background: var(--img64-primary-bg); color: var(--img64-primary); border-color: var(--img64-primary); }

/* ── Auto-convert toggle ──────────────────────────────────── */
.img64-auto-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--img64-muted);
    cursor: pointer;
    user-select: none;
}

.img64-auto-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.img64-toggle {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
    background: var(--img64-faint);
    border-radius: 999px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.img64-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.img64-auto-label input:checked + .img64-toggle { background: var(--img64-primary); }
.img64-auto-label input:checked + .img64-toggle::after { transform: translateX(16px); }

/* ── Main grid ────────────────────────────────────────────── */
.img64-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (min-width: 1040px) {
    .img64-grid {
        grid-template-columns: 2fr 3fr;
    }
}

.img64-col {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ── Panel ────────────────────────────────────────────────── */
.img64-panel {
    background: var(--img64-panel);
    border: 1px solid var(--img64-border);
    border-radius: var(--img64-radius);
    overflow: hidden;
    animation: img64-panel-in 0.25s ease both;
}

@keyframes img64-panel-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.img64-panel__hd {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--img64-border);
    gap: 10px;
}

.img64-panel__title {
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--img64-text);
    margin-bottom: 0;
}

.img64-panel__sub {
    font-size: 0.72rem;
    color: var(--img64-muted);
    margin-bottom: 0;
    margin-top: 2px;
}

/* ── Drop zone ────────────────────────────────────────────── */
.img64-dropzone {
    margin: 16px;
    border: 2px dashed var(--img64-border2);
    border-radius: var(--img64-radius-sm);
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
    cursor: pointer;
}

.img64-dropzone:hover,
.img64-dropzone:focus-visible {
    border-color: var(--img64-primary);
    background: var(--img64-primary-bg);
    outline: none;
}

.img64-dropzone.is-over {
    border-color: var(--img64-primary);
    background: var(--img64-primary-bg);
    transform: scale(1.012);
    box-shadow: 0 0 0 4px rgba(124, 111, 255, 0.15);
}

.img64-dropzone.is-over .img64-dropzone__icon svg {
    animation: img64-bounce 0.5s ease infinite alternate;
}

@keyframes img64-bounce {
    from { transform: translateY(0); }
    to   { transform: translateY(-6px); }
}

.img64-dropzone__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 20px;
    gap: 8px;
    text-align: center;
}

.img64-dropzone__icon {
    margin-bottom: 4px;
    transition: transform 0.2s;
}

.img64-dropzone__main {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--img64-text);
    margin-bottom: 0;
}

.img64-dropzone__or {
    font-size: 0.78rem;
    color: var(--img64-faint);
    margin-bottom: 0;
}

.img64-dropzone__browse {
    display: inline-block;
    appearance: none;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--img64-primary);
    padding: 0;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--img64-primary);
    cursor: pointer;
    transition: opacity 0.15s;
}
.img64-dropzone__browse:hover { opacity: 0.75; }

.img64-dropzone__hint {
    font-size: 0.76rem;
    color: var(--img64-muted);
    margin-bottom: 0;
}

.img64-dropzone__formats {
    font-size: 0.7rem;
    color: var(--img64-faint);
    letter-spacing: 0.04em;
    margin-bottom: 0;
}

/* ── Preview panel ────────────────────────────────────────── */
.img64-preview {
    padding: 12px 16px 0;
}

.img64-preview__checker {
    border-radius: var(--img64-radius-sm);
    overflow: hidden;
    background-color: #1c1c1c;
    background-image:
        linear-gradient(45deg, #2a2a2a 25%, transparent 25%),
        linear-gradient(-45deg, #2a2a2a 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #2a2a2a 75%),
        linear-gradient(-45deg, transparent 75%, #2a2a2a 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    max-height: 280px;
}

.img64[data-theme="light"] .img64-preview__checker {
    background-color: #e5e7eb;
    background-image:
        linear-gradient(45deg, #d1d5db 25%, transparent 25%),
        linear-gradient(-45deg, #d1d5db 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #d1d5db 75%),
        linear-gradient(-45deg, transparent 75%, #d1d5db 75%);
}

.img64-preview__checker img {
    max-width: 100%;
    max-height: 280px;
    object-fit: contain;
    display: block;
    border-radius: 2px;
}

.img64-preview__meta {
    font-size: 0.76rem;
    color: var(--img64-muted);
    padding: 8px 16px 4px;
    min-height: 24px;
}

.img64-panel [data-convert-btn] {
    margin: 12px 16px 16px;
    width: calc(100% - 32px);
}

/* ── Image information grid ───────────────────────────────── */
.img64-info-grid {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 8px 0;
}

.img64-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 18px;
    border-bottom: 1px solid var(--img64-border);
    gap: 12px;
}

.img64-info-row:last-child { border-bottom: none; }

.img64-info-row dt {
    font-size: 0.78rem;
    color: var(--img64-muted);
    flex-shrink: 0;
}

.img64-info-row dd {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--img64-text);
    font-family: var(--img64-mono);
    text-align: right;
    word-break: break-all;
    margin: 0;
}

/* ── Output panel ─────────────────────────────────────────── */
.img64-panel--output {
    display: flex;
    flex-direction: column;
    min-height: 480px;
}

/* ── Format tabs ──────────────────────────────────────────── */
.img64-tabs {
    display: flex;
    gap: 2px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--img64-border);
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
}

.img64-tabs::-webkit-scrollbar { display: none; }

.img64-tab {
    font-family: var(--img64-font);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.38em 0.9em;
    border: 1px solid transparent;
    border-radius: var(--img64-radius-xs);
    background: transparent;
    color: var(--img64-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.img64-tab:hover { color: var(--img64-text); background: var(--img64-panel2); }

.img64-tab.is-active {
    background: var(--img64-primary-bg);
    color: var(--img64-primary);
    border-color: rgba(124, 111, 255, 0.3);
}

/* ── Output area ──────────────────────────────────────────── */
.img64-output-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 300px;
}

.img64-output-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    gap: 12px;
    text-align: center;
    color: var(--img64-muted);
}

.img64-output-empty p {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--img64-muted);
    margin-bottom: 0;
}

.img64-output-empty span {
    font-size: 0.73rem;
    color: var(--img64-faint);
    letter-spacing: 0.03em;
}

.img64-output-text {
    flex: 1;
    width: 100%;
    min-height: 300px;
    background: var(--img64-code-bg);
    color: var(--img64-code-text);
    font-family: var(--img64-mono);
    font-size: 0.8rem;
    line-height: 1.7;
    border: none;
    border-top: 1px solid var(--img64-border);
    padding: 16px 18px;
    resize: vertical;
    outline: none;
    word-break: break-all;
    overflow-wrap: anywhere;
}

.img64-output-text:focus { box-shadow: inset 0 0 0 2px var(--img64-primary); }

.img64-output-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 48px 24px;
    color: var(--img64-muted);
    font-size: 0.88rem;
}

.img64-output-loading p { margin-bottom: 0; }

/* ── Spinner ──────────────────────────────────────────────── */
.img64-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--img64-border2);
    border-top-color: var(--img64-primary);
    border-radius: 50%;
    animation: img64-spin 0.7s linear infinite;
}

@keyframes img64-spin {
    to { transform: rotate(360deg); }
}

/* ── Output footer ────────────────────────────────────────── */
.img64-output-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-top: 1px solid var(--img64-border);
    gap: 10px;
    flex-wrap: wrap;
}

.img64-char-count {
    font-size: 0.75rem;
    color: var(--img64-muted);
    font-family: var(--img64-mono);
}

.img64-output-actions {
    display: flex;
    gap: 6px;
}

/* ── Stats row ────────────────────────────────────────────── */
.img64-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.img64-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--img64-panel);
    border: 1px solid var(--img64-border);
    border-radius: var(--img64-radius);
    animation: img64-stat-in 0.3s ease both;
    transition: transform 0.15s, box-shadow 0.15s;
}

.img64-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--img64-shadow-sm);
}

@keyframes img64-stat-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.img64-stat:nth-child(1) { animation-delay: 0.04s; }
.img64-stat:nth-child(2) { animation-delay: 0.08s; }
.img64-stat:nth-child(3) { animation-delay: 0.12s; }
.img64-stat:nth-child(4) { animation-delay: 0.16s; }
.img64-stat:nth-child(5) { animation-delay: 0.20s; }
.img64-stat:nth-child(6) { animation-delay: 0.24s; }
.img64-stat:nth-child(7) { animation-delay: 0.28s; }

.img64-stat__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
}

.img64-stat--blue   .img64-stat__icon { background: rgba(88,  166, 255, 0.12); color: var(--img64-blue);   }
.img64-stat--purple .img64-stat__icon { background: rgba(188, 140, 255, 0.12); color: var(--img64-purple); }
.img64-stat--green  .img64-stat__icon { background: rgba(63,  185,  80, 0.12); color: var(--img64-green);  }
.img64-stat--orange .img64-stat__icon { background: rgba(227, 179,  65, 0.12); color: var(--img64-orange); }
.img64-stat--cyan   .img64-stat__icon { background: rgba(57,  197, 207, 0.12); color: var(--img64-cyan);   }
.img64-stat--pink   .img64-stat__icon { background: rgba(247, 120, 186, 0.12); color: var(--img64-pink);   }
.img64-stat--yellow .img64-stat__icon { background: rgba(210, 153,  34, 0.12); color: var(--img64-yellow); }

.img64-stat__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.img64-stat__body span {
    font-size: 0.7rem;
    color: var(--img64-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.img64-stat__body strong {
    font-size: 0.9rem;
    font-weight: 700;
    font-family: var(--img64-mono);
    color: var(--img64-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Fullscreen overlay ───────────────────────────────────── */
.img64-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--img64-bg);
    display: flex;
    flex-direction: column;
    animation: img64-fs-in 0.18s ease;
}

@keyframes img64-fs-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.img64-fullscreen[hidden] { display: none; }

.img64-fullscreen__hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--img64-border);
    background: var(--img64-panel);
    gap: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.img64-fullscreen__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.img64-fullscreen__text {
    flex: 1;
    width: 100%;
    background: var(--img64-code-bg);
    color: var(--img64-code-text);
    font-family: var(--img64-mono);
    font-size: 0.85rem;
    line-height: 1.75;
    border: none;
    padding: 20px 24px;
    resize: none;
    outline: none;
    word-break: break-all;
    overflow-wrap: anywhere;
}

.img64-tabs--fs { padding: 0; border: none; }

/* ── Toast notification ───────────────────────────────────── */
.img64-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.img64-toast__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: var(--img64-radius-sm);
    font-size: 0.84rem;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 4px 18px rgba(0,0,0,0.45);
    animation: img64-toast-in 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
    pointer-events: auto;
    max-width: 320px;
}

.img64-toast__item--success { background: #1a6e2a; border: 1px solid rgba(63, 185, 80, 0.4); }
.img64-toast__item--error   { background: #6e1a1a; border: 1px solid rgba(248, 81, 73, 0.4); }
.img64-toast__item--info    { background: #1a2a6e; border: 1px solid rgba(88, 166, 255, 0.4); }

.img64-toast__item.is-leaving {
    animation: img64-toast-out 0.2s ease both;
}

@keyframes img64-toast-in {
    from { opacity: 0; transform: translateX(20px) scale(0.95); }
    to   { opacity: 1; transform: translateX(0)    scale(1); }
}

@keyframes img64-toast-out {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(12px); }
}

/* ── SEO section ──────────────────────────────────────────── */
.img64-seo {
    background: var(--img64-bg2);
    border-top: 1px solid var(--img64-border);
    padding: 56px 20px 64px;
}

.img64-seo__inner {
    max-width: 1280px;
    margin: 0 auto;
}

.img64-seo__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

@media (min-width: 640px) {
    .img64-seo__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1040px) {
    .img64-seo__grid { grid-template-columns: repeat(3, 1fr); }
}

.img64-seo__card {
    background: var(--img64-panel);
    border: 1px solid var(--img64-border);
    border-radius: var(--img64-radius);
    padding: 24px 22px;
}

.img64-seo__card h2 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
    color: var(--img64-text);
}

.img64-seo__card p,
.img64-seo__card li {
    font-size: 0.875rem;
    color: var(--img64-muted);
    line-height: 1.7;
}

.img64-seo__card--faq { grid-column: 1 / -1; }

.img64-seo__card details {
    border-top: 1px solid var(--img64-border);
    padding: 12px 0;
}

.img64-seo__card details:last-of-type { border-bottom: 1px solid var(--img64-border); }

.img64-seo__card summary {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--img64-text);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    user-select: none;
}

.img64-seo__card summary::-webkit-details-marker { display: none; }

.img64-seo__card summary::after {
    content: '+';
    font-size: 1.1rem;
    color: var(--img64-primary);
    transition: transform 0.2s;
    flex-shrink: 0;
    font-weight: 400;
    line-height: 1;
}

.img64-seo__card details[open] summary::after { content: '−'; }

.img64-seo__card details > p {
    margin-top: 10px;
    margin-bottom: 0;
    font-size: 0.855rem;
    color: var(--img64-muted);
}

.img64-code-sample {
    display: block;
    font-size: 0.75rem !important;
    background: var(--img64-code-bg) !important;
    color: var(--img64-code-text) !important;
    border: 1px solid var(--img64-border);
    border-radius: var(--img64-radius-xs);
    padding: 8px 12px !important;
    word-break: break-all;
    margin-top: 8px;
}

/* ── Related tools ────────────────────────────────────────── */
.img64-related { text-align: center; }

.img64-related h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.img64-related__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.img64-related__grid a {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--img64-muted);
    text-decoration: none;
    padding: 0.45em 1em;
    border: 1px solid var(--img64-border2);
    border-radius: 999px;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.img64-related__grid a:hover {
    color: var(--img64-primary);
    border-color: var(--img64-primary);
    background: var(--img64-primary-bg);
}

/* ── Utility: hidden ──────────────────────────────────────── */
.img64 [hidden] { display: none !important; }

/* ── Copy success flash ───────────────────────────────────── */
.img64-btn.is-copied {
    background: rgba(63, 185, 80, 0.15) !important;
    color: var(--img64-success) !important;
    border-color: rgba(63, 185, 80, 0.3) !important;
}

/* ── Responsive: Tablet ───────────────────────────────────── */
@media (max-width: 1039px) {
    .img64-stats {
        grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    }
}

/* ── Responsive: Mobile ───────────────────────────────────── */
@media (max-width: 639px) {
    .img64-hero { padding: 40px 16px 28px; }

    .img64-workspace { padding: 16px 12px 36px; }

    .img64-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .img64-toolbar__left,
    .img64-toolbar__right {
        width: 100%;
    }

    .img64-toolbar__right {
        justify-content: flex-end;
    }

    .img64-tabs {
        padding: 8px 10px;
    }

    .img64-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .img64-stat__body strong {
        font-size: 0.82rem;
    }

    .img64-panel--output {
        min-height: 360px;
    }

    .img64-output-text {
        min-height: 220px;
        font-size: 0.75rem;
    }

    .img64-fullscreen__hd {
        flex-direction: column;
        align-items: flex-start;
    }

    .img64-seo__card--faq { grid-column: auto; }

    .img64-toast {
        bottom: 16px;
        right: 12px;
        left: 12px;
    }

    .img64-toast__item { max-width: 100%; }
}
