/* Home-only final layer. Loaded after the legacy reference stylesheet so
   the new calendar composition cannot be reordered or restyled by it. */
#view-home[style*="display: block"] .home-islamic-calendar { order: -10; }
#view-home[style*="display: block"] #home-location-panel { order: -9; }
#view-home[style*="display: block"] .home-prayer-priority { order: -8; }
#view-home[style*="display: block"] .home-continue-section { order: -7; }
#view-home[style*="display: block"] .home-shortcuts { order: -6; }
#view-home[style*="display: block"] #home-daily-times-container { order: -5; }
#view-home[style*="display: block"] #home-notifications-container { order: -4; }
#view-home[style*="display: block"] #home-settings-container { order: -3; }

#view-home .home-prayer-priority > .home-next-prayer-card {
    display: grid;
    grid-template-columns: 52% 48%;
    min-height: 184px;
    margin: 0;
    padding: 0 !important;
    overflow: hidden;
    color: var(--sm-ink) !important;
    border: 1px solid var(--sm-line) !important;
    border-radius: 20px !important;
    background: color-mix(in srgb, var(--sm-surface) 97%, transparent) !important;
    box-shadow: 0 9px 28px rgba(34,55,47,.055) !important;
}

#view-home .home-prayer-priority > .home-next-prayer-card::after { display: none !important; }
#view-home .home-prayer-priority > .home-next-prayer-card > * { position: relative; z-index: 1; }
#view-home .home-next-prayer-copy > span { color: var(--sm-green) !important; font-size: .68rem !important; }
#view-home .home-next-prayer-copy h3 { color: var(--sm-ink) !important; font-size: 1.75rem !important; }
#view-home .home-next-prayer-copy > div > strong { color: var(--sm-green) !important; font-size: 1rem !important; }
#view-home .home-next-prayer-copy > p { color: var(--sm-purple) !important; font-size: .72rem !important; }
#view-home .home-next-prayer-copy footer span { color: var(--sm-muted) !important; font-size: .65rem !important; }
#view-home .home-next-prayer-copy footer button { color: var(--sm-green) !important; font-size: .63rem !important; }

@media (max-width: 400px) {
    #view-home .home-prayer-priority > .home-next-prayer-card { grid-template-columns: 54% 46%; }
    #view-home .home-next-prayer-copy h3 { font-size: 1.55rem !important; }
}

/* Final Home header + five-column nav hotfix. No ornamental image behind text. */
.app-container > .home-main-header {
    position: relative;
    min-height: 0;
    padding: 0 2px 15px;
    overflow: visible;
    text-align: center;
}
.home-main-header .home-header-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0 0 14px;
}
.home-header-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 106px;
    height: 44px;
    min-width: 106px;
    min-height: 44px;
    box-sizing: border-box;
    padding: 5px 12px 5px 7px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb,#b88938 38%,var(--sm-line));
    border-radius: 999px;
    background: color-mix(in srgb,var(--sm-surface) 97%,#fff6df);
    color: var(--sm-green);
    font: 750 .77rem/1 var(--sm-sans);
    box-shadow: 0 7px 18px rgba(59,48,31,.11);
}
.home-header-pill-icon {
    display: grid;
    place-items: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    overflow: hidden;
    border-radius: 50%;
}
.home-header-pill-icon img { width: 32px; height: 32px; max-width: none; object-fit: contain; }
.home-header-brand { display: flex; flex-direction: column; align-items: center; width: 100%; }
.home-header-crescent {
    position: relative;
    display: block;
    width: 55px;
    height: 32px;
    margin: 0 auto 3px;
    color: #b88938;
    font-family: Georgia,serif;
}
.home-header-crescent b {
    position: absolute;
    top: -10px;
    left: 6px;
    font-size: 2.85rem;
    font-weight: 400;
    line-height: 1;
}
.home-header-crescent i {
    position: absolute;
    top: 4px;
    right: 5px;
    font-size: .72rem;
    font-style: normal;
}
.app-container > .home-main-header .home-header-brand > h1 {
    position: static;
    margin: 0 0 4px;
    color: var(--sm-ink);
    font-family: 'Playfair Display',Georgia,serif;
    font-size: clamp(2rem,9vw,2.5rem);
    font-weight: 650;
    line-height: 1.04;
    letter-spacing: -.025em;
    text-align: center;
}
.app-container > .home-main-header .home-header-brand > .brand-desc {
    position: static;
    max-width: none;
    margin: 0;
    color: var(--sm-muted);
    font-family: var(--sm-sans);
    font-size: .82rem;
    text-align: center;
}
.home-main-header .home-header-ornament,
.home-main-header > .home-graphic-header { display: none !important; }

