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

/* Visually hidden but accessible to screen readers (for SEO h1) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

html, body {
    min-height: 100%;
    overflow: auto;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #fafafa;
    color: #1a1a1a;
    display: flex;
    flex-direction: column;
}

nav {
    background: #1a1a1a;
    border-bottom: none;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    position: relative;
    z-index: 100;
}

.nav-brand {
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

/* Navigation Search */
.nav-search {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-search .search-icon {
    position: absolute;
    left: 10px;
    width: 16px;
    height: 16px;
    color: #999;
    pointer-events: none;
}

.nav-search .search-input {
    padding: 8px 12px 8px 34px;
    font-size: 0.875rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    width: 180px;
    transition: all 0.2s;
}

.nav-search .search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.nav-search .search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    width: 220px;
}

.nav-btn-active {
    color: #fff;
    font-weight: 500;
}

/* Nav Menu Container */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Hamburger Button - hidden on desktop */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: none;
    border: none;
    cursor: pointer;
    gap: 5px;
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
    transition: all 0.2s;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Navigation Buttons */
.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 1rem;
    font-weight: 400;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    border: none;
    margin: 0;
    background: none;
    color: #fff;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    white-space: nowrap;
}

.nav-btn:hover {
    color: #aaa;
}

.nav-btn:focus {
    outline: none;
}

.nav-btn-primary,
.nav-btn-secondary {
    /* Both look the same - plain text */
}

.nav-btn-primary:hover,
.nav-btn-secondary:hover {
    color: #aaa;
}

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

.nav-dropdown .dropdown-arrow {
    width: 10px;
    height: 10px;
    opacity: 0.7;
    transition: transform 0.15s;
    margin-left: 2px;
}

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

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 150px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.15s;
    z-index: 1000;
    overflow: hidden;
}

.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    font-size: 0.8125rem;
    font-weight: 500;
    text-align: left;
    color: #333;
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.1s;
}

.lang-option:hover {
    background: #f5f5f5;
}

.lang-option.active {
    color: #16a34a;
    background: #f0fdf4;
}

.flag-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 15px;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.flag-icon svg {
    width: 100%;
    height: 100%;
}

.lang-btn .flag-icon {
    width: 18px;
    height: 13px;
}

.lang-select {
    padding: 6px 28px 6px 10px;
    font-size: 0.8125rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.lang-select:focus {
    outline: none;
    border-color: rgba(255,255,255,0.4);
}

.lang-select option {
    background: #1a1a1a;
    color: #fff;
}

.calc-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 12px;
}

.calc-tab {
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #666;
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.calc-tab:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

.calc-tab.active {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

.calc-form {
    /* Form container */
}

/* Learn Section Styles */
.learn-section {
    padding: 8px 0;
}

.page-section {
    width: 100%;
}

.learn-card {
    padding: 24px 28px;
}

.learn-card .section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e5e5;
}

.learn-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 20px;
}

.learn-topic {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.learn-topic:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.learn-topic h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.learn-topic p {
    font-size: 0.9375rem;
    color: #555;
    line-height: 1.6;
    margin: 0;
}

/* Search Results Section */
.search-card {
    padding: 20px 24px;
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e5e5;
}

.search-header .section-title {
    margin: 0;
    padding: 0;
    border: none;
}

.close-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #f5f5f5;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: #666;
    transition: all 0.15s;
}

.close-search-btn:hover {
    background: #e5e5e5;
    color: #1a1a1a;
}

.search-query-label {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 16px;
}

.search-query-label strong {
    color: #1a1a1a;
}

.search-iframe-container {
    width: 100%;
    height: 600px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.search-iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.main-content {
    flex: 1 0 auto;
    display: grid;
    grid-template-columns: 250px 1fr 250px;
    grid-template-areas: "left center right";
    width: 100%;
    gap: 0;
}

.ad-sidebar-left {
    grid-area: left;
    padding: 20px 8px 20px 12px;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
}

.container {
    grid-area: center;
    padding: 20px 12px;
    min-width: 0;
}

.ad-sidebar-right {
    grid-area: right;
    padding: 20px 12px 20px 8px;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
}

.ad-slot {
    width: 100%;
    max-width: 350px;
    background: #fff;
    border: 1px dashed #ddd;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: #bbb;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ad-slot.tall {
    height: 600px;
}

.ad-slot.short {
    height: 100px;
}

.layout {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 20px;
}

.input-group {
    margin-bottom: 14px;
}

.input-group:last-child {
    margin-bottom: 0;
}

label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #666;
    margin-bottom: 6px;
}

label > span:first-child {
    margin-right: 4px;
}

/* Help icon tooltip styles */
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    font-size: 0.625rem;
    font-weight: 600;
    color: #999;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 50%;
    cursor: help;
    position: relative;
    vertical-align: middle;
    margin-left: 2px;
    transition: all 0.15s;
}

