/* =========================================================
   143TOOL GLOBAL THEME
   Version: 1.1.0 (Theme Flicker Fix)
   ========================================================= */

:root {
    color-scheme: light; /* ✅ Browser ko batao light mode default hai */
    --primary: #e91e63;
    --primary-hover: #c2185b;
    --secondary: #9c27b0;
    --body-bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #f8f9fb;
    --text: #202124;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --success: #198754;
    --danger: #dc3545;
    --warning: #f59e0b;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, .05);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, .08);
    --radius-sm: 7px;
    --radius-md: 11px;
    --radius-lg: 17px;
    --radius-xl: 24px;
    --container: 1180px;
    --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
    color-scheme: dark; /* ✅ Browser ko batao dark mode active hai */
    --body-bg: #101114;
    --surface: #181a1f;
    --surface-2: #202229;
    --text: #f3f4f6;
    --text-muted: #a1a1aa;
    --border: #2e3139;
}

@media (prefers-color-scheme: dark) {
    html[data-theme="system"] {
        color-scheme: dark;
        --body-bg: #101114;
        --surface: #181a1f;
        --surface-2: #202229;
        --text: #f3f4f6;
        --text-muted: #a1a1aa;
        --border: #2e3139;
    }
}

/* ... (baaki CSS same rahega) ... */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--body-bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.6;
    transition: background-color .2s ease, color .2s ease;
}
button, a, input, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

:focus-visible {
    outline: 3px solid rgba(233, 30, 99, .35);
    outline-offset: 3px;
}

.container {
    width: min(calc(100% - 32px), var(--container));
    margin-inline: auto;
}

/* HEADER */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
}
.navbar {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    font-size: 21px;
    white-space: nowrap;
}
.logo-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 6px 18px rgba(233, 30, 99, .22);
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-links a {
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    transition: background .2s ease, color .2s ease;
}
.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 8%, transparent);
}
.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.theme-button {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 17px;
}
.menu-button {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 10px;
}

/* USER MENU */
.user-menu-wrapper { position: relative; display: inline-block; }
.user-icon-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 5px;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 600;
}
.user-icon-btn:hover {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 5%, var(--surface));
}
.user-icon-btn.logged-in { padding: 4px 12px 4px 4px; }
.user-icon-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    flex-shrink: 0;
}
.user-icon-default {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.user-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dropdown-arrow {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}
.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 260px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 9999;
    overflow: hidden;
}
.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    background: var(--surface-2);
}
.dropdown-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    flex-shrink: 0;
}
.dropdown-user-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.dropdown-user-info { flex: 1; min-width: 0; }
.dropdown-user-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
}
.dropdown-user-status {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 18px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s ease;
}
.dropdown-item:hover {
    background: color-mix(in srgb, var(--primary) 8%, transparent);
    color: var(--primary);
}
.dropdown-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.dropdown-divider { height: 1px; background: var(--border); margin: 5px 0; }
.dropdown-item-primary { color: var(--primary); font-weight: 700; }
.dropdown-item-danger { color: var(--danger); }

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 17px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-weight: 700;
    font-size: 14px;
    transition: transform .15s ease, background .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    box-shadow: 0 7px 20px rgba(233, 30, 99, .18);
}
.btn-outline {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

/* HERO */
.hero { padding: clamp(55px, 8vw, 100px) 0 clamp(45px, 7vw, 80px); }
.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
    gap: 55px;
    align-items: center;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 9%, transparent);
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 17px;
}
.hero h1 {
    margin: 0;
    max-width: 780px;
    font-size: clamp(38px, 6vw, 70px);
    line-height: 1.04;
    letter-spacing: -2.8px;
}
.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero-description {
    max-width: 650px;
    margin: 22px 0 0;
    color: var(--text-muted);
    font-size: clamp(16px, 2vw, 19px);
    line-height: 1.75;
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 11px;
    margin-top: 30px;
}
.hero-card {
    padding: 30px;
    border: 1px solid var(--border);
    background: linear-gradient(145deg, var(--surface), var(--surface-2));
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}
.heart { font-size: 46px; margin-bottom: 15px; }
.hero-card h2 { margin: 0 0 9px; font-size: 24px; }
.hero-card p { margin: 0; color: var(--text-muted); line-height: 1.7; }

