/* === Reset & Base === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-page: #F3EBD3;
    --bg-card: #FFFDF5;
    --bg-card-hover: #fff;
    --border: #d4c9b0;
    --border-dash: #AAAAAA;
    --text-primary: #5A4235;
    --text-secondary: #8a7560;
    --accent: #6B4E3D;
    --accent-hover: #8a6a56;
    --accent-rose: #e8a0b4;
    --fg-green: #8BA888;
    --fg-green-bright: #6dbd6d;
    --bg-red: #f87171;
    --shadow-pixel: 4px 4px 0px 0px rgba(0, 0, 0, 0.12);
    --shadow-pixel-hover: 2px 2px 0px 0px rgba(0, 0, 0, 0.12);
    --transition: 150ms ease;
    --font-pixel: 'Press Start 2P', cursive;
    --font-retro: 'VT323', monospace;
    --cta-text: #111111;
    /* Per-pet accent — overridden by each tool page */
    --pet-color: #E8A0B4;
    --pet-color-hover: #d47090;
    --pet-color-text: #3E1C2A;
}

/* === Dark Mode: system default === */
@media (prefers-color-scheme: dark) {
    html:not(.light) {
        --bg-page: #2D2420;
        --bg-card: #3E322C;
        --bg-card-hover: #4a3d35;
        --border: #5a4a3e;
        --border-dash: #666666;
        --text-primary: #EAD8C0;
        --text-secondary: #b39e87;
        --accent: #EAD8C0;
        --accent-hover: #f5ead8;
        --accent-rose: #d48fa5;
        --fg-green: #a3c4a0;
        --fg-green-bright: #8ddb8d;
        --shadow-pixel: 4px 4px 0px 0px rgba(0, 0, 0, 0.3);
        --shadow-pixel-hover: 2px 2px 0px 0px rgba(0, 0, 0, 0.3);
        --cta-text: #ffffff;
    }
}

/* === Dark Mode: manual override === */
html.dark {
    --bg-page: #2D2420;
    --bg-card: #3E322C;
    --bg-card-hover: #4a3d35;
    --border: #5a4a3e;
    --border-dash: #666666;
    --text-primary: #EAD8C0;
    --text-secondary: #b39e87;
    --accent: #EAD8C0;
    --accent-hover: #f5ead8;
    --accent-rose: #d48fa5;
    --fg-green: #a3c4a0;
    --fg-green-bright: #8ddb8d;
    --shadow-pixel: 4px 4px 0px 0px rgba(0, 0, 0, 0.3);
    --shadow-pixel-hover: 2px 2px 0px 0px rgba(0, 0, 0, 0.3);
    --cta-text: #ffffff;
}

html,
body {
    min-height: 100%;
    font-family: var(--font-retro);
    font-size: 20px;
    background: var(--bg-page);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

.font-pixel {
    font-family: var(--font-pixel);
}

/* === Privacy Banner === */
.privacy-banner {
    background: var(--accent);
    color: var(--bg-page);
    padding: 8px 16px;
    text-align: center;
    font-family: var(--font-retro);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

html.dark .privacy-banner {
    background: #1e1714;
    color: #EAD8C0;
}

@media (prefers-color-scheme: dark) {
    html:not(.light) .privacy-banner {
        background: #1e1714;
        color: #EAD8C0;
    }
}

/* === Cookie Banner === */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 3px solid var(--border);
    border-radius: 12px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-pixel);
    z-index: 1000;
    max-width: 90%;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.cookie-banner .cookie-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.cookie-banner p {
    font-family: var(--font-retro);
    font-size: 18px;
    color: var(--text-primary);
    margin: 0;
}

.cookie-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.cookie-btn {
    font-family: var(--font-pixel);
    font-size: 10px;
    padding: 8px 16px;
    border: 2px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.cookie-btn.accept {
    background: var(--fg-green);
    color: white;
    border-color: var(--fg-green);
}

.cookie-btn.accept:hover {
    background: var(--fg-green-bright);
    border-color: var(--fg-green-bright);
}

.cookie-btn.decline {
    background: transparent;
    color: var(--text-secondary);
}

.cookie-btn.decline:hover {
    background: var(--border);
    color: var(--text-primary);
}

@media (max-width: 600px) {
    .cookie-banner {
        flex-direction: column;
        text-align: center;
        bottom: 10px;
        padding: 16px;
    }

    .cookie-buttons {
        width: 100%;
        justify-content: center;
    }
}

/* === Site Header === */
.site-header {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 36px 0 24px;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 48px;
    z-index: 5;
}

/* Right column: subtitle + badges stacked, right-aligned */
.site-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.site-title {
    font-size: 36px;
    color: var(--accent);
    letter-spacing: -1px;
    cursor: default;
    user-select: none;
    transition: transform 0.2s ease;
    filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.08));
}

.site-title:hover {
    transform: scale(1.05);
}

.site-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: 0;
    gap: 4px 8px;
    font-family: var(--font-retro);
    font-size: 17px;
    color: var(--text-secondary);
}

.site-badges span {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.site-badges span+span::before {
    content: '·';
    margin-right: 8px;
    color: var(--border);
    font-style: normal;
}

/* === Site Subtitle === */
.site-subtitle {
    font-family: var(--font-retro);
    font-size: 22px;
    color: var(--text-secondary);
    margin-top: 4px;
    letter-spacing: 0.5px;
}

.site-quote {
    font-family: var(--font-retro);
    font-size: 18px;
    color: var(--text-secondary);
    opacity: 0.55;
    letter-spacing: 0.5px;
}

/* === Theme Switcher (footer) === */
.theme-switch {
    pointer-events: auto;
    cursor: pointer;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
}

.theme-switch:hover {
    color: var(--accent);
}

/* === States === */
.state {
    display: none;
    width: 100%;
}

.state.active {
    display: flex;
}

/* === Landing / Upload === */
#landing {
    align-items: flex-start;
    justify-content: flex-start;
}

.landing-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 12px 24px 80px;
}

