/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* Design Tokens & Theme Variables */
:root {
    --font-heading: 'Poppins', 'Segoe UI', Roboto, Arial, sans-serif;
    --font-body: 'Inter', 'Poppins', 'Segoe UI', Roboto, Arial, sans-serif;

    /* Light Theme Palette */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-glow: rgba(37, 99, 235, 0.15);
    --accent: #0f172a;
    --accent-glow: rgba(15, 23, 42, 0.05);
    --border-color: #e2e8f0;
    --card-shadow: 0 4px 20px -2px rgba(148, 163, 184, 0.12), 0 2px 8px -1px rgba(148, 163, 184, 0.08);
    --card-hover-shadow: 0 20px 25px -5px rgba(37, 99, 235, 0.1), 0 10px 10px -5px rgba(37, 99, 235, 0.04);
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(226, 232, 240, 0.8);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

[data-theme="dark"] {
    /* Dark Theme Palette */
    --bg-primary: #090d16;
    --bg-secondary: #0f172a;
    --bg-tertiary: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-glow: rgba(59, 130, 246, 0.25);
    --accent: #f8fafc;
    --accent-glow: rgba(248, 250, 252, 0.1);
    --border-color: #1e293b;
    --card-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
    --card-hover-shadow: 0 20px 25px -5px rgba(59, 130, 246, 0.15), 0 10px 10px -5px rgba(59, 130, 246, 0.08);
    --glass-bg: rgba(15, 23, 42, 0.75);
    --glass-border: rgba(30, 41, 59, 0.8);
}

/* Reset and Global Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body, main, .hero-section {
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    height: 100%;
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
}

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

a:hover {
    color: var(--primary-hover);
}

button {
    cursor: pointer;
    font-family: var(--font-body);
}

/* Container */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Sticky Header Style */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: transparent;
    border-bottom: 1px solid transparent;
    transition: background-color 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
    backdrop-filter: blur(0px);
}

.site-header.scrolled {
    background-color: var(--glass-bg);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4.5rem;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 800;
    font-size: clamp(1.1rem, 3.5vw, 1.5rem);
    font-family: var(--font-heading);
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
}

.logo-svg {
    height: 42px;
    width: 42px;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Navigation & Mega Menu */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    list-style: none;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s ease;
}

.nav-link svg {
    transition: transform 0.25s ease-in-out;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
}

.nav-link.active svg {
    transform: rotate(180deg);
}

@media (min-width: 993px) {
    .nav-item:hover .nav-link svg {
        transform: rotate(180deg);
    }
}

/* Mega Menu Container */
.mega-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 90vw;
    max-width: 1100px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: var(--card-hover-shadow);
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 1010;
}

.nav-item:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    width: 100%;
}

.mega-menu-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.mega-menu-card-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.mega-menu-card-emoji {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.mega-menu-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.mega-menu-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.mega-menu-card-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.mega-menu-card-arrow {
    font-size: 1.1rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease, color 0.2s ease;
}

.mega-menu-card:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.mega-menu-card:hover .mega-menu-card-title {
    color: var(--primary);
}

.mega-menu-card:hover .mega-menu-card-arrow {
    color: var(--primary);
    transform: translateX(4px);
}

.mega-menu-card:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Header Utilities */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Search Bar style */
.search-wrapper {
    position: relative;
    width: 200px;
    transition: width 0.3s ease;
}

.search-wrapper:focus-within {
    width: 300px;
}

.search-input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.25rem;
    font-family: var(--font-body);
    font-size: 0.875rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s, background-color 0.2s;
}

.search-input:focus {
    border-color: var(--primary);
    background-color: var(--bg-secondary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    width: 0.9rem;
    height: 0.9rem;
}

/* Auto-suggest Search Results */
.search-results-dropdown {
    position: absolute;
    top: 110%;
    right: 0;
    width: 350px;
    max-height: 400px;
    overflow-y: auto;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--card-hover-shadow);
    z-index: 1050;
    display: none;
}

