@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Tajawal:wght@400;500;700&display=swap');

:root {
    --bg-top: #edf5ff;
    --bg-mid: #d8ebff;
    --bg-bottom: #c3dffa;
    --panel: rgba(255, 255, 255, 0.92);
    --surface-soft: #eef6ff;
    --ink: #102438;
    --muted: #5a7088;
    --brand: #0f6ecf;
    --brand-strong: #0b4f94;
    --stroke: rgba(10, 40, 70, 0.14);
    --shadow: 0 16px 34px rgba(11, 36, 59, 0.16);
    --radius-xl: 20px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    font-family: 'Outfit', 'Tajawal', sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 8%, #ffffff 0%, transparent 45%),
        radial-gradient(circle at 88% 0%, #f3f9ff 0%, transparent 42%),
        linear-gradient(180deg, var(--bg-top), var(--bg-mid) 44%, var(--bg-bottom));
    padding: 0 0 calc(92px + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.5;
    background-image:
        linear-gradient(120deg, rgba(15, 110, 207, 0.05) 25%, transparent 25%),
        linear-gradient(300deg, rgba(11, 79, 148, 0.05) 25%, transparent 25%);
    background-size: 34px 34px;
}

body.modal-open {
    overflow: hidden;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font-family: inherit;
}

.hidden,
.is-hidden {
    display: none !important;
}

.wall-shell {
    width: min(1120px, calc(100% - 26px));
    max-width: 100%;
    margin: 16px auto 24px;
}

.wall-header {
    background: var(--panel);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-xl);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(6px);
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-wrap--logo-only {
    justify-content: center;
}

.brand-logo {
    width: 170px;
    height: auto;
}

main {
    margin-top: 14px;
}

.page-section {
    display: block;
}

.toolbar-card {
    background: var(--panel);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-xl);
    padding: 14px;
    box-shadow: var(--shadow);
}

.toolbar-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.toolbar-row {
    margin-top: 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.search-input-wrap {
    position: relative;
    min-width: 0;
}

.search-input-wrap i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #6f88a1;
    pointer-events: none;
}

.search-input-wrap input {
    width: 100%;
    border: 1px solid var(--stroke);
    border-radius: 14px;
    padding: 13px 14px 13px 40px;
    background: #fff;
    color: var(--ink);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input-wrap input:focus {
    border-color: rgba(15, 110, 207, 0.6);
    box-shadow: 0 0 0 4px rgba(15, 110, 207, 0.12);
}

.sort-button {
    border: 1px solid rgba(15, 110, 207, 0.3);
    border-radius: 14px;
    padding: 12px 14px;
    background: #ebf5ff;
    color: var(--brand-strong);
    font-weight: 700;
    font-size: 0.86rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.sort-button:hover {
    transform: translateY(-1px);
    background: #e0efff;
    box-shadow: 0 8px 16px rgba(12, 72, 130, 0.16);
}

.sort-button.active {
    background: var(--brand);
    color: #fff;
}

.offers-layout {
    margin-top: 14px;
    min-width: 0;
}

.sections-stack {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.compact-section,
.all-offers-section,
.account-panel {
    background: var(--panel);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-xl);
    padding: 14px;
    box-shadow: var(--shadow);
    min-width: 0;
}

.compact-section--featured {
    border-left: 5px solid #0f74d5;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.section-head h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.section-note {
    font-size: 0.74rem;
    color: var(--muted);
    background: var(--surface-soft);
    border: 1px solid var(--stroke);
    border-radius: 999px;
    padding: 5px 10px;
    white-space: nowrap;
}

.compact-track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 2px 2px 6px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    min-width: 0;
}

.compact-track::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.compact-track::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb,
.floating-country-popover::-webkit-scrollbar-thumb {
    background: rgba(15, 110, 207, 0.35);
    border-radius: 999px;
}

.mini-offer {
    scroll-snap-align: start;
    min-width: 282px;
    max-width: 282px;
    flex: 0 0 auto;
    border: 1px solid #d2e5f7;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f5fbff 100%);
    padding: 10px 12px;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    text-align: left;
}

.mini-offer:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(8, 41, 72, 0.16);
    border-color: rgba(15, 110, 207, 0.45);
}

.mini-thumb {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #d5e7f8;
    background: #eef6ff;
}

.mini-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mini-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mini-title {
    margin: 0;
    font-size: 0.84rem;
    font-weight: 700;
    color: #113251;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mini-type-badge {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.mini-type-badge--easy {
    color: #0b7748;
    background: #e5f7ee;
    border-color: #bde6d1;
}

.mini-type-badge--multi {
    color: #985400;
    background: #fff3e4;
    border-color: #f4d8b2;
}

.mini-context-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 0;
}

