/* FreeToolStack — single central stylesheet (site.css) */
/* No additional CSS files unless approved per AGENTS.md section 5 */
/* Design: Bento + Minimal Flat | Accent: Green/Teal | Dark mode: system + toggle */

/* ===== Design Tokens (Light) ===== */
:root {
    /* Accent */
    --accent: #10b981;
    --accent-hover: #059669;
    --accent-light: #ecfdf5;
    --accent-muted: #a7f3d0;

    /* Surfaces */
    --bg: #f8fafb;
    --bg-card: #ffffff;
    --bg-card-hover: #f0fdf8;
    --bg-elevated: #ffffff;

    /* Borders */
    --border: #e5e7eb;
    --border-light: #f0f0f0;

    /* Text */
    --text: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --text-on-accent: #ffffff;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    /* Spacing */
    --gap: 1rem;
    --gap-lg: 1.5rem;

    /* Typography */
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
        Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
}

/* ===== Design Tokens (Dark) ===== */
[data-theme="dark"] {
    --accent: #34d399;
    --accent-hover: #6ee7b7;
    --accent-light: rgba(52, 211, 153, 0.1);
    --accent-muted: rgba(52, 211, 153, 0.2);

    --bg: #0f1117;
    --bg-card: #1a1d27;
    --bg-card-hover: #222633;
    --bg-elevated: #1e2130;

    --border: #2d3141;
    --border-light: #252836;

    --text: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --text-on-accent: #0f1117;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    color-scheme: light dark;
}

body {
    font-family: var(--font-body);
    color: var(--text);
    background-color: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* ===== Container ===== */
.container {
    width: 100%;
    max-width: 1120px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    line-height: 1.25;
    margin-bottom: 0.5em;
    color: var(--text);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    line-height: 1.4;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: var(--text-on-accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: var(--text-on-accent);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--gap-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-muted);
}

.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.card-link:hover {
    text-decoration: none;
}

.card-link:hover .card {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-muted);
    transform: translateY(-2px);
}

/* ===== Header ===== */
.site-header {
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(248, 250, 251, 0.85);
}

[data-theme="dark"] .site-header {
    background: rgba(15, 17, 23, 0.85);
}

.nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.01em;
    color: var(--text);
}

.logo:hover {
    text-decoration: none;
    color: var(--text);
}

/* ===== Search Bar ===== */
.search-bar {
    flex: 1;
    max-width: 480px;
    margin: 0 1.5rem;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 0.875rem;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.75rem;
    font-size: 0.9375rem;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    outline: none;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.search-input:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

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

.nav-desktop {
    display: flex;
}

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

.nav-links a {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    transition: color 0.15s ease;
}

.nav-links a:hover {
    color: var(--accent);
    text-decoration: none;
}

/* ===== Cluster Dropdown Navigation ===== */
.nav-dropdown-wrapper {
    position: relative;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    transition: color 0.15s ease;
}

.nav-dropdown-toggle:hover {
    color: var(--accent);
}

.dropdown-icon {
    transition: transform 0.2s ease;
}

.dropdown-icon-open {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 1rem);
    left: 50%;
    transform: translateX(-50%);
    min-width: 640px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    z-index: 200;
}

[data-theme="dark"] .nav-dropdown-menu {
    background: rgba(26, 29, 39, 0.95);
}

.nav-dropdown-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem;
}

.nav-dropdown-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s ease;
}

.nav-dropdown-item:hover {
    background: var(--accent-light);
    text-decoration: none;
}

.nav-dropdown-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: var(--radius-sm);
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.nav-dropdown-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    flex: 1;
}

.nav-dropdown-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.nav-dropdown-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Dropdown transitions */
.dropdown-enter {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.dropdown-enter-start {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px);
}

.dropdown-enter-end {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.dropdown-leave {
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.dropdown-leave-start {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.dropdown-leave-end {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px);
}

/* ===== Mobile Menu Toggle ===== */
.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-secondary);
    padding: 0;
}