/* SECTION */
.section { padding: clamp(48px, 7vw, 80px) 0; }
.section-alt { background: var(--surface-2); }
.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 27px;
}
.section-heading h2 {
    margin: 0;
    font-size: clamp(26px, 4vw, 36px);
    letter-spacing: -.8px;
}
.section-heading p {
    margin: 6px 0 0;
    color: var(--text-muted);
    max-width: 650px;
}
.section-link {
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
}

/* CARDS */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: color-mix(in srgb, var(--primary) 25%, var(--border));
}

/* TOOL GRID */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}
.tool-card {
    padding: 24px;
    text-align: center;
}
.tool-card-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 15px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: color-mix(in srgb, var(--primary) 9%, transparent);
    font-size: 28px;
}
.tool-card h3 {
    margin: 0 0 8px;
    font-size: 16px;
}
.tool-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
}

/* TYPE GRID */
.type-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
}
.type-card { padding: 22px; text-align: center; }
.type-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 13px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: color-mix(in srgb, var(--primary) 9%, transparent);
    font-size: 24px;
}
.type-card h3 { margin: 0; font-size: 16px; }
.type-card p { margin: 7px 0 0; color: var(--text-muted); font-size: 13px; }

/* CTA */
.cta {
    padding: clamp(40px, 6vw, 65px);
    text-align: center;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 12%, var(--surface)), color-mix(in srgb, var(--secondary) 10%, var(--surface)));
    border: 1px solid color-mix(in srgb, var(--primary) 15%, var(--border));
}
.cta h2 { margin: 0; font-size: clamp(27px, 5vw, 42px); letter-spacing: -1px; }
.cta p { max-width: 650px; margin: 13px auto 25px; color: var(--text-muted); }

/* PAGE CONTENT */
.page-content {
    max-width: 800px;
    margin: 0 auto;
}
.page-content h1 { font-size: 36px; margin-bottom: 20px; }
.page-content h2 { font-size: 24px; margin: 30px 0 15px; }
.page-content p { color: var(--text-muted); line-height: 1.8; margin-bottom: 15px; }
.page-content a { color: var(--primary); font-weight: 600; }

/* CONTACT FORM */
.contact-form {
    max-width: 600px;
    margin: 30px auto 0;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--body-bg);
    color: var(--text);
    font-size: 16px;
    transition: border-color 0.2s ease;
}
.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    outline: none;
}

/* TOOL PAGE */
.tool-page {
    max-width: 900px;
    margin: 0 auto;
}
.tool-header {
    text-align: center;
    margin-bottom: 40px;
}
.tool-header-icon {
    font-size: 64px;
    margin-bottom: 15px;
}
.tool-header h1 {
    font-size: 36px;
    margin: 0 0 10px;
}
.tool-description {
    color: var(--text-muted);
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto;
}
.tool-category-section {
    margin-bottom: 50px;
}
.tool-category-section h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

/* FOOTER */
.site-footer {
    padding: 50px 0 25px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 35px;
}
.footer-brand p {
    max-width: 390px;
    color: var(--text-muted);
    line-height: 1.7;
}
.footer-title { margin: 0 0 14px; font-size: 14px; }
.footer-links { display: grid; gap: 9px; }
.footer-links a { color: var(--text-muted); font-size: 14px; }
.footer-links a:hover { color: var(--primary); }
.footer-bottom {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    gap: 15px;
    color: var(--text-muted);
    font-size: 13px;
}

/* MOBILE MENU */
.nav-links-mobile {
    display: block;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 650;
    text-decoration: none;
}
.nav-links-mobile:hover {
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 8%, transparent);
}

/* RESPONSIVE */
@media (max-width: 950px) {
    .nav-links { display: none; }
    .menu-button { display: grid; place-items: center; }
    .hero-grid { grid-template-columns: 1fr; }
    .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .user-name { display: none; }
    .user-icon-btn { padding: 4px; border-radius: 50%; }
    .user-icon-btn.logged-in { padding: 4px; }
    .dropdown-arrow { display: none; }
}

@media (max-width: 620px) {
    .container { width: min(calc(100% - 24px), var(--container)); }
    .navbar { min-height: 62px; }
    .logo { font-size: 18px; }
    .logo-mark { width: 36px; height: 36px; }
    .hero h1 { letter-spacing: -1.7px; }
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; }
    .tool-grid,
    .type-grid,
    .footer-grid { grid-template-columns: 1fr; }
    .section-heading { align-items: start; flex-direction: column; }
    .footer-bottom { flex-direction: column; }
    .hero-card { padding: 24px; }
    .user-dropdown { width: 240px; right: -50px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}
