/* ================================================
   imagemochi — Mochi Design System
   Warm cream + Pink palette (모에모에 갭)
   Light default, Dark toggle
   ================================================ */

:root {
    --bg:          #FFF8F5;
    --surface:     #FFFFFF;
    --surface-2:   #FFF0EB;
    --surface-3:   #FFE4DB;
    --border:      #F0D9D0;
    --border-hover:#E8C4B8;
    --text:        #2D1B14;
    --text-dim:    #6B5148;
    --text-muted:  #9C8179;
    --accent:      #FF7EB3;
    --accent-light:#FF9AC6;
    --accent-dim:  #E85D8F;
    --accent-bg:   rgba(255,126,179,0.08);
    --danger:      #EF4444;
    --success:     #5CC9A7;
    --mono:        'JetBrains Mono', monospace;
    --sans:        'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --ease:        cubic-bezier(0.22, 1, 0.36, 1);
    --radius:      16px;
    --radius-sm:   12px;
    --radius-lg:   24px;
}

/* ── DARK THEME (반전술식) ── */
[data-theme="dark"] {
    --bg:          #1A1216;
    --surface:     #231C20;
    --surface-2:   #2C2226;
    --surface-3:   #362A2E;
    --border:      #3D2F34;
    --border-hover:#5A4349;
    --text:        #FFF0EB;
    --text-dim:    #C9AAA0;
    --text-muted:  #8B706A;
    --accent:      #FF7EB3;
    --accent-light:#FF9AC6;
    --accent-dim:  #E85D8F;
    --accent-bg:   rgba(255,126,179,0.10);
    --danger:      #EF4444;
    --success:     #5CC9A7;
    --nav-bg:      rgba(26,18,22,0.92);
}
[data-theme="dark"] .tool-nav {
    background: var(--nav-bg);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    height: 100%;
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
}

body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
}

img { max-width: 100%; display: block; }
a { color: var(--accent-light); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }
button, select, input { font-family: inherit; }
.accent { color: var(--accent-light); }
.gold { color: var(--accent-light); }

/* ── NAV ── */
.tool-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 56px;
    border-bottom: 1px solid var(--border);
    background: rgba(255,248,245,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}

.nav-logo-mark {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    font-size: 22px;
    line-height: 1;
}

.nav-logo-text {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.3px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-tools-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.nav-tools-btn:hover {
    color: var(--text);
    border-color: var(--border-hover);
    background: var(--surface);
}

.nav-tools-btn svg { opacity: 0.6; }

.nav-cta-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.nav-cta-btn:hover {
    background: var(--accent-dim);
    color: #fff;
    box-shadow: 0 4px 16px rgba(255,126,179,0.25);
    transform: translateY(-1px);
}

/* ── MEGA MENU ── */
.mega-overlay {
    position: fixed;
    inset: 0;
    background: rgba(45,27,20,0.3);
    backdrop-filter: blur(4px);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.mega-overlay.open { opacity: 1; visibility: visible; }

.mega-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 480px;
    max-width: 100vw;
    height: 100vh;
    background: var(--surface);
    border-left: 1px solid var(--border);
    z-index: 201;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s var(--ease);
}

.mega-overlay.open .mega-panel { transform: translateX(0); }

.mega-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.mega-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.mega-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}

.mega-close:hover { color: var(--text); border-color: var(--border-hover); }

.mega-search {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.mega-search input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.mega-search input::placeholder { color: var(--text-muted); }
.mega-search input:focus { border-color: var(--accent-dim); }

.mega-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px 32px;
}

.mega-category {
    margin-bottom: 20px;
}

.mega-cat-title {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding-left: 4px;
}

.mega-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text);
    transition: all 0.15s;
    cursor: pointer;
}

.mega-item:hover {
    background: var(--accent-bg);
    color: var(--accent-light);
}

.mega-item.active {
    background: var(--accent-bg);
    color: var(--accent-light);
}

.mega-item-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    font-size: 15px;
}