#view-tabs.bottom-nav {
    display: grid !important;
    grid-template-columns: repeat(5,minmax(0,1fr)) !important;
    align-items: stretch;
    overflow: hidden;
}
#view-tabs .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    gap: 2px !important;
    color: #8a8d88 !important;
}
#view-tabs .home-nav-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    overflow: hidden;
    border-radius: 50%;
    background: transparent;
    transform: none;
}
#view-tabs .home-nav-icon img {
    display: block;
    width: 36px;
    height: 36px;
    max-width: none;
    object-fit: contain;
    opacity: .48;
    filter: grayscale(1) sepia(.1);
}
#view-tabs .bottom-nav-item[data-nav-key="impara"] .home-nav-icon img { width: 36px; height: 36px; transform: none; }
#view-tabs .bottom-nav-item[data-nav-key="vita"] .home-nav-icon,
#view-tabs .bottom-nav-item[data-nav-key="vita"] .home-nav-icon img {
    place-self: center;
    transform: none;
}
#view-tabs .bottom-nav-item > span:last-child { color: inherit; font-size: .58rem; font-weight: 650; }
#view-tabs .bottom-nav-item::after {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: transparent;
}
#view-tabs .bottom-nav-item.is-active { color: var(--sm-green) !important; }
#view-tabs .bottom-nav-item.is-active .home-nav-icon { background: color-mix(in srgb,var(--sm-green-soft) 78%,var(--sm-surface)); }
#view-tabs .bottom-nav-item.is-active .home-nav-icon img { opacity: 1; filter: none; }
#view-tabs .bottom-nav-item.is-active > span:last-child { color: var(--sm-green); font-weight: 800; }
#view-tabs .bottom-nav-item.is-active::after { background: var(--sm-green); }

@media (max-width: 400px) {
    .home-header-pill { width: 100px; min-width: 100px; height: 42px; min-height: 42px; }
    #view-tabs .home-nav-icon { width: 42px; height: 42px; }
}

/* Home Graphic Lock V2 — assets and proportions from the approved boards. */
.home-graphic-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0 0 15px;
    padding: 0;
}
.home-header-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 98px;
    min-height: 43px;
    padding: 7px 14px 7px 10px;
    border: 1px solid color-mix(in srgb, #b88938 30%, var(--sm-line));
    border-radius: 999px;
    background: color-mix(in srgb, var(--sm-surface) 97%, #fff5de);
    color: var(--sm-green);
    font: 750 .77rem/1 var(--sm-sans);
    box-shadow: 0 5px 15px rgba(59,48,31,.09);
}
.home-header-chip img { width: 27px; height: 27px; object-fit: contain; }
.app-container > header > h1 { font-family: 'Playfair Display',Georgia,serif; font-weight: 650; }
#view-home .home-islamic-calendar {
    padding: 5px;
    border: 1px solid color-mix(in srgb,#b88938 62%,var(--sm-line));
    background: color-mix(in srgb,var(--sm-surface) 98%,#f5e6c6);
    box-shadow: 0 10px 28px rgba(65,49,27,.09);
}
#view-home .home-islamic-calendar::before {
    content: '';
    position: absolute;
    pointer-events: none;
    inset: 4px;
    border: 1px solid color-mix(in srgb,#b88938 58%,transparent);
    border-radius: inherit;
}
#home-calendar-source-decoration .home-calendar-quran-art {
    display: block;
    width: 58px;
    height: 52px;
    object-fit: contain;
    filter: drop-shadow(0 3px 2px rgba(70,48,20,.16));
}
.home-calendar-message footer[data-source-type="hadith"] .home-calendar-quran-art { display: none; }
.home-location-setup-head > span img { width: 39px; height: 39px; object-fit: contain; }
#view-home .home-continue-card {
    display: grid;
    grid-template-columns: minmax(0,1fr) 48px;
    align-items: center;
    gap: 10px;
}
#view-home .home-continue-copy { display: block; min-width: 0; }
#view-home .home-continue-approved-icon { width: 48px; height: 48px; object-fit: contain; }
#view-home .home-continue-card > i { display: none; }
.home-shortcut-tile > span img,
.home-shortcuts-empty > span img { width: 38px; height: 38px; object-fit: contain; }
.home-shortcuts-empty > span { display: grid; place-items: center; margin-bottom: 7px; }
.home-nav-icon { position: relative; display: block; width: 29px; height: 29px; }
.home-nav-icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.home-nav-icon .is-active { opacity: 0; }
.bottom-nav-item.active .home-nav-icon .is-inactive { opacity: 0; }
.bottom-nav-item.active .home-nav-icon .is-active { opacity: 1; }
.bottom-nav-item .home-nav-icon + span { font-size: .6rem; font-weight: 650; }
.bottom-nav-item.active .home-nav-icon + span { color: var(--sm-green); font-weight: 850; }
#amin-fab { display: none !important; }

