:root {
    /* Brand colors (from app icon) */
    --qw-primary: #a73f3e;
    /* main red */
    --qw-primary-soft: #fbe5e3;
    --qw-primary-dark: #7f2a29;
    --qw-accent: #f3b08a;
    --qw-bg: #fdf7f6;
    --qw-text-main: #1f2933;
    --qw-text-muted: #6b7280;
    --qw-card-bg: #ffffff;
    --qw-radius-lg: 18px;
    --qw-radius-xl: 26px;
    --qw-shadow-soft: 0 18px 45px rgba(120, 26, 20, 0.22);
}


.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Style for when date is hidden */
.devotion-date-block.hidden-date .devotion-date {
    display: none;
}

.devotion-date-block.hidden-date .devotion-date-label {
    font-size: 1rem;
    color: var(--qw-text-main);
    text-transform: none;
    letter-spacing: normal;
}


* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, #fed7d7, #fdf7f6 55%),
        radial-gradient(circle at bottom right, #fde6d4, #fdf7f6 55%);
    color: var(--qw-text-main);
    display: flex;
    justify-content: center;
    padding: 20px 12px;
}

.page {
    width: 100%;
    max-width: 960px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* HEADER / HERO */
.qw-header {
    background: linear-gradient(135deg,
            var(--qw-primary),
            #e46d5a);
    border-radius: var(--qw-radius-xl);
    padding: 18px 18px 16px;
    color: white;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 16px 40px rgba(80, 16, 12, 0.38);
    position: relative;
    overflow: hidden;
}

.qw-header::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 120% -20%, rgba(255, 255, 255, 0.32), transparent 55%),
        radial-gradient(circle at -10% 120%, rgba(255, 255, 255, 0.15), transparent 55%);
    pointer-events: none;
}

.qw-header-main {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    z-index: 1;
}

.qw-logo-circle {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    background: rgba(248, 250, 252, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.qw-logo-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qw-title-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.qw-app-name {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.25rem;
    letter-spacing: 0.06em;
}

.qw-tagline {
    font-size: 0.85rem;
    opacity: 0.92;
}

.qw-store-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
    position: relative;
    z-index: 1;
}

.store-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    border: 1px solid rgba(254, 242, 242, 0.9);
    padding: 6px 13px;
    text-decoration: none;
    background: rgba(80, 18, 14, 0.35);
    backdrop-filter: blur(18px);
    color: #fefdfd;
    font-size: 0.75rem;
    font-weight: 500;
    transition: transform 0.12s ease, box-shadow 0.12s ease,
        background 0.12s ease;
}

.store-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 30px rgba(54, 11, 10, 0.7);
    background: rgba(80, 18, 14, 0.55);
}

.store-badge i {
    font-size: 1rem;
}

.store-text-small {
    font-size: 0.6rem;
    opacity: 0.9;
    display: block;
}

.store-text-main {
    display: block;
}

/* MAIN CARD */
.qw-main {
    flex: 1;
    display: flex;
    justify-content: center;
}

.devotion-card {
    width: 100%;
    max-width: 780px;
    background: var(--qw-card-bg);
    border-radius: var(--qw-radius-lg);
    padding: 20px 18px 18px;
    box-shadow: var(--qw-shadow-soft);
    position: relative;
}

