/* Reminders-only light-theme corrections. No global layout, scrolling or garage rules. */
html[data-theme="light"] body.ebadi-reminders-page .vehicle-context-tabs a:not(.is-active) {
    border-color: #dfe5e8 !important;
    background: #fff !important;
    color: #263238 !important;
    box-shadow: 0 2px 8px rgba(35, 48, 58, .045) !important;
}
html[data-theme="light"] body.ebadi-reminders-page .vehicle-context-tabs a.is-active {
    border-color: #c48631 !important;
    background: #c48631 !important;
    color: #171b20 !important;
}
/* Inline empty-state SVG had no intrinsic size limit and expanded to its default size. */
html[data-theme="light"] body.ebadi-reminders-page .reminders-empty > .ebadi-mono-icon {
    display: grid !important;
    place-items: center !important;
    width: 64px !important;
    height: 64px !important;
    margin: 0 auto 12px !important;
    padding: 0 !important;
    border-radius: 18px;
    background: #fff0d8;
    color: #171b20 !important;
    line-height: 1 !important;
}
html[data-theme="light"] body.ebadi-reminders-page .reminders-empty > .ebadi-mono-icon > svg {
    display: block !important;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    max-width: 30px !important;
    max-height: 30px !important;
    fill: none !important;
    stroke: #171b20 !important;
    stroke-width: 1.75 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}

/* iOS: the shared app header already accounts for the top safe area.
 * The legacy CRUD canvas added it a second time above the reminders title.
 * Keep the reminders heading at the same small offset as other app pages.
 * Strictly scoped: no changes to navigation, scroll, or other routes. */
html[data-theme="light"] body.ebadi-reminders-page.ebadi-crud-page .reminders-app.ebadi-crud-app {
    padding-top: 12px !important;
}


/* Readability follow-up after the global font increase.
 * Fix profile summary and quick-access tiles so content can breathe on mobile.
 */
@media (max-width:640px) {
    html[data-theme="light"] body .profile-page .profile-summary-card {
        grid-template-columns: minmax(0,1.35fr) minmax(0,.9fr) minmax(0,1fr) !important;
        gap: 8px !important;
        min-height: 0 !important;
        padding: 8px !important;
        border-radius: 20px !important;
    }
    html[data-theme="light"] body .profile-page .profile-summary-card__identity,
    html[data-theme="light"] body .profile-page .profile-summary-card__stat {
        min-height: 112px !important;
        height: auto !important;
        border-radius: 14px !important;
    }
    html[data-theme="light"] body .profile-page .profile-summary-card__identity {
        gap: 8px !important;
        padding: 10px 8px !important;
    }
    html[data-theme="light"] body .profile-page .profile-summary-card__avatar {
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
        flex-basis: 50px !important;
    }
    html[data-theme="light"] body .profile-page .profile-summary-card__identity h2 {
        font-size: var(--eb-fs-caption) !important;
        line-height: 1.45 !important;
        white-space: normal !important;
    }
    html[data-theme="light"] body .profile-page .profile-summary-card__identity small {
        white-space: normal !important;
        line-height: 1.45 !important;
    }
    
    html[data-theme="light"] body .profile-page .profile-summary-card__stat {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 4px !important;
        padding: 10px 6px !important;
        text-align: center !important;
    }
    html[data-theme="light"] body .profile-page .profile-summary-card__stat:before { display: none !important; }
    html[data-theme="light"] body .profile-page .profile-summary-card__stat small {
        white-space: normal !important;
        line-height: 1.4 !important;
    }
    html[data-theme="light"] body .profile-page .profile-summary-card__stat strong {
        margin: 0 !important;
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        max-width: 100% !important;
        white-space: normal !important;
        text-align: center !important;
        line-height: 1.35 !important;
    }
    html[data-theme="light"] body .profile-page .profile-summary-card__stat--level strong {
        font-size: var(--eb-fs-caption) !important;
    }
    html[data-theme="light"] body .profile-page .profile-summary-card__stat--wallet strong {
        font-size: var(--eb-fs-label) !important;
    }
    html[data-theme="light"] body .profile-page .profile-summary-card__stat em {
        margin: 0 !important;
        line-height: 1.2 !important;
    }
    html[data-theme="light"] body .profile-page .profile-summary-card__club-link {
        margin-top: auto !important;
        min-width: 0 !important;
        width: auto !important;
        max-width: 100% !important;
        height: 26px !important;
        padding: 0 8px !important;
        white-space: nowrap !important;
    }

    html[data-theme="light"] body .profile-page .profile-quick-access__grid {
        grid-template-columns: repeat(5,minmax(0,1fr)) !important;
        gap: 8px !important;
    }
    html[data-theme="light"] body .profile-page .profile-quick-access__grid > a {
        height: auto !important;
        min-height: 98px !important;
        padding: 10px 5px !important;
        gap: 8px !important;
        justify-content: flex-start !important;
        border-radius: 14px !important;
    }
    html[data-theme="light"] body .profile-page .profile-quick-access__grid svg {
        width: 26px !important;
        height: 26px !important;
        flex: 0 0 26px !important;
    }
    html[data-theme="light"] body .profile-page .profile-quick-access__grid strong {
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        min-height: 2.9em !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: normal !important;
        line-height: 1.45 !important;
        padding-inline: 0 !important;
    }
}

@media (max-width:380px) {
    html[data-theme="light"] body .profile-page .profile-summary-card {
        grid-template-columns: minmax(0,1.25fr) minmax(0,.92fr) minmax(0,.98fr) !important;
        gap: 6px !important;
        padding: 6px !important;
    }
    html[data-theme="light"] body .profile-page .profile-summary-card__identity,
    html[data-theme="light"] body .profile-page .profile-summary-card__stat {
        min-height: 108px !important;
    }
    html[data-theme="light"] body .profile-page .profile-quick-access__grid {
        gap: 6px !important;
    }
    html[data-theme="light"] body .profile-page .profile-quick-access__grid > a {
        min-height: 94px !important;
        padding: 9px 4px !important;
    }
    html[data-theme="light"] body .profile-page .profile-quick-access__grid svg {
        width: 24px !important;
        height: 24px !important;
        flex-basis: 24px !important;
    }
}

/* Profile summary layout: all three actions share .profile-summary-card__club-link.
   Only placement is specific to the identity column. */
.profile-page .profile-summary-card__identity {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 8px;
    row-gap: 4px;
    min-width: 0;
}
.profile-page .profile-summary-card__identity > .profile-summary-card__avatar {
    grid-column: 1;
    grid-row: 1;
}
.profile-page .profile-summary-card__identity > div {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    width: 100%;
    height: auto;
}
.profile-page .profile-summary-card__identity > .profile-summary-card__club-link {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
    align-self: end;
    margin: 0 !important;
    max-width: 100%;
    white-space: nowrap;
}

/* On wide centered views, keep the same action baseline as the profile column. */
@media (min-width: 641px) {
    .profile-page .profile-summary-card__stat {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 4px;
        padding-bottom: 14px;
    }
    .profile-page .profile-summary-card__stat > .profile-summary-card__club-link {
        margin-top: auto !important;
        align-self: center;
    }
}