.landing-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.mascot-img {
    width: 200px;
    height: 200px;
    object-fit: contain;
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.15));
    transition: transform 0.3s ease;
}

.mascot-img:hover {
    transform: scale(1.1);
}

.mascot-axol-img {
    width: 240px;
    height: 240px;
}

.landing-header h1 {
    font-size: 20px;
    line-height: 1.6;
    color: var(--accent);
    letter-spacing: 1px;
}

.subtitle {
    font-size: 22px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* === Homepage Tools Grid === */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    width: 100%;
    max-width: 900px;
}

.tool-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 24px;
    padding-top: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 8px 0 0 var(--border), 4px 4px 0px 0px rgba(0, 0, 0, 0.10);
    border: 2px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 1;
}

.tool-card:hover {
    transform: translateY(5px);
    box-shadow: 0 12px 0 0 var(--border), 4px 4px 0px 0px rgba(0, 0, 0, 0.14);
    z-index: 10;
}



.tool-card .mascot-img {
    width: 180px;
    height: 180px;
    margin-bottom: 0px;
}

#inky-card-img {
    width: 150px;
    height: 150px;
}


.tool-name {
    font-size: 11px;
    color: var(--accent);
    letter-spacing: 1px;
    line-height: 1.4;
}

.tool-role {
    font-family: var(--font-pixel);
    font-size: 11px;
    color: var(--accent);
    letter-spacing: 1px;
    line-height: 1.8;
    opacity: 0.7;
}

.tool-desc {
    font-size: 20px;
    color: var(--text-secondary);
    margin: 8px 0 20px;
}

.tool-card .drop-zone {
    width: 100%;
}

.tool-card .drop-zone-content {
    padding: 32px 24px;
}

.tool-card .model-status {
    margin-top: 16px;
}

/* Drop zone icon variants */
.icon-upload {
    color: var(--text-secondary) !important;
}

.icon-convert {
    color: var(--fg-green) !important;
}

/* === Multi-select Preview Grid === */
.preview-grid {
    display: none;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px;
    justify-content: center;
    align-items: flex-start;
    min-height: 100px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    /* Dashed border via SVG background */
    background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='12' ry='12' stroke='%23AAAAAA' stroke-width='3' stroke-dasharray='12%2c 12' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
}

html.dark .preview-grid {
    background-color: rgba(0, 0, 0, 0.2);
    background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='12' ry='12' stroke='%23666666' stroke-width='3' stroke-dasharray='12%2c 12' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
}

@media (prefers-color-scheme: dark) {
    html:not(.light) .preview-grid {
        background-color: rgba(0, 0, 0, 0.2);
        background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='12' ry='12' stroke='%23666666' stroke-width='3' stroke-dasharray='12%2c 12' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
    }
}

.preview-thumb {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: visible;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.preview-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e55;
    color: #fff;
    border: 2px solid var(--bg-card);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s ease, background 0.15s ease;
    z-index: 2;
}

.preview-remove:hover {
    background: #c33;
    transform: scale(1.15);
}

/* === Drop Zone (dashed box style from pixl.pet) === */
.drop-zone {
    position: relative;
    width: 100%;
    cursor: pointer;
    transition: all var(--transition);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 40vh;
    gap: 12px;
    text-align: center;
    padding: 48px 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5);
    transition: all var(--transition);
    /* Dashed border via SVG background */
    background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='12' ry='12' stroke='%23AAAAAA' stroke-width='3' stroke-dasharray='12%2c 12' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
}

html.dark .drop-zone-content {
    background: rgba(0, 0, 0, 0.2);
    background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='12' ry='12' stroke='%23666666' stroke-width='3' stroke-dasharray='12%2c 12' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
}

@media (prefers-color-scheme: dark) {
    html:not(.light) .drop-zone-content {
        background: rgba(0, 0, 0, 0.2);
        background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='12' ry='12' stroke='%23666666' stroke-width='3' stroke-dasharray='12%2c 12' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
    }
}

.drop-zone-content:hover {
    background-color: rgba(255, 255, 255, 0.9);
    background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='12' ry='12' stroke='%236B4E3D' stroke-width='3' stroke-dasharray='12%2c 12' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
}

html.dark .drop-zone-content:hover {
    background-color: rgba(0, 0, 0, 0.4);
    background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='12' ry='12' stroke='%23EAD8C0' stroke-width='3' stroke-dasharray='12%2c 12' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
}

@media (prefers-color-scheme: dark) {
    html:not(.light) .drop-zone-content:hover {
        background-color: rgba(0, 0, 0, 0.4);
        background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='12' ry='12' stroke='%23EAD8C0' stroke-width='3' stroke-dasharray='12%2c 12' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
    }
}

.drop-zone.drag-over .drop-zone-content {
    background-color: rgba(255, 255, 255, 0.95);
    background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='12' ry='12' stroke='%236B4E3D' stroke-width='3' stroke-dasharray='12%2c 12' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
}

.drop-icon {
    font-size: 36px;
    color: var(--pet-color, var(--accent-rose));
    transition: color var(--transition);
}

.drop-zone-content:hover .drop-icon {
    color: var(--accent);
}

.drop-label {
    font-family: var(--font-pixel);
    font-size: 12px;
    font-weight: 700;
}

.drop-hint {
    font-size: 16px;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* === Model Status === */
.model-status {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 14px;
    font-family: var(--font-retro);
}

.model-status.loaded .model-progress-ring .ring-fill {
    stroke: var(--pet-color, var(--fg-green));
    stroke-dashoffset: 0;
}

.model-status.loaded .ring-pct {
    color: var(--pet-color, var(--fg-green-bright));
    font-size: 14px;
}

.model-status-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#model-status-label {
    font-size: 16px;
}

.model-status-detail {
    font-size: 14px;
    opacity: 0.7;
}

/* === Progress Ring (landing page) === */
.model-progress-ring {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.model-progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.model-progress-ring .ring-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 3;
}

.model-progress-ring .ring-fill {
    fill: none;
    stroke: var(--pet-color, var(--accent));
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 100.53;
    stroke-dashoffset: 100.53;
    transition: stroke-dashoffset 0.3s ease;
}

