/* ==========================================================================
   FastTrack Tools — High-Velocity Direct-Showing UI Design
   Dark Minimalist Theme & Responsive System
   ========================================================================== */

:root {
    --bg-main: #060913;
    --bg-card: #0d1322;
    --bg-card-hover: #131b2e;
    --bg-input: #101728;
    --border-dim: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(0, 229, 153, 0.35);
    
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --accent: #00e599;
    --accent-glow: rgba(0, 229, 153, 0.2);
    --accent-blue: #00c2ff;
    
    --tag-pdf: #ef4444;
    --tag-image: #a855f7;
    --tag-business: #10b981;
    --tag-web: #06b6d4;
    --tag-dev: #f59e0b;
    --tag-content: #ec4899;
    --tag-converters: #3b82f6;

    --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body.theme-dark {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.tools-header {
    background: rgba(10, 15, 29, 0.85);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-dim);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.logo-symbol {
    color: #f59e0b;
    font-size: 1.35rem;
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.5));
}

.brand-highlight {
    color: var(--accent);
}

.version-badge {
    background: rgba(0, 229, 153, 0.1);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 229, 153, 0.25);
    white-space: nowrap;
}

/* Header Quick Search */
.header-search {
    flex: 1;
    max-width: 400px;
    background: var(--bg-input);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.header-search:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: #141d33;
}

.search-placeholder {
    color: var(--text-dim);
    font-size: 0.85rem;
    flex: 1;
}

.shortcut-key {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-main);
}

.cat-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}
.cat-dot.pdf { background: var(--tag-pdf); }
.cat-dot.image { background: var(--tag-image); }
.cat-dot.business { background: var(--tag-business); }
.cat-dot.web { background: var(--tag-web); }
.cat-dot.dev { background: var(--tag-dev); }

.portfolio-back-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-dim);
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition-fast);
}

.portfolio-back-btn:hover {
    background: rgba(0, 229, 153, 0.12);
    border-color: var(--accent);
    color: var(--accent);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
}

.mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-main);
}

/* ==========================================================================
   Google AdSense Policy-Compliant Banners
   ========================================================================== */
.ad-banner-slot {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0.5rem 1.5rem;
}

.top-leaderboard-slot {
    padding-top: 0.75rem;
    padding-bottom: 0.25rem;
}

.ad-container-box {
    background: rgba(13, 19, 34, 0.5);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    min-height: 52px;
    overflow: hidden;
}

.ad-policy-label {
    align-self: flex-start;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin-bottom: 0.2rem;
    text-transform: uppercase;
}

.ad-fallback-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.4rem;
    width: 100%;
    color: var(--text-dim);
    font-size: 0.78rem;
}

.ad-fallback-card.compact {
    font-size: 0.74rem;
    padding: 0.25rem;
}

.ad-pill {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ad-info-link {
    color: var(--text-muted);
    text-decoration: underline;
    font-size: 0.72rem;
    margin-left: auto;
}

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

ins.adsbygoogle:has(iframe) + .ad-fallback-card {
    display: none !important;
}

.bottom-leaderboard-slot {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.tool-mid-ad-slot {
    padding: 0;
    margin: 1.25rem 0;
}

/* In-Grid Native Sponsored Card */
.ad-grid-card {
    background: rgba(13, 19, 34, 0.75) !important;
    border: 1px dashed rgba(245, 158, 11, 0.35) !important;
}

.ad-grid-card:hover {
    border-color: rgba(245, 158, 11, 0.6) !important;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.12) !important;
}

.chip-sponsored {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #f59e0b !important;
    border: 1px solid rgba(245, 158, 11, 0.4) !important;
    font-weight: 800;
}

.ad-card-body {
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Sticky Bottom Floating Anchor Ad Bar */
.sticky-anchor-ad {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: rgba(10, 15, 29, 0.95);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--border-hover);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.6);
    padding: 0.35rem 1rem;
    transition: transform 0.25s ease-in-out;
}

.sticky-anchor-inner {
    max-width: 980px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sticky-close-btn {
    position: absolute;
    top: -14px;
    right: 0;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #94a3b8;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    z-index: 10;
}

.sticky-close-btn:hover {
    background: var(--accent);
    color: #060913;
}

.sticky-ad-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}


