:root {
    color-scheme: light;
    --bg:            #0d1117;
    --surface:       rgba(255, 255, 255, 0.92);
    --surface-2:     rgba(244, 248, 252, 0.94);
    --ink:           #102033;
    --muted:         #5e6f86;
    --line:          rgba(23, 42, 67, 0.15);
    --accent:        #087f5b;
    --accent-2:      #0f77b7;
    --accent-3:      #c67a10;
    --accent-bg:     rgba(8, 127, 91, 0.11);
    --accent-border: rgba(8, 127, 91, 0.28);
    --good:          #087f5b;
    --warn:          #a26307;
}

/* ─── RESET ─────────────────────────────── */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    position: relative;
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 15% 20%, rgba(32, 63, 92, 0.70) 0%, transparent 34%),
        radial-gradient(circle at 82% 10%, rgba(41, 83, 87, 0.58) 0%, transparent 38%),
        radial-gradient(circle at 18% 92%, rgba(47, 74, 43, 0.48) 0%, transparent 34%),
        linear-gradient(150deg, var(--bg), #172136 58%, #111827);
    -webkit-font-smoothing: antialiased;
}

a   { color: inherit; }
button { font: inherit; }

/* ─── CUSTOM CURSOR ─────────────────────── */

#cursor-dot,
#cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    display: none;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -50%);
}

/* ─── MOVING BACKGROUND ─────────────────── */

#fx,
.noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

#fx {
    z-index: 0;
    width: 100%;
    height: 100%;
}

.noise {
    z-index: 0;
    opacity: 0.075;
    background-image: radial-gradient(circle, #ffffff 0.6px, transparent 0.6px);
    background-size: 3px 3px;
    animation: drift 14s linear infinite;
}

/* ─── SHELL ──────────────────────────────── */

.shell {
    position: relative;
    z-index: 1;
    width: min(1320px, calc(100% - 40px));
    margin: 0 auto;
    padding: 20px 0 60px;
}

/* ─── HEADER ─────────────────────────────── */

.topbar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 56px;
    margin-bottom: 20px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(236, 250, 245, 0.92) 48%, rgba(232, 244, 255, 0.90));
    box-shadow: 0 16px 48px rgba(2, 8, 23, 0.16);
    backdrop-filter: blur(18px);
}

.topbar::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border-top: 3px solid rgba(8, 127, 91, 0.72);
    pointer-events: none;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 0.875rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-decoration: none;
    text-transform: uppercase;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 7px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 8px 22px rgba(15, 119, 183, 0.24);
    font-size: 1rem;
    font-weight: 800;
}

.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 13px;
    border: 1px solid var(--accent-border);
    border-radius: 999px;
    color: #087f5b;
    background: linear-gradient(135deg, rgba(8, 127, 91, 0.13), rgba(15, 119, 183, 0.10));
    font-size: 0.78rem;
    font-weight: 600;
}

.live-dot {
    flex-shrink: 0;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    animation: livePulse 2.2s ease-out infinite;
}

/* ─── HERO ───────────────────────────────── */

.hero {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding: 24px 24px;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background:
        radial-gradient(circle at 88% 16%, rgba(15, 119, 183, 0.20), transparent 26%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(241, 252, 247, 0.92) 48%, rgba(238, 247, 255, 0.90));
    box-shadow: 0 22px 80px rgba(2, 8, 23, 0.24);
    backdrop-filter: blur(18px);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        linear-gradient(90deg, rgba(8, 127, 91, 0.62), rgba(15, 119, 183, 0.45), rgba(198, 122, 16, 0.36));
    height: 4px;
    pointer-events: none;
}

.hero-copy,
.hero-stats {
    position: relative;
    z-index: 1;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

h1 {
    margin: 0 0 8px;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.01em;
    background: linear-gradient(90deg, #102033, #087f5b 55%, #0f77b7);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lede {
    margin: 0;
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.6;
}

.hero-stats {
    display: flex;
    gap: 1px;
    background: linear-gradient(135deg, rgba(8, 127, 91, 0.24), rgba(15, 119, 183, 0.18));
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.hero-stats div {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 14px 20px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 248, 253, 0.92));
    min-width: 120px;
    text-align: center;
}

.hero-stats span {
    color: #607188;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.hero-stats strong {
    font-size: 1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
}

/* ─── BOARD HEAD (top of table card) ─────── */

.board-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 11px 18px;
    border: 1px solid var(--line);
    border-radius: 10px 10px 0 0;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(238, 247, 255, 0.92));
}

.board-head div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.board-head span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 500;
}

