/* ===== CUSTOM PALETTE — not Tailwind ===== */
:root {
    --bg: #f4f6fb;
    --sidebar-bg: #131926;
    --sidebar-hover: #1c2538;
    --sidebar-active: #283248;
    --sidebar-text: #8b95a9;
    --sidebar-text-bright: #dce1e9;
    --card-bg: #ffffff;
    --border: #dfe4ee;
    --text: #1b2437;
    --text-muted: #5e6a80;
    --primary: #4f6ef7;
    --primary-hover: #3b59d9;
    --primary-subtle: rgba(79,110,247,0.08);
    --success: #1aad62;
    --danger: #e63946;
    --warning: #e5960b;
    --info: #0ea5c9;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --shadow: 0 1px 2px rgba(27,36,55,0.04), 0 2px 8px rgba(27,36,55,0.06);
    --shadow-md: 0 2px 8px rgba(27,36,55,0.08), 0 6px 20px rgba(27,36,55,0.08);
    --shadow-lg: 0 8px 30px rgba(27,36,55,0.12);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ===== LAYOUT ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 270px;
    background: var(--sidebar-bg);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s;
    scrollbar-width: thin;
    scrollbar-color: var(--sidebar-active) transparent;
    border-right: 1px solid rgba(255,255,255,0.04);
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--sidebar-active); border-radius: 4px; }
.main-content {
    flex: 1;
    margin-left: 270px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== SIDEBAR ===== */
.sidebar-header {
    padding: 22px 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-header .logo {
    width: 30px; height: 30px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; flex-shrink: 0;
}
.sidebar-header .logo img {
    width: 100%; height: 100%; object-fit: contain;
}
.sidebar-header h1 {
    color: #fff; font-size: 18px; font-weight: 700; letter-spacing: -0.5px;
}
.sidebar-header h1 span { color: var(--primary); }
.sidebar-search {
    padding: 10px 14px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-search input {
    width: 100%;
    background: var(--sidebar-hover);
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--sidebar-text-bright);
    padding: 8px 12px 8px 34px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: var(--font);
    outline: none;
    transition: border-color var(--transition), background var(--transition);
}
.sidebar-search input:focus { border-color: var(--primary); background: rgba(79,110,247,0.08); }
.sidebar-search input::placeholder { color: var(--sidebar-text); }
.sidebar-search .search-wrap { position: relative; }
.sidebar-search .search-wrap i {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    color: var(--sidebar-text); font-size: 13px; pointer-events: none;
}
.sidebar-nav { padding: 8px 0; }
.nav-category {
    padding: 14px 20px 5px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sidebar-text);
    opacity: 0.7;
}
.nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 450;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}
.nav-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-bright);
}
.nav-link.active {
    background: var(--sidebar-hover);
    color: #fff;
    border-left-color: var(--primary);
    font-weight: 550;
}
.nav-link i { width: 18px; text-align: center; font-size: 12px; opacity: 0.6; }
.nav-link.active i { opacity: 1; color: var(--primary); }

/* ===== TOPBAR ===== */
.topbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(8px);
    background: rgba(255,255,255,0.85);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-muted); }