.ring-pct {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-retro);
}

/* === Download Overlay (processing state) === */
.download-overlay {
    position: absolute;
    inset: 0;
    background: rgba(45, 36, 32, 0.88);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(4px);
}

html.dark .download-overlay {
    background: rgba(30, 23, 20, 0.92);
}

@media (prefers-color-scheme: dark) {
    html:not(.light) .download-overlay {
        background: rgba(30, 23, 20, 0.92);
    }
}

.download-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.download-overlay-content p {
    color: #EAD8C0;
    font-size: 18px;
    font-weight: 500;
    font-family: var(--font-retro);
}

.download-overlay-detail {
    font-size: 15px !important;
    font-weight: 400 !important;
    color: #b39e87 !important;
}

.download-ring {
    position: relative;
    width: 64px;
    height: 64px;
}

.download-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.download-ring .ring-bg {
    fill: none;
    stroke: #5a4a3e;
    stroke-width: 4;
}

.download-ring .ring-fill {
    fill: none;
    stroke: var(--accent-rose);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 163.36;
    stroke-dashoffset: 163.36;
    transition: stroke-dashoffset 0.3s ease;
}

.download-ring-pct {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #EAD8C0;
    font-family: var(--font-retro);
}

/* === Spinner (kept for compatibility) === */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* === Processing === */
#processing {
    align-items: center;
    justify-content: center;
}

.processing-container {
    position: relative;
    max-width: 80%;
    max-height: 80%;
}

.processing-container canvas {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 12px;
    display: block;
    box-shadow: var(--shadow-pixel);
}

/* Cream veil that fades out as progress increases */
.processing-overlay {
    position: absolute;
    inset: 0;
    background: rgba(243, 235, 211, var(--reveal, 1));
    border-radius: 12px;
    transition: background 0.6s ease;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 32px;
}

html.dark .processing-overlay {
    background: rgba(45, 36, 32, var(--reveal, 1));
}

@media (prefers-color-scheme: dark) {
    html:not(.light) .processing-overlay {
        background: rgba(45, 36, 32, var(--reveal, 1));
    }
}

/* Animated shimmer sweep */
.shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg,
            transparent 40%,
            rgba(255, 255, 255, 0.4) 50%,
            transparent 60%);
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Status bar inside the overlay */
.processing-status-bar {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 80%;
    max-width: 320px;
}

.processing-status-bar p {
    color: var(--accent);
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    font-family: var(--font-retro);
    text-shadow: 0 0 12px rgba(243, 235, 211, 0.8);
}

html.dark .processing-status-bar p {
    color: #EAD8C0;
    text-shadow: 0 0 12px rgba(45, 36, 32, 0.8);
}

@media (prefers-color-scheme: dark) {
    html:not(.light) .processing-status-bar p {
        color: #EAD8C0;
        text-shadow: 0 0 12px rgba(45, 36, 32, 0.8);
    }
}

.progress-track {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

html.dark .progress-track {
    background: rgba(255, 255, 255, 0.1);
}

@media (prefers-color-scheme: dark) {
    html:not(.light) .progress-track {
        background: rgba(255, 255, 255, 0.1);
    }
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* === Result Screen === */
#result {
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 24px;
}

.result-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    max-width: 90%;
    max-height: 85%;
    animation: resultFadeIn 0.5s ease;
}

