/* ==========================================================================
   Inner Monk App Shell
   ========================================================================== */

:root {
    --im-sidebar-width: 260px;
    --im-topbar-height: 56px;
    --im-color-primary: #1a1a2e;
    --im-color-primary-light: #25253e;
    --im-color-accent: #c2cd23;
    --im-color-accent-hover: #a8b31e;
    --im-color-text: #1a1a2e;
    --im-color-text-light: #6b7280;
    --im-color-text-inverse: #ffffff;
    --im-color-bg: #f8f7f4;
    --im-color-card: #ffffff;
    --im-color-border: #e5e5e5;
    --im-color-sidebar-bg: #1a1a2e;
    --im-color-sidebar-text: rgba(255, 255, 255, 0.85);
    --im-color-sidebar-hover: rgba(255, 255, 255, 0.1);
    --im-color-sidebar-active: rgba(194, 205, 35, 0.15);
    --im-radius: 8px;
    --im-radius-lg: 12px;
    --im-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --im-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Reset for app shell */
body.im-app {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--im-color-bg);
    color: var(--im-color-text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body.im-app *,
body.im-app *::before,
body.im-app *::after {
    box-sizing: border-box;
}

/* Reset all body spacing from WP/Kadence */
body.im-app,
body.im-app.admin-bar {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

html {
    margin-top: 0 !important;
}

/* Alpine cloak */
[x-cloak] { display: none !important; }

/* ==========================================================================
   Layout
   ========================================================================== */

.im-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
}

.im-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--im-sidebar-width);
    background: var(--im-color-sidebar-bg);
    color: var(--im-color-sidebar-text);
    z-index: 100;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
}

.im-sidebar--open {
    transform: translateX(0);
}

.im-main {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.im-topbar {
    position: sticky;
    top: 0;
    height: var(--im-topbar-height);
    background: var(--im-color-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 50;
}

.im-topbar__logo {
    height: 32px;
    width: auto;
    display: block;
}

.im-topbar__spacer {
    width: 40px;
}

.im-hamburger {
    background: none;
    border: none;
    padding: 8px;
    margin: -8px;
    cursor: pointer;
    color: var(--im-color-text-inverse);
    border-radius: var(--im-radius);
    transition: background 0.15s;
}

.im-hamburger:hover {
    background: rgba(255, 255, 255, 0.1);
}

.im-main {
    background-image: url('../media/home-hero.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    position: relative;
}

.im-main::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(248, 247, 244, 0.75);
    z-index: 0;
    pointer-events: none;
}

.im-main > * {
    position: relative;
    z-index: 1;
}

.im-content {
    flex: 1;
    padding: 20px 16px;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
}

/* Views that benefit from a wider column (e.g. the live video embed) tag
   their fragment root with .im-fragment--wide. Browsers without :has()
   simply keep the standard width — graceful fallback. */
.im-content:has(.im-fragment--wide) {
    max-width: 960px;
}

/* Desktop: sidebar always visible */
@media (min-width: 768px) {
    .im-sidebar {
        transform: translateX(0);
    }

    .im-sidebar-overlay[style] {
        display: none !important;
    }

    .im-main {
        margin-left: var(--im-sidebar-width);
    }

    .im-hamburger {
        display: none;
    }

    .im-topbar {
        display: none;
    }

    .im-content {
        padding: 40px 24px 32px;
    }
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .im-topbar {
        padding: 0 16px;
    }

    @supports (padding-top: env(safe-area-inset-top)) {
        .im-topbar {
            padding-top: env(safe-area-inset-top);
            height: calc(var(--im-topbar-height) + env(safe-area-inset-top));
        }
    }

    .im-content {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }

    .im-sidebar {
        padding-top: env(safe-area-inset-top);
    }

    .im-sidebar__bottom {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }

    .im-history__item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.im-sidebar__logo {
    padding: 20px 16px 0;
}

.im-sidebar__logo-img {
    display: block;
    max-width: 175px;
    margin: 0 auto;
    height: auto;
}

.im-sidebar__logo-subtitle {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    letter-spacing: 0.05em;
    margin-top: 10px;
    text-align: center;
    margin-bottom: 10px;
}

.im-sidebar__user {
    padding: 16px 16px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.im-sidebar__avatar img {
    border-radius: 50%;
    display: block;
}

.im-sidebar__user-name {
    font-weight: 600;
    font-size: 14px;
}

.im-sidebar__signin-btn {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: var(--im-color-accent);
    color: var(--im-color-primary);
    text-align: center;
    text-decoration: none;
    border-radius: var(--im-radius);
    font-weight: 600;
    font-size: 14px;
    transition: background 0.15s;
}

.im-sidebar__signin-btn:hover {
    background: var(--im-color-accent-hover);
}

.im-sidebar__nav {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    flex: 1;
}

.im-sidebar__nav li {
    margin: 0;
}

.im-sidebar__nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--im-color-sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 0;
    transition: background 0.15s;
}

.im-sidebar__nav a:hover {
    background: var(--im-color-sidebar-hover);
}

.im-sidebar__nav a svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.im-sidebar__link--active {
    background: var(--im-color-sidebar-active) !important;
    color: var(--im-color-accent) !important;
}

.im-sidebar__link--active svg {
    opacity: 1 !important;
    stroke: var(--im-color-accent);
}

.im-sidebar__divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 8px 16px;
}

.im-sidebar__link--external {
    opacity: 0.7;
}

.im-sidebar__bottom {
    padding: 8px 0 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

a.im-sidebar__bottom-user,
.im-sidebar__bottom-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--im-color-sidebar-text);
    transition: background 0.15s;
}

a.im-sidebar__bottom-user:hover {
    background: var(--im-color-sidebar-hover);
}

.im-sidebar__bottom-user .im-sidebar__avatar img {
    border-radius: 50%;
    display: block;
}

.im-sidebar__bottom-user .im-sidebar__user-name {
    font-size: 14px;
    font-weight: 500;
}

.im-sidebar__link--logout {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--im-color-sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.7;
    transition: background 0.15s, opacity 0.15s;
}

.im-sidebar__link--logout:hover {
    background: var(--im-color-sidebar-hover);
    opacity: 1;
}

/* ==========================================================================
   Prayer Card
   ========================================================================== */

.im-prayer__card {
    background: var(--im-color-card);
    border-radius: var(--im-radius-lg);
    padding: 28px 24px;
    box-shadow: var(--im-shadow);
    margin-bottom: 20px;
}

.im-prayer__type {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--im-color-primary);
    margin-bottom: 16px;
}