/* =========================================================
   GLOBAL SHARE BUTTONS
   Version: 1.0.0
   ========================================================= */

.share-box {
    margin: 32px auto;
    max-width: 900px;
    padding: 20px 24px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    animation: shareFadeIn .35s ease;
}

@keyframes shareFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.share-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.share-title {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
}

/* Native share button (shown on mobile only via JS) */
.share-native-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;
    border: 0;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s ease;
    box-shadow: 0 4px 14px rgba(233, 30, 99, .22);
}

.share-native-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(233, 30, 99, .32);
}

.share-native-icon {
    font-size: 15px;
}

/* Buttons row */
.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all .18s ease;
    font-family: inherit;
    min-height: 40px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.share-btn:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .08);
    color: var(--primary);
}

.share-btn:active {
    transform: translateY(0) scale(.97);
}

.share-btn-icon {
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}

.share-btn-label {
    white-space: nowrap;
}

/* Network-specific hover colors */
.share-whatsapp:hover {
    background: #25D366;
    border-color: #25D366;
    color: #fff;
}
.share-facebook:hover {
    background: #1877F2;
    border-color: #1877F2;
    color: #fff;
}
.share-twitter:hover {
    background: #000;
    border-color: #000;
    color: #fff;
}
.share-linkedin:hover {
    background: #0A66C2;
    border-color: #0A66C2;
    color: #fff;
}
.share-telegram:hover {
    background: #229ED9;
    border-color: #229ED9;
    color: #fff;
}
.share-reddit:hover {
    background: #FF4500;
    border-color: #FF4500;
    color: #fff;
}
.share-pinterest:hover {
    background: #E60023;
    border-color: #E60023;
    color: #fff;
}
.share-email:hover {
    background: #EA4335;
    border-color: #EA4335;
    color: #fff;
}

/* Copy button (was .share-copy) */
.share-copy.share-copied {
    background: #10B981;
    border-color: #10B981;
    color: #fff;
}

/* ---------- Compact layout ---------- */
.share-layout-compact {
    padding: 14px 18px;
}
.share-layout-compact .share-btn-label {
    display: none;
}
.share-layout-compact .share-btn {
    padding: 9px;
    min-width: 40px;
    justify-content: center;
}
.share-layout-compact .share-title {
    margin: 0;
}

/* ---------- Vertical layout ---------- */
.share-layout-vertical .share-buttons {
    flex-direction: column;
}
.share-layout-vertical .share-btn {
    justify-content: flex-start;
    width: 100%;
}

/* =========================================================
   SEARCH OVERLAY
   Version: 1.0.0
   ========================================================= */

.search-trigger {
    /* Uses .theme-button styles already */
}

/* =========================================================
   SEARCH OVERLAY CONTAINER
   ========================================================= */
.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, .5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 80px 20px 20px;
    animation: searchFadeIn .2s ease;
    overflow-y: auto;
}

@keyframes searchFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.search-panel {
    width: 100%;
    max-width: 640px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 60px rgba(0, 0, 0, .35);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 100px);
    overflow: hidden;
    animation: searchSlideIn .25s cubic-bezier(.22,.85,.35,1);
}

@keyframes searchSlideIn {
    from { opacity: 0; transform: translateY(-16px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* =========================================================
   SEARCH INPUT
   ========================================================= */
.search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}

.search-input-icon {
    font-size: 20px;
    flex-shrink: 0;
    opacity: .7;
}

.search-input {
    flex: 1;
    padding: 6px 0;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 18px;
    font-weight: 600;
    font-family: inherit;
    outline: none;
    min-width: 0;
}

.search-input::placeholder {
    color: var(--text-muted);
    font-weight: 500;
    opacity: .7;
}

.search-close {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: grid;
    place-items: center;
    transition: all .15s ease;
    font-family: inherit;
    flex-shrink: 0;
}

.search-close:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 8%, var(--surface-2));
}

.search-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: searchSpin .6s linear infinite;
    flex-shrink: 0;
}

@keyframes searchSpin {
    to { transform: rotate(360deg); }
}

/* =========================================================
   SEARCH BODY
   ========================================================= */
.search-body {
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
    max-height: 480px;
}

.search-section-label {
    padding: 12px 20px 8px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-muted);
}