.mini-context-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
    border-radius: 999px;
    padding: 3px 7px;
    font-size: 0.64rem;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid transparent;
}

.mini-context-chip i {
    font-size: 0.66rem;
    flex: 0 0 auto;
}

.mini-context-chip--os {
    color: #1a4f84;
    background: #edf6ff;
    border-color: #cfe3f7;
}

.mini-context-chip--country {
    color: #5b3f0e;
    background: #fff8ea;
    border-color: #f1ddbd;
}

.mini-context-chip--country-trigger {
    cursor: pointer;
    user-select: none;
}

.mini-context-chip--country-trigger:focus-visible {
    outline: 2px solid #2b7fd2;
    outline-offset: 2px;
}

.mini-country-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #e6f1ff;
    color: #144677;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 0 4px;
}

.mini-points {
    min-width: 78px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.mini-points-label {
    font-size: 0.64rem;
    font-weight: 700;
    color: #5c7792;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.mini-payout {
    background: transparent;
    border-radius: 0;
    padding: 0;
    font-size: 1rem;
    line-height: 1.1;
    font-weight: 800;
    color: #0a4f99;
    white-space: nowrap;
}

.mini-points--unlimited {
    min-width: 116px;
}

.mini-points--unlimited .mini-points-label {
    color: #2c628f;
}

.section-head--all {
    margin-bottom: 12px;
}

.count-pill {
    font-size: 0.76rem;
    color: var(--brand-strong);
    border: 1px solid rgba(15, 110, 207, 0.25);
    background: #edf6ff;
    border-radius: 999px;
    padding: 5px 10px;
    font-weight: 700;
    white-space: nowrap;
}

.offers-list {
    display: grid;
    gap: 12px;
    contain: layout;
    min-width: 0;
}

.offer-card {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--stroke);
    border-radius: 16px;
    background: #fff;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    min-width: 0;
}

.offer-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(7, 32, 57, 0.16);
    border-color: rgba(15, 110, 207, 0.42);
}

.offer-card__media {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    overflow: hidden;
    background: #ebf5ff;
}

.offer-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.offer-card__body {
    min-width: 0;
}

.offer-card__title {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.3;
}

.offer-card__text {
    margin: 6px 0 0;
    font-size: 0.84rem;
    line-height: 1.4;
    color: var(--muted);
}