.search-result-item {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.search-result-item:hover, .search-result-item.highlighted {
    background-color: var(--bg-tertiary);
}

.search-result-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.search-result-cat {
    font-size: 0.75rem;
    color: var(--primary);
    text-transform: uppercase;
    font-weight: 700;
}

/* Theme Switcher Toggle */
.theme-toggle-btn {
    background: none;
    border: 1px solid var(--border-color);
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--text-secondary);
    transition: border-color 0.2s, background-color 0.2s;
}

.theme-toggle-btn:hover {
    border-color: var(--primary);
    background-color: var(--bg-tertiary);
    color: var(--primary);
}

.theme-toggle-btn svg {
    width: 1.15rem;
    height: 1.15rem;
}

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

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

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

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    width: 2.25rem;
    height: 2.25rem;
    color: var(--text-primary);
}

/* Hero Section */
.hero-section {
    position: relative;
    padding: 7rem 0 5rem 0;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 4rem;
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hero-badge {
    align-self: flex-start;
    padding: 0.35rem 0.85rem;
    background-color: var(--primary-glow);
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-badge-pulse {
    width: 6px;
    height: 6px;
    background-color: var(--primary);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0.5; }
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.15;
    font-family: var(--font-heading);
    font-weight: 800;
}

.hero-title span {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

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

.btn-secondary:hover {
    background-color: var(--bg-tertiary);
    transform: translateY(-2px);
    border-color: var(--text-muted);
}

/* Animated Icons / Illustration Container */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.hero-illustration {
    max-width: 420px;
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 15px 30px rgba(15, 23, 42, 0.08));
}

/* 3D Floating Icons */
.icon-3d-scene {
    position: absolute;
    width: 250px;
    height: 250px;
    transform-style: preserve-3d;
    animation: sceneFloat 6s ease-in-out infinite;
}

.icon-3d-finance {
    top: 5%;
    left: 10%;
    animation-delay: 0s;
}

.icon-3d-marketing {
    bottom: 5%;
    right: 5%;
    animation-delay: -2s;
}

.icon-3d-inventory {
    top: 30%;
    right: 35%;
    animation-delay: -4s;
}

/* Float Animations */
@keyframes sceneFloat {
    0%, 100% { transform: translateY(0px) rotateX(10deg) rotateY(10deg); }
    50% { transform: translateY(-25px) rotateX(12deg) rotateY(12deg); }
}

/* CSS 3D Shapes */
.shape-coin {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, #fbbf24 30%, #d97706 90%);
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.6), inset 0 0 15px rgba(255, 255, 255, 0.6);
    transform-style: preserve-3d;
    animation: rotate3D 5s linear infinite;
    display: grid;
    place-items: center;
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 3px solid #fef08a;
}

.shape-prism {
    width: 80px;
    height: 120px;
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.6);
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    transform-style: preserve-3d;
    animation: rotate3DY 6s linear infinite;
}

.shape-cube {
    width: 90px;
    height: 90px;
    transform-style: preserve-3d;
    animation: rotateCube 8s linear infinite;
}

.cube-face {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(37, 99, 235, 0.25);
    border: 2px solid var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
    backdrop-filter: blur(4px);
}

/* Cube Transforms */
.cube-front  { transform: rotateY(  0deg) translateZ(45px); }
.cube-back   { transform: rotateY(180deg) translateZ(45px); }
.cube-right  { transform: rotateY( 90deg) translateZ(45px); }
.cube-left   { transform: rotateY(-90deg) translateZ(45px); }
.cube-top    { transform: rotateX( 90deg) translateZ(45px); }
.cube-bottom { transform: rotateX(-90deg) translateZ(45px); }

@keyframes rotate3D {
    0% { transform: rotateY(0deg) rotateX(15deg); }
    100% { transform: rotateY(360deg) rotateX(15deg); }
}