.im-prayer__text {
    font-size: 18px;
    line-height: 1.7;
    color: var(--im-color-text);
    font-family: Georgia, 'Times New Roman', serif;
    margin-bottom: 20px;
}

.im-prayer__text p {
    margin: 0 0 12px;
}

.im-prayer__text p:last-child {
    margin-bottom: 0;
}

.im-prayer__date {
    font-size: 13px;
    color: var(--im-color-text-light);
    margin-bottom: 20px;
}

.im-prayer__empty {
    color: var(--im-color-text-light);
    font-style: italic;
}

.im-prayer__action {
    padding-top: 4px;
}

/* ==========================================================================
   Visitor Banner
   ========================================================================== */

.im-banner {
    background: var(--im-color-primary);
    color: var(--im-color-text-inverse);
    padding: 16px 20px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: sticky;
    bottom: 0;
    z-index: 40;
}

.im-banner__content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.im-banner__text {
    flex: 1;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
    opacity: 0.9;
    min-width: 200px;
}

.im-banner__text strong {
    opacity: 1;
}

.im-banner__actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.im-banner__badge {
    height: 32px;
    width: auto;
    display: block;
}

.im-banner__close {
    background: none;
    border: none;
    color: var(--im-color-text-inverse);
    opacity: 0.5;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

.im-banner__close:hover {
    opacity: 1;
}

@media (max-width: 767px) {
    .im-banner__content {
        flex-direction: column;
        gap: 12px;
    }

    .im-banner__actions {
        align-self: center;
    }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.im-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: var(--im-radius);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}

.im-btn:active {
    transform: scale(0.98);
}

.im-btn--primary {
    background: var(--im-color-accent);
    color: var(--im-color-primary);
}

.im-btn--primary:hover {
    background: var(--im-color-accent-hover);
}

.im-btn--secondary {
    background: var(--im-color-primary);
    color: #fff;
}

.im-btn--outline {
    background: transparent;
    color: var(--im-color-text);
    border: 1px solid var(--im-color-border);
}

.im-btn--outline:hover {
    background: rgba(0, 0, 0, 0.03);
}

/* Destructive action (account deletion): outlined in red so it reads as
   serious without shouting, filled on hover/press. */
.im-btn--danger {
    background: transparent;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.im-btn--danger:hover {
    background: #b91c1c;
    color: #fff;
    border-color: #b91c1c;
}

.im-btn--prayer {
    background: var(--im-color-accent);
    color: var(--im-color-primary);
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    gap: 8px;
}

.im-btn--prayer:hover {
    background: var(--im-color-accent-hover);
}

.im-btn--full {
    width: 100%;
}

.im-btn--small {
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
}

.im-btn--prayed {
    background: #4ade80;
    color: var(--im-color-primary);
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    cursor: default;
    gap: 8px;
}

.im-prayer__total {
    text-align: center;
    font-size: 13px;
    color: var(--im-color-text-light);
    margin: 8px 0 0;
}

/* ==========================================================================
   Forms
   ========================================================================== */

.im-form {
    max-width: 400px;
    margin: 0 auto;
}

.im-form__field {
    margin-bottom: 16px;
}

.im-form__field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--im-color-text);
}