/* ==========================================================================
   Direct-Showing Tools Layout (No Verbal Fluff)
   ========================================================================== */
.main-content {
    flex: 1;
    min-width: 0;
}

.tools-ad-shell {
    width: 100%;
}

.desktop-side-ad {
    display: none;
}

.side-ad-box {
    min-height: 600px;
    width: 160px;
    background: rgba(13, 19, 34, 0.5);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 0.6rem;
    position: sticky;
    top: 96px;
    overflow: hidden;
}

.side-ad-box .adsbygoogle {
    width: 160px;
    min-height: 600px;
}

.side-fallback {
    min-height: 520px;
    flex-direction: column;
    gap: 0.55rem;
    text-align: center;
}

@media (min-width: 1580px) {
    .tools-ad-shell {
        max-width: 1760px;
        margin: 0 auto;
        padding: 0 1rem;
        display: grid;
        grid-template-columns: 160px minmax(0, 1fr) 160px;
        gap: 1.25rem;
        align-items: start;
    }

    .desktop-side-ad {
        display: block;
        padding-top: 1rem;
    }
}

.tools-direct-view {
    padding: 1rem 0 3rem;
}

.tools-direct-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Compact Command & Search Bar */
.command-bar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.search-box-direct {
    background: var(--bg-card);
    border: 1.5px solid var(--border-dim);
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition-fast);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.search-box-direct:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow), 0 8px 30px rgba(0, 0, 0, 0.35);
    background: #10172a;
}

.search-icon-direct {
    font-size: 1.2rem;
    color: var(--accent);
}

.search-box-direct input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 1.05rem;
    font-family: var(--font-main);
    font-weight: 500;
}

.search-box-direct input::placeholder {
    color: var(--text-dim);
    font-size: 0.95rem;
}

.clear-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.clear-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.search-stats-badge {
    background: rgba(0, 229, 153, 0.1);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 229, 153, 0.25);
    white-space: nowrap;
}

/* Category Filter Pills Row */
.category-pills-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.category-pills-row::-webkit-scrollbar {
    display: none;
}

.pill-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    color: var(--text-muted);
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.pill-btn:hover {
    background: #141d33;
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-main);
}

.pill-btn.active {
    background: var(--accent);
    color: #060913;
    border-color: var(--accent);
    font-weight: 700;
    box-shadow: 0 0 14px var(--accent-glow);
}

/* ==========================================================================
   Tools Grid — High Velocity & Responsive
   ========================================================================== */
.tools-grid-direct {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.tool-card-direct {
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-md);
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.tool-card-direct:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-icon-wrap {
    font-size: 1.65rem;
    line-height: 1;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.cat-chip {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
}

.chip-pdf { background: rgba(239, 68, 68, 0.12); color: var(--tag-pdf); border: 1px solid rgba(239, 68, 68, 0.3); }
.chip-image { background: rgba(168, 85, 247, 0.12); color: var(--tag-image); border: 1px solid rgba(168, 85, 247, 0.3); }
.chip-business { background: rgba(16, 185, 129, 0.12); color: var(--tag-business); border: 1px solid rgba(16, 185, 129, 0.3); }
.chip-web { background: rgba(6, 182, 212, 0.12); color: var(--tag-web); border: 1px solid rgba(6, 182, 212, 0.3); }
.chip-dev { background: rgba(245, 158, 11, 0.12); color: var(--tag-dev); border: 1px solid rgba(245, 158, 11, 0.3); }
.chip-content { background: rgba(236, 72, 153, 0.12); color: var(--tag-content); border: 1px solid rgba(236, 72, 153, 0.3); }
.chip-converters { background: rgba(59, 130, 246, 0.12); color: var(--tag-converters); border: 1px solid rgba(59, 130, 246, 0.3); }

.feature-chip {
    background: rgba(0, 229, 153, 0.1);
    color: var(--accent);
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    border: 1px solid rgba(0, 229, 153, 0.25);
}

.card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.tool-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
}

.tool-card-direct:hover .tool-name {
    color: var(--accent);
}

.tool-summary {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    font-size: 0.78rem;
    font-weight: 600;
    transition: var(--transition-fast);
}

.tool-card-direct:hover .card-action {
    color: var(--accent);
}

.action-arrow {
    transition: var(--transition-fast);
}

.tool-card-direct:hover .action-arrow {
    transform: translateX(3px);
}

/* Empty State */
.empty-state-direct {
    text-align: center;
    padding: 4rem 1.5rem;
    background: var(--bg-card);
    border: 1px dashed var(--border-dim);
    border-radius: var(--radius-md);
    margin-top: 1rem;
}

.empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.empty-state-direct h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.empty-state-direct p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.empty-state-direct code {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: var(--font-mono);
}

.reset-search-btn {
    background: var(--accent);
    color: #060913;
    border: none;
    font-weight: 700;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.reset-search-btn:hover {
    box-shadow: 0 0 16px var(--accent-glow);
}

/* ==========================================================================
   Tool Workspace View
   ========================================================================== */
.tool-page-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.tool-page-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.85rem;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-dim);
    overflow-x: auto;
    white-space: nowrap;
}

