:root {
    --primary-color: #0d9488;
    --primary-hover: #0f766e;
    --bg-color: #ecfdf5;
    --text-color: #0f172a;
    --text-muted: #475569;
    --border-color: #a7f3d0;
    --card-bg: #ffffff;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --success-color: #22c55e;
}

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

html,
body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

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

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
}

/* Header & Navigation */
.navbar {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 75px;
    display: flex;
    align-items: center;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b;
}

.logo .text-primary {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-links li a {
    font-weight: 600;
    color: #475569;
    transition: 0.3s;
}

.nav-links li a:hover,
.nav-links li a.active {
    color: var(--primary-color);
}

.mobile-menu-toggle {
    display: none;
    background: #f1f5f9;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    font-size: 1.25rem;
    color: var(--primary-color);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

/* Main Layout */
.main-layout {
    display: flex;
    gap: 30px;
    margin: 40px auto;
    align-items: start;
}

.content-area {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 320px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
}

/* Tool Cards & Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.tool-card {
    background: white;
    border-radius: 16px;
    padding: 25px 15px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: 0.3s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.icon-wrap {
    width: 48px;
    height: 48px;
    margin: 0 auto 15px;
    border-radius: 12px;
    background: #eef2ff;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Widgets */
.widget {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.widget-header {
    font-weight: 800;
    font-size: 0.95rem;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #334155;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(91, 70, 209, 0.1);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

/* Responsive Overrides */
@media (max-width: 1024px) {
    .main-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: static;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-links {
        display: none !important;
        position: absolute;
        top: 75px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 20px;
        border-bottom: 1.5px solid var(--border-color);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        gap: 10px;
        z-index: 999;
    }

    .nav-links.active {
        display: flex !important;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links li a {
        display: block;
        padding: 12px;
        background: #f8fafc;
        border-radius: 10px;
        text-align: center;
    }

    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }

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

    .container {
        padding: 0 10px;
    }

    .logo span {
        font-size: 1.1rem;
    }
}

/* ═══════════════════════════════════════ THE NUCLEAR OPTION ══════════════════════════════════════ */
/* Forces all containers to stay within viewport on any device < 600px */
@media (max-width: 600px) {
    * {
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    .container,
    .main-layout,
    .content-area,
    .sidebar,
    .rt-card,
    [class*="container"] {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    /* Ensure grids stack */
    [style*="display: grid"]:not(.tools-grid),
    .rt-grid,
    .rt-res-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    /* Responsive Chart sizing */
    canvas {
        width: 100% !important;
        height: auto !important;
    }

    /* Fix for cards that have explicit margins in their styles */
    [style*="margin: 0 auto"] {
        margin: 0 !important;
    }
}

/* FAQ Global Styles - Premium Upgrade */
.faq-section {
    margin-top: 60px;
    margin-bottom: 60px;
    padding: 0 10px;
}
.faq-title {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--text-color);
    margin-bottom: 40px;
    text-align: center;
    letter-spacing: -0.02em;
    position: relative;
}
.faq-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 10px;
}
.faq-list {
    max-width: 900px;
    margin: 0 auto;
}
.faq-item-frontend {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}
.faq-item-frontend:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 30px rgba(13, 148, 136, 0.08);
    border-color: var(--primary-color);
    background: #fff;
}
.faq-question {
    padding: 25px 30px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 800;
    color: #1e293b;
    font-size: 1.15rem;
    user-select: none;
    transition: color 0.3s;
}
.faq-item-frontend.active .faq-question {
    color: var(--primary-color);
}
.faq-answer {
    padding: 0 30px 30px;
    color: #475569;
    line-height: 1.8;
    font-size: 1.05rem;
    display: none;
    animation: fadeInSlide 0.4s ease forwards;
}
@keyframes fadeInSlide {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.faq-icon {
    width: 32px;
    height: 32px;
    background: #f1f5f9;
    color: #94a3b8;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    flex-shrink: 0;
}
.faq-item-frontend.active .faq-icon {
    transform: rotate(180deg);
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}
.faq-item-frontend.active .faq-answer {
    display: block;
}