.im-form__field input {
    width: 100%;
    padding: 10px 12px;
    font-size: 16px;
    border: 1px solid var(--im-color-border);
    border-radius: var(--im-radius);
    background: var(--im-color-card);
    color: var(--im-color-text);
    transition: border-color 0.15s;
}

.im-form__field input:focus {
    outline: none;
    border-color: var(--im-color-accent);
    box-shadow: 0 0 0 3px rgba(194, 205, 35, 0.2);
}

/* ==========================================================================
   Account
   ========================================================================== */

.im-account {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px 0;
}

.im-account__heading {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 24px;
    text-align: center;
}

.im-account__profile {
    text-align: center;
    margin-bottom: 32px;
}

.im-account__avatar img {
    border-radius: 50%;
    display: inline-block;
    margin-bottom: 12px;
}

.im-account__name {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px;
}

.im-account__email {
    font-size: 14px;
    color: var(--im-color-text-light);
    margin: 0;
}

.im-account__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.im-account__switch {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--im-color-text-light);
}

.im-account__fineprint {
    margin: 14px 0 0;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
    color: var(--im-color-text-light);
}

.im-account__fineprint a {
    color: inherit;
    text-decoration: underline;
}

.im-account__card {
    background: var(--im-color-card);
    border-radius: var(--im-radius-lg);
    padding: 28px 24px;
    box-shadow: var(--im-shadow);
    margin-bottom: 20px;
}

.im-account__card .im-form {
    max-width: none;
}

.im-account__subheading {
    font-size: 14px;
    color: var(--im-color-text-light);
    text-align: center;
    margin: -12px 0 24px;
}

.im-account__forgot {
    display: block;
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
    color: var(--im-color-text-light);
    text-decoration: none;
}

.im-account__forgot:hover {
    color: var(--im-color-text);
}

.im-account__callout {
    background: var(--im-color-primary);
    color: var(--im-color-text-inverse);
    border-radius: var(--im-radius-lg);
    padding: 24px;
    text-align: center;
}

.im-account__callout-heading {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px;
}

.im-account__callout-text {
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.85;
    margin: 0 0 20px;
}

.im-account__callout .im-btn--secondary {
    background: var(--im-color-accent);
    color: var(--im-color-primary);
}

.im-account__switch a {
    color: var(--im-color-accent);
    text-decoration: none;
    font-weight: 600;
}

.im-account__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.im-form__error {
    color: #dc2626;
    font-size: 14px;
    margin: 0 0 12px;
    padding: 10px 12px;
    background: #fef2f2;
    border-radius: var(--im-radius);
}

.im-form__success {
    color: #16a34a;
    font-size: 14px;
    margin: 0 0 12px;
    padding: 10px 12px;
    background: #f0fdf4;
    border-radius: var(--im-radius);
}

/* ==========================================================================
   History
   ========================================================================== */

.im-history__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.im-stat {
    background: var(--im-color-card);
    border-radius: var(--im-radius);
    padding: 16px 12px;
    text-align: center;
    box-shadow: var(--im-shadow);
}

.im-stat__number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--im-color-accent);
}