.mobile-menu-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

/* ===== Mobile Menu ===== */
.mobile-menu {
    position: fixed;
    top: 73px;
    left: 0;
    right: 0;
    bottom: 0;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(248, 250, 251, 0.98);
    border-top: 1px solid var(--border);
    overflow-y: auto;
    z-index: 99;
    padding: 1.5rem 0;
}

[data-theme="dark"] .mobile-menu {
    background: rgba(15, 17, 23, 0.98);
}

.mobile-menu-section {
    margin-bottom: 2rem;
}

.mobile-menu-heading {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.mobile-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.mobile-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
    text-align: center;
}

.mobile-menu-item:hover {
    background: var(--accent-light);
    border-color: var(--accent-muted);
    text-decoration: none;
}

.mobile-menu-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.mobile-menu-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
}

.mobile-menu-actions .btn {
    width: 100%;
    justify-content: center;
}

.mobile-menu-actions .theme-toggle {
    width: 100%;
    height: 48px;
}

/* Mobile menu transitions */
.mobile-menu-enter {
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.mobile-menu-enter-start {
    opacity: 0;
    transform: translateY(-12px);
}

.mobile-menu-enter-end {
    opacity: 1;
    transform: translateY(0);
}

.mobile-menu-leave {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.mobile-menu-leave-start {
    opacity: 1;
    transform: translateY(0);
}

.mobile-menu-leave-end {
    opacity: 0;
    transform: translateY(-12px);
}

/* Alpine.js x-cloak utility */
[x-cloak] {
    display: none !important;
}

/* ===== User Menu (Signed In) ===== */
.user-menu-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-email {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-signout-form {
    display: flex;
    margin: 0;
}

.user-signout-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.user-signout-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-light);
}

.user-signout-btn svg {
    flex-shrink: 0;
}

.mobile-user-info {
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
}

.mobile-user-email {
    font-size: 0.9375rem;
    color: var(--text);
    font-weight: 500;
    display: block;
    word-break: break-word;
}

.mobile-signout-form {
    display: flex;
    margin: 0;
}

.mobile-signout-btn {
    width: 100%;
    justify-content: center;
}

/* ===== Theme Toggle ===== */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-secondary);
    padding: 0;
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.theme-toggle:hover svg {
    transform: rotate(15deg);
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ===== Main Content ===== */
main {
    flex: 1;
    padding: 2rem 0;
}

/* ===== Breadcrumbs ===== */
.breadcrumbs {
    margin-bottom: 1.5rem;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    list-style: none;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb-link {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.breadcrumb-link:hover {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumb-current {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.breadcrumb-separator {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    opacity: 0.5;
}

/* ===== Hero ===== */
.hero {
    text-align: center;
    padding: 3rem 0 2.5rem;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.hero h1 .accent {
    color: var(--accent);
}

.hero p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 580px;
    margin-left: auto;
    margin-right: auto;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-top: 2rem;
}

.hero-stat {
    text-align: center;
}

.hero-stat-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    display: block;
}

.hero-stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

/* ===== Bento Grid ===== */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--gap-lg);
    padding: 1rem 0;
}

.bento-grid-3 {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

/* ===== Cluster Cards ===== */
.cluster-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.cluster-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-muted);
    transform: translateY(-2px);
    text-decoration: none;
}

.cluster-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.cluster-card h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: 0;
    color: var(--text);
}

.cluster-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    line-height: 1.5;
}

.cluster-card-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: auto;
    padding-top: 0.5rem;
}

/* ===== Card Illustrations (inline SVG with CSS custom properties) ===== */

.cluster-card--with-illustration {
    padding: 0;
}

