:root {
    /* Primary palette (mapped from user's colors) */
    --primary: #0277bd; /* colorPrimary */
    --primary-dark: #0269a7; /* colorPrimaryDark */
    --primary-variant: #3700b3; /* colorPrimaryVariant */

    /* Text */
    --text: #626262; /* colorText */
    --text-dark: #000000; /* colorTextDark */
    --muted: #626262;

    /* Backgrounds / surfaces */
    --bg: #f2f2f2; /* background */
    --card: #ffffff; /* cardBackground / colorCardBackground */
    --card2: #dfdfdf; /* colorExtraLightGray */
    --border: #dddddd; /* colorLightGray */

    /* UI surface tokens */
    --btn-bg: #ffffff;
    --btn-text: #000000; /* colorBlack */
    --btn-text2: #ffffff; /* colorBlack */
    --btn-border: var(--border);
    --muted-bg: #bbbbbb; /* colorBackground */
    --key-bg: #ffffff; /* colorWhite */
    --op-bg: #f39c12; /* slight tint for operator keys (kept subtle) */
    --special-bg: #fff2f0;
    --equals-bg: #f3621f; /* colorSecondary */
    --equals-text: #ffffff; /* colorWhite */

    /* semantic / extras */
    --color-done: #f3621f;
    --color-bottom-option: #023b5e;
    --color-green-dark: #004d40;
    --color-pie: #000000;

    /* shadows */
    --shadow: rgba(0, 0, 0, 0.06);
    --soft-shadow: 6px 6px 14px rgba(0, 0, 0, 0.08);
    --soft-highlight: -6px -6px 14px rgba(255, 255, 255, 0.8);
}

body {
    font-family: "Inter", Arial;
    color: var(--text);
    margin: 0;
    background: var(--bg);
    line-height: 1.6;
}

/* Make a simple sticky-footer layout using flexbox so footer stays at the bottom
   when the page content is short. This is preferred over fixed positioning which
   can overlay content. */
html,
body {
    height: 100%;
}
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background: var(--card);
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px var(--shadow);
}

/* Header navigation - professional desktop style */
.header-nav {
    flex: 1 1 auto; /* allow nav to take center space */
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 16px;
}

/* center column for downloads */
.header-center {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.download .badge-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 28px;
    background: var(--card);
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 4px;
}

.download .badge-link i {
    font-size: 14px;
    color: var(--color-green-dark);
}

.theme-toggle {
    border: 1px solid var(--border);
    background: var(--card);
    padding: 6px 10px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
}

.header-nav .nav-bar {
    display: flex;
    gap: 12px;
    align-items: center;
}

.header-nav .nav-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.header-nav .nav-item:hover {
    background: rgba(2, 119, 189, 0.06);
    color: var(--primary);
    transform: translateY(-1px);
}

.header-nav .nav-item.active {
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    color: var(--btn-text2);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pill-nav .nav-bar {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pill-nav .nav-item {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
}
.container-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.pill-nav .nav-item i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    text-align: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(0, 0, 0, 0.95);
    font-size: 16px;
}

.pill-nav .nav-item.active i {
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    color: #ffffff;
    /* box-shadow: 0 6px 12px rgba(2,119,189,0.18); */
}
.pill-nav .nav-item.active .nav-label {
    color: #ffffff !important;
    /* box-shadow: 0 6px 12px rgba(2,119,189,0.18); */
}
.nav-label {
    color: #2c2c2c;
}
/* --- Base Layout --- */
.main-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    justify-content: left;
    width: 100%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: sticky;
    align-items: center;
    justify-content: center;
    top: 0;
    z-index: 1000;
}
.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Left group (menu + brand) */
.left-group {
    display: flex;
    align-items: center;
    gap: 10px;
}
.menu-toggle {
    background: none;
    border: 1px solid var(--border);
    font-size: 1.3rem;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--primary-dark);
    transition: all 0.2s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
}
.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}
.brand-text h1 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0;
}
.brand-text .tagline {
    font-size: 0.8rem;
    color: var(--muted);
    margin: 0;
}

/* Nav menu */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}
.nav-menu ul {
    list-style: none;
    display: flex;
    gap: 18px;
    margin: 0;
    padding: 0;
}
.nav-menu a {
    text-decoration: none;
    color: var(--primary-dark);
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    transition: 0.2s;
}

.nav-menu a.active {
    background: var(--color-bottom-option);
    color: var(--btn-text2);
}