.im-stat__label {
    display: block;
    font-size: 12px;
    color: var(--im-color-text-light);
    margin-top: 4px;
}

.im-history__profile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 20px;
}

.im-history__avatar img {
    border-radius: 50%;
    display: block;
}

.im-history__user-name {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: var(--im-color-text);
}

.im-history__user-since {
    font-size: 13px;
    color: var(--im-color-text-light);
    margin: 2px 0 0;
}

.im-history__empty {
    text-align: center;
    color: var(--im-color-text-light);
    padding: 32px 0;
}

/* ==========================================================================
   Calendar
   ========================================================================== */

.im-calendar {
    background: var(--im-color-card);
    border-radius: var(--im-radius-lg);
    padding: 20px;
    box-shadow: var(--im-shadow);
    margin-bottom: 24px;
}

.im-calendar__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--im-color-text);
}

.im-calendar__title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: var(--im-color-text);
}

.im-calendar__chevron {
    transition: transform 0.2s;
}

.im-calendar__chevron--open {
    transform: rotate(180deg);
}

.im-calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
    padding-top: 16px;
}

.im-calendar__day-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--im-color-text-light);
    padding: 4px 0 8px;
}

.im-calendar__cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    border-radius: 50%;
    color: var(--im-color-text);
}

.im-calendar__cell--empty {
    visibility: hidden;
}

.im-calendar__cell--prayed {
    background: var(--im-color-accent);
    color: var(--im-color-primary);
    font-weight: 700;
}

.im-calendar__cell--today {
    outline: 2px solid var(--im-color-primary);
    outline-offset: -2px;
}

.im-calendar__cell--today.im-calendar__cell--prayed {
    outline-color: var(--im-color-accent);
}

/* ==========================================================================
   History Log
   ========================================================================== */

.im-history__log {
    background: var(--im-color-card);
    border-radius: var(--im-radius-lg);
    padding: 20px;
    box-shadow: var(--im-shadow);
}

.im-history__log-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--im-color-text);
}

.im-history__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.im-history__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--im-color-border);
}

.im-history__item:last-child {
    border-bottom: none;
}

.im-history__item-type {
    font-size: 14px;
    font-weight: 600;
    color: var(--im-color-text);
}

.im-history__item-date {
    font-size: 13px;
    color: var(--im-color-text-light);
}

.im-history__load-more {
    text-align: center;
    padding-top: 16px;
}

/* ==========================================================================
   Auth Prompt
   ========================================================================== */

.im-auth-prompt {
    text-align: center;
    padding: 48px 20px;
}

.im-auth-prompt p {
    color: var(--im-color-text-light);
    margin-bottom: 20px;
}

/* ==========================================================================
   Home
   ========================================================================== */

.im-home {
    text-align: center;
    padding: 32px 0;
}

.im-home__logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 24px;
}

.im-home__content {
    max-width: 500px;
    margin: 0 auto 24px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--im-color-text-light);
}

.im-home__content p {
    margin: 0 0 12px;
}

.im-home__stores {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.im-home__store-badge {
    height: 44px;
    width: auto;
}

/* ==========================================================================
   Profile
   ========================================================================== */

.im-profile {
    max-width: 500px;
    margin: 0 auto;
}

.im-profile__avatar-section {
    text-align: center;
    margin-bottom: 24px;
}

.im-profile__avatar img {
    border-radius: 50%;
    display: inline-block;
}

.im-profile__avatar-form {
    margin-top: 12px;
}

.im-profile__card {
    background: var(--im-color-card);
    border-radius: var(--im-radius-lg);
    padding: 24px;
    box-shadow: var(--im-shadow);
    margin-bottom: 20px;
}

.im-profile__card .im-form {
    max-width: none;
}

.im-profile__section-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 20px;
    color: var(--im-color-text);
}

.im-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 400px) {
    .im-form__row {
        grid-template-columns: 1fr;
    }
}

.im-history__edit-link {
    color: var(--im-color-accent);
    text-decoration: none;
    font-weight: 600;
}

/* ==========================================================================
   Placeholder
   ========================================================================== */

.im-placeholder {
    text-align: center;
    padding: 64px 20px;
    color: var(--im-color-text-light);
}

.im-placeholder h2 {
    margin: 16px 0 8px;
    color: var(--im-color-text);
}