.card-illustration {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-illustration svg {
    width: 100%;
    height: 100%;
    display: block;
}

.cluster-card--with-illustration .card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (max-width: 640px) {
    .cluster-card--with-illustration .card-content {
        padding: 1.25rem;
    }
}

/* ===== Section Headers ===== */
.section-header {
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.section-header p {
    color: var(--text-muted);
    font-size: 0.9375rem;
    margin-bottom: 0;
}

/* ===== Guide Filter Chips ===== */
.guide-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.guide-chip {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
    font-family: var(--font-body);
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: capitalize;
    line-height: 1.4;
}

.guide-chip:hover {
    border-color: var(--accent-muted);
    color: var(--text);
}

.guide-chip--active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.guide-chip--active:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}

/* ===== Guides Section Spacing ===== */
.guides-section {
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
}

.guides-section:first-of-type {
    border-top: none;
}

/* ── Guide Card Tags ── */
.guide-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.guide-card-tag {
    display: inline-block;
    padding: 0.1875rem 0.5rem;
    font-size: 0.6875rem;
    font-family: var(--font-body);
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 999px;
    text-transform: capitalize;
    line-height: 1.4;
}

/* ===== Sign In ===== */
.signin-page {
    max-width: 420px;
    margin: 3rem auto;
    text-align: center;
}

.signin-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-md);
}

.signin-card h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.signin-card p {
    font-size: 0.9375rem;
    color: var(--text-muted);
}

/* ===== Google Sign-In Button ===== */
.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    background: var(--accent);
    color: var(--text-on-accent);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    line-height: 1.4;
}

.btn-google:hover {
    background: var(--accent-hover);
    color: var(--text-on-accent);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-google .google-icon {
    flex-shrink: 0;
}

/* ===== Error Page ===== */
.error-page {
    text-align: center;
    padding: 5rem 0;
}

.error-page h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.error-page h1 .error-code {
    color: var(--accent);
}

.error-page p {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* ===== Footer ===== */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    margin-top: auto;
    font-size: 0.875rem;
}

.site-footer .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-footer p {
    color: var(--text-muted);
    margin-bottom: 0;
}

.footer-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.875rem;
}

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

/* ===== Page Header (tool/cluster/subcategory pages) ===== */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.page-header-description {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.page-header-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.page-header-icon svg {
    width: 28px;
    height: 28px;
    color: var(--accent);
    stroke: var(--accent);
}

.page-header-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* ===== Subcategory Cards (cluster page) ===== */
.subcategory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--gap-lg);
    padding: 1rem 0;
}

.subcategory-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
}

.subcategory-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-muted);
    transform: translateY(-2px);
    text-decoration: none;
}

.subcategory-card h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: 0;
    color: var(--text);
}

.subcategory-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    line-height: 1.5;
}

.subcategory-card-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: auto;
    padding-top: 0.25rem;
}

/* ===== Tool Intro (prose block) ===== */
.tool-intro {
    margin-bottom: 1rem;
    position: relative;
}

.tool-intro-text {
    transition: max-height 0.3s ease;
}

.tool-intro-collapsed {
    max-height: 4.5em;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 40%, transparent 100%);
}

.tool-intro-toggle {
    display: inline-flex;
    align-items: center;
    margin-top: 0.25rem;
    padding: 0.25rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.tool-intro-toggle:hover {
    background: var(--accent-light);
    border-color: var(--accent);
}

.prose {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text-secondary);
}

.prose p {
    margin-bottom: 1em;
}

.prose ul,
.prose ol,
.legal-content ul,
.legal-content ol {
    margin-bottom: 1em;
    padding-left: 1.5em;
}

.prose li,
.legal-content li {
    margin-bottom: 0.25em;
}

/* ===== Tool Interface (inputs + button) ===== */
.tool-interface .card {
    padding: 2rem;
}

.tool-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.tool-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.tool-field label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.tool-field input:not([type="file"]),
.tool-field select,
.tool-field textarea {
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
    width: 100%;
}