/* Desktop right actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}
.download a i {
    font-size: 1.3rem;
    color: var(--color-green-dark);
}
.theme-toggle {
    border: 1px solid #ddd;
    background: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}


/* === Mobile Styles === */
@media (max-width: 768px) {
    .header-container {
        width: 100%;
        flex-wrap: wrap;
        margin: 0;
    }
    .menu-toggle {
        display: flex;
    }
    .nav-menu {
        width: 100%;
        display: none;
        flex-direction: column;
        background: #fff;
        border-top: 1px solid #eee;
        padding: 10px 0 0 0;
    }
    .nav-menu.show {
        display: flex;
        animation: slideDown 0.25s ease;
    }
    .nav-menu ul {
        flex-direction: column;
        align-items: start;
        gap: 14px;
    }
    .header-actions {
        display: none;
    }
    .mobile-actions {
        position: absolute;
        right: 16px;
        display: block !important;
    }
    .left-group .header-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .header-container > .header-actions {
        display: none;
    }
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

.download {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
}

.download-label {
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
}

.download .badge-link {
    color: var(--primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.download .badge-link i {
    font-size: 18px; /* smaller, professional size */
    color: var(--color-green-dark);
}

.theme-toggle {
    border: 1px solid var(--border);
    background: transparent;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
}

/* Responsive: compact header and mobile nav behavior on narrow screens */
@media (max-width: 720px) {
    header {
        padding: 12px;
    }
    .download-label {
        display: none;
    }

    /* show a hamburger toggle and hide the normal nav until toggled */
    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 8px;
        border: 1px solid rgba(0, 0, 0, 0.06);
        background: transparent;
        cursor: pointer;
        font-size: 18px;
        color: var(--text);
    }

    /* hide the header-nav by default on small screens; it will be revealed when .open is added */
    .header-nav {
        display: none;
    }
    .header-nav.open {
        display: flex;
        position: absolute;
        left: 12px;
        right: 12px;
        top: calc(100% + 8px);
        background: var(--card);
        padding: 12px;
        border-radius: 10px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
        z-index: 1100;
        justify-content: center;
    }

    /* make nav items stack vertically in mobile menu for easier tapping */
    .header-nav.open .nav-bar {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    .header-nav.open .nav-item {
        display: flex;
        justify-content: flex-start;
        padding: 10px 12px;
        border-radius: 8px;
    }
}

/* Dark theme header overrides */
body.dark header {
    background: #0f1415; /* deep header background */
    border-bottom-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
}

body.dark header .brand-text h1 {
    color: #19a6ff; /* brighter cyan for logo text in dark */
}

body.dark header .tagline {
    color: #bfc3c6;
}

body.dark .header-center {
    color: #e6e6e6;
}

body.dark .download .badge-link {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}

body.dark .theme-toggle {
    background: rgba(255, 255, 255, 0.03);
    color: #f5f5f5;
    border-color: rgba(255, 255, 255, 0.06);
}

/* Pill nav dark adjustments */
body.dark .pill-nav {
    box-shadow: 0 6px 18px rgba(1, 13, 15, 0.6);
}

body.dark .pill-nav .nav-item {
    color: rgba(255, 255, 255, 0.9);
}

body.dark .pill-nav .nav-item i {
    background: rgba(255, 255, 255, 0.02);
    color: rgba(255, 255, 255, 0.95);
}

body.dark .pill-nav .nav-item.active i {
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    color: #fff;
}

body.dark .pill-nav .nav-item .nav-label {
    color: rgba(255, 255, 255, 0.95);
}
.chart-close {
    color: #a6acb1 !important;
}
/* Make the main content container use a dark surface in dark mode so pages
   like Rates.html visually match the site's dark theme (header/modal/etc). */
body.dark .main-section {
    background: #0f1415;
    /* same deep surface used for header */
}
/* Chart overlay styles */
.chart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
}
.chart-card {
    width: min(920px, 96%);
    max-height: 90vh;
    overflow: auto;
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.chart-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.chart-card-title {
    font-weight: 700;
    color: var(--primary);
}
.chart-close {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 6px 8px;
    color: var(--muted-bg);
}
.chart-area {
    display: flex;
    gap: 18px;
    padding: 16px;
    align-items: center;
}
.donut-wrap {
    position: relative;
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.donut {
    width: 100%;
    height: 100%;
}
.donut-center {
    position: absolute;
    text-align: center;
    font-size: 13px;
}
.donut-center .maturity-label {
    color: var(--muted);
    font-size: 12px;
}
.donut-center .maturity-value {
    font-weight: 700;
    color: var(--primary);
    margin-top: 6px;
}
.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.chart-legend .dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}
.dot-interest {
    background: var(--primary);
}
.dot-invested {
    background: var(--color-green-dark);
}
.chart-table-card {
    padding: 12px 16px 24px 16px;
}
.chart-table {
    width: 100%;
    border-collapse: collapse;
}
.chart-table th,
.chart-table td {
    padding: 8px 10px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}
.chart-table tr:nth-child(odd) {
    background: var(--card2);
}

@media (max-width: 640px) {
    .chart-area {
        flex-direction: column;
        align-items: center;
    }
    .donut-wrap {
        width: 140px;
        height: 140px;
    }
}

/* Rates controls (search, filter, count) */
.rates-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin: 10px 0 6px;
    flex-wrap: wrap;
}
.search-wrap {
    flex: 1 1 420px;
    min-width: 200px;
}
.rates-search {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card);
    box-shadow: var(--soft-highlight);
    font-size: 14px;
}
/* ensure placeholder is readable in both light and dark themes */
.rates-search::placeholder {
    color: var(--muted) !important;
    opacity: 1;
}
.filter-wrap {
    flex: 0 0 240px;
}
.rates-filter {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card);
    font-size: 14px;
}
/* Make select and its options match the site's dark theme on small screens
   and across themes. Native dropdown list styling is browser-controlled on
   some platforms, but these rules improve appearance where supported. */
.rates-filter,
.rates-filter option {
    color: var(--text);
    background: var(--card) !important;
}
.rates-filter {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--text) 50%),
        linear-gradient(135deg, var(--text) 50%, transparent 50%);
    background-position: calc(100% - 20px) calc(1em + 2px),
        calc(100% - 15px) calc(1em + 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 34px;
}
.rates-count {
    flex: 0 0 auto;
    color: var(--muted);
    font-weight: 600;
}

@media (max-width: 640px) {
    .rates-controls {
        gap: 8px;
    }
    .filter-wrap {
        flex-basis: 100%;
    }
    .rates-count {
        width: 100%;
        text-align: left;
        margin-top: 6px;
    }
    /* ensure select dropdowns look dark on small screens */
    .rates-filter,
    .rates-filter option {
        background: var(--card) !important;
        color: var(--text) !important;
    }
}

/* Medium screens: keep filter pinned to the right and drop the count to a new line below the search */
@media (max-width: 900px) and (min-width: 641px) {
    .rates-controls {
        display: flex;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;
    }
    .search-wrap {
        order: 0;
        flex: 1 1 60%;
        min-width: 220px;
    }
    .filter-wrap {
        order: 1;
        flex: 0 0 260px;
        margin-left: auto;
    }
    .rates-count {
        order: 2;
        width: 100%;
        text-align: left;
        margin-top: 10px;
    }
}