.im-placeholder p {
    margin: 0;
}

/* ==========================================================================
   HTMX Loading & Transitions
   ========================================================================== */

/* Top progress bar — shown during any HTMX request */
#im-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--im-color-accent);
    z-index: 200;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.1s;
    pointer-events: none;
}

#im-loading-bar.htmx-request {
    transform: scaleX(0.7);
    transition: transform 8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Content fade on swap */
.im-content {
    animation: im-fade-in 0.2s ease;
}

@keyframes im-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Button loading state */
.im-btn.htmx-request {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.im-btn.htmx-request::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: im-spin 0.6s linear infinite;
    margin-left: 8px;
}

@keyframes im-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   HTMX Error State
   ========================================================================== */

.im-error {
    text-align: center;
    padding: 48px 20px;
    color: var(--im-color-text-light);
}

.im-error__icon {
    margin-bottom: 16px;
    opacity: 0.4;
}

.im-error h3 {
    color: var(--im-color-text);
    margin: 0 0 8px;
}

.im-error p {
    margin: 0 0 20px;
}

/* ==========================================================================
   Empty States
   ========================================================================== */

.im-empty {
    text-align: center;
    padding: 48px 20px;
}

.im-empty__icon {
    margin-bottom: 16px;
    opacity: 0.3;
}

.im-empty h3 {
    color: var(--im-color-text);
    margin: 0 0 8px;
    font-size: 18px;
}

.im-empty p {
    color: var(--im-color-text-light);
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.6;
}

/* ==========================================================================
   Page headings (shared by feed / favorites / lectio fragments)
   ========================================================================== */

.im-page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--im-color-primary);
    margin: 0 0 6px;
}

.im-page-subtitle {
    font-size: 14px;
    color: var(--im-color-text-light);
    margin: 0 0 20px;
    line-height: 1.5;
}

/* ==========================================================================
   Favorite (heart) button
   ========================================================================== */

.im-prayer__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.im-prayer__header .im-prayer__type {
    margin-bottom: 16px;
}

.im-fav-btn {
    background: none;
    border: none;
    padding: 6px;
    margin: -6px -6px 0 0;
    cursor: pointer;
    color: var(--im-color-text-light);
    border-radius: var(--im-radius);
    transition: color 0.15s, transform 0.1s;
    line-height: 0;
}

.im-fav-btn:hover {
    color: #c0392b;
}

.im-fav-btn:active {
    transform: scale(0.9);
}

.im-fav-btn--active {
    color: #c0392b;
}

/* ==========================================================================
   Favorites list
   ========================================================================== */

.im-favorites__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.im-favorites__item {
    background: var(--im-color-card);
    border-radius: var(--im-radius-lg);
    box-shadow: var(--im-shadow);
    margin-bottom: 12px;
    overflow: hidden;
}

.im-favorites__toggle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    width: 100%;
    background: none;
    border: none;
    padding: 16px 18px;
    cursor: pointer;
    text-align: left;
    color: var(--im-color-text);
}

.im-favorites__opening {
    flex: 1 1 100%;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 16px;
    line-height: 1.5;
}

.im-favorites__meta {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--im-color-text-light);
}

.im-favorites__chevron {
    margin-left: auto;
    color: var(--im-color-text-light);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.im-favorites__chevron--open {
    transform: rotate(180deg);
}

.im-favorites__body {
    padding: 0 18px 16px;
    border-top: 1px solid var(--im-color-border);
}

.im-favorites__text {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 17px;
    line-height: 1.7;
    padding-top: 14px;
}

.im-favorites__text p {
    margin: 0 0 12px;
}

.im-favorites__remove {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 8px 0 0;
    cursor: pointer;
    font-size: 13px;
    color: #c0392b;
}

/* ==========================================================================
   Rule of St. Benedict daily reading
   ========================================================================== */

.im-rule {
    background: var(--im-color-card);
    border-radius: var(--im-radius-lg);
    box-shadow: var(--im-shadow);
    margin-bottom: 20px;
    padding: 20px 24px;
}

.im-rule__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
    color: var(--im-color-text);
}

.im-rule__label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--im-color-accent-hover);
    margin-bottom: 4px;
}

.im-rule__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--im-color-primary);
}

.im-rule__ref {
    font-size: 13px;
    color: var(--im-color-text-light);
    margin-top: 2px;
}