@keyframes resultFadeIn {
    from {
        opacity: 0;
        transform: scale(0.97);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.result-canvas-wrap {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-pixel);
    /* Default: light transparent (checkerboard) */
    background-image:
        linear-gradient(45deg, #e0d8c0 25%, transparent 25%),
        linear-gradient(-45deg, #e0d8c0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e0d8c0 75%),
        linear-gradient(-45deg, transparent 75%, #e0d8c0 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    background-color: #f5eed8;
}

.result-canvas-wrap[data-bg="dark"] {
    background-color: #3E322C;
    background-image:
        linear-gradient(45deg, #4a3d35 25%, transparent 25%),
        linear-gradient(-45deg, #4a3d35 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #4a3d35 75%),
        linear-gradient(-45deg, transparent 75%, #4a3d35 75%);
}

.result-canvas-wrap[data-bg="white"] {
    background: #ffffff;
    background-image: none;
}

.result-canvas-wrap[data-bg="grey"] {
    background: #3E322C;
    background-image: none;
}

.result-canvas-wrap canvas {
    display: block;
    max-width: 100%;
    max-height: 60vh;
}

.result-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* Background toggle circles */
.bg-toggles {
    display: flex;
    gap: 10px;
}

.bg-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: transparent;
    padding: 3px;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.bg-toggle:hover {
    transform: scale(1.1);
}

.bg-toggle.active {
    border-color: var(--accent);
}

.bg-swatch {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.bg-swatch.light-trans {
    background-image:
        linear-gradient(45deg, #ddd 25%, transparent 25%),
        linear-gradient(-45deg, #ddd 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ddd 75%),
        linear-gradient(-45deg, transparent 75%, #ddd 75%);
    background-size: 8px 8px;
    background-position: 0 0, 0 4px, 4px -4px, -4px 0;
    background-color: #f5f5f5;
}

.bg-swatch.dark-trans {
    background-image:
        linear-gradient(45deg, #444 25%, transparent 25%),
        linear-gradient(-45deg, #444 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #444 75%),
        linear-gradient(-45deg, transparent 75%, #444 75%);
    background-size: 8px 8px;
    background-position: 0 0, 0 4px, 4px -4px, -4px 0;
    background-color: #2a2a2a;
}

.bg-swatch.white-solid {
    background: #ffffff;
}

.bg-swatch.grey-solid {
    background: #3E322C;
}

/* Result action buttons */
.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.result-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--font-retro);
    box-shadow: var(--shadow-pixel);
}

.result-btn:hover {
    box-shadow: var(--shadow-pixel-hover);
    transform: translateY(2px);
}

.result-btn.primary {
    background: var(--accent);
    color: var(--bg-page);
}

.result-btn.primary:hover {
    background: var(--accent-hover);
}

.result-btn.ghost {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.result-btn.ghost:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

/* === Footer === */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 24px;
    font-size: 16px;
    font-family: var(--font-retro);
    color: var(--text-secondary);
    background: var(--bg-page);
    pointer-events: none;
    z-index: 100;
}

.footer-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.footer-left,
.footer-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    pointer-events: auto;
}

.footer-sep {
    opacity: 0.5;
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
    pointer-events: auto;
}

footer a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.footer-kofi {
    pointer-events: auto;
    white-space: nowrap;
}

.heart {
    color: #e55;
    font-size: 18px;
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-page);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* === Responsive === */
@media (min-width: 769px) and (max-width: 1024px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .site-header {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        padding: 20px 16px 12px;
        max-width: 100%;
    }

    .site-header-right {
        align-items: center;
    }

    .site-title {
        font-size: 26px;
    }

    .site-subtitle {
        font-size: 18px;
    }

    .site-badges {
        font-size: 14px;
        gap: 2px 6px;
        justify-content: center;
    }

    .site-quote {
        font-size: 15px;
    }

    .dark-toggle {
        top: 12px;
        right: 12px;
        width: 38px;
        height: 38px;
    }

    .tools-grid {
        grid-template-columns: 1fr;
        gap: 24px;
        max-width: 400px;
    }

    .tool-card .mascot-img {
        width: 120px;
        height: 120px;
    }

    #inky-card-img {
        width: 120px;
        height: 120px;
    }

    .mascot-wrap {
        height: 120px;
    }

    .tool-card-description {
        display: none;
    }

    .tool-name {
        font-size: 9px;
    }

    .tool-role {
        font-size: 9px;
    }

    .landing-inner {
        padding: 16px 16px 24px;
    }

    html,
    body {
        overflow: auto;
        height: auto;
    }

    .state {
        height: auto;
    }

    #result {
        min-height: 72vh;
    }

    #processing {
        min-height: 72vh;
    }

    footer {
        position: static;
        pointer-events: auto;
    }

    .footer-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 4px;
    }

    .mascot-img {
        width: 120px;
        height: 120px;
    }

    .landing-header h1 {
        font-size: 16px;
    }

    .subtitle {
        font-size: 18px;
    }

    .drop-label {
        font-size: 10px;
    }

    .privacy-banner {
        font-size: 14px;
        padding: 6px 12px;
    }
}

/* =====================================================
   LANDING PAGE — TOOL GRID (nav cards with hover reveal)
   ===================================================== */

/* Tool cards are now <a> links */
a.tool-card {
    text-decoration: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: visible;
}

/* Wrapper anchoring the tooltip relative to just the mascot image */
.mascot-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    width: 100%;
    height: 180px;
}

a.tool-card:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.tool-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 4px;
}

.tool-badge {
    display: inline-block;
    font-family: var(--font-pixel);
    font-size: 9px;
    color: var(--bg-page);
    background: var(--accent);
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.tool-tagline {
    font-size: 28px;
    color: var(--text-secondary);
    margin: 4px 0 0;
}

/* Hover-reveal speech bubble above mascot — same component as .speech-bubble */
.tool-card-description {
    position: absolute;
    bottom: calc(100% + 18px);
    left: 50%;
    transform: translateX(-50%) translateY(30px);
    width: max(200px, 85%);
    font-family: var(--font-retro);
    font-size: 18px;
    font-style: italic;
    line-height: 1.4;
    color: #e8d8c0;
    background: #3a2e28;
    border: 2px solid #2a2018;
    border-radius: 14px;
    padding: 14px 18px;
    text-align: center;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 100;
}

/* Solid triangle arrow pointing down toward pet head */
.tool-card-description::after {
    content: '';
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 14px solid #3a2e28;
}

a.tool-card:hover .tool-card-description,
a.tool-card.touch-active .tool-card-description {
    opacity: 1;
    transform: translateX(-50%) translateY(20px);
    pointer-events: auto;
}

.tool-card-cta {
    font-family: var(--font-pixel);
    font-size: 10px;
    font-weight: bold;
    color: var(--cta-text);
    margin-top: 16px;
    margin-bottom: 4px;
    padding: 0;
    transition: opacity 0.15s ease;
}

a.tool-card:hover .tool-card-cta {
    opacity: 0.7;
}

.coming-soon-badge {
    display: inline-block;
    font-family: var(--font-pixel);
    font-size: 8px;
    color: var(--text-secondary);
    background: var(--border);
    padding: 4px 8px;
    border-radius: 12px;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    opacity: 0.7;
}

/* =====================================================
   DETAIL PAGE — Layout + Components
   ===================================================== */

/* Override body overflow for tool detail pages */
html:has(.detail-page-body) {
    overflow: visible;
    height: auto;
}

body.detail-page-body {
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.detail-page-body .site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    max-width: none;
    background: var(--bg-page);
    padding-top: 14px;
    padding-bottom: 12px;
    padding-inline: max(32px, calc(50vw - 518px));
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
}

.detail-page-body .site-header .back-link {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
}

.detail-page-body .site-header-brand {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.detail-page-body .site-title {
    font-size: 20px;
}

.detail-page-body .site-subtitle {
    font-size: 15px;
}

.detail-page-body footer {
    position: static;
    pointer-events: auto;
    margin-top: auto;
    padding-inline: max(32px, calc(50vw - 518px));
}

.detail-page-body .footer-inner {
    max-width: none;
}

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-pixel);
    font-size: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 0;
    transition: color var(--transition);
    flex-shrink: 0;
}

.back-link::before {
    content: '←';
    font-size: 14px;
}

.back-link:hover {
    color: var(--accent);
}

/* Detail page main content */
.detail-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 32px 80px;
    gap: 0;
}

.detail-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 40px;
    align-items: start;
}

/* Left panel: mascot + info */
.detail-mascot-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0;
    position: sticky;
    top: 80px;
}

/* Speech bubble above mascot — shared component (detail page + landing hover) */
.speech-bubble {
    position: relative;
    background: #3a2e28;
    border: 2px solid #2a2018;
    border-radius: 14px;
    padding: 16px 22px;
    margin-bottom: 0;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.3);
    max-width: 280px;
    text-align: center;
}

.speech-bubble p {
    font-family: var(--font-retro);
    font-size: 20px;
    font-style: italic;
    color: #e8d8c0;
    line-height: 1.4;
    margin: 0;
}

/* Solid triangle arrow pointing down toward pet head */
.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 14px solid #3a2e28;
}