.help-icon:hover {
    color: #666;
    background: #e5e5e5;
    border-color: #ccc;
}

.help-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 400;
    white-space: normal;
    width: max-content;
    max-width: 220px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
    z-index: 1000;
    pointer-events: none;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.help-icon::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1a1a1a;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
    z-index: 1000;
}

.help-icon:hover::after,
.help-icon:hover::before {
    opacity: 1;
    visibility: visible;
}

.toggle-label .help-icon {
    margin-left: 6px;
}

input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.9375rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
    transition: border-color 0.2s, background 0.2s;
}

input[type="number"]:focus {
    outline: none;
    border-color: #1a1a1a;
    background: #fff;
}

select {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.9375rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

select:focus {
    outline: none;
    border-color: #1a1a1a;
    background-color: #fff;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 0;
}

.toggle-label {
    font-size: 0.875rem;
    color: #1a1a1a;
}

.toggle {
    position: relative;
    width: 40px;
    height: 22px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ddd;
    transition: 0.2s;
    border-radius: 22px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.2s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.toggle input:checked + .toggle-slider {
    background-color: #1a1a1a;
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(18px);
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

button {
    width: 100%;
    padding: 12px;
    font-size: 0.9375rem;
    font-weight: 500;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 14px;
}

button:hover {
    background: #333;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.result-label {
    color: #666;
    font-size: 0.875rem;
}

.result-value {
    font-weight: 600;
    font-size: 0.875rem;
}

.result-value.highlight {
    color: #16a34a;
}

.section-title {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    margin-bottom: 12px;
}

.contribution-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #f0f0f0;
}

.results-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.summary-box {
    background: #fafafa;
    border-radius: 8px;
    padding: 14px;
}

.summary-box-label {
    font-size: 0.6875rem;
    color: #666;
    margin-bottom: 4px;
}

.summary-box-value {
    font-size: 1.25rem;
    font-weight: 600;
}

.summary-box-value.green {
    color: #16a34a;
}

.summary-box-value.red {
    color: #ef4444;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.results-table th,
.results-table td {
    padding: 10px 12px;
    font-size: 0.8125rem;
    text-align: left;
}

.results-table thead th {
    background: #f5f5f5;
    font-weight: 600;
    color: #666;
    border-bottom: 2px solid #e5e5e5;
}

.results-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
}

.results-table tbody tr:hover {
    background: #fafafa;
}

.results-table tbody tr:last-child {
    border-bottom: none;
    background: #f0fdf4;
    font-weight: 600;
}

.results-table .monthly-breakdown-header td {
    background: #f5f5f5;
    padding: 12px;
    border-bottom: 1px solid #e5e5e5;
}

.results-table .table-subheader td {
    background: #fafafa;
    font-weight: 600;
    color: #666;
    font-size: 0.75rem;
}

.results-table .total-row td {
    background: #f0fdf4;
    border-top: 2px solid #16a34a;
}

.results-table .section-spacer td {
    padding: 8px;
    background: #fff;
    border: none;
}

.results-table td:not(:first-child) {
    text-align: right;
}

.results-table th:not(:first-child) {
    text-align: right;
}

.results-table .highlight {
    color: #16a34a;
}

.results-table .highlight-red {
    color: #ef4444;
}

.results-table .real-value {
    color: #f59e0b;
}

.table-wrapper {
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
}

.table-wrapper::-webkit-scrollbar {
    width: 6px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.summary-section {
    margin-top: 12px;
}

.chart-container {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    height: 280px;
}

.view-toggle {
    display: inline-flex;
    gap: 0;
    margin-bottom: 12px;
    background: #e8f4ec;
    border-radius: 8px;
    padding: 4px;
    margin-left: 50%;
    transform: translateX(-50%);
}

.view-btn {
    padding: 8px 20px;
    font-size: 0.8125rem;
    font-weight: 500;
    background: transparent;
    color: #16a34a;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.view-btn:hover {
    color: #15803d;
}

.view-btn.active {
    background: #16a34a;
    color: #fff;
    box-shadow: 0 1px 3px rgba(22, 163, 74, 0.3);
}

footer {
    background: #1a1a1a;
    color: rgba(255,255,255,0.6);
    padding: 48px 24px 24px;
    font-size: 0.8125rem;
    flex-shrink: 0;
    margin-top: auto;
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-col h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 16px;
}

.footer-col h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-col p {
    line-height: 1.7;
    color: rgba(255,255,255,0.5);
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.footer-col ul a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    transition: color 0.15s;
}

.footer-col ul a:hover {
    color: #16a34a;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
    gap: 20px;
}

.footer-copy {
    color: rgba(255,255,255,0.4);
}

.footer-disclaimer {
    color: rgba(255,255,255,0.35);
    font-size: 0.75rem;
    max-width: 400px;
    text-align: right;
}

@media (max-width: 768px) {
    /* Mobile Navigation */
    nav {
        padding: 10px 12px;
        height: auto;
        min-height: 56px;
    }

    .nav-brand {
        font-size: 1rem;
    }

    .nav-right {
        gap: 8px;
    }

    .nav-search {
        order: 0;
    }

    .nav-search .search-input {
        width: 120px;
        padding: 8px 8px 8px 32px;
        font-size: 0.8125rem;
    }

    .nav-search .search-input:focus {
        width: 140px;
    }

    /* Show hamburger on mobile */
    .hamburger-btn {
        display: flex;
    }

    /* Hide nav menu by default on mobile */
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: #1a1a1a;
        flex-direction: column;
        padding: 16px;
        gap: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        z-index: 1000;
    }

    .nav-menu.open {
        display: flex;
    }

    .nav-menu .nav-btn {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 16px;
        font-size: 1rem;
    }

    .nav-menu .nav-dropdown {
        width: 100%;
    }

    .nav-menu .nav-dropdown .nav-btn {
        width: 100%;
    }

    .nav-menu .nav-dropdown-menu {
        position: static;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 6px;
        margin-top: 8px;
    }

    .nav-menu .nav-dropdown-menu .lang-option {
        color: #fff;
        background: transparent;
    }

    .nav-menu .nav-dropdown-menu .lang-option:hover {
        background: rgba(255, 255, 255, 0.15);
        color: #fff;
    }

    .nav-menu .nav-dropdown-menu .lang-option.active {
        background: rgba(255, 255, 255, 0.2);
        color: #fff;
    }

    .main-content {
        grid-template-columns: 1fr;
        grid-template-areas: "center";
    }

    .ad-sidebar-left,
    .ad-sidebar-right {
        display: none;
    }

    .container {
        padding: 12px;
    }

    .card {
        padding: 16px;
    }

    /* Stack form rows on mobile */
    .row {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    /* Tabs - scrollable on mobile */
    .calc-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        flex-wrap: nowrap;
        padding-bottom: 8px;
        margin-bottom: 12px;
    }

    .calc-tabs::-webkit-scrollbar {
        display: none;
    }

    .calc-tab {
        flex-shrink: 0;
        padding: 8px 12px;
        font-size: 0.8125rem;
    }

    /* Summary grid - stack on mobile */
    .summary-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .summary-box {
        padding: 12px;
    }

    .summary-box-value {
        font-size: 1.125rem;
    }

    /* Table responsive */
    .table-wrapper {
        margin: 0 -16px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .results-table th,
    .results-table td {
        padding: 8px 10px;
        font-size: 0.75rem;
    }

    /* Chart container */
    .chart-container {
        height: 220px;
        margin-left: -8px;
        margin-right: -8px;
    }

    /* View toggle */
    .view-toggle {
        margin-left: 0;
        transform: none;
        width: 100%;
        justify-content: center;
    }

    .view-btn {
        padding: 8px 16px;
        font-size: 0.75rem;
    }

    /* Navigation */
    nav {
        padding: 0 16px;
    }

    .nav-brand {
        font-size: 1rem;
    }

    .nav-btn {
        padding: 8px 12px;
        font-size: 0.875rem;
    }

    /* Footer */
    footer {
        padding: 32px 16px 20px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
        text-align: center;
    }
    
    .footer-col:first-child {
        padding-bottom: 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-disclaimer {
        text-align: center;
        max-width: 100%;
    }
    
    .lang-menu {
        right: -10px;
    }

    /* Help tooltips - show on left to avoid cutoff */
    .help-icon::after {
        left: auto;
        right: 0;
        transform: none;
        max-width: 180px;
    }

    .help-icon::before {
        left: auto;
        right: 10px;
        transform: none;
    }

    /* Input adjustments */
    input[type="number"],
    select {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    button {
        padding: 14px;
        font-size: 1rem;
    }

    /* Section titles */
    .section-title {
        font-size: 0.625rem;
    }

    .contribution-section {
        margin-top: 12px;
        padding-top: 12px;
    }
}

/* Extra small devices */
@media (max-width: 380px) {
    .container {
        padding: 8px;
    }

    .card {
        padding: 12px;
    }

    .calc-tab {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .nav-btn {
        padding: 6px 8px;
        font-size: 0.8125rem;
    }

    .summary-box-value {
        font-size: 1rem;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e5e5;
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    line-height: 1;
}

.modal-close:hover {
    background: #e5e5e5;
    color: #1a1a1a;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-body h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 20px 0 10px 0;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-body p {
    font-size: 0.875rem;
    line-height: 1.7;
    color: #555;
    margin-bottom: 12px;
}

.modal-body ul {
    margin: 0 0 12px 0;
    padding-left: 20px;
}

.modal-body ul li {
    font-size: 0.875rem;
    line-height: 1.7;
    color: #555;
    margin-bottom: 6px;
}

.modal-body a {
    color: #16a34a;
    text-decoration: none;
}

.modal-body a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .modal {
        width: 95%;
        max-height: 85vh;
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
}