.mega-item-text {
    flex: 1;
    min-width: 0;
}

.mega-item-name {
    font-size: 13px;
    font-weight: 500;
}

.mega-item-desc {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mega-item:hover .mega-item-desc { color: var(--text-dim); }

.mega-item-hidden { display: none; }

/* ── HERO ── */
.tool-hero {
    text-align: center;
    padding: 32px 24px 20px;
    max-width: 680px;
    margin: 0 auto;
}

.tool-hero h1 {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.tool-hero p {
    font-size: 14px;
    color: var(--text-dim);
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ── TOOL AREA ── */
.tool-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 24px 56px;
    width: 100%;
    flex: 1;
}

/* Drop Zone */
.tool-dropzone {
    border: 2px dashed var(--border-hover);
    background: var(--surface);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s var(--ease);
    margin-bottom: 24px;
    border-radius: var(--radius);
}

.tool-dropzone:hover {
    border-color: var(--accent-dim);
    background: var(--surface-2);
}

.tool-dropzone.drag-over {
    border-color: var(--accent);
    background: var(--accent-bg);
}

.tool-dropzone.has-file {
    border-style: solid;
    border-color: var(--accent-dim);
}

.tool-dropzone h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
}

.tool-dropzone p {
    font-size: 12px;
    color: var(--text-muted);
}

/* Controls */
.tool-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.tool-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tool-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    min-width: 80px;
}

.tool-input {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 9px 14px;
    font-size: 13px;
    font-family: var(--mono);
    transition: border-color 0.2s;
}

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

.tool-select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 9px 14px;
    font-size: 13px;
    cursor: pointer;
    flex: 1;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23A1A1AA' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    transition: border-color 0.2s;
}

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

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    background: var(--bg);
    cursor: pointer;
    transition: box-shadow 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    box-shadow: 0 0 0 4px rgba(255,126,179,0.2);
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    background: var(--bg);
    cursor: pointer;
}

.slider-val {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--accent-light);
    min-width: 40px;
    text-align: right;
}

/* Buttons */
.tool-btn {
    width: 100%;
    padding: 13px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s var(--ease);
}

.tool-btn:hover {
    background: var(--accent-dim);
    box-shadow: 0 6px 20px rgba(255,126,179,0.25);
    transform: translateY(-1px);
}

.tool-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.tool-btn-outline {
    width: 100%;
    padding: 13px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s var(--ease);
}

.tool-btn-outline:hover {
    background: var(--surface-2);
    border-color: var(--border-hover);
}

/* Result area */
.tool-result {
    display: none;
    margin-top: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 20px;
    animation: slideUp 0.4s var(--ease);
}

.tool-result.visible { display: block; }

.tool-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.tool-result-title {
    font-size: 18px;
    font-weight: 600;
}

.tool-result-img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.tool-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1px;
    background: var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.tool-meta-item {
    background: var(--surface-2);
    padding: 12px 14px;
}

.tool-meta-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.tool-meta-value {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text);
    margin-top: 3px;
}

/* ── CTA BANNER ── */
.cta-banner {
    max-width: 720px;
    margin: 0 auto 56px;
    padding: 32px 28px;
    text-align: center;
    border: 1px solid var(--accent-dim);
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(255,126,179,0.06), rgba(255,126,179,0.14));
}

.cta-banner h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.cta-banner p {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 20px;
    line-height: 1.7;
}

.cta-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 28px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--radius-sm);
    transition: all 0.2s var(--ease);
}

.cta-link:hover {
    background: var(--accent-dim);
    color: #fff;
    box-shadow: 0 6px 20px rgba(255,126,179,0.25);
    transform: translateY(-1px);
}

