/* Smart Muslim — final dark-mode layer.
   Every rule is scoped to .dark-theme so the approved light mode is untouched. */
body.dark-theme {
    --dark-bg: #071813;
    --dark-surface: #0d211a;
    --dark-surface-raised: #122920;
    --dark-surface-soft: #18342a;
    --dark-text: #f3eee4;
    --dark-text-secondary: #aebcb5;
    --dark-text-muted: #788b82;
    --dark-border: #355348;
    --dark-border-soft: #29443a;
    --dark-green: #17644f;
    --dark-mint: #95cfb7;
    --dark-gold: #b9872e;
    --dark-coral: #ef8f85;

    --sm-canvas: var(--dark-bg);
    --sm-surface: var(--dark-surface);
    --sm-surface-soft: var(--dark-surface-raised);
    --sm-ink: var(--dark-text);
    --sm-muted: var(--dark-text-secondary);
    --sm-line: var(--dark-border-soft);
    --sm-green: var(--dark-mint);
    --sm-green-soft: var(--dark-surface-soft);
    --sm-coral: var(--dark-coral);
    --sm-coral-soft: #3b2726;
    --primary: var(--dark-mint);
    --primary-light: var(--dark-surface-soft);
    --text-dark: var(--dark-text);
    --text-muted: var(--dark-text-secondary);
    --surface: var(--dark-surface);
    --bg-warm: var(--dark-bg);
    --bg-light: var(--dark-surface);
    --border-color: var(--dark-border-soft);
    background: #04100d;
    color: var(--dark-text);
}

body.dark-theme .app-container {
    background: var(--dark-bg);
    color: var(--dark-text);
}

/* Header pills: same geometry, dark premium treatment. */
body.dark-theme .home-header-pill,
body.dark-theme .home-header-chip {
    color: var(--dark-mint);
    border-color: color-mix(in srgb, var(--dark-gold) 48%, var(--dark-border));
    background: color-mix(in srgb, var(--dark-surface-raised) 90%, transparent);
    box-shadow: 0 7px 20px rgba(0, 0, 0, .28);
}
body.dark-theme .home-header-crescent { color: var(--dark-gold); }
body.dark-theme .app-container > .home-main-header .home-header-brand > h1 { color: var(--dark-text); }
body.dark-theme .app-container > .home-main-header .home-header-brand > .brand-desc { color: var(--dark-text-secondary); }

/* Home: calendar composition is intentionally excluded. */
body.dark-theme #view-home #home-location-panel,
body.dark-theme #view-home .home-continue-section,
body.dark-theme #view-home .home-shortcuts {
    color: var(--dark-text);
    border-color: var(--dark-border-soft);
    background: var(--dark-surface);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .24);
}
body.dark-theme .home-location-setup-head > span,
body.dark-theme .home-shortcut-tile > span {
    color: var(--dark-mint);
    background: var(--dark-surface-soft);
}
body.dark-theme .home-location-setup-head strong,
body.dark-theme .home-shortcuts-head h3,
body.dark-theme #view-home .home-continue-card strong { color: var(--dark-text); }
body.dark-theme .home-location-setup-head small,
body.dark-theme .home-location-privacy,
body.dark-theme #view-home .home-continue-card small,
body.dark-theme .home-shortcut-tile small,
body.dark-theme .home-shortcuts-empty small { color: var(--dark-text-secondary); }
body.dark-theme .home-location-actions button {
    color: var(--dark-text);
    border-color: var(--dark-green);
    background: var(--dark-green);
}
body.dark-theme .home-location-actions button + button {
    color: var(--dark-mint);
    border-color: var(--dark-border);
    background: var(--dark-surface-raised);
}
body.dark-theme #view-home .home-prayer-priority > .home-next-prayer-card {
    color: var(--dark-text) !important;
    border-color: var(--dark-border-soft) !important;
    background: var(--dark-surface) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .26) !important;
}
body.dark-theme #view-home .home-next-prayer-copy {
    background: var(--dark-surface);
}
body.dark-theme #view-home .home-next-prayer-copy > span,
body.dark-theme #view-home .home-next-prayer-copy > div > strong,
body.dark-theme #view-home .home-next-prayer-copy footer button { color: var(--dark-mint) !important; }
body.dark-theme #view-home .home-next-prayer-copy h3 { color: var(--dark-text) !important; }
body.dark-theme #view-home .home-next-prayer-copy > p { color: #c5b4db !important; }
body.dark-theme #view-home .home-next-prayer-copy footer span { color: var(--dark-text-secondary) !important; }
body.dark-theme #view-home .home-next-prayer-art { background: var(--dark-surface-soft); }
body.dark-theme #view-home .home-next-prayer-art::before {
    background: linear-gradient(90deg, var(--dark-surface) 0%, rgba(13, 33, 26, .84) 18%, transparent 48%);
}
body.dark-theme #view-home .home-continue-card,
body.dark-theme .home-shortcut-tile {
    color: var(--dark-text);
    border-color: var(--dark-border-soft);
    background: var(--dark-surface-raised);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}
body.dark-theme .home-shortcuts-head button,
body.dark-theme .home-shortcut-tile.is-add { color: var(--dark-mint); }
body.dark-theme .home-shortcut-tile.is-add { border-color: var(--dark-mint); }
body.dark-theme .home-shortcuts-empty {
    color: var(--dark-mint);
    border-color: var(--dark-mint);
    background: var(--dark-surface-raised);
}