/* Modal/details styles */
.rate-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1400;
    opacity: 0;
    transition: opacity 0.18s ease;
}
.rate-modal-overlay.open {
    opacity: 1;
}
.rate-modal {
    width: min(720px, 94%);
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    padding: 18px;
}
.rate-modal {
    position: relative;
}
.rate-modal-body {
    padding: 16px 20px 18px 20px;
    color: var(--text);
}
.rate-modal-close {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 20px;
    cursor: pointer;
}
.rate-modal-close:hover {
    background: rgba(0, 0, 0, 0.04);
}
.rate-modal-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: #e6f7ff;
    color: #0277bd;
    font-weight: 800;
    margin-bottom: 8px;
}
.rate-modal-title {
    margin: 6px 0 8px;
    color: var(--primary);
    font-size: 18px;
}
.rate-modal-desc {
    color: var(--muted);
    margin-bottom: 12px;
}
.rate-modal-summary {
    display: flex;
    gap: 18px;
    margin-bottom: 12px;
}
.summary-item {
    flex: 1;
    text-align: left;
}
.summary-label {
    font-size: 13px;
    color: var(--muted);
}
.summary-value {
    font-weight: 800;
    font-size: 20px;
    margin-top: 6px;
    color: var(--text-dark);
}
.tariff-codes h4 {
    margin: 8px 0 6px;
}
.tariff-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.tariff-list .tag {
    background: rgba(0, 0, 0, 0.06);
    padding: 6px 10px;
    border-radius: 8px;
}
.rate-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 14px;
}
.btn-copy,
.btn-close {
    padding: 10px 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
}
.btn-copy {
    background: transparent;
    border: 1px solid var(--border);
}
.btn-history {
    display: block;
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    font-weight: 800;
    cursor: pointer;
}
.btn-primary {
    display: block;
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    font-weight: 800;
    cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
    .rate-modal-overlay,
    .rate-modal {
        transition: none !important;
    }
}

/* Responsive modal for small screens: full height dialog / drawer feel */
@media (max-width: 640px) {
    .rate-modal {
        width: 96vw;
        max-height: 94vh;
        border-radius: 12px;
        padding: 12px 12px;
        overflow: auto;
    }
    .rate-modal-body {
        padding: 12px;
    }
    .rate-modal-close {
        right: 8px;
        top: 8px;
    }
    .rate-modal-summary {
        flex-direction: column;
        gap: 8px;
    }
    .rate-modal-actions {
        justify-content: space-between;
    }
}

/* Dark mode overrides for modal */
body.dark .rate-modal {
    background: var(--card);
    color: var(--text);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}
body.dark .rate-modal-overlay {
    background: rgba(0, 0, 0, 0.6);
}
body.dark .rate-modal-badge {
    background: rgba(255, 255, 255, 0.06);
    color: var(--primary);
}
body.dark .tariff-list .tag {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.03);
}
body.dark .btn-copy {
    border-color: rgba(255, 255, 255, 0.06);
    color: var(--text);
}
body.dark .btn-close {
    box-shadow: none;
}

/* --- Rates list styles (GST Rate Finder) --- */
.rates-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 8px;
}
.rate-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 6px 18px rgba(14, 22, 36, 0.04);
    position: relative;
}
.rate-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.rate-tags {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.rate-tags .tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    font-weight: 700;
    font-size: 13px;
    color: var(--text);
}

.rate-desc {
    color: var(--muted);
    margin: 12px 0;
}
.rate-card hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 8px 0 12px;
}
.rate-values {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}
.rate-col {
    flex: 1;
    text-align: center;
}
.rate-label {
    font-size: 12px;
    color: var(--muted);
}
.rate-pill {
    display: inline-block;
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 14px;
}
.pill-cgst,
.pill-sgst {
    background: rgba(2, 119, 189, 0.08); /* softened primary tint */
    color: var(--primary);
}
.pill-igst {
    background: rgba(254, 243, 199, 0.9);
    color: #b88600;
}

@media (max-width: 720px) {
    .rate-values {
        flex-direction: column;
        align-items: stretch;
    }
    .rate-col {
        text-align: left;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .rate-desc {
        margin-bottom: 10px;
    }
}

header .brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

header img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(45deg, var(--primary), #2b8aef);
}

header h1 {
    font-size: 18px;
    margin: 0;
    color: var(--primary);
    font-weight: 700;
}

header .actions {
    font-size: 14px;
    color: var(--muted);
}

header .actions a {
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
}

.container {
    max-width: 800px;
    margin: 30px auto;
    padding: 0 16px;
    box-sizing: border-box;
}

/* Make the main element that uses the container fill remaining space so the
   footer is naturally pushed to the bottom. Use main.container to avoid
   affecting other .container usages from Bootstrap. */
main.container {
    flex: 1 0 auto;
}

.intro {
    text-align: center;
    color: var(--muted);
    margin-bottom: 24px;
    font-size: 15px;
}

.calculator {
    background: var(--card2);
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 6px 22px var(--shadow);
}

h2 {
    font-size: 20px;
    color: var(--primary) !important;
    text-align: center;
    margin-bottom: 20px;
}

.denoms {
    background: var(--card);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 540px;
    margin: 0 auto;

    box-shadow: var(--soft-shadow);
}

.row {
    display: grid;
    grid-template-columns: 90px 20px 1fr 20px 1fr;
    gap: 8px;
    align-items: center;
}

.note {
    background: linear-gradient(135deg, #ffffff, #f5f6f8);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    font-weight: 700;
    font-size: 15px;
    text-align: center;
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.02);
}

.times,
.equals {
    text-align: center;
    color: var(--muted);
    font-weight: 600;
}

input.count {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    font-size: 15px;
    text-align: center;
    transition: 0.2s ease;
    background: #fff;
}

input.count:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(6, 175, 71, 0.15);
    outline: none;
}

