html, body {
    background:
        radial-gradient(circle at top left, rgba(244, 162, 97, 0.3), transparent 28%),
        radial-gradient(circle at right 20%, rgba(61, 169, 160, 0.28), transparent 24%),
        linear-gradient(180deg, #07141d 0%, #102732 100%);
    color: #f3f7f0;
    font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    margin: 0;
    min-height: 100%;
}

html {
    overflow-y: scroll;
}

body {
    overflow-x: hidden;
}

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

a, .btn-link {
    color: #8de1ce;
}

a:hover {
    color: #ffbf69;
}

h1:focus {
    outline: none;
}

#blazor-error-ui {
    background: #f28482;
    bottom: 0;
    box-shadow: 0 -1px 6px rgba(0, 0, 0, 0.2);
    color: #102028;
    display: none;
    left: 0;
    padding: 0.8rem 1rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.loading-progress {
    display: block;
    height: 7rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
    position: absolute;
    width: 7rem;
}

.loading-progress circle {
    fill: none;
    stroke: rgba(243, 247, 240, 0.24);
    stroke-width: 0.5rem;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.loading-progress circle:last-child {
    stroke: #8de1ce;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    font-weight: 700;
    inset: calc(20vh + 2.8rem) 0 auto 0;
    position: absolute;
    text-align: center;
}

img,
svg,
canvas {
    max-width: 100%;
}


/* Preserve the navigation, sticky header, cards, and search layout from the Blazor app. */
.hero-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: minmax(0, 2fr) minmax(18rem, 1.2fr);
    margin-bottom: 1.75rem;
    max-height: 80rem;
    opacity: 1;
    overflow: hidden;
    transition: max-height 320ms ease, margin-bottom 320ms ease, opacity 180ms ease, transform 320ms ease;
}

.hero-grid.is-collapsed {
    margin-bottom: 0;
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-0.75rem);
    visibility: hidden;
}

.hero-sidebars {
    display: grid;
    gap: 1rem;
}

.hero-copy,
.hero-panel,
.deal-card,
.filter-bar {
    backdrop-filter: blur(12px);
    background: rgba(10, 27, 36, 0.64);
    border: 1px solid rgba(173, 219, 208, 0.16);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(4, 12, 16, 0.25);
}

.hero-copy {
    padding: 1.8rem;
    min-width: 0;
}

.hero-kicker {
    color: #8de1ce;
    font-size: 0.8rem;
    letter-spacing: 0.18em;
    margin: 0 0 0.75rem;
    text-transform: uppercase;
}

.hero-copy h1 {
    font-family: "Avenir Next", "Segoe UI", sans-serif;
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 0.95;
    margin: 0;
    max-width: 14ch;
}

.hero-body {
    color: rgba(243, 247, 240, 0.82);
    font-size: 1.05rem;
    margin: 1rem 0 0;
    max-width: 60ch;
}

.hero-panel {
    display: grid;
    gap: 1rem;
    min-width: 0;
    padding: 1.4rem;
}

.exchange-rates-panel {
    overflow: hidden;
}

.exchange-rates-marquee {
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    overflow: hidden;
    width: 100%;
}

.exchange-rates-track {
    display: flex;
    gap: 1rem;
    min-width: max-content;
    width: max-content;
}

.exchange-rates-panel-ltr .exchange-rates-track {
    animation: exchange-rates-ltr 28s linear infinite;
}

.exchange-rates-panel-rtl .exchange-rates-track {
    animation: exchange-rates-rtl 28s linear infinite;
}

.exchange-rate-chip {
    flex: 0 0 auto;
    min-width: 15rem;
}

.stat-chip {
    background: rgba(243, 247, 240, 0.08);
    border-radius: 18px;
    padding: 1rem 1.1rem;
}