.tool-field input:not([type="file"]):focus,
.tool-field select:focus,
.tool-field textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.tool-field textarea {
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.tool-field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

/* ===== Grouped Tool Inputs ===== */
.tool-inputs-grouped {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tool-input-group {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.25rem 1rem;
    margin: 0;
    background: var(--bg);
}

.tool-input-group-label {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    padding: 0 0.5rem;
    margin: 0;
}

.tool-input-group-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.tool-input-group-fields .tool-field:has(textarea) {
    grid-column: 1 / -1;
}

/* ===== File Drop Zone (styled file input) ===== */
.tool-field:has(.file-drop-zone) {
    grid-column: 1 / -1;
}

.file-drop-zone {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.file-drop-zone:hover,
.file-drop-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-light);
}

.file-drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    pointer-events: none;
}

.file-drop-zone-content svg {
    color: var(--accent);
}

.file-drop-zone-text {
    font-size: 0.875rem;
}

.file-drop-zone-text strong {
    color: var(--accent);
}

.file-drop-zone-hint {
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
}

.file-drop-zone-selected {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
}

.file-drop-zone-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    word-break: break-all;
}

.file-drop-zone-clear {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 1.5rem;
    height: 1.5rem;
    font-size: 1rem;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 3;
    position: relative;
    transition: color 0.15s, border-color 0.15s;
}

.file-drop-zone-clear:hover {
    color: #ef4444;
    border-color: #ef4444;
}

.file-drop-zone.has-file .file-drop-zone-content {
    display: none;
}

.file-drop-zone.has-file .file-drop-zone-selected {
    display: flex !important;
}

/* ===== Tool Results (output display) ===== */
.tool-results-section {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.tool-results-section.has-results {
    opacity: 1;
}

.tool-results-section .card {
    padding: 2rem;
}

.tool-outputs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
}

.tool-output-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tool-output-field label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tool-output-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.3;
}

.tool-output-field textarea {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    resize: vertical;
    width: 100%;
    outline: none;
    line-height: 1.5;
}

/* ===== HTML Output (rich tool output container) ===== */

/* When a tool-outputs grid contains an html output, let it span full width */
.tool-outputs:has(.tool-output-html) {
    display: block;
}

.tool-output-field:has(.tool-output-html) > label {
    display: none;
}

.tool-output-html {
    width: 100%;
}

/* ===== Invoice Generator ===== */