.detail-mascot-img {
    width: 220px;
    height: 220px;
    object-fit: contain;
    filter: drop-shadow(2px 4px 8px rgba(0, 0, 0, 0.18));
    transition: transform 0.3s ease;
}

.detail-mascot-img:hover {
    transform: scale(1.06) rotate(-1deg);
}

.detail-tool-badge {
    display: inline-block;
    font-family: var(--font-pixel);
    font-size: 9px;
    color: var(--bg-page);
    background: var(--accent);
    padding: 5px 14px;
    border-radius: 20px;
    margin-top: -8px;
    letter-spacing: 0.5px;
    z-index: 1;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.15);
}

.detail-tool-name {
    font-size: 28px;
    color: var(--accent);
    margin-top: 16px;
    line-height: 1.2;
}

.detail-tool-subtitle {
    font-family: var(--font-retro);
    font-size: 22px;
    color: var(--pet-color);
    margin-top: 4px;
    line-height: 1.4;
}

.detail-tool-desc {
    font-size: 18px;
    color: var(--text-secondary);
    margin-top: 12px;
    line-height: 1.6;
}

/* Right panel: tool UI */
.detail-tool-panel {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 6px 6px 0px 0px rgba(0, 0, 0, 0.10);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* CTA Button — color driven by --pet-color */
.detail-cta-btn {
    width: 100%;
    padding: 18px 24px;
    background: var(--pet-color);
    color: var(--pet-color-text);
    border: none;
    border-radius: 12px;
    font-family: var(--font-pixel);
    font-size: 14px;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 4px 4px 0px 0px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.detail-cta-btn:hover {
    background: var(--pet-color-hover);
    transform: translateY(2px);
    box-shadow: 2px 2px 0px 0px rgba(0, 0, 0, 0.15);
}

.detail-cta-btn:disabled {
    background: var(--border);
    color: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Tool option row (label + controls) */
.tool-options-row {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.tool-option-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tool-option-label {
    font-family: var(--font-pixel);
    font-size: 9px;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

/* Shared strength slider row (used by compressor, face-blur, etc.) */
.strength-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-retro);
    font-size: 17px;
    color: var(--text-secondary);
}

.strength-row input[type="range"] {
    flex: 1;
    accent-color: var(--pet-color);
}

.strength-ends {
    font-size: 15px;
    white-space: nowrap;
    color: var(--text-muted);
}

.strength-value {
    font-family: var(--font-pixel);
    font-size: 10px;
    min-width: 36px;
    text-align: right;
    color: var(--text-primary);
}

/* Toggle buttons (PRECISE / FAST style) */
.mode-toggles {
    display: flex;
    gap: 0;
}

.mode-btn {
    padding: 8px 20px;
    font-family: var(--font-pixel);
    font-size: 9px;
    letter-spacing: 1px;
    border: 2px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.mode-btn:first-child {
    border-radius: 6px 0 0 6px;
}

.mode-btn:last-child {
    border-radius: 0 6px 6px 0;
    border-left: none;
}

.mode-btn.active {
    background: var(--accent);
    color: var(--bg-page);
    border-color: var(--accent);
}

.mode-btn:hover:not(.active) {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

/* Select dropdown */
.tool-select {
    padding: 8px 32px 8px 12px;
    font-family: var(--font-retro);
    font-size: 18px;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a7560' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    min-width: 160px;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.08);
}

.tool-select:focus {
    outline: none;
    border-color: var(--accent);
}

/* =====================================================
   DETAIL PAGE — Processing + Result states
   (reused from main but scoped to detail-page-body)
   ===================================================== */

.detail-page-body .state {
    height: auto;
    min-height: 400px;
}

.detail-page-body #processing,
.detail-page-body #result {
    padding: 32px;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

/* =====================================================
   EXIF REMOVER — Results table
   ===================================================== */

.exif-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.exif-file-result {
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.exif-file-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.exif-file-name {
    font-family: var(--font-retro);
    font-size: 17px;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.exif-file-status {
    font-size: 15px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.exif-file-status.success {
    color: var(--fg-green-bright);
}

.exif-file-status.error {
    color: var(--bg-red);
}

.exif-download-btn {
    font-family: var(--font-pixel);
    font-size: 8px;
    padding: 6px 12px;
    background: var(--accent);
    color: var(--bg-page);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--transition);
    flex-shrink: 0;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

.exif-download-btn:hover {
    background: var(--accent-hover);
}

.exif-fields-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 16px;
}

.exif-field-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-family: var(--font-retro);
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3px 10px;
}

.exif-size-diff {
    font-size: 14px;
    color: var(--fg-green-bright);
    padding: 4px 16px 12px;
}

/* Download all ZIP button */
.exif-download-all {
    width: 100%;
    padding: 12px 20px;
    font-family: var(--font-pixel);
    font-size: 10px;
    background: var(--accent);
    color: var(--bg-page);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.12);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.exif-download-all:hover {
    background: var(--accent-hover);
    transform: translateY(1px);
    box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.12);
}

.exif-download-all:disabled {
    background: var(--border);
    color: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* =====================================================
   FACE BLUR — Image canvas + face boxes
   ===================================================== */

.face-image-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.face-image-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-page);
}

.face-image-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.face-image-name {
    font-family: var(--font-retro);
    font-size: 17px;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.face-count-badge {
    font-size: 14px;
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-left: 8px;
}

.face-canvas-wrap {
    position: relative;
    display: inline-block;
    width: 100%;
}

.face-canvas-wrap canvas,
.face-canvas-wrap img {
    display: block;
    width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.face-box-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* =====================================================
   FACE BLUR — Processing progress
   ===================================================== */

.face-processing-wrap {
    padding: 32px 16px;
    text-align: center;
}

.face-processing-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
    font-family: var(--font-retro);
    font-size: 18px;
    color: var(--text-secondary);
}

.face-progress-track {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.face-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* =====================================================
   FACE BLUR — Summary bar
   ===================================================== */

.face-summary-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.face-summary-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.face-summary-icon {
    font-size: 36px;
    color: var(--accent);
    background: rgba(107, 78, 61, 0.08);
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    flex-shrink: 0;
}

html.dark .face-summary-icon,
html:not(.light) .face-summary-icon {
    background: rgba(234, 216, 192, 0.08);
}

.face-summary-info strong {
    font-family: var(--font-retro);
    font-size: 20px;
    display: block;
    margin-bottom: 2px;
}

.face-summary-info p {
    font-family: var(--font-retro);
    font-size: 16px;
    color: var(--text-secondary);
}

.face-summary-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.face-icon-btn {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.face-icon-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.face-restart-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    font-family: var(--font-pixel);
    font-size: 9px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.face-restart-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

/* =====================================================
   FACE BLUR — Person groups section
   ===================================================== */

.face-persons-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
}

.face-persons-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.face-persons-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.face-persons-icon {
    font-size: 32px;
    color: var(--accent);
    background: rgba(107, 78, 61, 0.08);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

html.dark .face-persons-icon,
html:not(.light) .face-persons-icon {
    background: rgba(234, 216, 192, 0.08);
}

.face-persons-title-wrap strong {
    font-family: var(--font-retro);
    font-size: 20px;
    display: block;
    margin-bottom: 2px;
}

.face-persons-meta {
    font-family: var(--font-retro);
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
}

.face-persons-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.face-select-btn {
    font-family: var(--font-pixel);
    font-size: 9px;
    padding: 10px 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.face-select-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

.face-persons-hint {
    font-family: var(--font-retro);
    font-size: 16px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 20px;
}

/* ── Person card grid ── */

.face-persons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
}

/* ── Single person card ── */

.face-person-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 16px 8px 12px;
    border-radius: 14px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.face-person-card:hover {
    background: rgba(107, 78, 61, 0.04);
}

html.dark .face-person-card:hover,
html:not(.light) .face-person-card:hover {
    background: rgba(234, 216, 192, 0.04);
}

.face-person-card.selected {
    background: rgba(76, 175, 80, 0.08);
    border-color: var(--fg-green);
}

html.dark .face-person-card.selected,
html:not(.light) .face-person-card.selected {
    background: rgba(76, 175, 80, 0.12);
}

/* ── Polaroid thumb frame ── */

.face-thumb-frame {
    position: relative;
    width: 110px;
    height: 130px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 2px 3px 10px rgba(0, 0, 0, 0.12);
    padding: 8px 8px 28px;
    margin-bottom: 10px;
    transition: transform 0.2s ease;
}

html.dark .face-thumb-frame {
    background: #4a3d35;
    box-shadow: 2px 3px 10px rgba(0, 0, 0, 0.3);
}

@media (prefers-color-scheme: dark) {
    html:not(.light) .face-thumb-frame {
        background: #4a3d35;
        box-shadow: 2px 3px 10px rgba(0, 0, 0, 0.3);
    }
}

/* Slight rotation per card for polaroid effect */
.face-person-card:nth-child(6n+1) .face-thumb-frame {
    transform: rotate(-3deg);
}

.face-person-card:nth-child(6n+2) .face-thumb-frame {
    transform: rotate(2deg);
}

.face-person-card:nth-child(6n+3) .face-thumb-frame {
    transform: rotate(-1.5deg);
}

.face-person-card:nth-child(6n+4) .face-thumb-frame {
    transform: rotate(3deg);
}

.face-person-card:nth-child(6n+5) .face-thumb-frame {
    transform: rotate(-2deg);
}

.face-person-card:nth-child(6n+6) .face-thumb-frame {
    transform: rotate(1deg);
}

.face-person-card:hover .face-thumb-frame {
    transform: rotate(0deg) scale(1.03);
}

.face-thumb-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
    display: block;
}

/* Face count badge */
.face-thumb-badge {
    position: absolute;
    bottom: -6px;
    left: -6px;
    background: var(--accent);
    color: var(--bg-page);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-retro);
    font-size: 15px;
    font-weight: bold;
    box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

/* Detail eye button */
.face-detail-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 3;
}

.face-detail-btn .material-icons {
    font-size: 16px;
}

.face-person-card:hover .face-detail-btn {
    opacity: 1;
}

/* Check icon (shown when selected) */
.face-check-icon {
    position: absolute;
    bottom: 4px;
    right: 4px;
    font-size: 22px;
    color: var(--fg-green-bright);
    opacity: 0;
    transition: opacity 0.2s ease;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
    z-index: 3;
}

.face-person-card.selected .face-check-icon {
    opacity: 1;
}

/* Person name & count */
.face-person-name {
    font-family: var(--font-retro);
    font-size: 17px;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 2px;
}

.face-person-count {
    font-family: var(--font-retro);
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
}

/* =====================================================
   FACE BLUR — Detail modal
   ===================================================== */

.face-detail-modal {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.face-detail-modal.open {
    opacity: 1;
}

.face-detail-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 720px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.face-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.face-detail-header h3 {
    font-family: var(--font-pixel);
    font-size: 14px;
    margin-bottom: 4px;
}

.face-detail-header p {
    font-family: var(--font-retro);
    font-size: 16px;
    color: var(--text-secondary);
}

.face-detail-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.face-detail-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-page);
}

.face-detail-img-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: var(--bg-page);
}

.face-detail-img-wrap img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 300px;
    object-fit: contain;
}

.face-detail-box {
    position: absolute;
    border: 2px solid var(--accent-rose);
    border-radius: 4px;
    pointer-events: none;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.face-detail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.face-detail-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    font-family: var(--font-retro);
    font-size: 15px;
    color: var(--text-primary);
    user-select: none;
}

.face-detail-check input[type=checkbox] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.face-detail-check span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =====================================================
   FACE BLUR — CTA row
   ===================================================== */

.face-cta-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

/* Blur controls */
.blur-controls {
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 16px;
}

.face-download-btn {
    font-family: var(--font-pixel);
    font-size: 8px;
    padding: 8px 14px;
    background: var(--accent);
    color: var(--bg-page);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--transition);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.face-download-btn:hover {
    background: var(--accent-hover);
}

/* Status / loading message */
.tool-status-msg {
    font-family: var(--font-retro);
    font-size: 17px;
    color: var(--text-secondary);
    text-align: center;
    padding: 12px;
}

.tool-status-msg.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* =====================================================
   RESPONSIVE — Detail Page
   ===================================================== */

@media (max-width: 900px) {
    .detail-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .detail-page-body .site-header {
        display: flex;
        position: sticky;
        padding: 10px 16px;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }

    .detail-page-body .site-header .back-link {
        grid-column: unset;
        position: absolute;
        left: 16px;
        top: 50%;
        transform: translateY(-50%);
    }

    .detail-page-body .site-header-brand {
        grid-column: unset;
        align-items: center;
        text-align: center;
    }

    .detail-page-body .site-subtitle {
        display: none;
    }

    .detail-mascot-panel {
        position: static;
        flex-direction: column;
        text-align: center;
        align-items: center;
        gap: 4px;
    }

    .detail-mascot-img {
        width: 160px;
        height: 160px;
        flex-shrink: 0;
    }

    .detail-mascot-panel .speech-bubble {
        display: block;
        max-width: 320px;
        margin-bottom: 0;
    }

    .detail-tool-name {
        font-size: 22px;
    }

    .detail-tool-desc {
        font-size: 16px;
    }

    .detail-main {
        padding: 20px 16px 60px;
    }

    .detail-tool-panel {
        padding: 24px 16px;
        overflow-x: hidden;
        word-break: break-word;
    }
}

@media (max-width: 600px) {
    .detail-layout {
        gap: 12px;
    }

    .detail-mascot-img {
        width: 140px;
        height: 140px;
    }

    .detail-tool-name {
        font-size: 18px;
    }

    .detail-tool-subtitle {
        font-size: 11px;
    }

    .detail-tool-desc {
        font-size: 15px;
    }

    .detail-tool-panel {
        padding: 16px 12px;
        border-radius: 14px;
    }

    .detail-cta-btn {
        font-size: 10px;
        padding: 14px 12px;
        word-break: break-word;
        text-align: center;
        justify-content: center;
    }

    .tool-options-row {
        flex-direction: column;
        gap: 16px;
    }

    /* Face blur responsive */
    .face-summary-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 14px 12px;
    }

    .face-summary-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .face-restart-btn {
        font-size: 8px;
        padding: 8px 12px;
    }

    .face-persons-section {
        padding: 16px 12px;
    }

    .face-persons-header {
        flex-direction: column;
    }

    .face-persons-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px;
    }

    .face-thumb-frame {
        width: 85px;
        height: 105px;
    }

    .face-detail-images {
        grid-template-columns: 1fr;
    }

    .face-detail-modal {
        padding: 12px;
    }

    .face-detail-content {
        padding: 16px 12px;
        max-height: 90vh;
        border-radius: 12px;
    }

    .face-cta-row {
        flex-direction: column;
    }

    .face-select-btn {
        font-size: 8px;
        padding: 8px 12px;
    }

    .blur-controls {
        padding: 10px 12px;
        gap: 10px;
    }

    .exif-download-all {
        font-size: 10px;
        padding: 14px 12px !important;
    }
}