.offer-card__meta {
    margin-top: 9px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.offer-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.offer-type--simple {
    background: #dff3ea;
    color: #0f7a4d;
}

.offer-type--simple::before {
    content: '\f058';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.7rem;
}

.offer-type--multi {
    background: #fff1e2;
    color: #b45900;
}

.offer-type--multi::before {
    content: '\f0ae';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.7rem;
}

.offer-region {
    font-size: 0.7rem;
    font-weight: 700;
    color: #4b6580;
    border: 1px solid #d8e4f0;
    background: #f7fbff;
    border-radius: 999px;
    padding: 4px 9px;
}

.offer-card__reward {
    text-align: right;
    min-width: 104px;
    border-radius: 13px;
    padding: 9px 10px 9px 12px;
    background: #f3f9ff;
    border: 1px solid #d8e9fb;
}

.offer-card__reward--unlimited {
    border-color: #b9daf6;
    background: linear-gradient(180deg, #f5fbff 0%, #edf7ff 100%);
}

.reward-label {
    display: block;
    font-size: 0.68rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.reward-value {
    display: block;
    margin-top: 2px;
    font-size: 1rem;
    line-height: 1.1;
    font-weight: 800;
    color: var(--brand-strong);
}

.reward-currency {
    display: block;
    margin-top: 2px;
    font-size: 0.72rem;
    color: #39628d;
}

.infinity-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 5px 10px;
    background: linear-gradient(135deg, #0f6ecf 0%, #0a4f99 45%, #1aa173 100%);
    color: #fff;
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 10px 20px rgba(9, 59, 109, 0.24);
}

.infinity-pill__symbol {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
}

.infinity-pill--mini {
    font-size: 0.64rem;
    padding: 4px 8px;
}

.infinity-pill--mini .infinity-pill__symbol {
    width: 15px;
    height: 15px;
    font-size: 0.9rem;
}

.infinity-pill--card {
    margin-top: 4px;
}

.state-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--stroke);
    background: #fff;
}

.state-box p {
    margin: 0;
    font-weight: 600;
}

.state-box--error {
    border-color: #e9b3b3;
    background: #fff5f5;
    color: #9a2f2f;
}

.state-box--neutral {
    border-color: #cdddf0;
    background: #f4f9ff;
    color: #1d4f80;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(6, 22, 39, 0.66);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1350;
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    width: min(760px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 20px;
    border: 1px solid rgba(10, 35, 61, 0.12);
    box-shadow: 0 30px 80px rgba(9, 24, 40, 0.45);
    padding: 22px 20px 18px;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 1px solid var(--stroke);
    border-radius: 10px;
    background: #fff;
    color: #4a6f97;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    background: #eff6ff;
    color: #123d69;
}

.modal-hero {
    display: grid;
    grid-template-columns: 106px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.modal-image {
    width: 106px;
    height: 106px;
    object-fit: cover;
    border-radius: 15px;
    border: 1px solid var(--stroke);
}

.modal-copy h2 {
    margin: 0;
    font-size: 1.24rem;
}

.modal-copy p {
    margin: 8px 0 0;
    font-size: 0.92rem;
    color: var(--muted);
    line-height: 1.45;
}

.modal-tags {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.reward-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 12px;
    background: #eaf4ff;
    color: var(--brand-strong);
    font-size: 0.76rem;
    font-weight: 800;
}

.reward-chip--unlimited {
    gap: 7px;
    background: linear-gradient(135deg, #0f6ecf 0%, #0a4f99 40%, #1aa173 100%);
    color: #fff;
}

.reward-chip--unlimited .infinity-pill__symbol {
    width: 17px;
    height: 17px;
    font-size: 0.92rem;
}

.event-unlimited {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: 800;
    color: #124b84;
    background: #eaf4ff;
    border: 1px solid #c8def4;
    white-space: nowrap;
}

.event-unlimited__symbol {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #d7eaff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    line-height: 1;
}

.events-section,
.additional-requirements {
    margin-top: 18px;
}

.events-section h3,
.additional-requirements h3 {
    margin: 0 0 10px;
    font-size: 0.95rem;
}

.requirements-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--stroke);
    border-radius: 14px;
    overflow: hidden;
}

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

.requirements-table th {
    background: #0f6ecf;
    color: #fff;
}

.requirements-table tbody tr:nth-child(even) {
    background: #f7fbff;
}

.empty-events {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.rules-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.rules-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.84rem;
    color: #3b4e64;
}

.rules-list i {
    margin-top: 2px;
    color: #c24f4f;
    font-size: 0.8rem;
}

.start-button-link {
    display: block;
    margin-top: 18px;
}

.start-button {
    width: 100%;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #0f6ecf, #0a4f99);
    color: #fff;
    font-size: 0.98rem;
    font-weight: 700;
    padding: 13px 16px;
    cursor: pointer;
}

.start-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(10, 79, 153, 0.3);
}

.main-nav {
    position: fixed;
    left: 50%;
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    width: min(560px, calc(100% - 16px));
    padding: 7px;
    border-radius: 15px;
    background: rgba(12, 39, 66, 0.95);
    border: 1px solid rgba(183, 214, 243, 0.25);
    box-shadow: 0 14px 28px rgba(3, 15, 29, 0.42);
    backdrop-filter: blur(8px);
    z-index: 1300;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.main-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 8px;
    border-radius: 11px;
    color: #d8ebff;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
}

.main-nav a:hover {
    background: rgba(31, 93, 155, 0.6);
}

.main-nav a.active {
    background: #1f5d9b;
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(209, 229, 255, 0.2);
}

.account-topbar {
    background: #fff;
    border: 1px solid var(--stroke);
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 12px;
}

.account-view-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.account-switch-btn {
    border: 1px solid #cdddf0;
    background: #f3f8ff;
    color: #234b71;
    border-radius: 11px;
    padding: 10px 12px;
    font-size: 0.84rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
}

.account-switch-btn:hover {
    background: #e9f3ff;
}

.account-switch-btn.active {
    border-color: #1e68b0;
    background: #1f5d9b;
    color: #fff;
    box-shadow: 0 8px 16px rgba(18, 69, 120, 0.24);
}

.account-pane {
    display: none;
}

.account-pane.is-active {
    display: block;
}

.account-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.account-stat-card {
    background: #fff;
    border: 1px solid var(--stroke);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.account-stat-card--points {
    border-color: #b8d8f6;
    background: linear-gradient(180deg, #ffffff 0%, #f2f9ff 100%);
}

.stat-label {
    font-size: 0.74rem;
    color: #5b7590;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.stat-value {
    font-size: 1.08rem;
    color: #122b44;
    line-height: 1.1;
}

.stat-value--points {
    color: #0a4f99;
    font-size: 1.18rem;
}

.stat-sub {
    color: #5f7690;
    font-size: 0.73rem;
}

.account-section {
    background: #fff;
    border: 1px solid var(--stroke);
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 12px;
}

.account-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.account-section-head h3 {
    margin: 0;
    font-size: 0.97rem;
    color: #153a5f;
}

.section-mini-note {
    font-size: 0.72rem;
    color: #5d7894;
}

.empty-history-card {
    border: 1px dashed #bfd4e8;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    color: #436381;
    background: #f7fbff;
}

.empty-history-card i {
    font-size: 1.12rem;
    margin-bottom: 6px;
}

.empty-history-card p {
    margin: 0;
    font-weight: 600;
}

.history-list {
    display: grid;
    gap: 10px;
}

.history-card {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    border: 1px solid #dbe9f5;
    border-radius: 13px;
    padding: 9px;
    background: #fbfdff;
    min-width: 0;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.history-card:hover {
    transform: translateY(-1px);
    border-color: #c4dcf2;
    box-shadow: 0 10px 22px rgba(12, 42, 68, 0.1);
}

.history-card--clicked {
    border-color: #c8dff3;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.history-card--clicked .history-card-media {
    border-color: #c7def3;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.history-card--clicked .history-card-content h4 {
    color: #163e67;
}

.history-card-media {
    width: 70px;
    height: 70px;
    border-radius: 11px;
    overflow: hidden;
    background: #edf5ff;
    border: 1px solid #d8e7f7;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-placeholder {
    color: #6b8bab;
    font-size: 0.86rem;
}

.history-card-content {
    min-width: 0;
}

.history-card-content h4 {
    margin: 0;
    font-size: 0.9rem;
    color: #173c63;
}

.history-tags {
    margin-top: 7px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.history-tag {
    font-size: 0.68rem;
    border-radius: 999px;
    border: 1px solid #d6e5f3;
    background: #f2f8ff;
    color: #355a7d;
    padding: 4px 8px;
    font-weight: 700;
}

.history-tag--clicks {
    background: linear-gradient(180deg, #eef7ff 0%, #e3f2ff 100%);
    border-color: #c5dcf4;
    color: #1e537f;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    font-size: 0.69rem;
}

.history-tag--reward {
    background: #e8f6ee;
    border-color: #c8e8d4;
    color: #0f6542;
}

.history-dates {
    margin-top: 8px;
    display: grid;
    gap: 3px;
}

.history-dates span {
    font-size: 0.7rem;
    color: #5f7891;
}

.history-date-line {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.history-date-line i {
    color: #5a7da0;
    font-size: 0.67rem;
}

.history-card-side {
    min-width: 108px;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.history-card-side--clicked {
    min-width: 136px;
    border: 1px solid #cfe3f7;
    background: linear-gradient(180deg, #f6fbff 0%, #eef6ff 100%);
    border-radius: 10px;
    padding: 8px 9px;
}

.history-card-side strong {
    font-size: 0.8rem;
    color: #183f66;
}

.clicked-points {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    line-height: 1;
}

.clicked-points-value {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.clicked-points-currency {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: lowercase;
    opacity: 0.86;
}

.clicked-points--done .clicked-points-value {
    color: #0f6a41;
}

.clicked-points--done .clicked-points-currency {
    color: #267452;
}

.clicked-points--pending .clicked-points-value {
    color: #2c4f70;
}

.clicked-points--pending .clicked-points-currency {
    color: #4f6d89;
}

.status-badge {
    font-size: 0.67rem;
    border-radius: 999px;
    padding: 5px 9px;
    font-weight: 700;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
}

.status-badge--done {
    background: #dff2e6;
    color: #107247;
    border-color: #bfe2ce;
}

.status-badge--pending {
    background: #fff4e7;
    color: #9d580b;
    border-color: #eccca2;
}

.stage-progress-wrap {
    margin-top: 8px;
}

.stage-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.72rem;
    color: #4b6988;
    font-weight: 600;
}

.stage-progress-head strong {
    color: #1c4f81;
}

.stage-progress-bar {
    margin-top: 6px;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #e9f2fb;
    overflow: hidden;
}

.stage-progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0f6ecf, #3ba4f6);
}

.stages-list {
    margin-top: 9px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.stage-chip {
    font-size: 0.66rem;
    font-weight: 700;
    color: #2e5073;
    background: #f1f8ff;
    border: 1px solid #d4e5f5;
    border-radius: 999px;
    padding: 4px 8px;
}

.stage-chip--more {
    color: #6f4f16;
    background: #fff7e8;
    border-color: #f0ddbe;
}

.history-card--expandable {
    cursor: pointer;
}

.history-card--expandable:focus-visible {
    outline: 2px solid #2f7ecf;
    outline-offset: 2px;
}

.history-card--expandable.is-expanded {
    border-color: #b7d8f4;
    background: linear-gradient(180deg, #ffffff 0%, #f3f9ff 100%);
    box-shadow: 0 12px 26px rgba(10, 44, 75, 0.1);
}

.completed-stages-toggle {
    margin-top: 8px;
    border: 1px solid #c8def3;
    border-radius: 10px;
    background: linear-gradient(180deg, #f6fbff 0%, #edf6ff 100%);
    color: #1d507f;
    min-height: 34px;
    padding: 7px 10px;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.completed-stages-toggle:hover {
    border-color: #a8caeb;
    background: linear-gradient(180deg, #eef7ff 0%, #e4f2ff 100%);
    color: #143f68;
}

.completed-stages-toggle:active {
    transform: translateY(1px);
}

.completed-stages-toggle i {
    font-size: 0.76rem;
}

.completed-stages-panel {
    margin-top: 10px;
    border: 1px solid #d3e4f5;
    border-radius: 11px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    padding: 8px;
    display: grid;
    gap: 6px;
}

.completed-stages-panel[hidden] {
    display: none !important;
}

.completed-stages-list {
    display: grid;
    gap: 6px;
}

.completed-stage-row {
    border: 1px solid #dce9f6;
    border-radius: 10px;
    padding: 7px 8px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.completed-stage-row.is-done {
    background: linear-gradient(180deg, #f1fbf6 0%, #e9f7f0 100%);
    border-color: #bfe3cf;
}

.completed-stage-row.is-pending {
    background: linear-gradient(180deg, #f9fcff 0%, #f3f8fe 100%);
    border-color: #d7e6f5;
}

.completed-stage-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    color: #4f7296;
}

.completed-stage-row.is-done .completed-stage-icon {
    color: #1f9a60;
}

.completed-stage-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.completed-stage-copy strong {
    font-size: 0.74rem;
    color: #1d4163;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.completed-stage-copy small {
    font-size: 0.64rem;
    font-weight: 700;
    color: #5f7c98;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.completed-stage-row.is-done .completed-stage-copy small {
    color: #1d8958;
}

.completed-stage-reward {
    display: grid;
    justify-items: end;
    gap: 2px;
    text-align: right;
}

.completed-stage-reward-points {
    font-size: 0.74rem;
    font-weight: 800;
    color: #134d86;
    line-height: 1.1;
    white-space: nowrap;
}

.completed-stage-reward small {
    font-size: 0.62rem;
    font-weight: 700;
    color: #5f7c98;
    text-transform: lowercase;
}

.floating-country-popover {
    position: fixed;
    left: 0;
    top: 0;
    width: clamp(214px, 52vw, 272px);
    max-height: 216px;
    overflow: auto;
    padding: 11px;
    border-radius: 14px;
    border: 1px solid #c5daef;
    background:
        radial-gradient(circle at 100% 0%, #f2f8ff 0%, transparent 42%),
        linear-gradient(180deg, #ffffff 0%, #f4f9ff 100%);
    box-shadow: 0 16px 32px rgba(8, 32, 56, 0.22);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px) scale(0.98);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    pointer-events: none;
    z-index: 1320;
}

.floating-country-popover.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.floating-country-popover::before {
    content: '';
    position: absolute;
    top: -6px;
    left: var(--country-popover-arrow-left, 18px);
    width: 10px;
    height: 10px;
    background: #f8fcff;
    border-left: 1px solid #c5daef;
    border-top: 1px solid #c5daef;
    transform: rotate(45deg);
}

.floating-country-popover.is-above::before {
    top: auto;
    bottom: -6px;
    transform: rotate(225deg);
    border-left: 0;
    border-top: 0;
    border-right: 1px solid #c5daef;
    border-bottom: 1px solid #c5daef;
}

.floating-country-popover__head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.71rem;
    font-weight: 800;
    color: #1d4d7e;
    margin-bottom: 9px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.floating-country-popover__count {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    padding: 0 6px;
    font-size: 0.65rem;
    font-weight: 800;
    color: #0e4778;
    background: #e7f2ff;
    border: 1px solid #cbe0f7;
}

.floating-country-popover__close {
    margin-left: 6px;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    border: 1px solid #c5daef;
    background: #ffffff;
    color: #2e557a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex: 0 0 auto;
    transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.floating-country-popover__close:hover {
    background: #eff6ff;
    color: #133f67;
    border-color: #afcce8;
}

.floating-country-popover__list {
    display: grid;
    gap: 7px;
}

.floating-country-popover__item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.71rem;
    font-weight: 700;
    color: #274f73;
    background: #fff;
    border: 1px solid #d4e4f4;
    border-radius: 9px;
    padding: 6px 8px;
    line-height: 1.2;
}

.floating-country-popover__item::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: linear-gradient(135deg, #0f6ecf, #43a2f2);
    box-shadow: 0 0 0 2px #eaf4ff;
    flex: 0 0 auto;
}

.floating-country-popover::-webkit-scrollbar {
    width: 7px;
}

@media (min-width: 1080px) {
    .offers-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .wall-shell {
        width: calc(100% - 16px);
        margin: 10px auto 18px;
    }

    .wall-header,
    .toolbar-card,
    .compact-section,
    .all-offers-section,
    .account-panel {
        border-radius: 16px;
        padding: 12px;
    }

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

    .history-card {
        grid-template-columns: 66px minmax(0, 1fr);
    }

    .history-card-side {
        grid-column: 1 / -1;
        align-items: flex-start;
        text-align: left;
        min-width: 0;
        padding-top: 4px;
        border-top: 1px dashed #d7e6f4;
    }

    .history-card-side--clicked {
        width: 100%;
        justify-content: space-between;
        flex-direction: row;
        align-items: center;
    }
}

@media (max-width: 740px) {
    .brand-logo {
        width: 154px;
    }

    .toolbar-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .sort-button,
    .search-input-wrap input {
        min-height: 44px;
    }

    .sort-button {
        width: 100%;
        justify-content: center;
    }

    .section-note {
        display: none;
    }

    .compact-section--featured .section-note--featured-note {
        display: inline-flex !important;
    }

    .mini-offer {
        min-width: min(90vw, 300px);
        max-width: min(90vw, 300px);
        grid-template-columns: 48px minmax(0, 1fr) auto;
        padding: 9px 10px;
    }

    .mini-thumb {
        width: 48px;
        height: 48px;
    }

    .mini-title {
        font-size: 0.8rem;
    }

    .mini-payout {
        font-size: 0.92rem;
    }

    .offer-card {
        grid-template-columns: 58px minmax(0, 1fr);
        gap: 9px;
        padding: 10px;
    }

    .offer-card__media {
        width: 58px;
        height: 58px;
    }

    .offer-card__reward {
        grid-column: 1 / -1;
        text-align: left;
        display: flex;
        align-items: baseline;
        gap: 6px;
        min-width: 0;
        width: 100%;
    }

    .reward-label,
    .reward-currency,
    .reward-value {
        display: inline;
        margin: 0;
    }

    .modal-content {
        padding: 20px 14px 14px;
    }

    .modal-hero {
        grid-template-columns: 1fr;
    }

    .modal-image {
        width: 90px;
        height: 90px;
    }

    .floating-country-popover {
        width: min(76vw, 226px);
        max-height: 184px;
    }

    .main-nav {
        width: calc(100% - 14px);
        transform: translateX(-50%);
    }

    .main-nav a {
        padding: 8px 6px;
        font-size: 0.78rem;
    }
}

@media (max-width: 560px) {
    .wall-shell {
        width: calc(100% - 12px);
        margin: 8px auto 14px;
    }

    .offer-card__title {
        font-size: 0.9rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .offer-card__text {
        font-size: 0.8rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .offer-type,
    .offer-region {
        font-size: 0.66rem;
        padding: 4px 7px;
    }

    .account-overview-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .history-card {
        grid-template-columns: 56px minmax(0, 1fr);
    }

    .history-card-media {
        width: 56px;
        height: 56px;
        border-radius: 10px;
    }

    .history-card-content h4 {
        font-size: 0.84rem;
    }

    .history-dates span {
        font-size: 0.68rem;
    }

    .completed-stage-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .completed-stage-reward {
        grid-column: 2 / -1;
        justify-items: start;
        text-align: left;
    }
}

@media (max-width: 420px) {
    .wall-shell {
        width: calc(100% - 10px);
    }

    .account-overview-grid {
        grid-template-columns: 1fr;
    }

    .mini-offer {
        min-width: 88vw;
        max-width: 88vw;
    }

    .mini-context-chip {
        font-size: 0.62rem;
    }
}

/* Mobile webview fallback */
@media screen and (max-device-width: 740px) {
    .wall-shell {
        width: calc(100% - 12px) !important;
        margin: 8px auto 14px !important;
    }

    .toolbar-row {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .sort-button,
    .search-input-wrap input {
        min-height: 44px !important;
    }

    .sort-button {
        width: 100% !important;
        justify-content: center !important;
    }

    .section-note {
        display: none !important;
    }

    .compact-section--featured .section-note--featured-note {
        display: inline-flex !important;
    }

    .mini-offer {
        min-width: 88vw !important;
        max-width: 88vw !important;
    }

    .offer-card {
        grid-template-columns: 58px minmax(0, 1fr) !important;
        gap: 9px !important;
        padding: 10px !important;
    }

    .offer-card__media {
        width: 58px !important;
        height: 58px !important;
    }

    .offer-card__reward {
        grid-column: 1 / -1 !important;
        text-align: left !important;
        display: flex !important;
        align-items: baseline !important;
        gap: 6px !important;
        min-width: 0 !important;
        width: 100% !important;
    }

    .reward-label,
    .reward-currency,
    .reward-value {
        display: inline !important;
        margin: 0 !important;
    }

    .main-nav {
        width: calc(100% - 12px) !important;
    }
}