.breadcrumb a { color: var(--text-muted); text-decoration: none; transition: color var(--transition); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { opacity: 0.3; }
.breadcrumb .current { color: var(--text); font-weight: 550; }
.menu-toggle {
    display: none;
    background: none; border: none; color: var(--text);
    font-size: 20px; cursor: pointer; padding: 4px;
}

/* ===== PAGE CONTENT ===== */
.page-content { padding: 28px 36px 36px; flex: 1; max-width: 1200px; width: 100%; margin: 0 auto; }
.page-title { font-size: 26px; font-weight: 750; margin-bottom: 6px; letter-spacing: -0.4px; }
.page-subtitle { color: var(--text-muted); font-size: 15px; margin-bottom: 28px; line-height: 1.5; }

/* ===== CARDS ===== */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    overflow: hidden;
    transition: box-shadow var(--transition);
}
.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 14px;
    display: flex; align-items: center; gap: 8px;
    background: var(--bg);
    color: var(--text);
}
.card-header i { color: var(--primary); opacity: 0.8; }
.card-body { padding: 22px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block; font-size: 13px; font-weight: 600;
    margin-bottom: 6px; color: var(--text);
}
.form-group small { display: block; color: var(--text-muted); font-size: 12px; margin-top: 5px; }
.form-control {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font);
    color: var(--text);
    background: #fff;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,110,247,0.1);
}
textarea.form-control { resize: vertical; min-height: 100px; font-family: var(--mono); font-size: 13px; line-height: 1.5; }
select.form-control { cursor: pointer; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.form-inline { display: flex; gap: 12px; align-items: flex-end; }
.form-inline .form-group { flex: 1; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 12px; }
.checkbox-group label {
    display: flex; align-items: center; gap: 6px;
    font-weight: 400; font-size: 13px; cursor: pointer;
}
.checkbox-group input[type="checkbox"] { accent-color: var(--primary); }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 550;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
    text-decoration: none;
    position: relative;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 3px rgba(79,110,247,0.3); }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 2px 8px rgba(79,110,247,0.35); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(1.1); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }
.btn-outline {
    background: #fff; color: var(--text); border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg); border-color: #c8cdd8; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-group { display: flex; gap: 8px; margin-top: 8px; }

/* ===== RESULTS ===== */
.result-card { margin-top: 24px; }
.result-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.result-table th, .result-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.result-table th {
    background: var(--bg); font-weight: 650; font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted);
}
.result-table tbody tr { transition: background var(--transition); }
.result-table tbody tr:hover td { background: rgba(79,110,247,0.03); }
.result-table td { word-break: break-all; }