/* ── PWA Install Banner ───────────────────────────────────────────────────── */
.pwa-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: min(520px, calc(100vw - 32px));
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    animation: pwa-slide-up 0.3s ease;
}

@keyframes pwa-slide-up {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.pwa-banner-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
}

.pwa-banner-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    flex-shrink: 0;
    object-fit: contain;
}

.pwa-banner-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pwa-banner-text strong {
    font-family: var(--font-pixel);
    font-size: 10px;
    color: var(--text-primary);
    letter-spacing: 0.04em;
}

.pwa-banner-text span {
    font-family: var(--font-retro);
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.3;
}

.pwa-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-install-btn {
    font-family: var(--font-pixel);
    font-size: 9px;
    padding: 9px 16px;
    background: var(--accent);
    color: var(--bg-page);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    letter-spacing: 0.05em;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.15);
    white-space: nowrap;
}
.pwa-install-btn:hover { background: var(--accent-hover); }

.pwa-dismiss-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    line-height: 1;
}
.pwa-dismiss-btn:hover { color: var(--text-primary); background: var(--bg-page); }

/* ── FAQ Accordions ─────────────────────────────────────────────────────── */

.faq-section {
    margin-top: 32px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 28px 28px 20px;
    box-shadow: var(--shadow-pixel);
}