/* Sectioned form layout (replaces flat grid) */
.invoice-form-sections {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.invoice-section {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
}

.invoice-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.invoice-section-title {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 0 0 0.75rem 0;
}

.invoice-section-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.invoice-section-fields--full {
    grid-template-columns: 1fr;
}

/* Line items input table */
.invoice-line-items {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
}

/* Section title inside line items uses .invoice-section-title */

.invoice-items-table {
    width: 100%;
    border-collapse: collapse;
}

.invoice-items-table th {
    text-align: left;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.375rem 0.5rem;
    border-bottom: 2px solid var(--border);
}

.invoice-items-table td {
    padding: 0.375rem 0.5rem;
    vertical-align: middle;
}

.invoice-items-table input {
    padding: 0.5rem 0.625rem;
    font-size: 0.875rem;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    width: 100%;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.invoice-items-table input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.invoice-items-table .col-desc { width: 40%; }
.invoice-items-table .col-qty { width: 15%; }
.invoice-items-table .col-rate { width: 20%; }
.invoice-items-table .col-amt { width: 18%; text-align: right; font-weight: 600; font-size: 0.875rem; }
.invoice-items-table .col-action { width: 7%; text-align: center; }

.invoice-btn-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: color 0.15s ease;
    display: inline-flex;
    align-items: center;
}

.invoice-btn-remove:hover {
    color: #ef4444;
}

.invoice-btn-add {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    background: transparent;
    border: 1px dashed var(--accent);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.invoice-btn-add:hover {
    background: var(--accent-light);
}

/* Invoice preview document — always light for print/PDF */
.invoice-doc {
    background: #ffffff;
    color: #111827;
    padding: 2.5rem;
    border-radius: var(--radius-md);
    border: 1px solid #e5e7eb;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.invoice-doc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.invoice-doc-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    color: #111827;
    margin: 0 0 0.25rem 0;
}

.invoice-doc-meta {
    text-align: right;
    font-size: 0.875rem;
    color: #6b7280;
}

.invoice-doc-meta strong {
    color: #111827;
}

.invoice-doc-addresses {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.invoice-doc-address h3 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    margin: 0 0 0.375rem 0;
}

.invoice-doc-address p {
    margin: 0;
    color: #374151;
    white-space: pre-line;
}

.invoice-doc-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.invoice-doc-table th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    padding: 0.75rem 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.invoice-doc-table th:last-child,
.invoice-doc-table td:last-child {
    text-align: right;
}

.invoice-doc-table td {
    padding: 0.625rem 0.5rem;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
}

.invoice-doc-totals {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
}

.invoice-doc-totals table {
    border-collapse: collapse;
    min-width: 240px;
}

.invoice-doc-totals td {
    padding: 0.375rem 0.5rem;
    font-size: 0.9375rem;
}

.invoice-doc-totals td:first-child {
    text-align: right;
    color: #6b7280;
    padding-right: 1.5rem;
}

.invoice-doc-totals td:last-child {
    text-align: right;
    font-weight: 600;
    color: #111827;
}

.invoice-doc-totals .invoice-total-final td {
    font-size: 1.125rem;
    font-weight: 700;
    border-top: 2px solid #e5e7eb;
    padding-top: 0.75rem;
}

.invoice-doc-totals .invoice-total-final td:last-child {
    color: #2563eb;
}

.invoice-doc-notes {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
    font-size: 0.875rem;
    color: #6b7280;
}

.invoice-doc-notes h3 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    margin: 0 0 0.375rem 0;
}

.invoice-doc-notes p {
    margin: 0;
    white-space: pre-line;
}

.invoice-doc-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
    text-align: center;
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Invoice actions (PDF download button) */
.invoice-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .invoice-doc-header {
        flex-direction: column;
        gap: 1rem;
    }

    .invoice-doc-meta {
        text-align: left;
    }

    .invoice-doc-addresses {
        grid-template-columns: 1fr;
    }

    .invoice-doc {
        padding: 1.5rem;
    }

    .invoice-items-table {
        font-size: 0.8125rem;
    }

    .invoice-items-table .col-desc { width: auto; }
}

/* ===== How-To Steps ===== */
.how-to-list {
    list-style: none;
    counter-reset: howto;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.how-to-list li {
    counter-increment: howto;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.how-to-list li::before {
    content: counter(howto);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 0.8125rem;
    font-weight: 700;
}

/* ===== FAQ ===== */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

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

.faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.faq-item h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: var(--text);
}

.faq-item p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    line-height: 1.6;
}

/* ===== Guide FAQ (dl/dt/dd) ===== */
.guide-faq dl {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.guide-faq dt {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 1.25rem;
}

.guide-faq dt:first-child {
    margin-top: 0;
}

.guide-faq dd {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0.375rem 0 0 0;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.guide-faq dd:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* ===== Guide Callouts ===== */

/* Shared callout base */
.callout {
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.callout p {
    margin: 0;
}

.callout p + p {
    margin-top: 0.5rem;
}

.callout-label {
    display: block;
    font-weight: 700;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.375rem;
}

/* Tip — green accent */
.callout-tip {
    background: var(--accent-light);
    border-left: 4px solid var(--accent);
}

.callout-tip .callout-label {
    color: var(--accent-hover);
}

/* Info — blue */
.callout-info {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
}

.callout-info .callout-label {
    color: #2563eb;
}

/* Warning — amber */
.callout-warning {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
}

.callout-warning .callout-label {
    color: #d97706;
}

/* Pull quote */
.callout-quote {
    border-left: 4px solid var(--accent);
    background: var(--bg-card);
    padding: 1.25rem 1.5rem;
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-style: italic;
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.callout-quote cite {
    display: block;
    margin-top: 0.5rem;
    font-style: normal;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Dark-mode overrides for callout backgrounds */
[data-theme="dark"] .callout-info {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: #60a5fa;
}

[data-theme="dark"] .callout-info .callout-label {
    color: #60a5fa;
}

[data-theme="dark"] .callout-warning {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: #fbbf24;
}

[data-theme="dark"] .callout-warning .callout-label {
    color: #fbbf24;
}

/* ===== Related Tools Grid ===== */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--gap-lg);
}

.tool-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.tool-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-muted);
    transform: translateY(-2px);
    text-decoration: none;
}

.tool-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.tool-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    line-height: 1.5;
}