.stat-chip span {
    color: rgba(243, 247, 240, 0.68);
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.stat-chip strong {
    display: block;
    font-size: 1.4rem;
    overflow-wrap: anywhere;
}

.stat-chip-wide strong {
    font-size: 1rem;
}

.filter-bar {
    align-items: center;
    display: grid;
    gap: 0.9rem;
    grid-template-columns: minmax(0, 2fr) repeat(2, minmax(12rem, 1fr)) auto;
    margin-bottom: 1.5rem;
    padding: 1rem;
    position: sticky;
    top: calc(var(--masthead-sticky-height, 0px) + env(safe-area-inset-top, 0px) + 0.75rem);
    z-index: 20;
}

.filter-input,
.filter-select,
.refresh-button {
    border: 0;
    border-radius: 14px;
    font: inherit;
    min-height: 3rem;
    padding: 0.8rem 0.95rem;
}

.filter-input,
.filter-select {
    background: rgba(243, 247, 240, 0.93);
    color: #102028;
    min-width: 0;
}

.refresh-button {
    background: linear-gradient(135deg, #ffbf69, #f28482);
    color: #102028;
    font-weight: 700;
    white-space: nowrap;
}

.refresh-button:disabled {
    opacity: 0.7;
}

.feedback {
    margin: 1rem 0;
}

.error {
    color: #ffb3b8;
}

.card-grid {
    display: grid;
    gap: 1.2rem;
    grid-template-columns: repeat(auto-fit, minmax(21rem, 1fr));
}

.deal-card {
    min-width: 0;
    padding: 1.4rem;
}

.deal-card-header {
    align-items: start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.deal-brand {
    color: #8de1ce;
    letter-spacing: 0.16em;
    margin: 0 0 0.3rem;
    text-transform: uppercase;
}

.deal-brand-row {
    align-items: center;
    display: flex;
    gap: 0.45rem;
    margin-bottom: 0.3rem;
}

.deal-brand-row .deal-brand {
    margin-bottom: 0;
}

.price-list-button,
.price-modal-close {
    align-items: center;
    background: rgba(141, 225, 206, 0.12);
    border: 1px solid rgba(141, 225, 206, 0.28);
    color: #8de1ce;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
}

.price-list-button {
    border-radius: 8px;
    height: 1.75rem;
    padding: 0;
    width: 1.75rem;
}

.price-list-button svg {
    fill: none;
    height: 1rem;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 1rem;
}

.price-list-button:hover,
.price-list-button:focus-visible,
.price-modal-close:hover,
.price-modal-close:focus-visible {
    background: rgba(141, 225, 206, 0.24);
    outline: 2px solid #8de1ce;
    outline-offset: 2px;
}

.deal-card h2 {
    margin: 0;
    overflow-wrap: anywhere;
}

.price-pill {
    background: rgba(141, 225, 206, 0.16);
    border: 1px solid rgba(141, 225, 206, 0.24);
    border-radius: 999px;
    font-size: 0.95rem;
    padding: 0.6rem 0.9rem;
    white-space: nowrap;
}

.deal-summary {
    color: rgba(243, 247, 240, 0.8);
}

.deal-stats {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 1rem 0;
}

.deal-stats div {
    background: rgba(243, 247, 240, 0.06);
    border-radius: 16px;
    padding: 0.8rem;
}

.deal-stats dt {
    color: rgba(243, 247, 240, 0.66);
    font-size: 0.8rem;
    margin-bottom: 0.3rem;
}

.deal-stats dd {
    margin: 0;
}

.region-table {
    border-collapse: collapse;
    width: 100%;
}

.region-table th,
.region-table td {
    border-bottom: 1px solid rgba(243, 247, 240, 0.12);
    padding: 0.7rem 0;
}

.region-table th {
    color: rgba(243, 247, 240, 0.66);
    font-size: 0.8rem;
    font-weight: 600;
}

.regional-price {
    cursor: help;
    display: inline-block;
    position: relative;
}

.regional-price:focus-visible {
    border-radius: 4px;
    outline: 2px solid #8de1ce;
    outline-offset: 3px;
}

.regional-price-balloon {
    background: #f3f7f0;
    border: 1px solid rgba(16, 32, 40, 0.16);
    border-radius: 10px;
    bottom: calc(100% + 0.65rem);
    box-shadow: 0 10px 28px rgba(4, 12, 16, 0.35);
    color: #102028;
    font-size: 0.85rem;
    font-weight: 700;
    inset-inline-start: 50%;
    opacity: 0;
    padding: 0.5rem 0.7rem;
    pointer-events: none;
    position: absolute;
    transform: translate(-50%, 0.25rem);
    transition: opacity 140ms ease, transform 140ms ease;
    visibility: hidden;
    white-space: nowrap;
    z-index: 10;
}

.regional-price-balloon::after {
    border-left: 0.4rem solid transparent;
    border-right: 0.4rem solid transparent;
    border-top: 0.4rem solid #f3f7f0;
    content: "";
    inset-inline-start: 50%;
    position: absolute;
    top: 100%;
    transform: translateX(-50%);
}

.regional-price:hover .regional-price-balloon,
.regional-price:focus-visible .regional-price-balloon {
    opacity: 1;
    transform: translate(-50%, 0);
    visibility: visible;
}

.price-modal-backdrop {
    align-items: center;
    background: rgba(4, 12, 16, 0.78);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: clamp(1rem, 4vw, 3rem);
    position: fixed;
    z-index: 1000;
}

.price-modal-backdrop[hidden] {
    display: none;
}

.price-modal {
    background: #10242d;
    border: 1px solid rgba(173, 219, 208, 0.24);
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    max-height: min(48rem, calc(100vh - 2rem));
    max-width: 72rem;
    overflow: auto;
    padding: clamp(1rem, 3vw, 1.5rem);
    width: 100%;
}

.price-modal-header {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.price-modal-header h2 {
    margin: 0;
}

.price-modal-close {
    border-radius: 999px;
    flex: 0 0 auto;
    font-size: 1.5rem;
    height: 2.5rem;
    line-height: 1;
    width: 2.5rem;
}

.price-modal-table-wrap {
    overflow-x: auto;
}

.price-modal-table {
    border-collapse: collapse;
    min-width: 44rem;
    width: 100%;
}

.price-modal-table th,
.price-modal-table td {
    border-bottom: 1px solid rgba(243, 247, 240, 0.12);
    padding: 0.8rem 1rem 0.8rem 0;
    text-align: start;
}

.price-modal-table th {
    color: rgba(243, 247, 240, 0.66);
    font-size: 0.8rem;
}

.price-modal-table th.modal-sortable-header {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.price-modal-table th.modal-sortable-header:hover,
.price-modal-table th.modal-sortable-header:focus-visible {
    color: rgba(243, 247, 240, 0.92);
    outline: 2px solid #8de1ce;
    outline-offset: -2px;
}

.modal-sortable-header .sort-indicator {
    display: inline-block;
    font-size: 0.7rem;
    margin-inline-start: 0.25rem;
    min-width: 0.8rem;
}

.section-heading {
    margin: 2.5rem 0 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: rgba(243, 247, 240, 0.92);
    letter-spacing: 0.02em;
}

.section-heading:first-of-type {
    margin-top: 1rem;
}

.region-table th.sortable-header {
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.region-table th.sortable-header:hover,
.region-table th.sortable-header:focus-visible {
    color: rgba(243, 247, 240, 0.92);
    outline: none;
}

.region-table th.sortable-header .sort-indicator {
    font-size: 0.7rem;
    line-height: 1;
}

@keyframes exchange-rates-ltr {
    from {
        transform: translateX(-50%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes exchange-rates-rtl {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

@media (max-width: 1100px) {
    .filter-bar {
        grid-template-columns: minmax(0, 1fr) repeat(2, minmax(10rem, 1fr));
    }

    .refresh-button {
        grid-column: 1 / -1;
        justify-self: start;
    }
}

@media (max-width: 900px) {
    .hero-grid,
    .filter-bar,
    .hero-sidebars {
        grid-template-columns: 1fr;
    }

    .hero-copy,
    .hero-panel,
    .deal-card,
    .filter-bar {
        border-radius: 22px;
    }

    .hero-copy {
        padding: 1.5rem;
    }

    .deal-stats {
        grid-template-columns: 1fr;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    }
}

@media (max-width: 640px) {
    .hero-grid {
        gap: 1rem;
        margin-bottom: 1.15rem;
    }

    .hero-copy,
    .hero-panel,
    .deal-card,
    .filter-bar {
        border-radius: 18px;
    }

    .hero-copy,
    .hero-panel,
    .deal-card {
        padding: 1rem;
    }

    .hero-copy h1 {
        font-size: clamp(1.8rem, 9vw, 2.5rem);
        line-height: 1;
        max-width: none;
    }

    .hero-body {
        font-size: 0.98rem;
    }

    .stat-chip {
        padding: 0.85rem 0.95rem;
    }

    .exchange-rates-marquee {
        mask-image: none;
    }

    .exchange-rate-chip {
        min-width: 13rem;
    }

    .stat-chip strong {
        font-size: 1.1rem;
    }

    .stat-chip-wide strong {
        font-size: 0.95rem;
    }

    .filter-bar {
        gap: 0.75rem;
        margin-bottom: 1rem;
        padding: 0.85rem;
    }

    .filter-input,
    .filter-select,
    .refresh-button {
        min-height: 2.75rem;
        width: 100%;
    }

    .refresh-button {
        justify-self: stretch;
    }

    .card-grid {
        gap: 1rem;
        grid-template-columns: 1fr;
    }

    .deal-card-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.75rem;
    }

    .price-pill {
        white-space: normal;
    }

    .deal-summary {
        font-size: 0.95rem;
    }

    .deal-stats {
        gap: 0.65rem;
        margin: 0.85rem 0;
    }

    .region-table,
    .region-table thead,
    .region-table tbody,
    .region-table tr,
    .region-table th,
    .region-table td {
        display: block;
    }

    .region-table thead {
        display: none;
    }

    .region-table tr {
        border-bottom: 1px solid rgba(243, 247, 240, 0.12);
        padding: 0.7rem 0;
    }

    .region-table tr:first-child {
        padding-top: 0;
    }

    .region-table tr:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

    .region-table td {
        border-bottom: 0;
        padding: 0.2rem 0;
    }

    .region-table td:first-child {
        color: #f3f7f0;
        font-weight: 700;
    }
}

@media (min-width: 1400px) {
    .hero-grid {
        grid-template-columns: minmax(0, 2.2fr) minmax(22rem, 1fr);
    }

    .card-grid {
        grid-template-columns: repeat(auto-fit, minmax(24rem, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-grid {
        transition: none;
    }
}

:root[data-theme="light"] {
    color-scheme: light;
}

html[data-theme="light"],
html[data-theme="light"] body {
    background:
        radial-gradient(circle at top left, rgba(244, 162, 97, 0.2), transparent 28%),
        radial-gradient(circle at right 20%, rgba(61, 169, 160, 0.16), transparent 24%),
        linear-gradient(180deg, #f8fbf8 0%, #eaf2ef 100%);
    color: #1d3035;
}

:root[data-theme="light"] a,
:root[data-theme="light"] .btn-link {
    color: #087f73;
}

:root[data-theme="light"] a:hover {
    color: #a94c21;
}

:root[data-theme="light"] .masthead {
    background: rgba(248, 251, 248, 0.94);
    box-shadow: 0 8px 28px rgba(35, 65, 68, 0.08);
}

:root[data-theme="light"] .theme-toggle {
    background: #fff;
    border-color: rgba(54, 100, 98, 0.24);
    color: #20383b;
}

:root[data-theme="light"] .theme-toggle:hover,
:root[data-theme="light"] .theme-toggle:focus-visible {
    background: #e6f2ee;
    outline-color: #087f73;
}

:root[data-theme="light"] .nav-kicker,
:root[data-theme="light"] .culture-label {
    color: #52686a;
}

:root[data-theme="light"] .nav-home,
:root[data-theme="light"] .nav-home.active {
    color: #183b40;
}

:root[data-theme="light"] .nav-copy,
:root[data-theme="light"] .hero-body,
:root[data-theme="light"] .deal-summary {
    color: #4c6264;
}

:root[data-theme="light"] .hero-copy,
:root[data-theme="light"] .hero-panel,
:root[data-theme="light"] .deal-card,
:root[data-theme="light"] .filter-bar {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(54, 100, 98, 0.16);
    box-shadow: 0 16px 40px rgba(35, 65, 68, 0.1);
}

:root[data-theme="light"] .hero-kicker,
:root[data-theme="light"] .deal-brand {
    color: #087f73;
}

:root[data-theme="light"] .stat-chip {
    background: rgba(26, 77, 74, 0.06);
}

:root[data-theme="light"] .stat-chip span,
:root[data-theme="light"] .deal-stats dt,
:root[data-theme="light"] .region-table th,
:root[data-theme="light"] .price-modal-table th {
    color: #5a7071;
}

:root[data-theme="light"] .filter-input,
:root[data-theme="light"] .filter-select {
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(54, 100, 98, 0.2);
    color: #20383b;
}

:root[data-theme="light"] .refresh-button {
    background: linear-gradient(135deg, #f6b35f, #ed887c);
    color: #26383a;
}

:root[data-theme="light"] .error {
    color: #a52b3d;
}

:root[data-theme="light"] .price-list-button,
:root[data-theme="light"] .price-modal-close {
    background: rgba(8, 127, 115, 0.08);
    border-color: rgba(8, 127, 115, 0.24);
    color: #087f73;
}

:root[data-theme="light"] .price-list-button:hover,
:root[data-theme="light"] .price-list-button:focus-visible,
:root[data-theme="light"] .price-modal-close:hover,
:root[data-theme="light"] .price-modal-close:focus-visible {
    background: rgba(8, 127, 115, 0.16);
    outline-color: #087f73;
}

:root[data-theme="light"] .price-pill {
    background: rgba(8, 127, 115, 0.08);
    border-color: rgba(8, 127, 115, 0.18);
    color: #1d3035;
}

:root[data-theme="light"] .deal-stats div {
    background: rgba(26, 77, 74, 0.055);
}

:root[data-theme="light"] .region-table th,
:root[data-theme="light"] .region-table td,
:root[data-theme="light"] .price-modal-table th,
:root[data-theme="light"] .price-modal-table td {
    border-bottom-color: rgba(35, 65, 68, 0.14);
}

:root[data-theme="light"] .regional-price:focus-visible,
:root[data-theme="light"] .modal-sortable-header:hover,
:root[data-theme="light"] .modal-sortable-header:focus-visible {
    outline-color: #087f73;
}

:root[data-theme="light"] .price-modal-backdrop {
    background: rgba(25, 43, 45, 0.48);
}

:root[data-theme="light"] .price-modal {
    background: #fff;
    border-color: rgba(54, 100, 98, 0.2);
    box-shadow: 0 30px 80px rgba(24, 49, 51, 0.24);
}

:root[data-theme="light"] .price-modal-table th.modal-sortable-header:hover,
:root[data-theme="light"] .price-modal-table th.modal-sortable-header:focus-visible,
:root[data-theme="light"] .section-heading,
:root[data-theme="light"] .region-table td:first-child {
    color: #243e40;
}