.lineTotal {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    background: #f9fafb;
    text-align: center;
    font-weight: 600;
    font-size: 15px;
    color: #333;
}

.reset {
    margin-top: 14px;
    background: var(--primary);
    color: #fff;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.reset:hover {
    background: #05973e;
}

/* === Smooth Gradient Ring Animation (Premium Feel) === */
.gst-type-anim {
    display: inline-block !important;
    border-radius: 999px !important;
    padding: 3px !important;
    position: relative !important	;
    background: linear-gradient(0deg, #fcd267, #ffc561, #b45309, #fcd267);
    background-size: 300% 300% !important;
    animation: smoothGrad 2.5s linear infinite, softPulse 1.5s ease-in-out infinite !important;
   
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Inner container (stable core) */
.gst-type-anim .inner {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    background: var(--card);
    border-radius: 999px;
    padding: 6px 10px;
    z-index: 1;
    position: relative;
}

/* Enhanced smooth gradient flow */
@keyframes smoothGrad {
    0% {
        background-position: 0% 50%;
    }
    25% {
        background-position: 50% 100%;
    }
    50% {
        background-position: 100% 50%;
    }
    75% {
        background-position: 50% 0%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gst-type-anim {
    animation: smoothGrad 10s linear infinite, softPulse 3s ease-in-out infinite;
}

/* Accessibility: no animation for users preferring reduced motion */
@media (prefers-reduced-motion: reduce) {
    .gst-type-anim {
        animation: none !important;
        transition: none !important;
    }
}

footer {
    position: relative;
    left: 0;
    right: 0;
    bottom: 0;
    /* height: 64px; */
    /* remove large top margin so footer sits directly after main content
     when using a column flex layout on body */
    margin-top: 0;
    /* ensure footer does not shrink/grow and stays at the end of the flex column */
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card);
    color: var(--muted);
    font-size: 13px;
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.08);
    /* z-index: 9999; */
}

@media (max-width: 640px) {
    .row {
        grid-template-columns: 70px 20px 1fr 20px 1fr;
    }
}

/* App download footer styles */
.app-download {
    width: 100%;
    /* background: #262b2d; */
    color: #e6eef5;
    /* padding: 28px 16px; */
    text-align: center;
}
.app-download h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    color: #fff;
}
.app-download .badges {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.app-download .badges img {
    height: 40px;
    display: inline-block;
}
.app-download .app-credit {
    color: #9aa0a4;
    font-size: 13px;
}
.app-download .app-credit a {
    color: #4ea3ff;
    text-decoration: none;
    font-weight: 600;
}
/* Theme toggle and dark-mode variables */
.theme-toggle {
    appearance: none;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.theme-toggle:hover {
    border-color: var(--primary);
    color: gold;
}

body.dark {
    --bg: #0f1112;
    --card: #161819;
    --card2: #212222;
    --text: #e6eef5;
    --muted: #9aa0a4;
    --border: #232628;
    --shadow: rgba(0, 0, 0, 0.6);
    --btn-bg: #1a1c1d;
    --btn-text: #e6eef5;
    --btn-border: #2a2d2e;
    --muted-bg: #121314;
    --key-bg: #171919;
    --op-bg: #f39c12;
    --special-bg: #2b1a16;
    --equals-bg: #f3621f;
    --equals-text: #ffffff;
    --soft-shadow: 6px 6px 18px rgba(0, 0, 0, 0.6);
    --soft-highlight: -6px -6px 18px rgba(255, 255, 255, 0.02);
}
body,
header,
.calculator,
.summary {
    transition: background-color 0.22s ease, color 0.22s ease,
        box-shadow 0.22s ease;
}
/* Header improvements */
.brand-text {
    display: flex;
    flex-direction: column;
}
.brand-text h1 {
    margin: 0;
    font-size: 18px;
    color: var(--primary);
    font-weight: 800;
}
.tagline {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}
.header-right {
    display: flex;
    gap: 12px;
    align-items: center;
}
.download {
    display: flex;
    gap: 8px;
    align-items: center;
}
.download .download-label {
    font-weight: 700;
    color: var(--text);
    margin-right: 6px;
    font-size: 13px;
}
.badge-link img {
    height: 28px;
    display: inline-block;
}
@media (max-width: 640px) {
    header {
        padding: 12px;
    }
    .brand-text h1 {
        font-size: 16px;
    }
    .download .download-label {
        display: none;
    }
}

/* Bottom navigation styles (fixed) */
.bottom-nav {
    height: 64px;
    background: var(--color-bottom-option, #023b5e);
    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 0 0 12px 12px;
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.12);
    z-index: 9999;
}
.nav-bar {
    width: 100%;
    max-width: 900px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 6px 12px;
}
.nav-item {
    color: #fff;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 8px;
    opacity: 0.95;
}
.nav-item .fas {
    font-size: 18px;
}
/* .nav-item.active {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.03)
  );
} */
/* .nav-item.active .fas {
  color: var(--primary);
} */
.nav-label {
    line-height: 1;
}

@media (max-width: 520px) {
    .bottom-nav {
        height: 56px;
    }
    .calculator {
        padding: 0;
    }
    .mode-btn {
        padding: 5px 8px !important;
        font-size: 11px !important;
    }

    .nav-item .fas {
        font-size: 16px;
    }
    .nav-label {
        font-size: 11px;
    }
}
/* GST app styles */
.gst-app {
    max-width: 540px;
    margin: 8px auto;
}
.gst-app {
    max-width: 540px;
    margin: 8px auto;
    background: var(--card);
    border-radius: 12px;
    padding: 18px;
}
.gst-top {
    text-align: right;
    margin-bottom: 14px;
}
.gst-display {
    font-size: 32px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: 0.6px;
}
.gst-sub {
    font-size: 13px;
    color: var(--muted);
    margin-top: 6px;
}
.gst-modes {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 12px 0;
    padding: 6px 0;
}
.mode-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}
.mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    font-weight: 600;
    cursor: pointer;
    position: relative;
}
.mode-btn::before {
    content: "";
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: inline-block;
    flex: 0 0 14px;
}
.mode-btn.active {
    color: var(--primary);
    border-color: transparent;
}
.mode-btn.active::before {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 6px rgba(6, 175, 71, 0.08);
}
/* === Mobile Styles (consolidated) === */
@media (max-width: 768px) {
    /* Header / navigation adjustments */
    .header-container {
        width: 100%;
        flex-wrap: wrap;
        margin: 0;
    }
    .menu-toggle {
        display: flex;
    }
    .nav-menu {
        width: 100%;
        display: none;
        flex-direction: column;
        background: #fff;
        border-top: 1px solid #eee;
        padding: 10px 0 0 0;
    }
    .nav-menu.show {
        display: flex;
        animation: slideDown 0.25s ease;
    }
    .nav-menu ul {
        flex-direction: column;
        align-items: start;
        gap: 14px;
    }
    .header-actions {
        display: none;
    }
    .mobile-actions {
        position: absolute;
        right: 16px;
        display: block !important;
    }
    .left-group .header-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .header-container > .header-actions {
        display: none;
    }

    /* Verify layout specific tweaks */
    .verify-wrap {
        grid-template-columns: 1fr 420px;
    }
    .main-header .header-container {
        justify-content: start;
    }

    /* Captcha sizing tweaks */
    .captcha-img img {
        height: 54px;
    }
    .captcha-refresh {
        width: 40px;
        height: 40px;
    }

    /* Footer responsive tweaks */
    .site-footer {
        padding: 1.25rem 1rem;
    }
    .badges a img {
        height: 36px;
    }
.app-download h3 {
        font-size: 1rem;
    }
}
/* GST type pill group on the right */
.gst-type {
    display: flex;
    gap: 6px;
    align-items: center;
    background: transparent;
}
.gst-type {
    border-radius: 999px;
    padding: 4px;
}
.type-btn {
    padding: 6px 14px;
    border-radius: 999px;
    background: transparent;
    border: none;
    color: var(--muted);
    font-weight: 700;
    cursor: pointer;
}
.type-btn.active {
    background: #f59e0b;
    color: #fff;
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.12);
}
/* Rate buttons: two explicit rows (positives / negatives) for clearer DOM structure */
.rate-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}
.rate-pos,
.rate-neg {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
    gap: 8px;
    align-items: stretch;
}
/* Make sure buttons fill their grid cell */
.rate-pos .rate-btn,
.rate-neg .rate-btn {
    width: 100%;
    box-sizing: border-box;
}
.rate-buttons:not(.old-gst) .rate-btn[data-rate="12"] {
    display: none;
}
.rate-btn {
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--btn-border);
    background: var(--btn-bg);
    color: var(--btn-text);
    cursor: pointer;
    font-weight: 700;
    box-shadow: var(--soft-highlight), var(--soft-shadow);
}
.rate-btn:active {
    transform: translateY(1px);
}
.rate-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: linear-gradient(180deg, var(--btn-bg), var(--muted-bg));
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}
.gst-results {
    margin-bottom: 12px;
    text-align: left;
    color: var(--muted);
}
.result-row {
    padding: 6px 0;
}
.keypad {
    display: block;
}
.kp-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}
.key {
    flex: 1;
    padding: 14px 10px;
    border-radius: 12px;
    border: 1px solid var(--btn-border);
    background: var(--key-bg);
    color: var(--btn-text);
    font-size: 16px;
    cursor: pointer;
    box-shadow: var(--soft-highlight), var(--soft-shadow);
    transition: transform 0.06s ease, box-shadow 0.12s ease;
}
.key:active {
    transform: translateY(2px);
    box-shadow: none;
}
.key.op {
    background: var(--op-bg);
    color: var(--btn-text2);
    box-shadow: none;
    font-size: 20px;
}
.key.equals {
    background: var(--equals-bg);
    color: var(--equals-text);
    font-size: 20px;
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.18);
}