@media (max-width: 400px) {
    .home-header-chip { min-width: 92px; padding-inline: 9px 12px; }
    .home-header-chip img { width: 25px; height: 25px; }
    .home-nav-icon { width: 27px; height: 27px; }
}

/* Home UI Polish V3 — header geometry and normalized five-item navigation. */
.app-container > header {
    position: relative;
    isolation: isolate;
    min-height: 174px;
    padding: 0 2px 8px;
    overflow: visible;
    text-align: center;
}
.home-graphic-header {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0;
}
.home-header-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 104px;
    min-width: 104px;
    height: 44px;
    min-height: 44px;
    box-sizing: border-box;
    gap: 7px;
    padding: 5px 12px 5px 7px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb,#b88938 38%,var(--sm-line)) !important;
    border-radius: 999px;
    background: color-mix(in srgb,var(--sm-surface) 97%,#fff6df) !important;
    color: var(--sm-green);
    font: 750 .77rem/1 var(--sm-sans);
    box-shadow: 0 7px 18px rgba(59,48,31,.11);
}
.home-toggle-btn { margin-right: 0; }
.home-header-icon {
    display: grid;
    place-items: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    overflow: hidden;
    border-radius: 50%;
}
.home-header-icon img {
    width: 34px;
    height: 34px;
    max-width: none;
    object-fit: contain;
}
.home-header-chip > span:last-child { display: block; line-height: 1; }
.home-header-ornament {
    position: absolute;
    z-index: 0;
    top: 43px;
    left: 50%;
    width: min(340px,94vw);
    height: 132px;
    transform: translateX(-50%);
    object-fit: contain;
    object-position: center top;
    pointer-events: none;
}
.app-container > header > h1 {
    position: relative;
    z-index: 1;
    margin: 55px 0 4px;
    color: var(--sm-ink);
    font-family: 'Playfair Display',Georgia,serif;
    font-weight: 650;
    letter-spacing: -.025em;
    text-align: center;
    font-size: clamp(2rem,9vw,2.55rem);
    line-height: 1.02;
}
.app-container > header > .brand-desc {
    position: relative;
    z-index: 1;
    max-width: none;
    margin: 0;
    text-align: center;
}
.bottom-nav {
    display: grid !important;
    grid-template-columns: repeat(5,minmax(0,1fr));
    align-items: stretch;
    overflow: hidden;
}
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    width: 100%;
}
.home-nav-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    overflow: hidden;
}
.home-nav-icon img {
    position: static;
    display: block;
    width: 34px;
    height: 34px;
    max-width: none;
    object-fit: contain;
}
.bottom-nav-item[data-nav-key="impara"] .home-nav-icon img { transform: scale(1.08); }
.bottom-nav-item.active .home-nav-icon { transform: translateY(-1px); }
.bottom-nav-item.active .home-nav-icon + span { color: var(--sm-green); }

@media (max-width: 400px) {
    .home-header-chip { width: 98px; min-width: 98px; height: 42px; min-height: 42px; padding: 5px 10px 5px 6px; }
    .home-header-icon { flex-basis: 28px; width: 28px; height: 28px; }
    .home-header-icon img { width: 32px; height: 32px; }
    .app-container > header { min-height: 165px; }
    .home-header-ornament { top: 41px; width: min(320px,94vw); height: 124px; }
    .app-container > header > h1 { margin-top: 52px; }
    .home-nav-icon,.home-nav-icon img { width: 32px; height: 32px; }
}