.faq-title {
    font-family: var(--font-pixel);
    font-size: clamp(10px, 2vw, 14px);
    color: var(--pet-color);
    letter-spacing: 0.04em;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 8px;
    overflow: hidden;
    transition: border-color var(--transition);
}

.faq-item:last-child { margin-bottom: 0; }

.faq-item[open] {
    border-color: var(--pet-color);
}

.faq-item summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    font-family: var(--font-retro);
    font-size: clamp(16px, 2.5vw, 19px);
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    user-select: none;
    line-height: 1.3;
    transition: color var(--transition), background var(--transition);
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
    content: '+';
    font-family: var(--font-pixel);
    font-size: 12px;
    color: var(--pet-color);
    flex-shrink: 0;
    transition: transform var(--transition);
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item summary:hover {
    color: var(--pet-color);
    background: var(--bg-page);
}

.faq-item[open] summary {
    color: var(--pet-color);
    border-bottom: 1px solid var(--border);
}

.faq-answer {
    padding: 16px 18px;
    font-family: var(--font-retro);
    font-size: clamp(15px, 2.2vw, 18px);
    color: var(--text-secondary);
    line-height: 1.7;
    background: var(--bg-page);
}

.faq-answer p { margin: 0 0 10px; }
.faq-answer p:last-child { margin-bottom: 0; }