/* ===== Tool Next/Prev Navigation ===== */
.tool-nav {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 1rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}

.tool-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s ease;
    max-width: 45%;
}

.tool-nav-link:hover {
    background: var(--accent-light);
    text-decoration: none;
}

.tool-nav-next {
    margin-left: auto;
    text-align: right;
}

.tool-nav-arrow {
    font-size: 1.25rem;
    color: var(--accent);
    flex-shrink: 0;
}

.tool-nav-label {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.tool-nav-direction {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tool-nav-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

/* ===== Bridge Links (cross-cluster) ===== */
.bridge-links-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bridge-link {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: all 0.15s ease;
}

.bridge-link:hover {
    border-color: var(--accent-muted);
    background: var(--bg-card-hover);
    text-decoration: none;
}

.bridge-link-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--accent);
}

.bridge-link-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ===== Share Button ===== */
.page-header-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-header-title-row h1 {
    margin-bottom: 0;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
}

.share-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-light);
}

.share-btn.share-copied {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-light);
}

.share-btn svg {
    flex-shrink: 0;
}

/* ===== Bug Report Section ===== */
.bug-report-section {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.bug-report-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    transition: color 0.15s ease;
}

.bug-report-toggle:hover {
    color: var(--accent);
}

.bug-report-toggle svg {
    flex-shrink: 0;
}

.bug-report-form {
    max-width: 560px;
}

.bug-report-form .tool-field {
    margin-bottom: 1rem;
}

