:root {
    --bg: #FFFFFF;
    --bg-soft: #F6F6F4;
    --bg-card: #FFFFFF;
    --ink: #0A0A0A;
    --ink-soft: #474747;
    --ink-mute: #8C8C8C;
    --line: #EAEAEA;
    --line-strong: #D4D4D4;
    --accent: #E30613;
    --accent-bg: #FFF1F2;
    --ok: #0E7C3A;
    --warn: #B45309;
    --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
    --safe-bottom: env(safe-area-inset-bottom, 0);
}

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html, body { overflow-x: hidden; }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: -0.01em;
    padding-bottom: 80px;
}
@media (min-width: 768px) { body { padding-bottom: 0; } }

a { color: inherit; }

.accent-text { color: var(--accent); }

/* TOPBAR */
.topbar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,0.94);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}
.topbar-inner { height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -0.03em; color: var(--ink); }
.brand-dot { width: 12px; height: 12px; background: var(--accent); border-radius: 2px; display: inline-block; }
.topnav { display: none; gap: 4px; align-items: center; }
@media (min-width: 992px) { .topnav { display: flex; } }
.topnav a { text-decoration: none; color: var(--ink-soft); font-size: 14px; font-weight: 500; padding: 8px 12px; border-radius: 6px; transition: all .18s; }
.topnav a:hover { color: var(--ink); background: var(--bg-soft); }

.btn { font-family: var(--sans); cursor: pointer; transition: all .18s; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn-ghost { background: transparent; border: 1px solid var(--line-strong); color: var(--ink); padding: 9px 14px; font-size: 14px; font-weight: 500; border-radius: 8px; }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-ink { background: var(--ink); border: 1px solid var(--ink); color: #FFFFFF; padding: 9px 16px; font-size: 14px; font-weight: 500; border-radius: 8px; white-space: nowrap; }
.btn-ink:hover { background: #000; color: white; }
.menu-btn { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; background: transparent; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0; cursor: pointer; }
@media (min-width: 992px) { .menu-btn { display: none; } }

.drawer { position: fixed; top: 0; right: -100%; width: 82%; max-width: 340px; height: 100vh; background: var(--bg); z-index: 200; transition: right .3s ease; padding: 20px; box-shadow: -20px 0 40px rgba(0,0,0,0.1); overflow-y: auto; }
.drawer.open { right: 0; }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 199; opacity: 0; pointer-events: none; transition: opacity .3s; }
.drawer-backdrop.open { opacity: 1; pointer-events: all; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.drawer a { display: block; padding: 14px 0; text-decoration: none; color: var(--ink); font-size: 16px; font-weight: 500; border-bottom: 1px solid var(--line); }

/* HERO */
.hero { padding: 40px 0 32px; text-align: center; }
@media (min-width: 768px) { .hero { padding: 64px 0 40px; } }

.tag-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 100px; background: var(--bg-card); font-size: 12px; font-weight: 500; color: var(--ink-soft); }
.tag-pill .dot { width: 6px; height: 6px; background: var(--ok); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

.h1 { font-size: clamp(34px, 8vw, 72px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 700; margin: 20px 0 14px; }
.hero-sub { font-size: clamp(15px, 1.8vw, 18px); color: var(--ink-soft); max-width: 560px; margin: 0 auto 28px; line-height: 1.5; }
.hide-sm { display: none; }
@media (min-width: 768px) { .hide-sm { display: inline; } }

/* SEARCH */
.search-wrap { max-width: 720px; margin: 0 auto; }
.search-box { background: var(--bg-card); border: 1.5px solid var(--line-strong); border-radius: 14px; padding: 6px 6px 6px 16px; display: flex; align-items: center; gap: 10px; transition: all .2s; box-shadow: 0 1px 2px rgba(0,0,0,0.02); }
.search-box:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(10,10,10,0.06); }
.search-icon { color: var(--ink-mute); flex-shrink: 0; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-family: var(--sans); font-size: 16px; padding: 14px 0; color: var(--ink); letter-spacing: -0.01em; }
.search-box input::placeholder { color: var(--ink-mute); }
.search-btn { background: var(--ink); color: white; border: 0; border-radius: 10px; height: 48px; padding: 0 18px; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; cursor: pointer; }
.search-btn:hover { background: #000; }
.search-btn-text { display: none; }
@media (min-width: 480px) { .search-btn { padding: 0 22px; } .search-btn-text { display: inline; } }

.hints { margin-top: 16px; display: flex; gap: 8px; overflow-x: auto; padding: 4px 0; scrollbar-width: none; -ms-overflow-style: none; }
.hints::-webkit-scrollbar { display: none; }
@media (min-width: 768px) { .hints { justify-content: center; flex-wrap: wrap; overflow: visible; } }
.hints-label { font-size: 12px; font-weight: 500; color: var(--ink-mute); flex-shrink: 0; align-self: center; text-transform: uppercase; letter-spacing: 0.04em; }
.chip { background: var(--bg-card); border: 1px solid var(--line); padding: 7px 14px; border-radius: 100px; font-size: 13px; font-weight: 500; color: var(--ink-soft); text-decoration: none; flex-shrink: 0; transition: all .15s; }
.chip:hover, .chip:active { background: var(--ink); color: white; border-color: var(--ink); }

/* STATS */
.stats { margin-top: 40px; padding: 28px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
@media (min-width: 768px) { .stats { margin-top: 64px; } }
.stat { text-align: left; }
.stat-num { font-size: clamp(26px, 5vw, 44px); line-height: 1; font-weight: 700; letter-spacing: -0.03em; display: inline-flex; align-items: baseline; gap: 2px; }
.stat-num .suffix { font-size: 0.55em; font-weight: 500; color: var(--ink-soft); margin-left: 2px; }
.stat-label { font-size: 12px; font-weight: 500; color: var(--ink-mute); margin-top: 6px; text-transform: uppercase; letter-spacing: 0.04em; }

/* SECTIONS */
.section { padding: 48px 0; }
@media (min-width: 768px) { .section { padding: 72px 0; } }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 24px; }
@media (min-width: 768px) { .section-head { margin-bottom: 32px; } }
.section-eyebrow { font-size: 11px; font-weight: 600; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.section-title { font-size: clamp(24px, 4vw, 38px); line-height: 1.1; font-weight: 700; letter-spacing: -0.03em; margin: 0; }
.section-link { font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; padding-bottom: 3px; border-bottom: 1.5px solid var(--ink); }
.section-link:hover { color: var(--accent); border-color: var(--accent); }

/* LOGO GRID */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 820px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 16px; } }

.logo-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-decoration: none; color: inherit; display: block; transition: all .2s; position: relative; }
.logo-card:active { transform: scale(0.98); }
@media (min-width: 820px) { .logo-card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,0.06); } }