.im-rule__chevron {
    color: var(--im-color-text-light);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.im-rule__chevron--open {
    transform: rotate(180deg);
}

.im-rule__body {
    padding-top: 16px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 17px;
    line-height: 1.7;
}

.im-rule__body p {
    margin: 0 0 12px;
}


/* ==========================================================================
   Feed lists (news / events)
   ========================================================================== */

.im-feed {
    list-style: none;
    margin: 0;
    padding: 0;
}

.im-feed__item {
    background: var(--im-color-card);
    border-radius: var(--im-radius-lg);
    box-shadow: var(--im-shadow);
    margin-bottom: 12px;
    overflow: hidden;
}

.im-feed__link {
    display: block;
    padding: 16px 18px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.im-feed__link:hover {
    background: rgba(0, 0, 0, 0.02);
}

.im-feed__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--im-color-primary);
    margin: 0 0 4px;
    line-height: 1.4;
}

.im-feed__date {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--im-color-text-light);
    margin-bottom: 6px;
}

.im-feed__excerpt {
    font-size: 14px;
    line-height: 1.55;
    color: var(--im-color-text);
    margin: 0;
}

/* Feed cards with a thumbnail (blog) — image left, text right */

.im-feed__link--thumb {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.im-feed__thumb {
    width: 72px;
    height: 72px;
    border-radius: var(--im-radius-lg);
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.04);
}

.im-feed__body {
    min-width: 0;
}

/* Podcast episodes — feed cards with artwork + inline audio player */

.im-podcast__item {
    padding: 16px 18px;
}

.im-podcast__row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.im-podcast__art {
    width: 72px;
    height: 72px;
    border-radius: var(--im-radius-lg);
    object-fit: cover;
    flex-shrink: 0;
}

.im-podcast__meta {
    min-width: 0;
}

.im-podcast__meta .im-feed__date {
    margin-bottom: 0;
}

.im-podcast__item .im-feed__excerpt {
    margin-bottom: 12px;
}

.im-podcast__player {
    display: block;
    width: 100%;
    height: 40px;
}

/* ==========================================================================
   Lectio Divina
   ========================================================================== */

.im-lectio__choose {
    margin-bottom: 24px;
}

.im-lectio__choose-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--im-color-primary);
    margin: 0 0 10px;
}

.im-lectio__passage-btn {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    background: var(--im-color-card);
    border: 2px solid var(--im-color-border);
    border-radius: var(--im-radius-lg);
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s;
}

.im-lectio__passage-btn--active {
    border-color: var(--im-color-accent);
}

.im-lectio__passage-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--im-color-primary);
}

.im-lectio__passage-ref {
    font-size: 13px;
    color: var(--im-color-text-light);
}

.im-lectio__begin {
    width: 100%;
}

.im-lectio__plan {
    font-size: 13px;
    color: var(--im-color-text-light);
    text-align: center;
    margin-top: 12px;
}

.im-lectio__progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.im-lectio__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--im-color-border);
}

.im-lectio__dot--filled {
    background: var(--im-color-accent);
}

.im-lectio__movement {
    text-align: center;
    margin-bottom: 16px;
}

.im-lectio__movement-latin {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--im-color-primary);
}

.im-lectio__movement-english {
    font-weight: 400;
    font-size: 20px;
    color: var(--im-color-text-light);
}

.im-lectio__movement-keyword {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--im-color-accent-hover);
    margin-top: 4px;
}

.im-lectio__points {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    text-align: center;
}

.im-lectio__points li {
    font-size: 15px;
    color: var(--im-color-text);
    margin-bottom: 6px;
}

.im-lectio__question {
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-size: 17px;
    text-align: center;
    color: var(--im-color-primary);
    margin: 0 0 20px;
}

.im-lectio__scripture {
    background: var(--im-color-card);
    border-radius: var(--im-radius-lg);
    box-shadow: var(--im-shadow);
    padding: 24px;
    margin-bottom: 20px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 17px;
    line-height: 1.7;
    max-height: 320px;
    overflow-y: auto;
}

.im-lectio__scripture p {
    margin: 0 0 14px;
}

.im-lectio__scripture p:last-child {
    margin-bottom: 0;
}

.im-lectio__scripture-ref {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--im-color-text-light);
    margin-bottom: 12px;
}

