:root {
    /* Color Palette - Light Mode - Richer */
    --primary-color: #E05A10;
    /* Richer Deep Orange Red */
    --primary-hover: #C0392B;
    --primary-light: #FBEFEA;
    --bg-main: #FAFBFC;
    --bg-card: #FFFFFF;
    --text-main: #1A202C;
    --text-muted: #718096;
    --border-color: #E2E8F0;
    --input-bg: #F7FAFC;

    /* Specific UI Colors based on reference */
    --btn-toggle-bg: #FFFFFF;
    --btn-toggle-text: #2D3748;
    --btn-toggle-active-bg: #E67E22;
    --btn-toggle-active-text: #FFFFFF;
    --info-box-bg: #FDF2E9;
    --info-box-text: #666666;

    /* Shadows & Radii */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Typography */
    --font-heading: 'Playfair Display', "Inter", serif;
    --font-body: 'Noto Sans Devanagari', 'Inter', sans-serif;
}

[data-theme="dark"] {
    /* Color Palette - Dark Mode - Richer */
    --primary-color: #E05A10;
    --primary-hover: #FF7043;
    --primary-light: #3E2723;
    --bg-main: #1A202C;
    --bg-card: #2D3748;
    --text-main: #F7FAFC;
    --text-muted: #A0AEC0;
    --border-color: #4A5568;
    --input-bg: #1A202C;

    --btn-toggle-bg: #2D3748;
    --btn-toggle-text: #F7FAFC;
    --btn-toggle-active-bg: #E67E22;
    --btn-toggle-active-text: #FFFFFF;
    --info-box-bg: #353F50;
    --info-box-text: #CBD5E0;
}

/* === Global Resets & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1,
h2,
h3,
h4,
h5,
h6,
.headline-font {
    font-family: var(--font-heading);
    color: var(--text-main);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

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

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

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

.text-sm {
    font-size: 0.85rem;
}

.text-xs {
    font-size: 0.75rem;
}

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

.font-weight-bold {
    font-weight: 700;
}

.code-font {
    font-family: 'Inter', monospace;
}

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

.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.border-top {
    border-top: 1px solid var(--border-color);
}

/* === Utilities === */
.mb-1 {
    margin-bottom: 4px;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-4 {
    margin-bottom: 24px;
}

.mt-2 {
    margin-top: 8px;
}

.mt-4 {
    margin-top: 24px;
}

.pt-2 {
    padding-top: 8px;
}

.pt-4 {
    padding-top: 24px;
}

.pb-2 {
    padding-bottom: 8px;
}

.w-50 {
    width: 48%;
}

.w-100 {
    width: 100%;
}

.hidden {
    display: none !important;
}

/* Hide banner and footer in Android App */
.app-mode .app-banner,
.app-mode .main-footer {
    display: none !important;
}

/* === App Banner (Mobile) === */
.app-banner {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-family: 'Noto Sans Devanagari', sans-serif;
}

.banner-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-download {
    background: white;
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.btn-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
}

/* === New Header Design === */
.main-header {
    background-color: var(--bg-card);
    padding: 12px 24px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 900;
}

.header-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 6px;
}

.logo-icon-bg {
    background: transparent;
    width: 60px;
    /* Slightly larger as requested to maximize visibility */
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.logo-icon-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.footer-logo-bg {
    width: 40px;
    height: 40px;
}

.logo:hover .logo-icon-bg {
    transform: scale(1.05);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.2;
}

.logo-subtitle {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

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

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.theme-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 50%;
}

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

/* === Main Layout === */
.main-content {
    flex: 1;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    /* Base gap; modified in media queries below */
    gap: 12px;
}

/* === Hero Section === */
.hero-title {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.hero-subtitle {
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.05rem;
}

.hero-cards {
    display: flex;
    gap: 24px;
    justify-content: center;
}

.hero-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.hero-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    background: linear-gradient(to bottom right, var(--bg-card), var(--primary-light));
}

.hero-card.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.2);
}