.breadcrumbs a {
    color: var(--text-muted);
}

.breadcrumbs a:hover {
    color: var(--accent);
}

.bc-current {
    color: var(--text-main);
    font-weight: 600;
}

.back-link {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-dim);
    color: var(--text-main);
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.back-link:hover {
    background: rgba(0, 229, 153, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

.tool-header-card {
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
}

.tool-icon-large {
    font-size: 2.75rem;
    line-height: 1;
}

.tool-header-content {
    flex: 1;
}

.tool-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.tool-main-title {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.tool-page-badge {
    background: rgba(0, 229, 153, 0.12);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 229, 153, 0.3);
}

.privacy-tag {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.tool-main-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Tool Workspace Canvas Area */
.tool-workspace {
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-lg);
    padding: 2rem;
    min-height: 380px;
    position: relative;
}

/* ==========================================================================
   Tool Workspace Comprehensive Controls & Form Inputs (Fix Dark Theme Inputs)
   ========================================================================== */
.tool-workspace input[type="text"],
.tool-workspace input[type="number"],
.tool-workspace input[type="email"],
.tool-workspace input[type="password"],
.tool-workspace input[type="url"],
.tool-workspace input[type="search"],
.tool-workspace input[type="tel"],
.tool-workspace textarea,
.tool-workspace select {
    background-color: #0f172a !important;
    border: 1.5px solid rgba(255, 255, 255, 0.15) !important;
    color: #f8fafc !important;
    padding: 0.65rem 0.95rem !important;
    border-radius: var(--radius-sm) !important;
    font-size: 0.95rem !important;
    font-family: var(--font-main) !important;
    outline: none !important;
    box-sizing: border-box !important;
    transition: var(--transition-fast) !important;
    width: 100%;
}

.tool-workspace input[type="text"]:focus,
.tool-workspace input[type="number"]:focus,
.tool-workspace input[type="password"]:focus,
.tool-workspace input[type="url"]:focus,
.tool-workspace textarea:focus,
.tool-workspace select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-glow) !important;
    background-color: #141f36 !important;
}

.tool-workspace input::placeholder,
.tool-workspace textarea::placeholder {
    color: #64748b !important;
}

.tool-workspace select option {
    background-color: #0f172a !important;
    color: #f8fafc !important;
}

.tool-workspace textarea {
    min-height: 140px;
    line-height: 1.6;
    font-family: var(--font-mono), monospace;
}

.controls-panel {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    margin: 1.25rem 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
    min-width: 180px;
}

.control-group label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.btn-primary {
    background: linear-gradient(135deg, #00e599 0%, #00b377 100%);
    color: #060913;
    border: none;
    padding: 0.65rem 1.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition-fast);
    box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.qr-preview-box {
    width: min(100%, 600px);
    max-width: calc(100vw - 5rem);
    padding: 1rem;
    background: #fff;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.qr-preview-box canvas {
    display: block;
    max-width: 100%;
}

.btn-secondary {
    background: #1e293b;
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: var(--transition-fast);
}

.btn-secondary:hover {
    background: #28354d;
    border-color: rgba(255, 255, 255, 0.25);
}

.dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.4);
    padding: 3rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent);
    background: rgba(0, 229, 153, 0.04);
}