.bug-report-form textarea {
    min-height: 100px;
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    resize: vertical;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bug-report-form textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.bug-report-form input[type="file"] {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.bug-report-success {
    padding: 0.75rem 1rem;
    background: var(--accent-light);
    border: 1px solid var(--accent-muted);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: 0.875rem;
    font-weight: 500;
}

.bug-report-error {
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    color: #ef4444;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* ===== Search Dropdown ===== */

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    margin-top: 0.25rem;
    display: none;
}

.search-result-item {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background 0.1s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover,
.search-result-item.active {
    background: var(--bg-card-hover);
    border-left: 3px solid var(--accent);
    padding-left: calc(1rem - 3px);
}

.search-result-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.search-result-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text);
}

.search-result-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-cluster-badge {
    display: inline-block;
    font-size: 0.6875rem;
    padding: 2px 8px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    font-weight: 600;
    white-space: nowrap;
}

.search-no-results {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ===== All Tools Page ===== */

.all-tools-filter-wrapper {
    max-width: 480px;
}

.all-tools-filter {
    width: 100%;
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    outline: none;
}

.all-tools-filter::placeholder {
    color: var(--text-muted);
}

.all-tools-filter:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.all-tools-cluster {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.all-tools-cluster:first-of-type {
    border-top: none;
}

.all-tools-cluster h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.all-tools-cluster h2 a {
    color: var(--text);
    text-decoration: none;
}

.all-tools-cluster h2 a:hover {
    color: var(--accent);
}

.all-tools-subcategory {
    margin-top: 1rem;
    margin-left: 0.5rem;
}

.all-tools-subcategory h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.all-tools-subcategory h3 a {
    color: var(--text);
    text-decoration: none;
}

.all-tools-subcategory h3 a:hover {
    color: var(--accent);
}

.all-tools-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.all-tools-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
}

.all-tools-list li:last-child {
    border-bottom: none;
}

.all-tools-list a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.all-tools-list a:hover {
    text-decoration: underline;
}

.all-tools-list .tool-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ===== Monetization Slots ===== */

/* Ad Slot (placeholder) */
.ad-slot {
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.ad-slot-label {
    position: absolute;
    top: 0.25rem;
    right: 0.5rem;
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ad-slot-placeholder {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Affiliate Block */
.affiliate-block {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.affiliate-block-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--gap-lg);
    box-shadow: var(--shadow-sm);
}

.affiliate-block-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.affiliate-block-product {
    margin-top: 0.5rem;
    font-size: 1.125rem;
}

.affiliate-block-description {
    margin-top: 0.375rem;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.affiliate-block-cta {
    margin-top: 1rem;
    display: inline-flex;
}

/* Email Capture */
.email-capture {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.email-capture-heading {
    font-size: 1.125rem;
}

.email-capture-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
}

.email-capture-form {
    max-width: 480px;
}

.email-capture-input-group {
    display: flex;
    gap: 0.5rem;
}

.email-capture-input {
    flex: 1;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.email-capture-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.email-capture-success {
    padding: 0.75rem 1rem;
    background: var(--accent-light);
    border: 1px solid var(--accent-muted);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: 0.875rem;
    font-weight: 500;
}

.email-capture-error {
    padding: 0.5rem 0;
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* ===== Utilities ===== */
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }

/* ===== Responsive ===== */
@media (max-width: 960px) {
    .search-bar {
        display: none;
    }

    .nav-desktop {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .nav-dropdown-menu {
        min-width: 90vw;
        left: 5vw;
        transform: none;
    }

    .dropdown-enter-start {
        transform: translateY(-8px);
    }

    .dropdown-enter-end {
        transform: translateY(0);
    }

    .dropdown-leave-start {
        transform: translateY(0);
    }

    .dropdown-leave-end {
        transform: translateY(-8px);
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    .hero-stats {
        gap: 1.25rem;
    }

    .bento-grid {
        grid-template-columns: 1fr;
    }

    .bento-grid-3 {
        grid-template-columns: 1fr;
    }

    .nav-dropdown-grid {
        grid-template-columns: 1fr;
    }

    .tool-inputs {
        grid-template-columns: 1fr;
    }

    .tool-input-group-fields {
        grid-template-columns: 1fr;
    }

    .tool-outputs {
        grid-template-columns: 1fr;
    }

    .tool-grid {
        grid-template-columns: 1fr;
    }

    .subcategory-grid {
        grid-template-columns: 1fr;
    }

    .tool-nav {
        flex-direction: column;
    }

    .tool-nav-link {
        max-width: 100%;
    }

    .tool-nav-next {
        text-align: left;
    }

    .page-header-title-row {
        flex-wrap: wrap;
    }

    .email-capture-input-group {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .hero {
        padding: 2rem 0 1.5rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .site-footer .container {
        flex-direction: column;
        text-align: center;
    }

    .cluster-card {
        padding: 1.25rem;
    }

    .mobile-menu-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Embed Code Snippet ─────────────────────────────── */
.embed-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.embed-toggle-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}
.embed-code-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}
.embed-code-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}
.embed-code-snippet {
    position: relative;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) / 2);
    padding: 0.75rem;
    padding-right: 5rem;
    overflow-x: auto;
}
.embed-code-snippet code {
    font-size: 0.75rem;
    word-break: break-all;
    white-space: pre-wrap;
    color: var(--text);
}
.embed-copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: calc(var(--radius) / 2);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}
.embed-copy-btn:hover {
    opacity: 0.9;
}