.im-lectio__ourfather {
    max-height: none;
    text-align: center;
}

.im-lectio__quiet {
    text-align: center;
    margin-bottom: 24px;
}

.im-lectio__quiet-hint {
    font-size: 13px;
    color: var(--im-color-text-light);
    margin: 10px 0 0;
}

.im-lectio__quiet-hint--done {
    font-size: 15px;
    margin-bottom: 12px;
}

.im-lectio__timer-clock {
    font-size: 44px;
    font-weight: 300;
    font-variant-numeric: tabular-nums;
    color: var(--im-color-primary);
    margin-bottom: 4px;
}

.im-lectio__timer-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
}


.im-rule__body sup {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 11px;
    color: var(--im-color-text-light);
    margin-right: 1px;
}


/* ==========================================================================
   Live Services
   ========================================================================== */

/* The BoxCast embed lays out player + title/description vertically, so the
   iframe needs 16:9-ish height plus room for the text; it scrolls internally
   if content runs longer. */
.im-live__frame {
    display: block;
    width: 100%;
    height: 480px;
    border: 0;
    border-radius: var(--im-radius-lg);
    background: #000;
    box-shadow: var(--im-shadow);
}

@media (min-width: 600px) {
    .im-live__frame {
        height: 620px;
    }
}

@media (min-width: 992px) {
    .im-live__frame {
        height: 760px;
    }
}

.im-live__fallback {
    font-size: 13px;
    color: var(--im-color-text-light);
    margin-top: 14px;
}

.im-live__fallback a {
    color: inherit;
}

/* ==========================================================================
   Badges
   ========================================================================== */

.im-history__lectio-count {
    font-size: 13px;
    color: var(--im-color-text-light);
    text-align: center;
    margin: -12px 0 24px;
}

.im-badges {
    background: var(--im-color-card);
    border-radius: var(--im-radius-lg);
    padding: 20px;
    box-shadow: var(--im-shadow);
    margin-bottom: 24px;
}

.im-badges__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 4px;
}

.im-badges__title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: var(--im-color-text);
}

.im-badges__count {
    font-size: 13px;
    color: var(--im-color-text-light);
}

.im-badges__hint {
    font-size: 13px;
    color: var(--im-color-text-light);
    margin: 0 0 14px;
}

.im-badges__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 12px;
}

@media (min-width: 520px) {
    .im-badges__grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.im-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 6px 10px;
    border: 1px solid var(--im-color-border);
    border-radius: var(--im-radius);
    background: none;
    text-align: center;
    color: var(--im-color-text-light);
    opacity: 0.55;
    font-family: inherit;
}

.im-badge--earned {
    opacity: 1;
    color: var(--im-color-primary);
    border-color: var(--im-color-accent);
    background: rgba(194, 205, 35, 0.08);
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.15s;
}

.im-badge--earned:hover {
    box-shadow: var(--im-shadow);
}

.im-badge--earned:active {
    transform: scale(0.96);
}

.im-badge--earned .im-badge__icon {
    color: var(--im-color-accent-hover);
}

.im-badge__icon {
    line-height: 0;
}

.im-badge__name {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
}

.im-badges__footnote {
    font-size: 12px;
    color: var(--im-color-text-light);
    margin: 12px 0 0;
    text-align: center;
}

/* ==========================================================================
   Badge toasts
   ========================================================================== */

.im-toasts {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(360px, calc(100vw - 32px));
    pointer-events: none;
}

.im-toast {
    position: relative;
    background: var(--im-color-primary);
    color: var(--im-color-text-inverse);
    border-radius: var(--im-radius-lg);
    padding: 14px 40px 14px 18px;
    box-shadow: var(--im-shadow-lg);
    pointer-events: auto;
    animation: im-toast-in 0.35s ease;
}

@keyframes im-toast-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.im-toast__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--im-color-accent);
    margin-bottom: 2px;
}

.im-toast__name {
    font-size: 16px;
    font-weight: 700;
}

.im-toast__desc {
    font-size: 13px;
    opacity: 0.85;
    margin-top: 2px;
    line-height: 1.4;
}

.im-toast__close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

/* ==========================================================================
   Preferences toggle (profile)
   ========================================================================== */