/* ── WATERMARK OVERLAY ── */
.wm-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    overflow: hidden;
    border-radius: 8px;
}
.wm-overlay span {
    font-size: 48px;
    font-weight: 900;
    color: rgba(255,255,255,0.2);
    text-shadow: 2px 2px 8px rgba(0,0,0,0.3);
    transform: rotate(-30deg);
    white-space: nowrap;
    letter-spacing: 8px;
}
.tool-result-img { position: relative; }
.wm-prompt {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-2);
    border: 1px solid var(--accent-dim);
    border-radius: 12px;
    padding: 16px 24px;
    z-index: 1000;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 8px 30px rgba(45,27,20,0.15);
    animation: slideUp 0.3s var(--ease);
}
.wm-prompt p { font-size: 14px; margin-bottom: 12px; color: var(--text); }
.wm-prompt-btn {
    padding: 8px 20px;
    background: var(--accent);
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: opacity 0.2s;
}
.wm-prompt-btn:hover { opacity: 0.9; }
.wm-prompt-close {
    padding: 8px 16px;
    background: var(--surface-3);
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
@keyframes slideUp {
    from { transform: translateX(-50%) translateY(20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ── FAQ ── */
.faq-section {
    max-width: 720px;
    margin: 0 auto 56px;
    padding: 0 24px;
}

.faq-section h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
}

.faq-item {
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}

.faq-q {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    gap: 16px;
}

.faq-q::after {
    content: '+';
    font-size: 20px;
    color: var(--accent-light);
    transition: transform 0.3s var(--ease);
    flex-shrink: 0;
}

.faq-item.open .faq-q::after {
    transform: rotate(45deg);
}

.faq-a {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.8;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s var(--ease), padding 0.3s;
    padding-top: 0;
}

.faq-item.open .faq-a {
    max-height: 300px;
    padding-top: 12px;
}

/* ── FOOTER ── */
.tool-footer {
    border-top: 1px solid var(--border);
    padding: 28px 24px;
    text-align: center;
    margin-top: auto;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-bottom: 14px;
}

.footer-links a {
    font-size: 12px;
    color: var(--text-muted);
    transition: color 0.2s;
}

.footer-links a:hover { color: var(--accent-light); }

.footer-legal {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 12px;
}
.footer-legal a {
    font-size: 11px;
    color: var(--text-muted);
    transition: color 0.2s;
    text-decoration: none;
}
.footer-legal a:hover { color: var(--accent-light); }

.footer-copy {
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.5;
}

/* ── BREADCRUMB ── */
.breadcrumb {
    padding: 10px 24px;
    font-size: 12px;
    color: var(--text-muted);
    max-width: 720px;
    margin: 0 auto;
}
.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.breadcrumb a:hover { color: var(--accent-light); }
.bc-sep { margin: 0 6px; opacity: 0.4; }
.bc-current { color: var(--text-dim); }

/* ── WORKFLOW SECTION ── */
.workflow-section {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 24px 0;
}
.workflow-section h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 12px;
}
.workflow-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.workflow-link {
    display: inline-block;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all 0.2s;
}
.workflow-link:hover {
    border-color: var(--accent-dim);
    color: var(--accent-light);
    background: var(--accent-bg);
}
.hub-tool-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all 0.25s var(--ease);
}
.hub-tool-link:hover {
    border-color: var(--accent-dim);
    color: var(--accent-light);
    background: var(--accent-bg);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45,27,20,0.08);
}
.hub-tool-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    font-size: 14px;
    flex-shrink: 0;
}
.hub-tool-info {
    flex: 1;
    min-width: 0;
}
.hub-tool-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hub-tool-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
}