.board-head strong {
    font-size: 0.875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ─── TABLE PANEL ────────────────────────── */

.table-panel {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(241, 252, 247, 0.90) 46%, rgba(239, 247, 255, 0.92));
    box-shadow: 0 22px 80px rgba(2, 8, 23, 0.24);
    backdrop-filter: blur(18px);
}

.table-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    z-index: 2;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
    pointer-events: none;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.mobile-rate-list {
    display: none;
}

table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

/* ─── BUTTON ─────────────────────────────── */

button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    border: 1px solid var(--accent-border);
    border-radius: 7px;
    padding: 0 16px;
    background: var(--accent-bg);
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease;
}

button:hover {
    background: rgba(61, 214, 140, 0.18);
    border-color: rgba(61, 214, 140, 0.45);
}

button:disabled {
    cursor: wait;
    opacity: 0.55;
}

.refresh-icon {
    width: 13px;
    height: 13px;
    border: 2px solid currentColor;
    border-left-color: transparent;
    border-radius: 50%;
}

button:disabled .refresh-icon {
    animation: spin 700ms linear infinite;
}

/* ─── TABLE STYLES ───────────────────────── */

thead th {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(232, 246, 240, 0.98), rgba(232, 241, 250, 0.98));
    color: #33455c;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
    user-select: none;
}

thead th.num-col {
    text-align: right;
}

thead th.sortable {
    cursor: pointer;
}

thead th.sortable:hover {
    color: var(--ink);
}

thead th.sortable[aria-sort="none"]::after {
    content: " ↕";
    opacity: 0.35;
}

thead th[aria-sort="ascending"]::after {
    content: " ↑";
    color: var(--accent);
    opacity: 1;
}

thead th[aria-sort="descending"]::after {
    content: " ↓";
    color: var(--accent);
    opacity: 1;
}

tbody tr {
    border-bottom: 1px solid var(--line);
    transition: background 130ms ease;
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background: rgba(8, 127, 91, 0.055);
}

tbody th,
tbody td {
    padding: 16px 18px;
    vertical-align: middle;
}

tbody th {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 150px;
    min-width: 150px;
    color: #41536a;
    background:
        linear-gradient(180deg, rgba(229, 244, 238, 0.98), rgba(232, 241, 250, 0.96));
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.10em;
    text-align: left;
    text-transform: uppercase;
}

.provider-row td,
.rate-row td,
.value-row td {
    min-width: 145px;
    text-align: center;
}

.provider-row td {
    background:
        linear-gradient(180deg, rgba(246, 251, 249, 0.96), rgba(236, 246, 254, 0.88));
}

.rate-row td {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(250, 253, 255, 0.78));
}

.value-row td {
    background:
        linear-gradient(180deg, rgba(232, 248, 241, 0.82), rgba(231, 244, 255, 0.72));
}

.provider-row td a,
.mobile-provider-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--accent-2);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    text-decoration-color: rgba(15, 119, 183, 0.38);
}

.provider-row td a::after,
.mobile-provider-link::after {
    content: "\2197";
    font-size: 0.72rem;
    line-height: 1;
    opacity: 0.78;
    transform: translateY(-1px);
}

.provider-row td a:hover,
.mobile-provider-link:hover {
    color: var(--accent);
    text-decoration-color: rgba(8, 127, 91, 0.65);
}

/* Rate cells */

.rate-number {
    display: inline-block;
    min-width: 86px;
    padding: 5px 9px;
    border: 1px solid rgba(16, 32, 51, 0.12);
    border-radius: 7px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(240, 247, 252, 0.88));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
}

.rate-number.is-best {
    border-color: rgba(8, 127, 91, 0.36);
    background:
        linear-gradient(135deg, rgba(8, 127, 91, 0.14), rgba(15, 119, 183, 0.11));
    color: var(--accent);
    font-weight: 700;
}

.rupee-value {
    display: inline-block;
    min-width: 112px;
    color: #182a3e;
    font-size: 0.92rem;
    font-weight: 700;
}

td.unavailable {
    color: #7b899a;
    font-size: 0.85rem;
    font-weight: 400;
}

/* Legacy status styles kept for API diagnostics if a row is reintroduced */

td:last-child {
    min-width: 145px;
}