/* Vita: retain the coral identity on true dark surfaces. */
body.dark-theme .hub-vita .hub-title,
body.dark-theme .hub-vita .hub-eyebrow,
body.dark-theme .hub-vita .hub-group-label { color: var(--dark-coral); }
body.dark-theme .hub-vita .hub-group {
    border-color: var(--dark-border-soft);
    background: var(--dark-surface);
}
body.dark-theme .hub-vita .hub-card {
    color: var(--dark-text);
    border-color: var(--dark-border-soft);
    background: var(--dark-surface-raised);
    box-shadow: 0 5px 16px rgba(0, 0, 0, .2);
}
body.dark-theme .hub-vita .hub-card strong { color: var(--dark-text); }
body.dark-theme .hub-vita .hub-card small { color: var(--dark-text-secondary); }
body.dark-theme .hub-vita .hub-icon {
    color: var(--dark-coral);
    background: #3b2726;
}
body.dark-theme .hub-vita .hub-card::after { color: var(--dark-coral); }

/* Impara: token alignment only. */
body.dark-theme .hub-impara .hub-group,
body.dark-theme .hub-impara .hub-card {
    border-color: var(--dark-border-soft);
    background: var(--dark-surface);
}
body.dark-theme .hub-impara .hub-card strong { color: var(--dark-text); }
body.dark-theme .hub-impara .hub-card small { color: var(--dark-text-secondary); }

/* Routine: colour-only alignment. */
body.dark-theme .rt-card,
body.dark-theme .rt-prayer-card,
body.dark-theme .rt-other-card,
body.dark-theme .rt-searchwrap {
    color: var(--dark-text);
    border-color: var(--dark-border-soft);
    background: var(--dark-surface);
}
body.dark-theme .rt-card-head h2,
body.dark-theme .rt-panel-intro h2,
body.dark-theme .rt-prayer-card strong,
body.dark-theme .rt-other-card strong { color: var(--dark-text); }
body.dark-theme .rt-panel-intro p,
body.dark-theme .rt-prayer-card small,
body.dark-theme .rt-other-card small { color: var(--dark-text-secondary); }
body.dark-theme .rt-prayer-icon,
body.dark-theme .rt-other-icon,
body.dark-theme .rt-card-icon { color: var(--dark-mint); background: var(--dark-surface-soft); }
body.dark-theme .smart-segmented-control {
    border-color: var(--dark-border-soft);
    background: var(--dark-surface-raised);
}
body.dark-theme .smart-segmented-item { color: var(--dark-text-secondary); }
body.dark-theme .smart-segmented-item.is-active {
    color: var(--dark-text);
    background: var(--dark-green);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}
body.dark-theme .rt-mood-search-submit,
body.dark-theme .rt-card-action.is-primary {
    color: var(--dark-text);
    border-color: var(--dark-green);
    background: var(--dark-green);
}
body.dark-theme .sm-add-home-action {
    color: var(--dark-mint);
    border-color: var(--dark-border);
    background: var(--dark-surface-raised);
}
body.dark-theme .sm-add-home-action.is-added {
    color: var(--dark-text);
    border-color: var(--dark-green);
    background: var(--dark-green);
}

/* Amin assistant. */
body.dark-theme #view-amin .results-title { color: var(--dark-text); }
body.dark-theme #view-amin .smart-muted-center { color: var(--dark-text-secondary); }
body.dark-theme #view-amin .search-container,
body.dark-theme #view-amin .local-assistant-answer,
body.dark-theme #view-amin .assistant-history-item {
    color: var(--dark-text);
    border-color: var(--dark-border-soft);
    background: var(--dark-surface);
}
body.dark-theme #view-amin .search-label { color: var(--dark-text); }
body.dark-theme #view-amin .search-input {
    color: var(--dark-text);
    caret-color: var(--dark-mint);
    border-color: var(--dark-border);
    background: var(--dark-surface-raised);
}
body.dark-theme #view-amin .search-input::placeholder { color: var(--dark-text-muted); opacity: 1; }
body.dark-theme #view-amin .search-icon-btn {
    color: var(--dark-text);
    border-color: var(--dark-green);
    background: var(--dark-green);
}
body.dark-theme #view-amin .assistant-source-card,
body.dark-theme #view-amin .assistant-linked-box {
    color: var(--dark-text);
    border-color: var(--dark-border);
    background: var(--dark-surface-raised);
}

/* Shared five-item bottom navigation. */
body.dark-theme #view-tabs.bottom-nav {
    border-color: var(--dark-border-soft);
    background: rgba(7, 24, 19, .97);
    box-shadow: 0 -8px 28px rgba(0, 0, 0, .34);
}
body.dark-theme #view-tabs .bottom-nav-item { color: var(--dark-text-muted) !important; }
body.dark-theme #view-tabs .bottom-nav-item .home-nav-icon img {
    opacity: .64;
    filter: grayscale(1) brightness(1.55) sepia(.15) hue-rotate(95deg);
}
body.dark-theme #view-tabs .bottom-nav-item.is-active { color: var(--dark-mint) !important; }
body.dark-theme #view-tabs .bottom-nav-item.is-active .home-nav-icon {
    background: color-mix(in srgb, var(--dark-mint) 16%, var(--dark-surface-raised));
}
body.dark-theme #view-tabs .bottom-nav-item.is-active .home-nav-icon img { opacity: 1; filter: none; }
body.dark-theme #view-tabs .bottom-nav-item.is-active > span:last-child { color: var(--dark-mint); }
body.dark-theme #view-tabs .bottom-nav-item.is-active::after { background: var(--dark-mint); }