.faq-answer strong { color: var(--text-primary); }

.faq-answer code {
    font-family: monospace;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.9em;
}

/* ── Blog Listing Page ──────────────────────────────────────────────────── */

.blog-page-title {
    font-family: var(--font-pixel);
    font-size: clamp(14px, 3vw, 22px);
    color: var(--accent);
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}

.blog-page-intro {
    font-family: var(--font-retro);
    font-size: clamp(17px, 2.5vw, 21px);
    color: var(--text-secondary);
    margin-bottom: 36px;
    line-height: 1.6;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    max-width: 960px;
}

.blog-article-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-pixel);
    text-decoration: none;
    color: inherit;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.blog-article-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-pixel-hover);
    border-color: var(--accent-rose);
}

.blog-card-mascot {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 24px 0;
    background: var(--bg-page);
}

.blog-card-mascot img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    image-rendering: pixelated;
}

.blog-card-body {
    padding: 20px 20px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.blog-card-tag {
    display: inline-block;
    font-family: var(--font-pixel);
    font-size: 8px;
    color: var(--pet-color-text, #fff);
    background: var(--pet-color);
    border-radius: 4px;
    padding: 4px 8px;
    letter-spacing: 0.04em;
    align-self: flex-start;
}

.blog-card-title {
    font-family: var(--font-retro);
    font-size: clamp(17px, 2.5vw, 20px);
    color: var(--text-primary);
    line-height: 1.35;
    margin: 0;
}

.blog-card-summary {
    font-family: var(--font-retro);
    font-size: clamp(14px, 2vw, 16px);
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
    flex: 1;
}

.blog-card-meta {
    font-family: var(--font-retro);
    font-size: 14px;
    color: var(--text-muted, var(--text-secondary));
    opacity: 0.8;
    margin-top: 4px;
}

/* ── Blog Article Pages ─────────────────────────────────────────────────── */

.article-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    align-items: start;
}

.article-sidebar {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.article-sidebar-mascot {
    width: 120px;
    height: 120px;
    object-fit: contain;
    image-rendering: pixelated;
}

.article-meta {
    font-family: var(--font-retro);
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.article-tag {
    font-family: var(--font-pixel);
    font-size: 7px;
    color: var(--pet-color-text, #fff);
    background: var(--pet-color);
    border-radius: 4px;
    padding: 4px 7px;
    letter-spacing: 0.04em;
}

.article-sidebar-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-pixel);
    font-size: 8px;
    background: var(--pet-color);
    color: var(--pet-color-text, #fff);
    border-radius: 10px;
    padding: 12px 16px;
    text-decoration: none;
    margin-top: 8px;
    box-shadow: var(--shadow-pixel);
    transition: transform var(--transition), box-shadow var(--transition);
    letter-spacing: 0.04em;
    text-align: center;
    line-height: 1.5;
}

.article-sidebar-cta:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-pixel-hover);
}

.article-body {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 36px 36px 32px;
    box-shadow: var(--shadow-pixel);
}

.article-h1 {
    font-family: var(--font-pixel);
    font-size: clamp(11px, 2vw, 16px);
    color: var(--accent);
    letter-spacing: 0.03em;
    line-height: 1.6;
    margin-bottom: 20px;
}

.article-intro {
    font-family: var(--font-retro);
    font-size: clamp(17px, 2.5vw, 21px);
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 24px;
}

.article-section {
    margin-bottom: 32px;
}

.article-section h2 {
    font-family: var(--font-pixel);
    font-size: clamp(9px, 1.8vw, 13px);
    color: var(--pet-color);
    letter-spacing: 0.04em;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.article-section h3 {
    font-family: var(--font-retro);
    font-size: clamp(17px, 2.5vw, 20px);
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: 0.03em;
}

.article-section p {
    font-family: var(--font-retro);
    font-size: clamp(16px, 2.2vw, 19px);
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 14px;
}

.article-section p:last-child { margin-bottom: 0; }

.article-callout {
    background: var(--bg-page);
    border-left: 4px solid var(--pet-color);
    border-radius: 0 10px 10px 0;
    padding: 14px 18px;
    margin: 16px 0;
    font-family: var(--font-retro);
    font-size: clamp(15px, 2.2vw, 18px);
    color: var(--text-secondary);
    line-height: 1.6;
}

.article-callout strong { color: var(--pet-color); }

.article-ol, .article-ul {
    font-family: var(--font-retro);
    font-size: clamp(16px, 2.2vw, 19px);
    color: var(--text-secondary);
    line-height: 1.75;
    padding-left: 24px;
    margin-bottom: 14px;
}

.article-ol li, .article-ul li { margin-bottom: 6px; }

.code-block {
    font-family: monospace;
    font-size: clamp(12px, 1.8vw, 14px);
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
    overflow-x: auto;
    white-space: pre;
    color: var(--text-primary);
    line-height: 1.6;
    margin: 12px 0 16px;
}

.article-footer-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-pixel);
    font-size: 9px;
    background: var(--pet-color);
    color: var(--pet-color-text, #fff);
    border-radius: 12px;
    padding: 14px 22px;
    text-decoration: none;
    margin-top: 8px;
    box-shadow: var(--shadow-pixel);
    letter-spacing: 0.04em;
    transition: transform var(--transition), box-shadow var(--transition);
}

.article-footer-cta:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-pixel-hover);
}

@media (max-width: 720px) {
    .article-layout {
        grid-template-columns: 1fr;
    }

    .article-sidebar {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        text-align: left;
        padding-bottom: 16px;
        border-bottom: 1px solid var(--border);
    }

    .article-sidebar-mascot {
        width: 72px;
        height: 72px;
    }

    .article-body {
        padding: 24px 20px;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .faq-section {
        padding: 20px 16px 14px;
    }
}