.dropzone-icon {
    font-size: 2.8rem;
    margin-bottom: 0.6rem;
}

.dropzone-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.dropzone-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.85rem;
}

.output-box {
    background: #0b1120;
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-top: 1.25rem;
}

.output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.output-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.code-pre {
    background: #020617;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 1rem;
    color: #e2e8f0;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Unit Converter & Data Tables */
.unit-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.unit-table th, .unit-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.unit-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.02);
}

.unit-table td {
    font-size: 0.9rem;
    color: var(--text-main);
}

.unit-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.unit-val {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--accent);
}

/* Diff Viewer */
.diff-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.diff-box {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-dim);
    background: #0b1120;
    padding: 1rem;
}

.diff-output-line {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 2px;
}

.diff-add {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-left: 3px solid #10b981;
}

.diff-del {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-left: 3px solid #ef4444;
}

.diff-same {
    color: var(--text-dim);
}

/* Color Palette Chips */
.palette-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 1rem;
}

.palette-chip {
    flex: 1;
    min-width: 130px;
    background: #0f172a;
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-fast);
}

.palette-chip:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.palette-swatch {
    height: 70px;
    width: 100%;
}

.palette-info {
    padding: 0.5rem;
    text-align: center;
}

.palette-hex {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

.palette-rgb {
    font-size: 0.7rem;
    color: var(--text-dim);
}

.workspace-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    min-height: 300px;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 229, 153, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.tool-workspace-ad-slot {
    padding: 0;
}

/* Guide Card */
.tool-guide-card {
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.guide-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.tip-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.tip-card strong {
    display: block;
    font-size: 0.9rem;
    margin: 0.3rem 0;
    color: var(--text-main);
}

.tip-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Related Tools */
.related-tools-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.related-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.related-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.view-all-link {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
}

.mini-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* ==========================================================================
   Legal Pages (Privacy & Terms)
   ========================================================================== */
.legal-page-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.legal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
}

.legal-badge {
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.legal-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
}

.legal-updated {
    color: var(--text-dim);
    font-size: 0.82rem;
    margin-bottom: 1.5rem;
}

.legal-section-highlight {
    background: rgba(0, 229, 153, 0.08);
    border: 1px solid rgba(0, 229, 153, 0.25);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.highlight-icon {
    font-size: 1.75rem;
}

.legal-body {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.legal-body h2 {
    color: var(--text-main);
    font-size: 1.25rem;
    margin: 1.75rem 0 0.75rem;
}

.legal-body ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.legal-body li {
    margin-bottom: 0.5rem;
}

.legal-footer-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-dim);
}

.btn-return {
    background: var(--accent);
    color: #060913;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.legal-alt-link {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.tools-footer {
    background: #080d1a;
    border-top: 1px solid var(--border-dim);
    margin-top: auto;
}

.footer-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 3rem 1.5rem 2rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2.5rem;
}

.brand-col .footer-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.75rem;
    max-width: 380px;
    line-height: 1.6;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1.2rem;
    font-weight: 800;
}

.founder-link {
    color: var(--accent);
    font-weight: 600;
}

.footer-col h4 {
    color: var(--text-main);
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-col a {
    color: var(--text-muted);
    font-size: 0.82rem;
    transition: var(--transition-fast);
}

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

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.25rem 1.5rem;
}

.footer-bottom-container {
    max-width: 1320px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-dim);
}

.footer-badge {
    background: rgba(0, 229, 153, 0.08);
    color: var(--accent);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

/* ==========================================================================
   Command Palette Modal (Cmd+K or /)
   ========================================================================== */
.cmd-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
}

.cmd-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
}

.cmd-modal-content {
    position: relative;
    width: 100%;
    max-width: 620px;
    background: #0d1322;
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

.cmd-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-dim);
}

.cmd-input-wrap input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-size: 1.1rem;
    font-family: var(--font-main);
}

.cmd-badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: var(--font-mono);
}

.cmd-results {
    max-height: 380px;
    overflow-y: auto;
    padding: 0.5rem;
}