.hero-card-icon {
    background: var(--primary-light);
    color: var(--primary-color);
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.feature-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.feature-badge i {
    color: var(--primary-color);
}

/* === Form Elements & Cards === */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    scroll-margin-top: 130px;
    /* Increased to ensure sticky header perfectly clears the card when JS scrolling */
}

/* Specific Dropdown Style */
.form-select-lg {
    font-size: 1.1rem;
    padding: 16px;
    font-weight: 600;
}

select,
input[type="number"],
input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    background-color: var(--input-bg);
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    appearance: none;
    min-height: 48px;
    transition: all 0.3s ease;
}

select {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%236B7280" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

select:focus,
input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.2);
    background-color: var(--bg-card);
}

label,
.step-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.step-title {
    margin-top: 24px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

#dynamic-form-container .step-title:first-child {
    margin-top: 0;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-action {
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-primary,
.btn-secondary {
    padding: 14px 24px;
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 48px;
}

.btn-action {
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 0.95rem;
    box-shadow: var(--shadow-sm);
    min-height: 44px;
    transition: all 0.2s;
}

.btn-action:hover {
    background-color: var(--input-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.btn-whatsapp {
    color: #25D366;
    border-color: #25D366;
    background: #fff;
}

.btn-whatsapp:hover {
    background-color: #25D366;
    color: white !important;
    border-color: #25D366;
    transform: translateY(-1px);
}

[data-theme="dark"] .btn-whatsapp {
    background: var(--input-bg);
}

.btn-pdf {
    color: #DC2626;
    border-color: #DC2626;
    background: #fff;
}

.btn-pdf:hover {
    background-color: #DC2626;
    color: white !important;
    border-color: #DC2626;
    transform: translateY(-1px);
}

[data-theme="dark"] .btn-pdf {
    background: var(--input-bg);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    box-shadow: var(--shadow-md);
    margin-top: 24px;
    display: block;
    font-size: 1.1rem;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Toggles */
.toggle-group {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.btn-toggle {
    flex: 1;
    min-width: 140px;
    padding: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--btn-toggle-bg);
    color: var(--btn-toggle-text);
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-toggle:hover {
    border-color: var(--primary-color);
}

.btn-toggle.active {
    background-color: var(--btn-toggle-active-bg);
    color: var(--btn-toggle-active-text);
    border-color: var(--btn-toggle-active-bg);
}


/* ===== RICH RESULT SECTION ===== */

/* Section-wide reset for new layout */
.result-card {
    padding: 0;
    overflow: hidden;
}

/* --- Summary Bar --- */
.result-summary-bar {
    background: linear-gradient(135deg, var(--primary-color) 0%, #C0392B 100%);
    color: #fff;
    padding: 14px 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.summary-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.summary-value {
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
}

/* --- Primary Hero Number --- */
.result-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 20px 8px;
    text-align: center;
}

.result-hero-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.result-hero-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1.1;
    font-family: 'Inter', sans-serif;
}

.result-hero-unit {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    opacity: 0.8;
    margin-bottom: 6px;
}

.result-hero-breakdown {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-light);
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-full);
    padding: 4px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 4px;
}

/* --- Comparison Table --- */
.result-table-wrap {
    padding: 12px 20px 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.result-table-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rich-result-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 340px;
    table-layout: fixed;
    /* Ensures column widths are respected */
}

.rich-result-table thead tr {
    background: var(--input-bg);
}

.rich-result-table th {
    padding: 12px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
}

.rich-result-table th:nth-child(2),
.rich-result-table td:nth-child(2) {
    text-align: center;
    /* Center the result column */
}

.rich-result-table td {
    padding: 12px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    word-wrap: break-word;
}

.rich-result-table tbody tr:last-child td {
    border-bottom: none;
}

.rich-result-table tbody tr:hover {
    background: var(--input-bg);
    transition: background 0.15s;
}

.rich-result-table .td-unit {
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.unit-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    flex-shrink: 0;
}

.unit-dot.dim {
    background: var(--text-muted);
    opacity: 0.4;
}

.td-value {
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Inter', monospace;
}

.td-breakdown {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.row-primary td {
    background: var(--primary-light);
}

.row-primary .td-value {
    font-size: 1.05rem;
}

/* --- CTA Row --- */
.result-cta-row {
    display: flex;
    gap: 10px;
    padding: 12px 20px 16px;
    flex-wrap: wrap;
}

.btn-cta {
    flex: 1;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: var(--radius-full);
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    position: relative;
}

.btn-cta-pdf {
    background: linear-gradient(135deg, #DC2626, #B91C1C);
    color: #fff;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-cta-pdf:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(220, 38, 38, 0.4);
}

.btn-cta-whatsapp {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-cta-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.4);
}

.cta-badge {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    margin-left: 2px;
}

/* Standard result (non-dismil) */
.standard-result-box {
    margin: 16px 20px 8px;
    padding: 18px 20px;
    background: var(--primary-light);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--primary-color);
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.standard-result-box span {
    font-size: 2.2rem;
}

/* old .primary-result kept for PDF compat */
.primary-result {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    margin: 20px 0;
    padding: 24px 16px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    border: 2px dashed var(--primary-color);
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.result-table th,
.result-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.result-table th {
    font-weight: 600;
    background-color: var(--input-bg);
    color: var(--text-muted);
}

/* Mobile responsive summary bar */
@media (max-width: 600px) {
    .result-summary-bar {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 12px 14px;
    }

    .result-hero-number {
        font-size: 2.2rem;
    }

    .result-hero {
        padding: 14px 14px 6px;
    }

    .result-table-wrap {
        padding: 8px 12px 6px;
    }

    .result-cta-row {
        padding: 8px 12px 12px;
    }

    .btn-cta {
        padding: 10px 12px;
        font-size: 0.82rem;
    }
}

/* Row Group */
.row-group {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
}

.input-wrapper.w-50 {
    flex: 1 1 45%;
}

/* Info Box */
.info-box {
    background-color: var(--info-box-bg);
    padding: 12px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--info-box-text);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

/* === Instructions Step Grid === */
.instruction-section,
.constants-section {
    scroll-margin-top: 100px;
}

.how-to-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    text-align: center;
}

.how-to-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.step-circle {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.step-title-text {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-main);
    line-height: 1.2;
}

.step-desc-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* === Video === */
.video-container {
    background: var(--input-bg);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-xl);
    height: 300px;
    /* Mock height */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* === Constants Grid === */
.constants-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.constant-card {
    padding: 24px;
}

.constant-card li {
    margin-bottom: 6px;
}

/* === Footer Multi-column === */
.main-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 40px 24px 24px 24px;
}

.footer-grid {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.2fr;
    gap: 40px;
}

.footer-col ul li {
    margin-bottom: 12px;
}

/* Legal Modal/Blocks Expansion Area */
.legal-content-area {
    max-width: 1000px;
    margin: 0 auto;
}

.legal-block {
    background: var(--input-bg);
    padding: 16px;
    border-radius: var(--radius-md);
}

.footer-bottom {
    max-width: 1000px;
    margin: 0 auto;
}

/* Responsive Overrides - Desktop / Larger Screens */
@media (min-width: 1025px) {
    .main-content {
        gap: 6px;
        /* Extremely tight to ensure fitting */
    }

    .card {
        padding: 12px 20px;
        scroll-margin-top: 80px;
    }

    #tool-selection-area,
    #calculator-section {
        margin-bottom: 0;
    }

    #tool-selection-area {
        padding-bottom: 8px;
    }

    #calculator-section {
        padding-top: 8px;
    }

    .step-title {
        margin-top: 8px;
        margin-bottom: 4px;
        padding-bottom: 4px;
        font-size: 1rem;
    }

    .btn-primary {
        margin-top: 8px;
    }

    .row-group {
        margin-bottom: 8px;
        gap: 8px;
    }
}

/* Responsive Overrides - Mobile / Tablets */
@media (max-width: 1024px) {
    .top-nav {
        display: none;
    }

    /* Hide regular nav on mobile for simplicity, or just scale down */
    .hero-cards {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
    }

    .hero-card {
        width: calc(50% - 6px);
        padding: 20px 12px;
    }

    .hero-card h2 {
        font-size: 1.25rem;
    }

    .hero-card p {
        font-size: 0.75rem;
    }

    .hero-card-icon {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }

    .how-to-grid {
        grid-template-columns: 1fr;
    }

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

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .input-wrapper.w-50 {
        flex: 1 1 100%;
    }

    /* Aggressive Compact layout for Mobile fitting */
    .main-content {
        gap: 4px;
        padding: 4px 6px;
    }

    .card {
        padding: 8px 10px;
        scroll-margin-top: 100px;
    }

    #tool-selection-area,
    #calculator-section {
        margin-bottom: 0;
    }

    #tool-selection-area {
        padding-bottom: 4px;
    }

    #calculator-section {
        padding-top: 4px;
    }

    .step-title {
        margin-top: 4px;
        font-size: 0.85rem;
        padding-bottom: 2px;
        margin-bottom: 2px;
    }

    .btn-primary {
        margin-top: 6px;
        min-height: 40px;
        font-size: 0.95rem;
    }

    .row-group {
        margin-bottom: 6px;
        gap: 4px;
    }

    select,
    input[type="number"],
    input[type="text"] {
        min-height: 38px;
        padding: 6px 10px;
        font-size: 0.9rem;
    }

    label {
        font-size: 0.75rem;
        margin-bottom: 2px;
    }

    .info-box {
        padding: 4px 8px;
        margin-bottom: 4px;
        font-size: 0.75rem;
    }

    .toggle-group {
        margin-bottom: 4px;
        gap: 6px;
    }

    .btn-toggle {
        min-width: 100px;
        padding: 6px;
        font-size: 0.85rem;
    }

    .logo-icon-bg {
        width: 48px;
        height: 48px;
    }

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

    .logo-subtitle {
        font-size: 0.6rem;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 16px;
        padding-bottom: 24px;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.4s ease-out forwards;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* === Guide Banner === */
.guide-banner-section {
    scroll-margin-top: 100px;
}

.guide-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    background: linear-gradient(to right, var(--bg-card), var(--primary-light));
    border: 1px solid var(--primary-color);
    padding: 24px !important;
}

.guide-banner-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.guide-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-lg);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.guide-text h4 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* === Mobile Adjustments for Guide Banner === */
@media (max-width: 600px) {
    .guide-banner {
        flex-direction: column;
        text-align: center;
        padding: 32px 20px !important;
        gap: 20px;
        background: linear-gradient(180deg, #FFFFFF 0%, var(--primary-light) 100%) !important;
        border-radius: 20px !important;
    }

    .guide-banner-content {
        flex-direction: column;
        gap: 20px;
    }

    .guide-icon {
        width: 64px;
        height: 64px;
        font-size: 2rem;
        border-radius: 16px;
        margin: 0 auto;
    }

    .guide-text h4 {
        font-size: 1.35rem;
        font-weight: 900;
        line-height: 1.3;
        margin-bottom: 8px;
        color: var(--text-main);
    }

    .guide-text p {
        font-size: 1.05rem;
        line-height: 1.5;
        color: var(--text-muted);
    }

    .guide-banner .btn-outline-primary {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 1.05rem;
        border-radius: 24px;
        border-width: 2px;
        background: white;
    }
}