/* responsive changes: stack keypad and controls on narrow viewports */
@media (max-width: 520px) {
    .kp-row {
        gap: 6px;
    }
    .key {
        padding: 14px 6px;
        font-size: 15px;
    }
    .gst-display {
        font-size: 22px;
    }.type-btn{
        font-size: 11px;
    }
}
/* ------------------- finance tools css------------ */
/* Section container */
.calculator.finance-tools {
    background: var(--card);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 10px 30px rgba(20, 30, 50, 0.06);
}

/* Hidden heading for screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

/* --- TOOL TABS (pill style) --- */
.tool-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 22px;
}
.tab {
    background: #f1f3f5;
    border-radius: 14px;
    padding: 10px 6px;
    text-align: center;
    font-weight: 700;
    color: var(--muted);
    border: none;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 2px 6px rgba(14, 22, 36, 0.04);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.tab i {
    display: block;
    font-size: 18px;
    margin-bottom: 6px;
}
.tab span {
    display: block;
    font-size: 13px;
}
.tab.active {
    background: linear-gradient(90deg, var(--primary), #008fe8);
    color: #fff;
    box-shadow: 0 8px 20px rgba(2, 119, 189, 0.18);
    transform: translateY(-6px);
}
.tab:hover:not(.active) {
    background: #eaeef3;
}

/* --- SECTION RESULT (large white card) --- */
.result-small {
    background: var(--card);
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(14, 22, 36, 0.06);
}
.result-small .label {
    font-size: 12px;
    color: #9aa0a4;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.result-small .value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-dark);
    margin-top: 8px;
}
.result-small .sub {
    display: flex;
    justify-content: space-between;
    margin-top: 14px;
    align-items: center;
}
.result-small .sub span:first-child {
    color: #c3c6c9;
}
.result-small .sub span:last-child {
    color: #1e90ff;
    font-weight: 700;
}
.result-small .result-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
/* --- INPUTS (black rounded bars) --- */
.inputs {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.input-field {
    display: flex;
    flex-direction: column;
    width: 100%;
}
.label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}
input[type="text"],
input[type="number"] {
    width: 100%;
    border-radius: 999px;
    border: none;
    padding: 14px 10px;
    font-size: 15px;
    background: #fff;
    color: #000;
    outline: none;
    box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.02);
}

input:focus {
    box-shadow: 0 0 0 4px rgba(2, 119, 189, 0.08);
}
.row-two {
    display: flex;
    gap: 12px;
}
.row-two .small {
    flex: 1;
}

/* --- ACTION ROW (calculate + chart) --- */
.row-actions {
    display: flex;
    gap: 12px;
    margin-top: 6px;
}
.btn-calc {
    flex: 1;
    background: linear-gradient(90deg, var(--primary), #00a3ff);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 16px 18px;
    font-weight: 800;
    font-size: 16px;
    text-transform: uppercase;
    box-shadow: 0 10px 30px rgba(2, 119, 189, 0.18);
    cursor: pointer;
}
.btn-chart {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 12px 14px;
    color: var(--text);
    cursor: pointer;
}
.btn-calc:hover {
    transform: translateY(-2px);
}

@media (max-width: 480px) {
    footer {
        padding: 0;
    }
    .calculator.finance-tools {
        max-width: 90%;
        padding: 20px;
    }
    .result-small .value {
        font-size: 24px;
    }
    .tab span {
        font-size: 12px;
    }
    .tab i {
        font-size: 16px;
    }
}

/* === Dark-theme adjustments for finance tools === */
body.dark .calculator.finance-tools {
    background: #0e1112; /* slightly darker canvas */
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}
body.dark .tool-tabs {
    gap: 12px;
}
body.dark input[type="text"],
input[type="number"] {
    background: #121314 !important;
    color: #fff;
}
body.dark .tab {
    background: #151718;
    color: var(--muted);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}
body.dark .tab:hover:not(.active) {
    background: #1b1d1e;
}
body.dark .tab.active {
    background: linear-gradient(90deg, #0b77b8, #0096ff);
    color: #fff;
    box-shadow: 0 10px 30px rgba(2, 119, 189, 0.22);
}

body.dark .result-small {
    background: #121314;
    color: var(--text);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7);
}
body.dark .result-small .label {
    color: #9aa0a4;
}
body.dark .result-small .value {
    color: #e6eef5;
}
body.dark .result-small .sub span:first-child {
    color: #7b8083;
}
body.dark .result-small .sub span:last-child {
    color: #4fc3ff;
}

/* inputs in dark mode keep the black look but ensure borders and placeholders are readable */
body.dark input[type="text"],
body.dark input[type="number"] {
    background: #0b0b0b;
    color: #fff;
    box-shadow: inset 0 2px 8px rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
}
body.dark input::placeholder {
    color: rgba(255, 255, 255, 0.28);
}

body.dark .btn-calc {
    box-shadow: 0 12px 36px rgba(2, 119, 189, 0.18);
}
body.dark .btn-chart {
    border-color: rgba(255, 255, 255, 0.04);
    color: #d1d7da;
}

/* chat icon color */
.chat-icon i {
    color: var(--muted);
}
body.dark .chat-icon i {
    color: #bfc6c9;
}

/* Make tabs wrap on narrow screens for better touch targets */
@media (max-width: 720px) {
    .tool-tabs {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 420px) {
    /* .tool-tabs { grid-template-columns: 1fr; } */
    .result-small {
        padding: 16px;
    }
    .inputs {
        gap: 12px;
    }
    .row-two {
        flex-direction: column;
    }
    .btn-calc {
        padding: 12px;
        font-size: 15px;
    }
}

/* Additional small-screen refinements for header, layout and footer */
@media (max-width: 720px) {
    .container-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    header {
        padding: 12px 16px;
    }
    /* Stack the header center/actions under the brand on small screens */
    .brand {
        order: 1;
    }
    .header-center {
        order: 2;
        width: 100%;
        justify-content: flex-start;
        gap: 8px;
    }
    .header-right {
        order: 3;
        width: 100%;
        justify-content: flex-start;
    }
    .header-center .download {
        flex-wrap: nowrap;
    }
    header img {
        width: 36px;
        height: 36px;
    }
    header h1 {
        font-size: 16px;
    }
    .container {
        margin: 20px auto;
        padding: 0 12px;
    }
}

@media (max-width: 480px) {
    .container-header {
        padding: 0;
    }
    .brand-text h1 {
        font-size: 15px;
    }
    .header-center {
        justify-content: flex-start;
    }
    .download .badge-link {
        width: 32px;
        height: 24px;
    }
    .theme-toggle {
        padding: 6px 8px;
        font-size: 13px;
    }

    /* Make the result title wrap and keep the chart icon accessible on the right */
    .result-small .result-title {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }
    .result-small .result-title .chat-icon {
        margin-left: auto;
    }

    /* Ensure main calculator padding is compact and buttons are full width */
    .calculator.finance-tools {
        padding: 18px;
    }
    .btn-calc {
        width: 100%;
    }

    /* Allow footer text to wrap on small screens */
}

/* ---------- Support for alternate header markup (.main-header / .header-container) and dark theme ---------- */
.main-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 10px var(--shadow);
}
.main-header .header-container {
    max-width: 1200px;
    margin: 0 0;
    padding: 12px 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
}
.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}
.menu-toggle,
.nav-toggle {
    display: none;
}

/* nav-menu: desktop inline, mobile dropdown */
.nav-menu {
    display: flex;
    gap: 12px;
    align-items: start;
}
.nav-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 12px;
}
.nav-menu a {
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    padding: 8px 10px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.nav-menu a.active {
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    color: #fff;
}
.mobile-actions {
    display: none;
}
.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    width: auto;
}
@media (max-width: 720px) {
    .nav-menu {
        display: none;
    }
    .menu-toggle,
    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: transparent;
        border: 1px solid rgba(0, 0, 0, 0.06);
        border-radius: 8px;
        color: var(--text);
    }
    .nav-menu.open {
        display: block;
        position: absolute;
        left: 12px;
        right: 12px;
        top: calc(100% + 8px);
        background: var(--card);
        padding: 14px;
        border-radius: 10px;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    }
    .nav-menu.open ul {
        flex-direction: column;
        gap: 10px;
    }
    .mobile-actions {
        display: flex;
        gap: 10px;
        align-items: center;
    }
    .header-actions {
        display: none;
    }
}