.cmd-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.cmd-item:hover, .cmd-item.active {
    background: #172138;
}

.cmd-item-icon {
    font-size: 1.35rem;
}

.cmd-item-info {
    flex: 1;
}

.cmd-item-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-main);
}

.cmd-item-desc {
    font-size: 0.75rem;
    color: var(--text-dim);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cmd-item-cat {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-dim);
    padding: 0.1rem 0.35rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1080px) {
    .tools-grid-direct {
        grid-template-columns: repeat(3, 1fr);
    }
    .tips-grid {
        grid-template-columns: 1fr;
    }
    .footer-container {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .header-search {
        display: none;
    }
    .nav-links {
        display: none;
    }
    .mobile-menu-toggle {
        display: flex;
    }
    .tools-grid-direct {
        grid-template-columns: repeat(2, 1fr);
    }
    .mini-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .tool-header-card {
        flex-direction: column;
    }
    .footer-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .tools-grid-direct {
        grid-template-columns: 1fr;
    }
    .mini-grid {
        grid-template-columns: 1fr;
    }
    .search-box-direct {
        padding: 0.5rem 0.75rem;
    }
    .search-box-direct input {
        font-size: 0.95rem;
    }
    .legal-card {
        padding: 1.5rem;
    }
}

/* Expanded utility tool layouts */
.tool-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.85rem;
    margin-top: 1rem;
}

.metric-card {
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-md);
    padding: 1rem;
    min-width: 0;
}

.metric-label {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

.metric-value {
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: clamp(1rem, 4vw, 1.45rem);
    font-weight: 900;
    overflow-wrap: anywhere;
}

.result-line {
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border-dim);
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

.result-line code {
    color: var(--accent);
    white-space: normal;
}

.tool-workspace input,
.tool-workspace select,
.tool-workspace textarea {
    max-width: 100%;
}

@media (max-width: 520px) {
    .tool-form-grid,
    .result-grid {
        grid-template-columns: 1fr;
    }

    .controls-panel {
        gap: 0.6rem;
    }

    .controls-panel .btn-primary,
    .controls-panel .btn-secondary,
    .controls-panel button {
        width: 100%;
        justify-content: center;
    }
}


/* Excel spin wheel */
.spin-import-grid,
.spin-wheel-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.75fr);
    gap: 1rem;
}

.spin-wheel-layout {
    align-items: start;
    margin-top: 1rem;
}

.spin-panel {
    background: rgba(255,255,255,0.045);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-md);
    padding: 1rem;
    min-width: 0;
}

.spin-panel h3 {
    margin: 0 0 .65rem;
    color: var(--text-main);
    font-size: 1rem;
}

.spin-wheel-wrap {
    position: relative;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: radial-gradient(circle at center, rgba(0,229,153,.12), rgba(6,9,19,.9));
    border: 1px solid var(--border-dim);
    border-radius: 24px;
    overflow: hidden;
}

#spin-canvas {
    width: min(100%, 520px);
    height: auto;
    max-height: 72vh;
}

.spin-main-btn {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    min-width: 92px;
    min-height: 92px;
    box-shadow: 0 18px 50px rgba(0,0,0,.45);
}

.spin-entry-list {
    display: grid;
    gap: .55rem;
    max-height: 320px;
    overflow: auto;
    margin-bottom: 1rem;
}

.spin-entry,
.winner-card {
    background: rgba(2,6,23,.65);
    border: 1px solid var(--border-dim);
    border-radius: 12px;
    padding: .7rem .8rem;
    overflow-wrap: anywhere;
}

.spin-entry span {
    display: block;
    color: var(--text-muted);
    font-size: .78rem;
    margin-top: .2rem;
}

.spin-history {
    display: grid;
    gap: .55rem;
}

.winner-card a {
    color: var(--accent);
    margin-right: .7rem;
    font-weight: 800;
}

@media (max-width: 900px) {
    .spin-import-grid,
    .spin-wheel-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .spin-panel,
    .spin-wheel-wrap {
        padding: .75rem;
        border-radius: 16px;
    }

    .spin-main-btn {
        min-width: 76px;
        min-height: 76px;
        font-size: .85rem;
    }
}