.logo-preview { aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center; padding: 20px; border-bottom: 1px solid var(--line); background: var(--bg-soft); }
@media (min-width: 560px) { .logo-preview { aspect-ratio: 4/3; padding: 24px; } }
.logo-preview svg, .logo-preview img { max-width: 100%; max-height: 100%; }

.logo-card-body { padding: 12px 12px; }
.logo-card-name { font-size: 13px; font-weight: 600; margin: 0 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 560px) { .logo-card-name { font-size: 14px; } .logo-card-body { padding: 14px 16px; } }
.logo-card-meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.formats { display: flex; gap: 3px; }
.format-tag { font-size: 9px; font-weight: 600; padding: 2px 5px; border: 1px solid var(--line); border-radius: 3px; color: var(--ink-mute); letter-spacing: 0.05em; }
.dl-info { font-size: 11px; color: var(--ink-mute); font-weight: 500; white-space: nowrap; }
.badge-new { position: absolute; top: 8px; left: 8px; background: var(--ink); color: white; font-size: 9px; font-weight: 700; padding: 3px 6px; border-radius: 3px; letter-spacing: 0.08em; }

/* SEARCH LIST */
.search-list { background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.search-item { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; gap: 14px; }
.search-item:last-child { border-bottom: 0; }
.search-item:active { background: var(--bg-soft); }
@media (min-width: 768px) { .search-item { padding: 16px 20px; } .search-item:hover { background: var(--bg-soft); } }
.rank { font-size: 20px; font-weight: 700; color: var(--ink-mute); min-width: 28px; letter-spacing: -0.04em; }
.search-item:hover .rank { color: var(--accent); }
.search-info { flex: 1; min-width: 0; }
.search-name { font-size: 14px; font-weight: 600; margin: 0 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-q { font-size: 11px; color: var(--ink-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.search-stats-col { font-size: 11px; color: var(--ink-mute); text-align: right; white-space: nowrap; font-weight: 500; }
.search-stats-col strong { display: block; color: var(--ink); font-size: 13px; font-weight: 700; letter-spacing: -0.01em; }

/* LIMIT BANNER */
.limit-banner { background: var(--ink); color: white; border-radius: 16px; padding: 28px 24px; position: relative; overflow: hidden; }
@media (min-width: 768px) { .limit-banner { padding: 36px; } }
.limit-banner::before { content: ""; position: absolute; top: -40%; right: -20%; width: 500px; height: 500px; background: radial-gradient(circle, rgba(227,6,19,0.25), transparent 60%); pointer-events: none; }
.limit-content { position: relative; z-index: 2; }
.tag-on-dark { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); color: rgba(255,255,255,0.9); font-size: 11px; font-weight: 500; padding: 5px 10px; border-radius: 100px; text-transform: uppercase; letter-spacing: 0.06em; }
.meter { display: flex; gap: 4px; margin: 16px 0 6px; }
.meter-dot { flex: 1; max-width: 42px; height: 5px; background: rgba(255,255,255,0.15); border-radius: 100px; }
.meter-dot.filled { background: var(--accent); }
.limit-count { font-size: 12px; color: rgba(255,255,255,0.65); font-weight: 500; }
.limit-head { font-size: clamp(22px, 4vw, 28px); line-height: 1.15; font-weight: 700; letter-spacing: -0.025em; margin: 10px 0 8px; }
.limit-sub { font-size: 14px; color: rgba(255,255,255,0.7); line-height: 1.5; margin-bottom: 18px; }
.btn-white { background: white; color: var(--ink); border: 0; padding: 14px 22px; border-radius: 10px; font-weight: 600; font-size: 14px; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; width: 100%; justify-content: center; }
@media (min-width: 480px) { .btn-white { width: auto; } }
.btn-white:hover { background: var(--accent); color: white; }

/* CRAWLER CARD */
.crawler-card { background: var(--bg-soft); border: 1.5px solid var(--ink); border-radius: 16px; padding: 32px 24px; position: relative; overflow: hidden; }
@media (min-width: 768px) { .crawler-card { padding: 48px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center; } }
.crawler-step-anim { position: relative; padding: 20px; background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; margin-top: 24px; font-size: 13px; }
@media (min-width: 768px) { .crawler-step-anim { margin-top: 0; } }
.step { display: flex; align-items: start; gap: 12px; padding: 10px 0; opacity: 0.5; transition: opacity .4s; }
.step.active { opacity: 1; }
.step-num { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: white; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all .3s; }
.step.active .step-num { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-bg); }
.step-body { flex: 1; }
.step-body strong { display: block; font-weight: 600; margin-bottom: 2px; font-size: 13px; }
.step-body span { font-size: 12px; color: var(--ink-mute); display: block; }
.step-connector { width: 1px; height: 14px; background: var(--line); margin-left: 11px; }
.crawler-badge { display: inline-block; background: var(--accent-bg); color: var(--accent); font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 100px; text-transform: uppercase; letter-spacing: 0.05em; }
.crawler-head { font-size: clamp(22px, 4vw, 32px); line-height: 1.15; font-weight: 700; letter-spacing: -0.025em; margin: 14px 0 10px; }
.crawler-sub { font-size: 15px; color: var(--ink-soft); line-height: 1.55; margin-bottom: 20px; }
.crawler-stats { display: flex; gap: 24px; margin-bottom: 22px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.crawler-stat-num { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; display: block; }
.crawler-stat-label { font-size: 11px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; margin-top: 2px; }

/* CATEGORY GRID */
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 820px) { .cat-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; } }
.cat-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 14px; text-decoration: none; color: var(--ink); display: flex; justify-content: space-between; align-items: center; gap: 10px; transition: all .18s; }
.cat-card:active { background: var(--bg-soft); transform: scale(0.98); }
@media (min-width: 820px) { .cat-card:hover { background: var(--ink); color: white; border-color: var(--ink); } .cat-card:hover .cat-count { color: rgba(255,255,255,0.5); } }
.cat-name { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.cat-count { font-size: 12px; color: var(--ink-mute); font-weight: 500; flex-shrink: 0; }

/* FOOTER */
.site-footer { background: var(--ink); color: white; padding: 48px 0 28px; }
.footer-title { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 14px; }
.footer-link { color: rgba(255,255,255,0.85); text-decoration: none; font-size: 14px; display: block; padding: 6px 0; }
.footer-link:hover { color: #FFB4B4; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); margin-top: 36px; padding-top: 20px; color: rgba(255,255,255,0.5); font-size: 12px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* BOTTOM NAV */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255,255,255,0.95); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-top: 1px solid var(--line); padding: 8px 0 calc(8px + var(--safe-bottom)); z-index: 90; display: flex; justify-content: space-around; }
@media (min-width: 768px) { .bottom-nav { display: none; } }
.bnav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--ink-mute); text-decoration: none; font-size: 10px; font-weight: 500; padding: 6px 4px; }
.bnav-item.active { color: var(--ink); }
.bnav-item svg { width: 22px; height: 22px; }