@keyframes rotate3DY {
    0% { transform: rotateX(0deg) rotateY(15deg); }
    100% { transform: rotateX(360deg) rotateY(15deg); }
}

@keyframes rotateCube {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}

/* Sections */
.section {
    padding: 5rem 0;
}

.section-bg-tertiary {
    background-color: var(--bg-tertiary);
}

.section-header {
    text-align: center;
    max-width: 650px;
    margin: 0 auto 3.5rem auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 800;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Premium Cards */
.card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.85rem;
    padding: 1.75rem;
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-hover-shadow);
    border-color: var(--primary);
}

.card-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    background-color: var(--primary-glow);
    display: grid;
    place-items: center;
    color: var(--primary);
    transition: background-color 0.3s, color 0.3s;
}

.card:hover .card-icon {
    background-color: var(--primary);
    color: #ffffff;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex-grow: 1;
}

.card-link {
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Categories dashboard list */
.categories-showcase {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.cat-box {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.cat-box:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: var(--card-shadow);
}

.cat-box-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background-color: var(--primary-glow);
    display: grid;
    place-items: center;
    color: var(--primary);
}

.cat-box-info {
    display: flex;
    flex-direction: column;
}

.cat-box-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.cat-box-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Why Choose Us & Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.stat-item {
    text-align: center;
    background-color: var(--bg-secondary);
    padding: 2rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--primary);
}

.stat-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Accordion FAQs */
.accordion {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.accordion-item {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: border-color 0.2s;
}

.accordion-item:hover {
    border-color: var(--primary);
}

.accordion-header {
    width: 100%;
    background: none;
    border: none;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.accordion-icon {
    font-size: 1.5rem;
    font-weight: 400;
    transition: transform 0.2s;
    color: var(--text-muted);
}

.accordion-item.active .accordion-icon {
    transform: rotate(45deg);
    color: var(--primary);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 1.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.accordion-item.active .accordion-content {
    padding: 0 1.5rem 1.5rem 1.5rem;
}

/* Tool Interface Structure */
.tool-page-grid {
    display: grid;
    grid-template-columns: 1.7fr 1.3fr;
    gap: 2.5rem;
    margin-bottom: 4rem;
}

.tool-interface-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: var(--card-shadow);
}

.tool-results-card {
    background-color: var(--bg-secondary);
    border: 2px solid var(--primary);
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: var(--card-hover-shadow);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: fit-content;
}

.tool-meta {
    margin-bottom: 2rem;
}

.tool-title {
    font-size: clamp(1.75rem, 4.5vw, 2.75rem);
    font-family: var(--font-heading);
    font-weight: 800;
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    max-width: 100%;
    word-wrap: break-word;
}

.tool-description {
    color: var(--text-secondary);
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    max-width: 800px;
    line-height: 1.5;
}

.tool-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.tool-breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
}

.tool-breadcrumbs a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.tool-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s, background-color 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
    background-color: var(--bg-secondary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.validation-error {
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: 0.25rem;
    display: none;
}

.tool-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Results Display */
.results-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
}

.results-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: var(--bg-tertiary);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.result-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.result-value {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-primary);
}

.result-value.highlighted {
    color: var(--primary);
    font-size: 1.35rem;
}

/* Document Tool Specialized Layout */
.document-editor-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.document-preview-pane {
    background-color: #ffffff;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    padding: 3rem;
    font-family: var(--font-body);
    min-height: 800px;
    position: relative;
}