.devotion-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.devotion-date-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.devotion-date-label {
    font-size: 0.8rem;
    color: var(--qw-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.devotion-date {
    font-weight: 600;
    font-size: 0.95rem;
}

.calendar-button {
    border-radius: 999px;
    border: 1px solid #f3e2dd;
    padding: 6px 10px;
    background: #fff7f6;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--qw-text-muted);
    transition: background 0.12s ease, transform 0.12s ease,
        box-shadow 0.12s ease;
}

.calendar-button:hover {
    background: #ffe4de;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(248, 113, 113, 0.55);
}

.calendar-button i {
    font-size: 0.95rem;
    color: var(--qw-primary);
}

.devotion-title {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.6rem;
    margin: 6px 0 10px;
    color: #111827;
}

.devotion-scripture {
    font-style: italic;
    font-size: 0.98rem;
    color: var(--qw-text-muted);
    border-left: 3px solid var(--qw-primary);
    padding-left: 10px;
    margin-bottom: 16px;
}

.devotion-text {
    font-size: 1rem;
    color: var(--qw-text-main);
    line-height: 1.7;
}

.devotion-text p {
    margin: 0 0 0.75em;
}

.devotion-text h1,
.devotion-text h2,
.devotion-text h3,
.devotion-text h4 {
    font-family: "Playfair Display", Georgia, serif;
    margin: 1.1em 0 0.4em;
}

.devotion-text ul,
.devotion-text ol {
    padding-left: 1.35em;
    margin-bottom: 1em;
}

.devotion-text strong {
    font-weight: 600;
}

.verse-link {
    color: var(--qw-primary-dark);
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    border-bottom: 1px dashed rgba(167, 63, 62, 0.6);
}

.verse-link:hover {
    border-bottom-style: solid;
}

.audio-player {
    margin-top: 16px;
    padding-top: 10px;
    border-top: 1px dashed #f3e2dd;
}

.audio-player label {
    font-size: 0.82rem;
    color: var(--qw-text-muted);
    display: block;
    margin-bottom: 4px;
}

.audio-player audio {
    width: 100%;
}

.card-footer-actions {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.share-button {
    border-radius: 999px;
    border: none;
    background: var(--qw-primary-soft);
    color: var(--qw-primary-dark);
    font-size: 0.85rem;
    padding: 7px 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.12s ease, transform 0.12s ease,
        box-shadow 0.12s ease;
}

.share-button i {
    font-size: 0.9rem;
}

.share-button:hover {
    background: #ffd3cc;
    transform: translateY(-1px);
    box-shadow: 0 7px 20px rgba(248, 113, 113, 0.55);
}

.quietwaters-footnote {
    font-size: 0.78rem;
    color: var(--qw-text-muted);
}

/* CALENDAR POPUP */
.calendar {
    display: none;
    position: absolute;
    right: 10px;
    top: 54px;
    background-color: #ffffff;
    border: 1px solid #f3e2dd;
    border-radius: 14px;
    padding: 10px;
    box-shadow: 0 16px 40px rgba(120, 26, 20, 0.4);
    z-index: 1000;
    width: min(260px, 85vw);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.calendar-header button {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 999px;
    color: var(--qw-text-muted);
}

.calendar-header button:hover {
    background: #f3f4f6;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    font-size: 0.72rem;
}

.calendar-day {
    padding: 4px 0;
    text-align: center;
    cursor: pointer;
    border-radius: 999px;
}

.calendar-day:hover {
    background-color: #ffe4de;
}

.calendar-day.selected {
    background-color: var(--qw-primary);
    color: white;
}

.calendar-days div:nth-child(-n + 7) {
    font-weight: 600;
    color: var(--qw-text-muted);
}

/* FOOTER */
.qw-footer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--qw-text-muted);
    margin-top: 4px;
}

/* VERSE POPUP - Change from absolute to fixed */
.verse-popup {
    position: fixed;
    background-color: #ffffff;
    border-radius: 14px;
    border: 1px solid #f3e2dd;
    padding: 12px 14px;
    box-shadow: 0 18px 45px rgba(120, 26, 20, 0.36);
    z-index: 2000;
    max-width: 320px;
    max-height: 80vh;
    overflow-y: auto;
    font-size: 0.85rem;
    line-height: 1.5;
}

.verse-reference {
    font-weight: 600;
    color: var(--qw-primary-dark);
    font-size: 0.9rem;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f3e2dd;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.verse-text {
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.verse-number {
    font-size: 0.75rem;
    color: var(--qw-primary);
    font-weight: 600;
    background: var(--qw-primary-soft);
    border-radius: 3px;
    padding: 1px 4px;
    min-width: 18px;
    text-align: center;
    flex-shrink: 0;
    margin-top: 1px;
}

@media (min-width: 768px) {
    .qw-header {
        padding: 20px 24px 18px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .qw-store-buttons {
        justify-content: flex-end;
    }

    .devotion-card {
        padding: 22px 24px 20px;
    }
}