/* LOGO DETAIL PAGE */
.logo-detail-hero { padding: 32px 0; border-bottom: 1px solid var(--line); }
.logo-detail-preview { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 16px; aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; padding: 48px; margin-bottom: 20px; }
.logo-detail-preview img, .logo-detail-preview svg { max-width: 100%; max-height: 100%; }
.breadcrumb-nav { font-size: 12px; color: var(--ink-mute); margin-bottom: 12px; }
.breadcrumb-nav a { color: var(--ink-mute); text-decoration: none; }
.breadcrumb-nav a:hover { color: var(--ink); }
.breadcrumb-nav .sep { margin: 0 6px; }
.download-format { background: var(--bg-card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; transition: all .15s; }
.download-format:hover { border-color: var(--ink); }
.format-icon { width: 40px; height: 40px; border-radius: 8px; background: var(--bg-soft); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px; letter-spacing: 0.03em; flex-shrink: 0; }
.format-info { flex: 1; min-width: 0; }
.format-name { font-weight: 600; font-size: 14px; margin: 0 0 2px; }
.format-desc { font-size: 11px; color: var(--ink-mute); }
.btn-download { background: var(--ink); color: white; padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; border: 0; cursor: pointer; }
.btn-download:hover { background: var(--accent); color: white; }

/* EMPTY / NOT FOUND */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { width: 64px; height: 64px; background: var(--bg-soft); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.empty-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.empty-sub { color: var(--ink-soft); margin-bottom: 24px; max-width: 480px; margin-left: auto; margin-right: auto; }

/* FORMS */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-input, .form-select, .form-textarea { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--bg-card); font-family: var(--sans); font-size: 15px; color: var(--ink); }
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: 0; border-color: var(--ink); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: 12px; color: var(--ink-mute); margin-top: 4px; }
.form-error { color: var(--accent); font-size: 13px; margin-top: 8px; }
.form-success { background: #E7F6EC; color: #0E7C3A; padding: 12px 16px; border-radius: 8px; font-size: 14px; }

/* ALERT */
.alert { padding: 14px 18px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; }
.alert-info { background: var(--accent-bg); color: var(--accent); border: 1px solid #FCA5A5; }
.alert-success { background: #E7F6EC; color: var(--ok); border: 1px solid #86EFAC; }
.alert-warn { background: #FEF3C7; color: var(--warn); border: 1px solid #FCD34D; }

/* ==== ADSENSE / ADS ==== */
.ad-container {
    margin: 24px auto;
    max-width: 100%;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.ad-container.ad-banner {
    padding: 8px 0;
}
.ad-container.ad-in-feed {
    margin: 16px 0;
    grid-column: 1 / -1; /* Span full width in logo grid */
}
.ad-container.ad-sidebar {
    margin: 16px 0;
    min-height: 250px;
}
.ad-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-mute);
    margin-bottom: 4px;
    font-weight: 500;
}

/* Placeholder (when ad slot not configured, for admin preview) */
.ad-placeholder {
    background: repeating-linear-gradient(45deg, var(--bg-soft), var(--bg-soft) 10px, #EEE 10px, #EEE 20px);
    border: 1.5px dashed var(--line-strong);
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    margin: 24px auto;
    max-width: 728px;
}
.ad-placeholder-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink-soft);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.ad-placeholder-sub {
    display: block;
    font-size: 11px;
    color: var(--ink-mute);
    margin-top: 4px;
    font-family: monospace;
}

/* Sticky sidebar ad for desktop only */
@media (min-width: 992px) {
    .ad-sidebar {
        position: sticky;
        top: 80px;
    }
}

/* In-feed ad blending with logo grid */
.ad-in-feed .ad-placeholder {
    margin: 0;
    padding: 60px 20px;
}