.im-pref-toggle {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.im-pref-toggle input {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    accent-color: var(--im-color-accent-hover);
    flex-shrink: 0;
}

.im-pref-toggle__text strong {
    display: block;
    font-size: 15px;
    color: var(--im-color-text);
}

.im-pref-toggle__desc {
    display: block;
    font-size: 13px;
    color: var(--im-color-text-light);
    margin-top: 2px;
    line-height: 1.5;
}

/* Daily reminders (Profile → Daily Reminders) */
.im-profile__section-note {
    font-size: 13px;
    color: var(--im-color-text-light);
    margin: -12px 0 18px;
    line-height: 1.5;
}

/* A note that follows a form rather than introducing it. */
.im-profile__section-note--after {
    margin: 16px 0 0;
}

.im-profile__section-note a {
    color: inherit;
    text-decoration: underline;
}

/* Delete Account card: a red rule on the left marks it as the one
   destructive thing on the page. */
.im-profile__card--danger {
    border-left: 4px solid #fca5a5;
}

.im-profile__card--danger .im-profile__section-title {
    color: #b91c1c;
}

/* Privacy policy: numbered deletion steps inside an About-style card. */
.im-privacy__steps {
    margin: 0 0 12px;
    padding-left: 22px;
    font-size: 14px;
    line-height: 1.6;
}

.im-privacy__steps li {
    margin-bottom: 6px;
}

/* Time input sits under its toggle, indented to read as a child of it. */
.im-form__field--inset {
    margin-left: 30px;
    margin-bottom: 18px;
}

.im-form__field--inset label {
    font-size: 13px;
    color: var(--im-color-text-light);
}

.im-form__field--inset input[type="time"] {
    max-width: 170px;
}

.im-form__note {
    font-size: 13px;
    color: var(--im-color-text-light);
    margin: 0 0 12px;
    padding: 10px 12px;
    background: var(--im-color-bg);
    border: 1px solid var(--im-color-border);
    border-radius: var(--im-radius);
    line-height: 1.5;
}

/* Prompt to register this device, shown only when a reminder is on but no
   device ARN exists yet. Deliberately more prominent than .im-form__note —
   without this step the reminder silently never arrives. */
.im-reminder-setup {
    margin: 0 0 12px;
    padding: 14px;
    background: var(--im-color-bg);
    border: 1px solid var(--im-color-accent);
    border-radius: var(--im-radius);
}

.im-reminder-setup__text {
    font-size: 13px;
    line-height: 1.55;
    color: var(--im-color-text);
    margin: 0 0 12px;
}

/* ==========================================================================
   About
   ========================================================================== */

.im-about__card {
    background: var(--im-color-card);
    border-radius: var(--im-radius-lg);
    box-shadow: var(--im-shadow);
    padding: 20px 24px;
    margin-bottom: 16px;
    font-size: 15px;
    line-height: 1.65;
}

.im-about__card p {
    margin: 0 0 12px;
}

.im-about__card p:last-child {
    margin-bottom: 0;
}

.im-about__section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--im-color-primary);
    margin: 0 0 12px;
}

.im-about__sources {
    list-style: none;
    margin: 0;
    padding: 0;
}

.im-about__sources li {
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.6;
}

.im-about__sources li:last-child {
    margin-bottom: 0;
}

.im-about a {
    color: var(--im-color-accent-hover);
}

/* ==========================================================================
   Public web pages (privacy / about / contact)

   These render inside Kadence's header and footer via page-public.php, not in
   the app shell, so nothing above applies to their layout — body.im-app is
   absent and the :root palette is doing the work. This block only provides the
   reading column the app's own content area would otherwise have given them.
   ========================================================================== */

.im-public {
    background: var(--im-color-bg);
    padding: 40px 16px 56px;
}

.im-public__inner {
    max-width: 720px;
    margin: 0 auto;
}

.im-public .im-page-title {
    font-size: 28px;
    margin-bottom: 8px;
}

.im-public__cta {
    margin: 32px 0 0;
    text-align: center;
}

.im-public__cta-link {
    display: inline-block;
    background: var(--im-color-primary);
    color: var(--im-color-text-inverse);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    padding: 12px 28px;
    border-radius: var(--im-radius);
}

.im-public__cta-link:hover,
.im-public__cta-link:focus {
    background: var(--im-color-primary-light);
    color: var(--im-color-text-inverse);
}