.status-ok,
.status-warn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.status-ok::before,
.status-warn::before {
    content: "";
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-ok {
    background: rgba(61, 214, 140, 0.12);
    color: #7ee8b5;
}

.status-ok::before {
    background: var(--good);
}

.status-warn {
    background: rgba(227, 179, 65, 0.12);
    color: #f0c860;
}

.status-warn::before {
    background: var(--warn);
}

td p {
    max-width: 260px;
    margin: 5px 0 0;
    color: #596b82;
    font-size: 0.76rem;
    font-weight: 400;
    line-height: 1.45;
    text-align: left;
}

/* ─── NOTICE ─────────────────────────────── */

.notice {
    margin-top: 14px;
    padding: 11px 16px;
    border: 1px solid rgba(162, 99, 7, 0.24);
    border-radius: 8px;
    color: #7a4b05;
    background: rgba(255, 248, 224, 0.92);
    font-size: 0.84rem;
}

.site-disclaimer {
    max-width: 980px;
    margin: 18px auto 0;
    color: rgba(232, 241, 250, 0.74);
    font-size: 0.72rem;
    line-height: 1.55;
    text-align: center;
}

[hidden] {
    display: none !important;
}

/* ─── KEYFRAMES ──────────────────────────── */

@keyframes livePulse {
    0%   { box-shadow: 0 0 0 0 rgba(61, 214, 140, 0.55); }
    70%  { box-shadow: 0 0 0 9px rgba(61, 214, 140, 0); }
    100% { box-shadow: 0 0 0 0 rgba(61, 214, 140, 0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes rowIn {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes drift {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(-120px, -80px, 0); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 1ms !important;
        transition-duration: 1ms !important;
    }

    #fx {
        display: none;
    }
}

@media (pointer: fine) {
    body.has-custom-cursor,
    body.has-custom-cursor a,
    body.has-custom-cursor button {
        cursor: none;
    }

    body.has-custom-cursor a:hover {
        cursor: pointer;
    }

    body.has-custom-cursor #cursor-dot,
    body.has-custom-cursor #cursor-ring {
        display: block;
        opacity: 1;
    }

    body.cursor-hidden #cursor-dot,
    body.cursor-hidden #cursor-ring {
        opacity: 0;
    }

    body.has-custom-cursor:has(a:hover) #cursor-dot,
    body.has-custom-cursor:has(a:hover) #cursor-ring {
        opacity: 0;
    }

    #cursor-dot {
        z-index: 9999;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: #5cffd4;
        mix-blend-mode: difference;
        transition: transform 100ms ease, background 250ms ease, opacity 180ms ease;
    }

    #cursor-ring {
        z-index: 9998;
        width: 36px;
        height: 36px;
        border: 1.5px solid rgba(92, 255, 212, 0.62);
        border-radius: 50%;
        transition:
            left 120ms ease,
            top 120ms ease,
            width 250ms ease,
            height 250ms ease,
            border-color 250ms ease,
            opacity 180ms ease;
    }

    body.has-custom-cursor:has(button:hover) #cursor-ring {
        width: 60px;
        height: 60px;
        border-color: rgba(15, 119, 183, 0.72);
    }
}

/* ─── RESPONSIVE ─────────────────────────── */

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

    .hero-stats {
        flex-wrap: wrap;
    }

    .hero-stats div {
        flex: 1;
        min-width: 100px;
    }
}

@media (max-width: 700px) {
    .table-wrap {
        display: none;
    }

    .mobile-rate-list {
        display: grid;
        gap: 10px;
        padding: 14px;
    }

    .mobile-rate-item {
        padding: 14px;
        border: 1px solid rgba(23, 42, 67, 0.12);
        border-radius: 9px;
        background:
            linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(236, 250, 245, 0.86) 52%, rgba(235, 246, 255, 0.88));
        box-shadow: 0 10px 28px rgba(2, 8, 23, 0.10);
    }

    .mobile-provider-link {
        margin-bottom: 12px;
        font-size: 0.98rem;
    }

    .mobile-rate-metrics {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 10px;
        margin: 0;
    }

    .mobile-rate-metrics div {
        min-width: 0;
        padding: 10px;
        border: 1px solid rgba(23, 42, 67, 0.10);
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.62);
    }

    .mobile-rate-metrics dt {
        margin: 0 0 6px;
        color: #607188;
        font-size: 0.66rem;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .mobile-rate-metrics dd {
        margin: 0;
    }

    .mobile-rate-metrics .rate-number,
    .mobile-rate-metrics .rupee-value {
        min-width: 0;
        max-width: 100%;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .mobile-empty {
        padding: 18px;
        color: var(--muted);
        font-size: 0.9rem;
        text-align: center;
    }
}

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

@media (max-width: 560px) {
    .shell {
        width: calc(100% - 24px);
        padding-top: 14px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 16px;
        min-height: auto;
        gap: 10px;
    }

    .hero {
        padding: 18px;
    }

    h1 {
        font-size: 1.25rem;
    }

    .board-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-stats {
        flex-direction: column;
        gap: 1px;
    }

    .hero-stats div {
        text-align: left;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 10px 14px;
    }
}