/* Dark theme overrides for alternate header/menu */
body.dark .main-header {
    background: #0f1415;
    border-bottom-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
}
body.dark .main-header .brand-text h1 {
    color: #19a6ff;
}
body.dark .nav-menu,
body.dark .nav-menu.open {
    background: #101416;
    border: 1px solid #101416;
}
body.dark .nav-menu a {
    color: rgba(255, 255, 255, 0.9);
}
body.dark .nav-menu a.active {
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    color: #fff;
}
body.dark .menu-toggle,
body.dark .nav-toggle {
    border-color: rgba(255, 255, 255, 0.06);
    color: #dfe7eb;
}
body.dark .mobile-actions .theme-toggle,
body.dark .header-actions .theme-toggle {
    background: rgba(255, 255, 255, 0.03);
    color: #e6eef5;
    border-color: rgba(255, 255, 255, 0.06);
}body.dark .theme-toggle:hover {
    border-color: var(--primary);
    color: gold;
}
body.dark .download a,
body.dark .mobile-actions .download a {
    color: #9adfa8;
}

/* rates page */
body.dark .summary-value {
    color: #dfe7eb;
}
body.dark .calcTitle {
    color: #dfe7eb;
}
body.dark option {
    color: #dfe7eb;
}
body.dark .rates-filter {
    color: #dfe7eb;
}
input::placeholder {
    color: rgba(73, 73, 73, 0.45);
}