/* ── AD SLOTS (3-tier Clean Ad) ── */
.ad-slot { text-align: center; margin: 20px auto; max-width: 800px; overflow: hidden; }
.ad-slot-hero { max-width: 728px; }
.ad-slot-result { max-width: 336px; margin: 16px auto 0; }
.ad-slot-faq { max-width: 336px; margin: 0 auto 20px; }
/* Reserve space only when real ads load (prevents CLS) */
.ad-slot-hero.ad-live { min-height: 90px; }
.ad-slot-result.ad-live { min-height: 250px; }
.ad-slot-faq.ad-live { min-height: 280px; }
.no-ads .ad-slot { display: none !important; }
.ad-slot-placeholder {
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 20px;
    color: var(--text-muted);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
@media (max-width: 768px) {
    .ad-slot-hero { min-height: 50px; max-width: 320px; }
    .ad-slot-result, .ad-slot-faq { max-width: 300px; }
    .ad-slot ins { max-width: 100%; }
}

/* ── LIVE PREVIEW MODE ── */
.tool-dropzone.preview-mode {
    padding: 0;
    border-style: solid;
    border-color: var(--border);
    cursor: default;
    overflow: hidden;
}
.tool-dropzone.preview-mode > h3,
.tool-dropzone.preview-mode > p,
.tool-dropzone.preview-mode > .mascot-img { display: none; }

.live-preview-wrap { display: none; }
.live-preview-wrap.visible { display: block; }

.live-preview-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.live-preview-info .mascot-state-img { width: 24px; height: 24px; flex-shrink: 0; }
.live-preview-info span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.live-preview-img {
    display: block;
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    background: var(--bg);
    padding: 8px;
    transition: filter 0.05s linear, transform 0.15s ease;
    will-change: filter, transform;
}

.live-download-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.live-download-meta {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--mono);
}

/* ── MOCHI STATE SYSTEM ── */
.mascot-state-img { transition: opacity 0.2s ease; }
.mochi-download-mascot { width: 20px; height: 20px; flex-shrink: 0; }

@keyframes mochiWork {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}
@keyframes mochiCelebrate {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

@media (max-width: 768px) {
    .live-preview-img { max-height: 350px; }
    .live-download-row { flex-wrap: wrap; }
}

/* ── UTILITIES ── */
.hidden { display: none !important; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ── Mochi Vending Machine Micro-interactions ── */
@keyframes mochiIntake {
    0%   { transform: scale(1); opacity: 1; }
    40%  { transform: scale(0.96); opacity: 0.85; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes mochiDispense {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes mochiPop {
    0%   { transform: scale(1); }
    50%  { transform: scale(0.95); }
    100% { transform: scale(1); }
}
.tool-dropzone.mochi-intake { animation: mochiIntake 0.35s var(--ease); }
.tool-result.mochi-dispense { animation: mochiDispense 0.4s var(--ease); }
.tool-btn.mochi-pop { animation: mochiPop 0.25s var(--ease); }
.mochi-processing {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    margin: 12px 0;
    font-size: 13px;
    color: var(--text-dim);
    opacity: 0;
    transition: opacity 0.3s var(--ease);
}
.mochi-processing.active { opacity: 1; }
.mochi-processing img { width: 32px; height: 32px; }
@media (prefers-reduced-motion: reduce) {
    .tool-dropzone.mochi-intake,
    .tool-result.mochi-dispense,
    .tool-btn.mochi-pop { animation: none !important; }
    .mochi-processing { transition: none !important; }
}

/* ── MOBILE FLOATING SEARCH BUTTON ── */
.mobile-search-fab {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(255,126,179,0.35);
    z-index: 900;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.mobile-search-fab:active {
    transform: scale(0.92);
}
@media (max-width: 768px) {
    .mobile-search-fab { display: flex; }
}

/* ── RECENT TOOLS (MEGA MENU) ── */
.mega-recent {
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

/* ── THEME TOGGLE ── */
.theme-toggle {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.3s var(--ease);
    flex-shrink: 0;
}
.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-bg);
    transform: rotate(20deg);
}
.theme-toggle .icon-sun,
.theme-toggle .icon-moon { transition: opacity 0.2s, transform 0.3s; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
    .tool-hero h1 { font-size: 28px; }
    .tool-hero p { font-size: 13px; }
    .tool-nav { padding: 0 16px; }
    .tool-container { padding: 0 16px 32px; }
    .mega-panel { width: 100vw; }
    .mobile-search-fab { bottom: 16px; right: 16px; }
}