.document-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.document-table th {
    background-color: #f1f5f9;
    color: #1e293b;
    font-weight: 700;
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.document-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.document-table input {
    border: 1px solid transparent;
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
    font-family: var(--font-body);
    width: 100%;
}

.document-table input:focus {
    border-color: #3b82f6;
    background-color: #f8fafc;
    outline: none;
}

/* SEO Content Area on Tool Pages */
.seo-content-container {
    max-width: 850px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.seo-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.seo-section h2 {
    font-size: 1.75rem;
    border-bottom: 2px solid var(--primary-glow);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.seo-section p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.75;
}

.seo-section ul, .seo-section ol {
    margin-left: 1.5rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Social Share Links */
.share-buttons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.share-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.share-btn {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: none;
    display: grid;
    place-items: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.share-btn:hover {
    color: #ffffff;
    transform: translateY(-2px);
}

.share-facebook:hover { background-color: #1877f2; border-color: #1877f2; }
.share-x:hover { background-color: #000000; border-color: #000000; }
.share-linkedin:hover { background-color: #0a66c2; border-color: #0a66c2; }
.share-email:hover { background-color: var(--primary); border-color: var(--primary); }

/* Comment Box Placeholder */
.comment-section-placeholder {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 2rem;
    margin-top: 3rem;
}

.comment-box-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.comment-textarea {
    width: 100%;
    min-height: 100px;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: var(--font-body);
    resize: vertical;
    outline: none;
    margin-bottom: 1rem;
}

/* Call to Action Container */
.cta-banner {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 1rem;
    padding: 4rem 2rem;
    text-align: center;
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-top: 4rem;
}

.cta-banner h2 {
    color: #ffffff;
    font-size: 2.5rem;
}

.cta-banner p {
    color: rgba(255, 255, 255, 0.85);
    max-width: 600px;
    font-size: 1.1rem;
}

/* Footer layout */
.site-footer {
    background-color: #090d16;
    color: #94a3b8;
    border-top: 1px solid #1e293b;
    margin-top: auto;
    padding: 5rem 0 2rem 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.9fr 0.9fr 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.footer-col-title {
    color: #f8fafc;
    font-size: 1.05rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-col-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 2rem;
    height: 2px;
    background-color: var(--primary);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 1.35rem;
    font-weight: 800;
    color: #f8fafc;
}

.site-footer .logo-svg .logo-spine,
.site-footer .logo-svg .logo-bar-bot {
    fill: #f8fafc !important;
}

.footer-desc {
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-socials {
    display: flex;
    gap: 0.75rem;
}

.footer-social-link {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background-color: #1e293b;
    display: grid;
    place-items: center;
    color: #94a3b8;
    transition: all 0.2s;
}

.footer-social-link:hover {
    color: #ffffff;
    transform: translateY(-2px);
}

.social-facebook:hover { background-color: #1877f2; }
.social-x:hover { background-color: #000000; }
.social-instagram:hover { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.social-linkedin:hover { background-color: #0a66c2; }

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    color: #94a3b8;
    font-size: 0.9rem;
    transition: color 0.2s, padding-left 0.2s;
}

.footer-links a:hover {
    color: var(--primary);
    padding-left: 4px;
}

.footer-bottom {
    border-top: 1px solid #1e293b;
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.footer-bottom-links {
    display: flex;
    gap: 1.5rem;
}

.footer-bottom-links a {
    color: #94a3b8;
}

.footer-bottom-links a:hover {
    color: #f8fafc;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--primary);
    color: #ffffff;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    display: grid;
    place-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
    background-color: var(--primary-hover);
}

/* Sidebar and Main Layout Column System */
.tool-layout-row {
    display: flex;
    gap: 2.5rem;
    margin-bottom: 4rem;
    align-items: flex-start;
    position: relative;
}

.tool-main-col {
    flex: 0 0 76%;
    width: 76%;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.tool-sidebar-col {
    flex: 0 0 24%;
    width: 24%;
    position: sticky;
    top: 6rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
    padding-right: 0.5rem;
}

.tool-sidebar-col::-webkit-scrollbar {
    width: 4px;
}

.tool-sidebar-col::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

.sidebar-widget {
    transition: transform 0.2s, border-color 0.2s;
}

.sidebar-widget:hover {
    border-color: var(--primary) !important;
}

.sidebar-links-list a:hover {
    color: var(--primary) !important;
    padding-left: 4px;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .tool-main-col {
        flex: 0 0 65%;
        width: 65%;
    }
    
    .tool-sidebar-col {
        flex: 0 0 35%;
        width: 35%;
        position: sticky;
        top: 5.5rem;
    }

    .hero-grid {
        grid-template-columns: 1.1fr 0.9fr;
        gap: 2.5rem;
    }
    
    .hero-visual {
        height: auto;
    }
    
    .tool-page-grid {
        grid-template-columns: 1fr;
    }
    
    .mega-menu-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 991px) {
    .tool-layout-row {
        flex-direction: column;
    }
    
    .tool-main-col, .tool-sidebar-col {
        flex: 0 0 100%;
        width: 100%;
        position: static;
        max-height: none;
        overflow-y: visible;
    }
}

@media (max-width: 992px) {
    .site-header {
        background-color: var(--glass-bg);
        border-bottom: 1px solid var(--border-color);
        backdrop-filter: blur(16px);
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: 4.5rem;
        left: 0;
        width: 100%;
        height: calc(100vh - 4.5rem);
        background-color: var(--bg-secondary);
        flex-direction: column;
        align-items: stretch;
        padding: 2rem;
        gap: 1.5rem;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: var(--card-shadow);
        overflow-y: auto;
    }
    
    .nav-menu.open {
        transform: translateX(0);
    }
    
    .nav-item:hover .mega-menu {
        display: none;
    }
    
    .mega-menu {
        position: static;
        width: 100%;
        max-width: none;
        transform: translateY(-10px);
        opacity: 0;
        visibility: hidden;
        display: block;
        max-height: 0;
        overflow: hidden;
        padding: 0;
        box-shadow: none;
        border: none;
        background: transparent;
        transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, transform 0.25s ease;
        pointer-events: none;
    }
    
    .mega-menu.mobile-expanded {
        max-height: 1000px;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        padding: 0.75rem 0;
        pointer-events: auto;
    }
    
    .mega-menu-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .mega-menu-card {
        padding: 0.75rem 1rem;
        background-color: var(--bg-tertiary);
        border: 1px solid var(--border-color);
        box-shadow: none;
    }
    
    .mega-menu-card-emoji {
        font-size: 1.25rem;
    }
    
    .mega-menu-card-title {
        font-size: 0.85rem;
    }
    
    .mega-menu-card-count {
        font-size: 0.75rem;
    }
    
    .nav-item > a[href*="categories.html"] svg {
        transition: transform 0.2s ease;
    }
    
    .nav-item > a[href*="categories.html"].active svg {
        transform: rotate(180deg);
    }
    
    .search-wrapper {
        width: 150px;
    }
    
    .search-wrapper:focus-within {
        width: 180px;
    }
    
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .hero-content {
        order: 1;
        align-items: center;
    }
    
    .hero-visual {
        order: 2;
        height: auto;
    }
    
    .hero-illustration {
        max-width: 280px;
    }
    
    .hero-badge {
        align-self: center;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .categories-showcase {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .footer-bottom-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .categories-showcase {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Print Styling */
@media print {
    /* Hide everything on the page when printing clone is active */
    body.printing-active > :not(#print-report) {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
    }
    
    body.printing-active {
        background: #ffffff !important;
        color: #000000 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Style the isolated print-report container for A4 page flow */
    body.printing-active #print-report {
        display: block !important;
        position: relative !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        box-shadow: none !important;
        border: none !important;
        visibility: visible !important;
        transform: none !important;
        top: 0 !important;
        left: 0 !important;
        page-break-before: avoid !important;
        break-before: avoid !important;
    }

    body.printing-active #print-report * {
        visibility: visible !important;
        max-height: none !important;
        overflow: visible !important;
    }

    /* Force background colors and gradients to print correctly */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    /* Adjust document layout margins and sizes */
    @page {
        size: A4 portrait;
        margin: 1.5cm;
    }
    
    /* Dynamic landscape orientation rules */
    body.print-landscape {
        @page {
            size: A4 landscape !important;
            margin: 1cm !important;
        }
    }
    
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 11pt !important;
        line-height: 1.5 !important;
    }
    
    /* Prevent bad page breaks inside critical elements */
    #print-report,
    #print-report table,
    #print-report tr,
    #print-report section,
    .results-grid,
    .calculations-breakdown,
    .summary-card,
    .audit-grid,
    .totals-row,
    .signature-area {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
    
    /* Prevent page break before the first child of the print area */
    #print-report > *:first-child {
        page-break-before: avoid !important;
        break-before: avoid !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    /* Repeat table headers across multi-page prints */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
    }
    
    thead {
        display: table-header-group !important;
    }
    
    tfoot {
        display: table-footer-group !important;
    }
    
    tr {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    /* Disable animations, transitions, and hover styles */
    * {
        animation: none !important;
        transition: none !important;
        box-shadow: none !important;
        text-shadow: none !important;
        filter: none !important;
        transform: none !important;
    }
}

/* Dashboard Homepage Styles */
.homepage-main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.dashboard-search-container {
    margin-bottom: 2.5rem;
    width: 100%;
}

.search-box-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 0.25rem 0.5rem;
    box-shadow: var(--card-shadow);
    transition: focus-within 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.search-box-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.search-box-icon {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--text-muted);
    margin-left: 1.25rem;
}

.dashboard-search-input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 1.25rem 1rem;
    font-size: 1.1rem;
    font-family: var(--font-body);
    color: var(--text-primary);
    outline: none;
}

.clear-search-btn {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-search-btn:hover {
    color: var(--text-primary);
}

/* Category Card */
.dashboard-cat-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 2.5rem;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.dashboard-cat-header {
    display: grid;
    grid-template-areas: "icon title badge right";
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.dashboard-cat-left {
    display: contents; /* Grid child leveling wrapper */
}

.dashboard-cat-title {
    grid-area: title;
    font-size: 20px;
    line-height: 1.3;
    max-height: 2.6em; /* 1.3 * 2 lines */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.dashboard-cat-count {
    grid-area: badge;
    font-size: 0.8rem;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    height: fit-content;
    align-self: center;
}

.dashboard-cat-right {
    grid-area: right;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    justify-self: end;
}

.dashboard-view-all-btn {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    transition: color 0.2s;
    text-decoration: none;
}

.dashboard-view-all-btn:hover {
    color: var(--primary-hover);
}

.dashboard-collapse-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.dashboard-collapse-btn svg {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.3s;
}

.dashboard-cat-card.collapsed .dashboard-collapse-btn svg {
    transform: rotate(-90deg);
}

.dashboard-cat-card.collapsed .dashboard-tool-grid {
    display: none;
}

/* Tool Grid & Cards */
.dashboard-tool-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    transition: all 0.3s;
}

@media (min-width: 1440px) {
    .dashboard-tool-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1024px) {
    .dashboard-tool-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-tool-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .dashboard-tool-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-tool-card {
    display: flex;
    flex-direction: column;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    height: 100%;
}

.dashboard-tool-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-hover-shadow);
    border-color: var(--primary);
}

.dashboard-tool-card-icon {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.dashboard-tool-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.dashboard-tool-card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.highlight {
    background-color: rgba(251, 191, 36, 0.3);
    padding: 0.1rem 0.2rem;
    border-radius: 4px;
    color: inherit;
}

/* Inline SVG Icon Wrapper & Icon styling */
.icon-svg-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background-color: var(--primary-glow);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
}

/* On card hover, elevate icon container */
.dashboard-tool-card:hover .icon-svg-wrapper,
.category-tool-card:hover .icon-svg-wrapper {
    background-color: var(--primary);
    color: #ffffff;
    transform: scale(1.05);
}

.svg-icon {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2px;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: inline-block;
    vertical-align: middle;
}

/* Category header icons */
.dashboard-cat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background-color: var(--primary-glow);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.dashboard-cat-icon .svg-icon {
    width: 20px;
    height: 20px;
}

/* --- Mobile Responsiveness and Layout Fixes --- */

/* Responsive category header title scaling */
@media (max-width: 992px) {
    .dashboard-cat-title {
        font-size: 18px;
    }
}

@media (max-width: 576px) {
    .dashboard-cat-header {
        grid-template-areas: 
            "icon title title title"
            "badge badge right right";
        grid-template-columns: auto minmax(0, 1fr) auto auto;
        gap: 0.75rem 0.5rem;
    }
    
    .dashboard-cat-title {
        font-size: 16px;
    }

    .dashboard-cat-count {
        justify-self: start;
        margin-top: 0.25rem;
    }
    
    .dashboard-cat-right {
        justify-self: end;
        margin-top: 0.25rem;
    }
}

/* Tool card padding overrides for tablets and mobile */
@media (max-width: 992px) {
    .dashboard-tool-card {
        padding: 16px;
    }
}

@media (max-width: 576px) {
    .dashboard-tool-card {
        padding: 14px;
    }
}

/* Prevents logo wrapping with responsive font sizing */
.logo-link {
    white-space: nowrap !important;
    font-size: clamp(1.1rem, 3.5vw, 1.5rem) !important;
}

/* Hide header search wrapper on small devices to prevent overflow */
@media (max-width: 576px) {
    .search-wrapper {
        display: none !important;
    }
    .header-actions {
        gap: 0.5rem !important;
    }
}

/* Enforce 44x44px minimum touch targets on interactive controls */
.theme-toggle-btn, 
.mobile-menu-toggle {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* Sitemap and Explorer Grids responsive styles */
.sitemap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

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

/* --- Redesigned Category Tool Grid & Cards --- */
.category-tool-grid-wrapper {
    margin-bottom: 3rem;
}

.dashboard-tool-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    transition: all 0.3s ease;
}

@media (min-width: 1200px) {
    .dashboard-tool-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 24px;
    }
}

@media (max-width: 1199px) and (min-width: 992px) {
    .dashboard-tool-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 24px;
    }
}

@media (max-width: 991px) and (min-width: 576px) {
    .dashboard-tool-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (max-width: 575px) {
    .dashboard-tool-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

.category-tool-card {
    display: flex;
    flex-direction: column;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem;
    height: 250px; /* Uniform height within 220-260px range */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.category-tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: var(--primary);
}

.category-tool-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.category-tool-card-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background-color: var(--primary-glow);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.category-tool-card:hover .category-tool-card-icon-wrapper {
    background-color: var(--primary);
    color: #ffffff;
}

.category-tool-card-icon-wrapper svg {
    width: 18px;
    height: 18px;
}

.category-tool-card-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.category-tool-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.6em; /* Safe height for up to 2 lines */
}

.category-tool-card-desc {
    font-size: 0.825rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em; /* Safe height for up to 2 lines */
    margin-bottom: 0.75rem;
}

.category-tool-card-spacer {
    flex-grow: 1;
}

.category-tool-card-btn {
    width: 100%;
    min-height: 38px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    padding: 0.5rem 1rem !important;
    border-radius: 8px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    align-self: stretch;
}

/* Prevent horizontal overflow scrolling across all viewports */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* --- Mobile Responsiveness and Touch Target Overrides for Tool Pages --- */
@media (max-width: 768px) {
    .tool-page-grid {
        gap: 1.5rem !important;
        margin-bottom: 2.5rem !important;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 16px !important;
    }
    
    .tool-title {
        line-height: 1.2 !important;
        margin-bottom: 0.5rem !important;
    }
    
    .tool-meta {
        margin-bottom: 1.5rem !important;
    }

    .tool-interface-card, 
    .tool-results-card {
        padding: 1.25rem !important;
        border-radius: 0.75rem !important;
    }

    .form-control,
    .btn,
    select,
    input[type="number"],
    input[type="text"] {
        min-height: 44px !important;
        font-size: 16px !important; /* Prevents auto-zoom on iOS */
    }

    /* Stack buttons for comfortable mobile touch targets */
    .tool-form button,
    .tool-form .btn,
    .form-actions button,
    .form-actions .btn {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
    }
    
    /* Spacing adjustments */
    main.container {
        padding-top: 1.5rem !important;
        padding-bottom: 3rem !important;
    }
    
    .seo-section {
        padding: 0.5rem 0 !important;
    }
}

/* --- Google AdSense Reusable Ad Slot --- */
.ad-slot-inline {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
    margin: 20px 0;
    padding: 16px;
    text-align: center;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    min-height: 90px;
    height: auto;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

@media (max-width: 575px) {
    .ad-slot-inline {
        min-height: 75px;
        margin: 16px 0;
        padding: 12px;
    }
}

.adsense-placeholder {
    width: 100%;
    padding: 12px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    box-sizing: border-box;
}

/* --- Premium Financial Dashboard Layout Styles --- */
.financial-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.financial-hero {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 0.5rem;
}

.financial-hero h1 {
    font-size: 2.25rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-family: var(--font-heading);
}

.financial-hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin: 0;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 1.8fr;
    gap: 1.5rem;
}

@media (max-width: 992px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
}

.dashboard-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.75rem;
    box-sizing: border-box;
}

.dashboard-card.highlighted {
    border-color: var(--primary);
    box-shadow: 0 4px 20px var(--primary-glow);
}

.dashboard-card h3 {
    font-size: 1.25rem;
    margin-top: 0;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    font-family: var(--font-heading);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 576px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

.metric-card {
    background-color: var(--bg-tertiary);
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-sizing: border-box;
    border: 1px solid transparent;
}

.metric-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.metric-card.highlighted {
    background-color: var(--primary-glow);
    border-color: rgba(37, 99, 235, 0.2);
}

.metric-card.highlighted .metric-value {
    color: var(--primary);
}

.chart-box {
    margin-bottom: 1.5rem;
    position: relative;
}

.chart-box canvas {
    width: 100%;
    height: 250px;
    border-radius: 0.5rem;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 250px;
    background-color: var(--bg-tertiary);
    border-radius: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    text-align: center;
    padding: 2rem;
    border: 2px dashed var(--border-color);
    box-sizing: border-box;
}

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

.breakdown-table-wrapper {
    overflow-x: auto;
    margin-top: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
}

.breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.breakdown-table th {
    background-color: var(--bg-tertiary);
    padding: 0.75rem 1rem;
    font-weight: 600;
    text-align: left;
    color: var(--text-primary);
}

.breakdown-table td {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.insights-box {
    margin-top: 1.5rem;
    background-color: var(--bg-tertiary);
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-sizing: border-box;
}

.insights-box h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-family: var(--font-heading);
    color: var(--text-primary);
}

.insights-list {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.insights-list li {
    margin-bottom: 0.5rem;
}

.export-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.export-actions .btn {
    flex: 1;
}

.reference-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    .reference-grid {
        grid-template-columns: 1fr;
    }
}

.formula-card, .faq-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.75rem;
    box-sizing: border-box;
}

.formula-card h3, .faq-card h3 {
    margin-top: 0;
    margin-bottom: 1.25rem;
    font-size: 1.25rem;
    font-family: var(--font-heading);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    color: var(--text-primary);
}

.formula-card code {
    background-color: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: Consolas, monospace;
    font-size: 0.95rem;
    color: var(--primary);
}

.faq-item {
    margin-bottom: 1.25rem;
}

.faq-question {
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
}

.faq-answer {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

i, svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

button i {
    pointer-events: none;
}

.button-icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}