.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 600;
    letter-spacing: 0.02em;
}
.badge-success { background: #e6f7ee; color: #0f7a3e; }
.badge-danger { background: #fde8ea; color: #b71c2b; }
.badge-warning { background: #fdf2e0; color: #8c5d00; }
.badge-info { background: #e2f4f8; color: #076b82; }

.alert {
    padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px;
    margin-bottom: 16px; display: flex; align-items: flex-start; gap: 10px;
}
.alert-danger { background: #fde8ea; color: #991b22; border: 1px solid #f5c6cb; }
.alert-success { background: #e6f7ee; color: #0f7a3e; border: 1px solid #b7ebc9; }
.alert-warning { background: #fdf2e0; color: #7a5200; border: 1px solid #f5dfa8; }
.alert-info { background: #e2f4f8; color: #076b82; border: 1px solid #ade0eb; }

pre.code-block {
    background: #171e2e; color: #d4dae6; padding: 18px;
    border-radius: var(--radius-sm); font-size: 13px; overflow-x: auto;
    font-family: var(--mono); line-height: 1.5;
    white-space: pre-wrap; word-break: break-all;
    border: 1px solid #232d41;
}

.mono { font-family: var(--mono); font-size: 13px; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }
.text-info { color: var(--info); }
.fw-600 { font-weight: 600; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }

/* ===== HOMEPAGE ===== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 14px;
}
.tool-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    text-decoration: none;
    color: var(--text);
    transition: all var(--transition);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
.tool-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: var(--primary);
    opacity: 0;
    transition: opacity var(--transition);
}
.tool-card:hover {
    border-color: rgba(79,110,247,0.3);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.tool-card:hover::before { opacity: 1; }
.tool-card:active { transform: translateY(0); }
.tool-card .tool-icon {
    width: 38px; height: 38px; border-radius: var(--radius-sm);
    background: var(--primary-subtle); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; flex-shrink: 0;
    transition: all var(--transition);
}
.tool-card:hover .tool-icon {
    background: var(--primary);
    color: #fff;
    transform: scale(1.05);
}
.tool-card .tool-info h3 { font-size: 14px; font-weight: 600; margin-bottom: 3px; letter-spacing: -0.15px; }
.tool-card .tool-info p { font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }

.category-section { margin-bottom: 36px; }
.category-title {
    font-size: 15px; font-weight: 700; margin-bottom: 14px;
    display: flex; align-items: center; gap: 10px;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-size: 12px;
}
.category-title i {
    color: var(--primary);
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-subtle);
    border-radius: var(--radius-sm);
    font-size: 12px;
}

/* ===== STATUS ===== */
.status-dot {
    width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.status-dot.open { background: var(--success); }
.status-dot.closed { background: var(--danger); }
.status-dot.filtered { background: var(--warning); }

.progress-bar-wrap {
    background: var(--border); border-radius: 99px; height: 8px; overflow: hidden;
    margin-top: 8px;
}
.progress-bar {
    height: 100%; border-radius: 99px; transition: width 0.4s ease;
}
.progress-bar.strong { background: var(--success); }
.progress-bar.medium { background: var(--warning); }
.progress-bar.weak { background: var(--danger); }

/* ===== COPY BUTTON ===== */
.copy-wrap { position: relative; }
.copy-btn {
    position: absolute; top: 8px; right: 8px;
    background: rgba(255,255,255,0.08); color: #8b95a9;
    border: none; padding: 4px 10px; border-radius: 4px;
    font-size: 12px; cursor: pointer; transition: all var(--transition);
}
.copy-btn:hover { background: rgba(255,255,255,0.16); color: #fff; }

/* ===== FOOTER ===== */
.footer {
    padding: 20px 36px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}
.footer-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    transition: color var(--transition);
}
.footer-links a:hover { color: var(--primary); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-toggle { display: block; }
    .page-content { padding: 20px 16px; }
    .topbar { padding: 0 16px; }
    .form-row { flex-direction: column; gap: 0; }
    .tools-grid { grid-template-columns: 1fr; }
    .sidebar-overlay {
        position: fixed; inset: 0; background: rgba(0,0,0,0.5);
        z-index: 99; display: none;
    }
    .sidebar-overlay.open { display: block; }
}

/* ===== SPINNER ===== */
.spinner {
    display: inline-block; width: 16px; height: 16px;
    border: 2px solid var(--border); border-top-color: var(--primary);
    border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== TABS ===== */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 16px; gap: 2px; }
.tab {
    padding: 9px 18px; font-size: 13px; font-weight: 550;
    color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent;
    margin-bottom: -2px; transition: all var(--transition); background: none;
    border-top: 0; border-left: 0; border-right: 0;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tab:hover { color: var(--text); background: var(--primary-subtle); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--primary-subtle); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== COOKIE CONSENT ===== */
.cookie-banner {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--sidebar-bg);
    color: var(--sidebar-text-bright);
    z-index: 9999;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
}
.cookie-inner {
    max-width: 900px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.cookie-inner p {
    font-size: 14px;
    margin: 0;
    flex: 1;
    min-width: 200px;
}
.cookie-inner a { color: var(--primary); text-decoration: underline; }
.cookie-buttons { display: flex; gap: 8px; flex-shrink: 0; }

/* ===== AD SLOTS ===== */
.ad-slot { text-align: center; }
.content-ad {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    min-height: 100px;
}
.sidebar-ad { border-top: 1px solid var(--sidebar-hover); margin-top: 12px; }

/* ===== LEGAL PAGES ===== */
.legal-content h2 {
    font-size: 18px;
    font-weight: 650;
    margin: 28px 0 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    color: var(--text);
}
.legal-content h2:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.legal-content h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 16px 0 8px;
    color: var(--text);
}
.legal-content p { margin-bottom: 12px; font-size: 14px; line-height: 1.7; }
.legal-content ul {
    margin: 8px 0 16px 24px;
    font-size: 14px;
    line-height: 1.7;
}
.legal-content ul li { margin-bottom: 4px; }
.legal-content a { color: var(--primary); }
.legal-content a:hover { text-decoration: underline; }

/* ===== BMC BANNER ===== */
.bmc-banner {
    margin: 32px 0 0;
    padding: 0 24px;
}
.bmc-banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: linear-gradient(135deg, #ff813f 0%, #ffdd00 100%);
    border-radius: var(--radius-lg);
    padding: 20px 28px;
    box-shadow: var(--shadow-md);
}
.bmc-banner-text {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #1a1a2e;
}
.bmc-banner-text .bmc-icon {
    font-size: 28px;
    opacity: 0.85;
}
.bmc-banner-text strong {
    font-size: 16px;
    display: block;
    margin-bottom: 2px;
}
.bmc-banner-text p {
    font-size: 13px;
    margin: 0;
    opacity: 0.8;
}
.bmc-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1a1a2e;
    color: #fff;
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: transform var(--transition), box-shadow var(--transition);
}
.bmc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
@media (max-width: 768px) {
    .bmc-banner-inner {
        flex-direction: column;
        text-align: center;
        padding: 16px 20px;
    }
    .bmc-banner-text {
        flex-direction: column;
        gap: 8px;
    }
}

/* ===== SKELETON ===== */
.skeleton-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-top: 24px;
    overflow: hidden;
}
.skeleton-card .card-header { color: var(--text-muted); font-style: italic; }
.skeleton-body { padding: 20px; }
.skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, var(--border) 25%, #ebeef5 50%, var(--border) 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    margin-bottom: 14px;
    animation: shimmer 1.5s ease-in-out infinite;
}
.skeleton-line:last-child { margin-bottom: 0; }
.skeleton-line.w-90 { width: 90%; }
.skeleton-line.w-75 { width: 75%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-45 { width: 45%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.h-lg { height: 20px; }
.skeleton-table { margin-top: 8px; }
.skeleton-table .skeleton-row {
    display: flex; gap: 16px; padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.skeleton-table .skeleton-row:last-child { border-bottom: none; }
.skeleton-table .skeleton-cell {
    height: 14px;
    background: linear-gradient(90deg, var(--border) 25%, #ebeef5 50%, var(--border) 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: shimmer 1.5s ease-in-out infinite;
}
.skeleton-table .skeleton-cell:first-child { width: 30%; }
.skeleton-table .skeleton-cell:last-child { flex: 1; }
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== FADE-IN ===== */
.result-card.fade-in { animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== HOMEPAGE HERO ===== */
.home-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 56px 0 36px;
    text-align: center;
}
.home-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}
.home-logo { width: 52px; height: 52px; border-radius: 12px; }
.home-title {
    font-size: 44px;
    font-weight: 750;
    letter-spacing: -1.5px;
    color: var(--text);
}
.home-title span { color: var(--primary); }
.home-subtitle {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 32px;
}
.home-search-wrap {
    width: 100%;
    max-width: 540px;
    position: relative;
}
.home-search-box {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 50px;
    padding: 0 20px;
    height: 52px;
    box-shadow: var(--shadow);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.home-search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 2px 20px rgba(79,110,247,0.13);
}
.home-search-box i {
    color: var(--text-muted);
    font-size: 15px;
    margin-right: 12px;
    flex-shrink: 0;
}
.home-search-box input {
    flex: 1;
    border: none;
    background: none;
    font-size: 16px;
    color: var(--text);
    outline: none;
    font-family: var(--font);
    min-width: 0;
}
.home-search-box input::placeholder { color: var(--text-muted); opacity: 0.7; }
.home-search-kbd {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 9px;
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--mono);
    line-height: 1.6;
    flex-shrink: 0;
}

/* Search Results Dropdown */
.home-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0; right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: none;
    max-height: 420px;
    overflow-y: auto;
    z-index: 200;
}
.home-search-results.active { display: block; }
.home-search-result {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    color: var(--text);
    text-decoration: none;
    transition: background 0.12s;
}
.home-search-result:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.home-search-result:last-child { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.home-search-result:only-child { border-radius: var(--radius-lg); }
.home-search-result:hover,
.home-search-result.highlighted {
    background: var(--primary-subtle);
}
.home-search-result .sr-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: var(--primary-subtle);
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
    font-size: 14px;
    flex-shrink: 0;
}
.home-search-result:hover .sr-icon,
.home-search-result.highlighted .sr-icon {
    background: var(--primary);
    color: #fff;
}
.home-search-result .sr-info { text-align: left; min-width: 0; }
.home-search-result .sr-info h4 {
    font-size: 14px; font-weight: 600;
    margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.home-search-result .sr-info p {
    font-size: 12px; color: var(--text-muted);
    margin: 2px 0 0; line-height: 1.4;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.home-search-result .sr-arrow {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
}
.home-search-result:hover .sr-arrow,
.home-search-result.highlighted .sr-arrow { opacity: 1; }
.home-search-results .no-results {
    padding: 24px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* Privacy Badge */
.home-privacy {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted);
}
.home-privacy i { color: var(--success); font-size: 12px; }
.home-privacy a { color: var(--primary); font-weight: 500; text-decoration: none; }
.home-privacy a:hover { text-decoration: underline; }

/* Homepage Sections */
.home-section { margin-top: 40px; }
.home-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.home-section-title i {
    font-size: 12px;
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
}
.home-section-title .fa-star { color: var(--warning); background: rgba(229,150,11,0.1); }
.home-section-title .fa-history { color: var(--primary); background: var(--primary-subtle); }
.home-section-title .fa-bolt { color: var(--success); background: rgba(26,173,98,0.08); }

@media (max-width: 768px) {
    .home-hero { padding: 28px 0 20px; }
    .home-brand { gap: 10px; margin-bottom: 6px; }
    .home-logo { width: 32px; height: 32px; border-radius: 8px; }
    .home-title { font-size: 24px; letter-spacing: -0.8px; }
    .home-subtitle { font-size: 13px; margin-bottom: 20px; }
    .home-search-wrap { max-width: 100%; }
    .home-search-box { height: 48px; padding: 0 16px; border-radius: 14px; }
    .home-search-box input { font-size: 15px; }
    .home-search-kbd { display: none; }
    .home-search-results { border-radius: var(--radius); }
    .home-search-result { padding: 10px 14px; gap: 10px; }
    .home-search-result .sr-icon { width: 32px; height: 32px; font-size: 12px; border-radius: 8px; }
    .home-search-result .sr-arrow { display: none; }
    .home-privacy { font-size: 11px; margin-top: 14px; }
    .home-section { margin-top: 28px; }
}

/* ===== DARK MODE ===== */
[data-theme="dark"] {
    --bg: #0d1117;
    --card-bg: #161b22;
    --border: #2a3140;
    --text: #e0e4ea;
    --text-muted: #8893a7;
    --primary-subtle: rgba(79,110,247,0.12);
    --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.35), 0 2px 4px -2px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.4);
}
[data-theme="dark"] .topbar { background: rgba(22,27,34,0.85); border-color: var(--border); }
[data-theme="dark"] .card-header { background: #12161d; }
[data-theme="dark"] .form-control { background: #0d1117; color: var(--text); border-color: var(--border); }
[data-theme="dark"] .form-control::placeholder { color: #5a6376; }
[data-theme="dark"] select.form-control { background: #0d1117; color: var(--text); }
[data-theme="dark"] .result-table th { background: #12161d; color: var(--text-muted); }
[data-theme="dark"] .result-table tbody tr:hover td { background: rgba(79,110,247,0.05); }
[data-theme="dark"] .result-table td { border-color: var(--border); }
[data-theme="dark"] .btn-outline { background: var(--card-bg); color: var(--text); border-color: var(--border); }
[data-theme="dark"] .btn-outline:hover { background: #1f2937; }
[data-theme="dark"] .skeleton-line,
[data-theme="dark"] .skeleton-table .skeleton-cell {
    background: linear-gradient(90deg, var(--border) 25%, #2d3748 50%, var(--border) 75%);
    background-size: 200% 100%;
}
[data-theme="dark"] .badge-success { background: #0f3d24; color: #86efac; }
[data-theme="dark"] .badge-danger { background: #4a0e13; color: #fca5a5; }
[data-theme="dark"] .badge-warning { background: #3d2e06; color: #fcd34d; }
[data-theme="dark"] .badge-info { background: #06303d; color: #7dd3fc; }
[data-theme="dark"] .alert-danger { background: #2d0a0e; color: #fca5a5; border-color: #5c1a22; }
[data-theme="dark"] .alert-success { background: #062415; color: #86efac; border-color: #0f5132; }
[data-theme="dark"] .alert-warning { background: #2d1f05; color: #fcd34d; border-color: #5c4012; }
[data-theme="dark"] .alert-info { background: #05252e; color: #7dd3fc; border-color: #0a4a5e; }
[data-theme="dark"] .tool-card { background: var(--card-bg); border-color: var(--border); }
[data-theme="dark"] .tool-card:hover { border-color: rgba(79,110,247,0.4); }
[data-theme="dark"] .cookie-banner { background: #161b22; color: var(--text); }
[data-theme="dark"] pre.code-block { background: #0d1117; border-color: var(--border); }
[data-theme="dark"] .home-search-box { background: #161b22; border-color: var(--border); }
[data-theme="dark"] .home-search-box:focus-within { border-color: var(--primary); box-shadow: 0 2px 20px rgba(79,110,247,0.15); }
[data-theme="dark"] .home-search-kbd { background: #0d1117; border-color: var(--border); }
[data-theme="dark"] .home-search-results { background: #161b22; border-color: var(--border); }
[data-theme="dark"] .home-search-result:hover,
[data-theme="dark"] .home-search-result.highlighted { background: rgba(79,110,247,0.1); }

/* ===== THEME TOGGLE ===== */
.topbar-right { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    transition: all var(--transition);
}
.theme-toggle:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-subtle); }

/* ===== FAVORITE BUTTON ===== */
.tool-title-row { display: flex; align-items: center; gap: 12px; }
.fav-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    transition: all var(--transition);
    flex-shrink: 0;
}
.fav-btn:hover { color: var(--warning); border-color: var(--warning); background: rgba(229,150,11,0.08); }
.fav-btn.active { color: var(--warning); border-color: var(--warning); background: rgba(229,150,11,0.08); }

/* ===== RELATED TOOLS ===== */
.related-tools { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--border); }
.related-title {
    font-size: 12px; font-weight: 700; margin-bottom: 14px;
    text-transform: uppercase; letter-spacing: 0.05em;
    display: flex; align-items: center; gap: 8px; color: var(--text-muted);
}
.related-title i { color: var(--primary); }

/* ===== TOOL DESCRIPTION ===== */
.tool-long-desc { color: var(--text-muted); font-size: 14px; line-height: 1.7; margin-bottom: 24px; max-width: 800px; }

/* ===== SHARE BUTTON ===== */
.share-btn {
    background: none; border: 1px solid var(--border); color: var(--text-muted);
    padding: 6px 14px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px;
    display: inline-flex; align-items: center; gap: 6px; transition: all var(--transition); margin-left: auto;
}
.share-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-subtle); }
.card-header:has(.share-btn) { display: flex; align-items: center; }

/* ===== 404 PAGE ===== */
.error-page { text-align: center; padding: 48px 0; }
.error-page .error-icon { font-size: 64px; color: var(--text-muted); margin-bottom: 16px; opacity: 0.4; }
.error-page h1 { font-size: 32px; margin-bottom: 8px; font-weight: 750; }
.error-page p { color: var(--text-muted); font-size: 16px; margin-bottom: 32px; }

/* ===== SIDEBAR FAVORITES ===== */
.sidebar-favorites-section { border-bottom: 1px solid rgba(255,255,255,0.06); padding-bottom: 4px; margin-bottom: 4px; }