/* ---------- Recent ---------- */
.search-recent {
    border-bottom: 1px solid var(--border);
}

.search-recent-list {
    padding: 0 8px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-recent-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background .15s ease;
}

.search-recent-item:hover {
    background: var(--surface-2);
}

.search-recent-icon {
    opacity: .6;
    font-size: 12px;
}

/* ---------- Results ---------- */
.search-results {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-result {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: transparent;
    border: 0;
    border-radius: var(--radius-md);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    text-align: left;
    transition: background .12s ease, transform .12s ease;
    font-family: inherit;
    width: 100%;
}

.search-result:hover,
.search-result.is-active {
    background: color-mix(in srgb, var(--primary) 8%, var(--surface-2));
}

.search-result.is-active {
    outline: 2px solid color-mix(in srgb, var(--primary) 40%, var(--border));
    outline-offset: -2px;
}

.search-result-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    border-radius: 12px;
    font-size: 22px;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.search-result-name mark {
    background: color-mix(in srgb, var(--primary) 25%, transparent);
    color: var(--primary);
    padding: 0 2px;
    border-radius: 3px;
    font-weight: 800;
}

.search-result-desc {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.search-result-cat {
    display: inline-block;
    padding: 2px 8px;
    background: var(--surface-2);
    color: var(--text-muted);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    flex-shrink: 0;
}

.search-result-arrow {
    color: var(--text-muted);
    font-size: 14px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity .15s ease, transform .15s ease;
}

.search-result:hover .search-result-arrow,
.search-result.is-active .search-result-arrow {
    opacity: 1;
    transform: translateX(3px);
    color: var(--primary);
}

/* ---------- Empty / Prompt ---------- */
.search-empty,
.search-prompt {
    padding: 48px 20px;
    text-align: center;
}

.search-empty-icon,
.search-prompt-icon {
    font-size: 40px;
    opacity: .35;
    margin-bottom: 10px;
}

.search-empty-title,
.search-prompt-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
}

.search-empty-sub,
.search-prompt-sub {
    font-size: 13px;
    color: var(--text-muted);
}

/* =========================================================
   SEARCH FOOTER
   ========================================================= */
.search-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    gap: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.search-footer-keys {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    flex-wrap: wrap;
}

.search-footer-keys span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.search-footer-keys kbd {
    display: inline-block;
    padding: 2px 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 4px;
    font-size: 10px;
    font-family: ui-monospace, monospace;
    font-weight: 700;
    color: var(--text);
    min-width: 18px;
    text-align: center;
}

.search-footer-link {
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.search-footer-link:hover {
    text-decoration: underline;
}

/* =========================================================
   RESPONSIVE — Mobile
   ========================================================= */
@media (max-width: 640px) {
    .search-overlay {
        padding: 0;
        align-items: stretch;
    }
    .search-panel {
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        border: 0;
    }
    .search-input-wrap {
        padding: 14px 16px;
    }
    .search-input {
        font-size: 16px;
    }
    .search-result {
        padding: 10px 12px;
    }
    .search-result-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    .search-result-name {
        font-size: 14px;
    }
    .search-result-desc {
        font-size: 11px;
    }
    .search-footer {
        padding: 10px 16px;
    }
    .search-footer-keys {
        display: none;
    }
}
/* =========================================================
   CRITICAL FIX — Hidden attribute must override display:flex
   ========================================================= */

.search-overlay[hidden] {
    display: none !important;
}

.search-overlay:not([hidden]) {
    display: flex;
}

/* Also fix spinner hidden */
.search-spinner[hidden] {
    display: none !important;
}

/* Also fix any other [hidden] element */
[hidden] {
    display: none !important;
}

/* =========================================================
   BODY LOCK (when overlay is open)
   ========================================================= */
body.search-is-open {
    overflow: hidden;
}


/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .share-box {
        padding: 16px 18px;
        margin: 24px auto;
        border-radius: var(--radius-md);
    }
    .share-buttons {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }
    .share-btn {
        justify-content: center;
        padding: 10px 6px;
        min-height: 46px;
    }
    .share-btn-label {
        display: none;
    }
    .share-btn-icon {
        font-size: 20px;
    }
    .share-title {
        font-size: 12px;
    }
}

@media (max-width: 380px) {
    .share-buttons {
        grid-template-columns: repeat(4, 1fr);
    }
}