/* Verify page styles — modern, compact, light/dark-friendly */
.verify-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.25rem 1rem;
    background: transparent;
    color: var(--text);
}
.verify-wrap {
    width: 100%;
    max-width: 820px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 1rem;
}
@media (max-width: 768px) {
    .verify-wrap {
        grid-template-columns: 1fr 420px;
    }
    .main-header .header-container {
        justify-content: start;
    }


    .nav-menu {
        width: 100%;
        display: none;
        flex-direction: column;
        background: #fff;
        border-top: 1px solid #eee;
        padding: 10px 0 0 0;
    }
}
.card-dark {
    background: var(--card);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--border);
    box-shadow: 0 8px 20px rgba(2, 6, 23, 0.06);
}
.card-dark.outline {
    border: 1px solid rgba(14, 165, 233, 0.12);
}
.card-title {
    color: var(--text);
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

/* Captcha row */
.captcha-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.captcha-img {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
    padding: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    min-height: 72px;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.02),
        rgba(0, 0, 0, 0.02)
    );
}
.captcha-img img {
    max-width: 100%;
    height: 64px;
    object-fit: contain;
    border-radius: 6px;
    display: block;
}
.captcha-refresh {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    transition: all 0.14s ease;
}
.captcha-refresh:hover {
    background: rgba(2, 119, 189, 0.06);
    transform: translateY(-3px);
    color: var(--primary);
    border-color: rgba(2, 119, 189, 0.18);
}

/* Input styles inside verify card */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
/* Inline input with counter (GST input + right-side count) */
.input-group-inline {
    display: flex;
    align-items: stretch;
    gap: 0;
}
.input-group-inline .form-input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
    flex: 1 1 auto;
    border-radius: 10px 0 0 10px; /* ensure left-side rounding only */
}
.input-group-inline .muted#gst-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 10px 10px 0; /* right-side rounding for the counter */
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.02));
    box-sizing: border-box;
}
.card-dark .form-input {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.02),
        rgba(0, 0, 0, 0.02)
    );
    border: 1px solid var(--border);
    padding: 0.9rem 1rem;
    border-radius: 10px;
    color: var(--text);
    outline: none;
    width: 100%;
    box-sizing: border-box;
}
.card-dark .form-input::placeholder {
    color: var(--muted);
}
.muted {
    font-size: 1.00rem;
    color: var(--muted);
    text-align: right;
}
.card-dark .form-input:focus {
    box-shadow: 0 10px 30px rgba(2, 119, 189, 0.08);
    border-color: rgba(2, 119, 189, 0.16);
}

.btn-verify {
    display: block;
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    font-weight: 800;
    cursor: pointer;
    letter-spacing: 0.2px;
}
.btn-verify[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .captcha-img img {
        height: 54px;
    }
    .captcha-refresh {
        width: 40px;
        height: 40px;
    }
}

#verifyResult .card-dark {
    margin-top: 0.6rem;
    padding: 0.6rem;
}

/* dark-mode tweaks; reuse site's tokens */
body.dark .captcha-img {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.01),
        rgba(0, 0, 0, 0.06)
    );
    border-color: rgba(255, 255, 255, 0.04);
}
body.dark .card-dark {
    background: var(--card);
    border-color: rgba(255, 255, 255, 0.04);
}
body.dark .card-dark .form-input {
    background: var(--card);
    border-color: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

/* History list styles */
.history-section {
    width: 100%;
    max-width: 820px;
}
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.history-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    box-shadow: 0 8px 20px rgba(2, 6, 23, 0.04);
}
.history-avatar {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
}
.history-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.history-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.history-gstin {
    font-weight: 800;
    color: var(--text);
}
.history-status {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 700;
}
.history-names {
    color: var(--text);
    font-weight: 700;
}
.history-sub {
    color: var(--muted);
    font-size: 0.9rem;
}
.history-tags {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}
.history-tag {
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.04);
    font-weight: 700;
    color: var(--text);
    font-size: 0.82rem;
}
.history-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}
.history-actions .btn-verify {
    padding: 8px 12px;
    border-radius: 8px;
}
.history-delete {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 18px;
}

@media (max-width: 720px) {
    .history-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .history-actions {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
    }
}

/* Raw JSON pre blocks for history */
.history-raw {
    white-space: pre-wrap;
    background: var(--card);
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 8px;
    margin-top: 10px;
    max-height: 40vh;
    overflow: auto;
}
.history-item-raw {
    white-space: pre-wrap;
}

/* dark tweaks */
body.dark .history-card {
    background: var(--card);
    border-color: rgba(255, 255, 255, 0.04);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}
body.dark .history-tag {
    background: rgba(255, 255, 255, 0.02);
}

/* Verify modal: compact popup for taxpayer details */
.verify-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
}
.verify-modal.open {
    display: flex;
}
.verify-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.55);
}
.verify-modal-card {
    position: relative;
    z-index: 2;
    max-width: 720px;
    width: 94%;
    border-radius: 12px;
    padding: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: 0 18px 48px rgba(2, 6, 23, 0.6);
    color: var(--text);
}
.verify-modal-card h3 {
    margin: 0 0 0.5rem;
    color: var(--primary);
}
.verify-modal-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 60vh;
    overflow: auto;
    padding-right: 0.25rem;
}
.verify-modal-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}
.verify-modal-row .label {
    width: 140px;
    font-size: 0.85rem;
    color: var(--muted);
}
.verify-modal-row .value {
    flex: 1;
    font-weight: 700;
    color: var(--text);
}
.verify-modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.75rem;
}
.verify-modal-close {
    position: absolute;
    right: 10px;
    top: 8px;
    background: transparent;
    border: none;
    font-size: 20px;
    color: var(--muted);
    cursor: pointer;
}
.verify-modal .btn-verify {
    width: auto;
    padding: 8px 14px;
    border-radius: 8px;
}
.verify-modal .btn-close {
    background: transparent;
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text);
}

@media (max-width: 640px) {
    .verify-modal-card {
        padding: 0.85rem;
    }
    .verify-modal-row .label {
        width: 110px;
    }
}

/* Responsive button and history tweaks */
@media (max-width: 720px) {
    /* Slightly reduce padding so buttons fit better */
    .btn-close,
    .btn-copy {
        padding: 8px 10px;
        font-size: 14px;
    }
    .btn-verify {
        padding: 10px;
        font-size: 15px;
    }
    .main-header {
        justify-content: left;
    }
    .main-header .header-container {
        justify-content: left;
    }
    /* History card actions should sit horizontally and keep spacing */
    .history-actions {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }
    .history-actions .btn-verify,
    .history-actions .history-raw {
        padding: 8px 10px;
    }
    .history-delete {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    /* Stack history header controls for narrow screens */
    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .history-header > div {
        display: flex;
        gap: 8px;
    }

    /* Make history actions full width and tall enough for touch */
    .history-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .history-actions .btn-verify,
    .history-actions .history-raw {
        width: 100%;
        display: inline-block;
        text-align: center;
        padding: 12px;
    }
    .history-actions .history-delete {
        width: auto;
        align-self: flex-end;
    }

    /* Ensure primary verify button remains comfortable on small screens */
    .btn-verify {
        width: 100%;
        padding: 12px;
        font-size: 16px;
    }

    /* Compact captcha row for phones */
    .captcha-img img {
        height: 48px;
    }
    .captcha-refresh {
        width: 40px;
        height: 40px;
    }

    /* Reduce container side padding on very small screens */
    .container {
        padding: 0 10px;
    }
}

/* history section */
.history-btn {
    gap: 5px;
}
.history-delete {
    background-color: red;
    border-radius: 8px;
    padding: 6px 8px;
    color: white !important;
}

/* footer css */
.site-footer {
    background: #2b3133;
    color: #cbd5e1;
    padding: 2.5rem 1rem 0.5rem 1rem;
    margin-top: 2rem;
}
.site-footer .footer-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.75rem;
}
.app-download h3 {
    margin: 0;
    font-size: 1.05rem;
    color: #ffffff;
    font-weight: 600;
}
.badges {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    margin-top: 0.5rem;
}
.badges a {
    display: inline-flex;
    background: #000;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    align-items: center;
    justify-content: center;
}
.badges a img {
    height: 40px;
    display: block;
}
.app-credit {
    font-size: 0.85rem;
    margin-top: 0.25rem;
    color: #9fb0bf;
}
.app-credit a {
    color: #66a3ff;
    text-decoration: none;
    font-weight: 600;
}
/* hide the extra footer-links for this design */
.footer-links {
    display: none;
}

@media (max-width: 768px) {
    .site-footer {
        padding: 1.25rem 1rem;
    }
    .badges a img {
        height: 36px;
    }
    .app-download h3 {
        font-size: 1rem;
    }
}
