:root {
  color-scheme: dark;
  --canvas: #061820;
  --canvas-2: #0b2731;
  --surface: #102d38;
  --surface-2: #173b46;
  --surface-3: #1b4654;
  --cream: #fff9eb;
  --muted: #c6d8d8;
  --soft: #9cb4b8;
  --line: #3b5c66;
  --gold: #f5c84c;
  --gold-dark: #112f3a;
  --orange: #ffb067;
  --green: #15945a;
  --blue: #246b9f;
  --red: #c8192d;
  --radius: 24px;
  --shadow: 0 22px 55px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  background:
    radial-gradient(circle at 18% -15%, rgba(36, 107, 159, .28), transparent 34rem),
    radial-gradient(circle at 92% 12%, rgba(21, 148, 90, .18), transparent 30rem),
    linear-gradient(155deg, #061820 0%, #0a222b 55%, #061820 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, a { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 1.25em; height: 1.25em; fill: currentColor; flex: 0 0 auto; }

.app-shell { width: min(1180px, 100%); margin: 0 auto; padding: 24px 28px 46px; }
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 17px 19px;
  border: 1px solid rgba(245, 200, 76, .42);
  border-radius: 26px;
  background: linear-gradient(110deg, rgba(10, 43, 56, .98), rgba(7, 81, 57, .94));
  box-shadow: var(--shadow);
}
.app-header[hidden] { display: none !important; }
.brand-block { display: flex; align-items: center; min-width: 0; gap: 15px; }
.brand-logo, .large-round-logo {
  width: 66px; height: 66px; object-fit: cover; border-radius: 50%;
  border: 3px solid rgba(245, 200, 76, .86); background: var(--cream);
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
}
.brand-block h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.45rem, 3vw, 2.1rem); line-height: 1.08; margin: 0; letter-spacing: -.02em; }
.eyebrow { margin: 0; color: var(--muted); font-size: .75rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.eyebrow.accent { color: var(--orange); }
.header-actions { display: flex; align-items: center; gap: 9px; }
.header-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-width: 58px; height: 50px; padding: 0 13px; border-radius: 15px;
  border: 1px solid rgba(255, 249, 235, .54); background: rgba(25, 74, 87, .72);
  color: var(--cream); font-weight: 800; cursor: pointer;
}
.icon-button { min-width: 50px; padding: 0; }
.header-button:hover { background: rgba(38, 104, 121, .9); transform: translateY(-1px); }

.tab-bar {
  position: sticky; top: 8px; z-index: 20;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px;
  max-width: 650px; margin: 18px auto 22px; padding: 7px;
  border: 1px solid rgba(84, 113, 122, .62); border-radius: 19px;
  background: rgba(6, 24, 32, .86); backdrop-filter: blur(18px);
  box-shadow: 0 12px 32px rgba(0,0,0,.22);
}
.tab {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 8px 14px; border: 1px solid transparent; border-radius: 14px;
  background: transparent; color: var(--muted); font-weight: 800; cursor: pointer;
}
.tab svg { color: var(--cream); }
.tab.active { color: var(--cream); border-color: rgba(245, 200, 76, .82); background: linear-gradient(100deg, #1d6578, #087049); box-shadow: 0 8px 22px rgba(0,0,0,.22); }

.screen { animation: screen-in .26s ease; }
.screen[hidden] { display: none !important; }
@keyframes screen-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.section-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 4px 14px; }
.section-intro h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.45rem, 3vw, 2rem); line-height: 1.12; }
.year-chip { display: inline-flex; align-items: center; min-height: 36px; padding: 7px 14px; border-radius: 12px; background: linear-gradient(100deg, #ffd65a, #ee9e19); color: var(--gold-dark); font-weight: 900; }

.reading-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(330px, .85fr); gap: 16px; align-items: start; }
.content-grid { display: grid; gap: 16px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bbn-grid { grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); }
.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(165deg, rgba(23, 59, 70, .98), rgba(16, 43, 54, .98));
  box-shadow: 0 17px 42px rgba(0,0,0,.18); padding: 22px;
}
.reading-card { border: 2px solid rgba(245, 200, 76, .8); background: linear-gradient(155deg, #174454, #0d2c37); padding: clamp(18px, 4vw, 30px); }
.date-row { display: grid; grid-template-columns: 54px 1fr 54px; align-items: center; gap: 11px; }
.date-nav { width: 54px; height: 54px; border: 1px solid #7697a1; border-radius: 15px; background: #183f4b; color: var(--cream); font-size: 2rem; font-weight: 800; cursor: pointer; }
.date-nav:disabled { opacity: .35; cursor: default; }
.date-center { display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: transparent; color: var(--cream); cursor: grab; }
.date-center strong { font-size: clamp(1.1rem, 3vw, 1.45rem); text-transform: uppercase; text-align: center; }
.date-center strong.sunday { color: #ff8f89; }
.date-center strong.saturday { color: #ffc56f; }
.date-center span { color: var(--muted); font-size: .78rem; }
.today-button { display: block; margin: 10px auto 0; min-height: 38px; padding: 6px 18px; border: 0; border-radius: 12px; background: var(--gold); color: var(--gold-dark); font-weight: 900; cursor: pointer; }
.scripture-panel { display: flex; flex-direction: column; align-items: center; margin-top: 20px; padding: 18px; border: 1px solid rgba(239,199,91,.74); border-radius: 18px; background: linear-gradient(180deg, #1b4a58, #112f3b); }
.scripture-panel span { color: var(--muted); font-size: .78rem; font-weight: 800; letter-spacing: .09em; }
.scripture-panel strong { margin-top: 7px; font-family: Georgia, "Times New Roman", serif; color: var(--cream); font-size: clamp(2rem, 6vw, 3.35rem); line-height: 1.05; text-align: center; }
.status-line { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 16px 2px 0; }
.status-line span { color: var(--muted); font-size: .78rem; font-weight: 800; letter-spacing: .07em; }
.status-line strong { color: var(--orange); text-align: center; }
.status-line strong.done { color: #69e3a4; }
.action-button.is-read { background: linear-gradient(105deg, #07723b, #0a9852); color: #fff; }
.primary-actions, .split-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.action-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 54px;
  padding: 11px 16px; border: 1px solid rgba(255,255,255,.28); border-radius: 15px;
  color: var(--cream); font-weight: 850; text-align: center; cursor: pointer;
  transition: transform .16s ease, filter .16s ease;
}
.action-button:hover, .download-card:hover, .split-link a:hover, .split-link button:hover { filter: brightness(1.12); transform: translateY(-1px); }
.action-button[aria-busy="true"] { opacity: .72; pointer-events: none; }
.action-button.blue { background: linear-gradient(100deg, #24649b, #123d6d); }
.action-button.gold { background: linear-gradient(100deg, #ffd65a, #f0a51e); color: var(--gold-dark); border-color: #fff1bd; }
.action-button.green { background: linear-gradient(100deg, #15945a, #07512e); }
.action-button.maps { background: linear-gradient(100deg, #1c6bd2, #124d9e); }
.action-button.waze { background: linear-gradient(100deg, #08728a, #124e68); }
.action-button.telegram { background: linear-gradient(100deg, #229ed9, #1475ad); }
.helper-text { margin: 9px 4px 0; color: var(--muted); font-size: .78rem; text-align: center; }
.bible-store-link { display: block; width: fit-content; margin: 8px auto 0; color: var(--gold); font-size: .78rem; font-weight: 800; text-align: center; text-decoration: underline; text-underline-offset: 3px; }

.week-card h3, .card h3 { margin: 3px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.45rem; }
.card-heading-row { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.card-heading-row > strong { color: var(--muted); font-size: .82rem; }
.week-summary { margin: 9px 0 0; color: var(--muted); font-size: .9rem; }
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 17px; }
.week-day { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; min-height: 78px; padding: 7px 2px; border: 1px solid #668ba1aa; border-radius: 12px; background: #173640; color: var(--muted); cursor: pointer; }
.week-day span { font-size: .66rem; font-weight: 850; }
.week-day strong { font-size: .88rem; }
.week-day b { font-size: .95rem; }
.week-day.read { background: #087a3d; color: white; }
.week-day.missed { border-color: #d96b6b; background: #4a2929; color: #ffb4a8; }
.week-day.selected { border: 2px solid #c88712; background: linear-gradient(180deg, #ffe89b, #ffd34e); color: #173c4d; }
.week-day.sunday:not(.selected) span { color: #ff9f99; }
.week-day.saturday:not(.selected) span { color: #ffc56f; }
.legend { display: flex; flex-wrap: wrap; gap: 7px 12px; margin-top: 14px; color: var(--soft); font-size: .74rem; }
.legend > span { display: inline-flex; align-items: center; gap: 4px; }
.legend-read { color: #69e3a4; } .legend-missed { color: #ffb4a8; }

.identity-row { display: flex; align-items: center; gap: 18px; }
.large-round-logo { width: 98px; height: 98px; }
.identity-row h3 { font-size: 1.85rem; }
.identity-row p, .pastor-profile p { margin: 4px 0 0; color: var(--muted); }
.service-chip { display: inline-flex; margin-top: 10px; padding: 7px 11px; border: 1px solid #8acab59a; border-radius: 11px; background: #164536; color: var(--cream); font-size: .8rem; font-weight: 800; text-transform: uppercase; }
.address-card { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; margin-top: 18px; min-height: 64px; padding: 11px 13px; border: 1.5px solid #e6c44f; border-radius: 14px; background: linear-gradient(100deg, #423718, #263b35); color: var(--cream); text-align: left; cursor: pointer; }
.address-card > svg { color: var(--gold); }
.address-card span { display: flex; flex-direction: column; min-width: 0; }
.address-card small { color: var(--orange); font-weight: 850; letter-spacing: .08em; }
.address-card strong { overflow-wrap: anywhere; }
.socials-card h3 { margin: 0 0 14px; }
.link-stack { display: grid; gap: 10px; }
.split-link { display: grid; grid-template-columns: 1fr 58px; min-height: 60px; border-radius: 15px; overflow: hidden; }
.split-link a { display: flex; align-items: center; gap: 12px; padding: 10px 19px; border-right: 1px solid rgba(255,255,255,.32); color: white; font-weight: 850; font-size: 1rem; }
.split-link a > svg { width: 24px; height: 24px; }
.split-link button { display: flex; align-items: center; justify-content: center; border: 0; color: white; background: rgba(0,0,0,.18); cursor: pointer; }
.split-link.youtube, .split-link.red { background: linear-gradient(100deg, #cf182b, #8f0717); }
.split-link.instagram { background: linear-gradient(100deg, #63219d, #b51e62); }
.split-link.facebook, .split-link.blue { background: linear-gradient(100deg, #2366a0, #113e70); }
.split-link.green { background: linear-gradient(100deg, #0e7543, #034e27); }
.pastor-profile { display: grid; grid-template-columns: 112px 1fr; gap: 18px; align-items: center; }
.pastor-profile img { width: 112px; height: 112px; object-fit: cover; object-position: center 22%; border-radius: 50%; border: 3px solid var(--gold); }
.pastor-profile h3 { font-size: 1.7rem; }
.contact-label { margin: 19px 0 -7px; color: var(--muted); font-size: .78rem; font-weight: 850; letter-spacing: .08em; }
.cornerstone-row { display: grid; grid-template-columns: 104px 1fr; gap: 15px; align-items: center; }
.cornerstone-frame { width: 104px; height: 104px; padding: 4px; border: 2px solid #f0d69e; border-radius: 50%; background: #e7c794; }
.cornerstone-frame img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.address-card.compact { margin: 0; min-height: 84px; grid-template-columns: 1fr auto; }

.bbn-hero { display: grid; grid-template-columns: 116px 1fr; align-items: center; gap: 20px; margin-bottom: 16px; padding: 25px; border: 1px solid rgba(245,200,76,.7); border-radius: var(--radius); background: linear-gradient(105deg, #075139, #0d3b4d); box-shadow: var(--shadow); }
.bbn-mark { display: grid; place-items: center; height: 88px; border: 2px solid var(--gold); border-radius: 17px; background: var(--cream); color: #064a31; font-size: 2.15rem; font-weight: 950; letter-spacing: -.06em; }
.bbn-hero h2 { margin: 0 0 4px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.65rem, 4vw, 2.5rem); }
.bbn-hero p:last-child { margin: 0; color: var(--muted); }
.bbn-actions-card .link-stack { margin-top: 0; }
.install-card { display: flex; flex-direction: column; align-items: stretch; justify-content: center; }
.install-card h3 { margin: 0 0 14px; }
.install-card p:not(.eyebrow) { color: var(--muted); }

.modal { width: min(880px, calc(100% - 24px)); max-height: min(88vh, 760px); padding: 0; border: 1px solid #4e707a; border-radius: 24px; background: linear-gradient(165deg, #173b46, #0d2731); color: var(--cream); box-shadow: 0 32px 90px rgba(0,0,0,.58); overflow: auto; }
.compact-modal { width: min(520px, calc(100% - 24px)); }
.modal::backdrop { background: rgba(0, 10, 15, .76); backdrop-filter: blur(8px); }
.modal form { padding: 24px; }
.modal-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.modal-heading h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.55rem, 5vw, 2.15rem); }
.close-button { width: 43px; height: 43px; border: 1px solid var(--line); border-radius: 13px; background: #183f4b; color: var(--cream); font-size: 1.65rem; cursor: pointer; }
.language-list { display: grid; gap: 9px; margin-top: 20px; }
.language-list button { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 14px; background: #102d38; color: var(--cream); text-align: left; cursor: pointer; }
.language-list button b { display: grid; place-items: center; height: 36px; border-radius: 10px; background: #1d6578; color: var(--cream); }
.language-list button.selected::after { content: "✓"; color: #69e3a4; font-weight: 900; }
.account-panel { margin-top: 18px; padding: 16px; border: 1px solid rgba(245,200,76,.58); border-radius: 18px; background: linear-gradient(115deg, #123a46, #113a31); }
.account-panel-heading { display: grid; grid-template-columns: 44px minmax(0,1fr) auto; align-items: center; gap: 12px; }
.account-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: #1d6578; color: var(--cream); }
.account-icon svg { width: 23px; height: 23px; }
.account-panel h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.22rem; }
.account-panel-heading p { margin: 3px 0 0; color: var(--muted); font-size: .84rem; }
.account-role { align-self: start; padding: 6px 10px; border: 1px solid #7697a1; border-radius: 999px; color: var(--cream); font-size: .74rem; font-weight: 850; }
.account-role.user { border-color: #58c990; color: #8cf0ba; }
.account-role.admin { border-color: var(--gold); background: rgba(245,200,76,.12); color: #ffe69a; }
.account-copy { margin: 14px 0 10px; color: var(--soft); font-size: .9rem; }
.google-button-host { min-height: 0; overflow: hidden; border-radius: 12px; }
.google-button-host:not(:empty) { min-height: 44px; }
.google-fallback-button { display: flex; align-items: center; justify-content: center; gap: 11px; width: 100%; min-height: 48px; padding: 9px 14px; border: 1px solid #d6d9dc; border-radius: 12px; background: white; color: #263238; font-size: .94rem; font-weight: 750; cursor: pointer; }
.google-fallback-button[hidden] { display: none; }
.google-g { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; color: #4285f4; font: 900 1.1rem/1 Arial, sans-serif; }
.account-note { margin: 9px 0 0; color: #ffd276; font-size: .8rem; text-align: center; }
.signed-account { display: grid; grid-template-columns: 46px minmax(0,1fr) auto; align-items: center; gap: 11px; margin-top: 14px; }
.signed-account[hidden] { display: none; }
.signed-account img { width: 46px; height: 46px; border: 2px solid var(--gold); border-radius: 50%; object-fit: cover; }
.account-identity { display: flex; flex-direction: column; min-width: 0; }
.account-identity strong, .account-identity span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-identity span { margin-top: 2px; color: var(--muted); font-size: .78rem; }
.account-actions { display: flex; gap: 7px; }
.account-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 11px; background: #183f4b; color: var(--cream); font-size: .78rem; font-weight: 800; cursor: pointer; }
.account-button.admin { border-color: rgba(245,200,76,.7); background: #554315; color: #fff1bd; }
.settings-section-label { margin: 17px 2px -6px; color: var(--muted); font-size: .76rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.settings-grid { display: grid; grid-template-columns: 1fr .95fr; gap: 18px; margin-top: 18px; }
.legal-links { margin-top: 20px; text-align: center; }
.legal-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: .9rem; font-weight: 750; text-underline-offset: 4px; }
.web-version-panel, .download-panel { display: grid; align-content: start; gap: 12px; }
.web-version-panel { grid-template-columns: 154px minmax(0, 1fr); grid-template-areas: "qr content" "qr actions"; padding: 15px; border: 1px solid var(--line); border-radius: 18px; background: #102d38; }
.qr-frame { grid-area: qr; align-self: start; padding: 9px; border-radius: 14px; background: white; }
.qr-frame img { display: block; width: 100%; height: auto; }
.web-link-block { grid-area: content; min-width: 0; }
.web-link-block a { display: block; margin-top: 4px; color: var(--gold); font-weight: 800; overflow-wrap: anywhere; }
.web-link-block p:last-child { margin: 8px 0 0; color: var(--muted); font-size: .82rem; }
.mini-actions { grid-area: actions; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-width: 0; }
.mini-actions #openWebLink { grid-column: 1 / -1; }
.mini-actions button, .mini-actions a { display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; min-height: 42px; padding: 8px 6px; border: 1px solid var(--line); border-radius: 12px; background: #1b4654; color: var(--cream); font-size: .84rem; line-height: 1.18; font-weight: 800; text-align: center; overflow-wrap: anywhere; cursor: pointer; }
.download-card { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; min-height: 72px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; color: white; text-align: left; cursor: pointer; transition: transform .16s ease, filter .16s ease; }
.download-card > svg:first-child { width: 32px; height: 32px; }
.download-card span { display: flex; flex-direction: column; }
.download-card strong { font-size: 1.05rem; }
.download-card small { margin-top: 2px; color: rgba(255,255,255,.78); }
.download-card.android { background: linear-gradient(100deg, #15945a, #07512e); }
.download-card.apple { background: linear-gradient(100deg, #3d4d55, #17262d); }
.download-card.web { background: linear-gradient(100deg, #24649b, #123d6d); }
.ios-instructions { margin-top: 18px; padding: 18px; border: 1px solid rgba(245,200,76,.66); border-radius: 18px; background: #102d38; }
.ios-instructions h3 { margin: 0; font-size: 1.25rem; }
.ios-instructions ol { margin: 12px 0 16px; padding-left: 24px; color: var(--muted); }
.ios-instructions li + li { margin-top: 7px; }
.dialog-actions { display: grid; gap: 9px; margin-top: 20px; }
#addressDialogText { font-size: 1.35rem; overflow-wrap: anywhere; }
.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 18px; }
.admin-stats > div { display: flex; flex-direction: column; min-height: 92px; padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: #102d38; }
.admin-stats span { color: var(--muted); font-size: .74rem; line-height: 1.25; }
.admin-stats strong { margin-top: auto; color: var(--gold); font-size: 1.65rem; }
.admin-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.admin-list-heading h3 { margin: 0; font-size: 1.1rem; }
.admin-list-heading button { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 11px; background: #1b4654; color: var(--cream); font-weight: 800; cursor: pointer; }
.admin-user-list { display: grid; gap: 7px; margin-top: 10px; }
.admin-user-list > p { margin: 0; color: var(--muted); }
.admin-user { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; padding: 10px 12px; border: 1px solid rgba(84,113,122,.68); border-radius: 12px; background: #102d38; }
.admin-user strong, .admin-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user div { display: flex; flex-direction: column; min-width: 0; }
.admin-user span, .admin-user time { color: var(--muted); font-size: .76rem; }
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 100; transform: translate(-50%, 20px); padding: 11px 16px; border: 1px solid rgba(245,200,76,.72); border-radius: 13px; background: #0e2b35; color: var(--cream); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 860px) {
  .app-shell { padding: 14px 14px 106px; }
  .reading-layout, .two-columns, .bbn-grid { grid-template-columns: 1fr; }
  .tab-bar { position: fixed; top: auto; bottom: max(10px, env(safe-area-inset-bottom)); left: 12px; right: 12px; z-index: 30; margin: 0 auto; max-width: 540px; }
  .week-card { order: 2; }
  .settings-grid { grid-template-columns: 1fr; }
  .web-version-panel { grid-template-columns: 138px minmax(0, 1fr); }
}

@media (max-width: 560px) {
  body { font-size: 15px; }
  .app-header { padding: 12px; border-radius: 20px; }
  .brand-logo { width: 54px; height: 54px; }
  .brand-block { gap: 10px; }
  .brand-block h1 { font-size: 1.28rem; }
  .brand-block .eyebrow { font-size: .58rem; }
  .header-button { min-width: 50px; height: 46px; padding: 0 10px; }
  .icon-button { min-width: 46px; }
  .tab-bar { grid-template-columns: repeat(3, 1fr); padding: 5px; gap: 5px; }
  .tab { min-height: 48px; padding: 6px; gap: 5px; font-size: .82rem; }
  .tab svg { width: 19px; height: 19px; }
  .section-intro { margin-top: 4px; }
  .section-intro h2 { font-size: 1.48rem; }
  .card, .reading-card { padding: 16px; border-radius: 20px; }
  .date-row { grid-template-columns: 46px 1fr 46px; gap: 7px; }
  .date-nav { width: 46px; height: 50px; }
  .date-center span { font-size: .68rem; }
  .scripture-panel strong { font-size: 2.05rem; }
  .primary-actions, .split-actions { grid-template-columns: 1fr; }
  .week-grid { gap: 3px; }
  .week-day { min-height: 69px; border-radius: 10px; }
  .identity-row, .pastor-profile { grid-template-columns: 84px 1fr; display: grid; gap: 12px; }
  .large-round-logo, .pastor-profile img { width: 84px; height: 84px; }
  .identity-row h3, .pastor-profile h3 { font-size: 1.35rem; }
  .cornerstone-row { grid-template-columns: 82px 1fr; gap: 10px; }
  .cornerstone-frame { width: 82px; height: 82px; }
  .address-card.compact strong { font-size: .78rem; }
  .bbn-hero { grid-template-columns: 82px 1fr; padding: 17px; gap: 13px; }
  .bbn-mark { height: 70px; font-size: 1.7rem; }
  .modal form { padding: 18px; }
  .settings-modal { width: min(100% - 12px, 520px); }
  .settings-modal form { padding: 15px; }
  .account-panel-heading { grid-template-columns: 40px minmax(0,1fr); }
  .account-role { grid-column: 2; justify-self: start; }
  .signed-account { grid-template-columns: 42px minmax(0,1fr); }
  .signed-account img { width: 42px; height: 42px; }
  .account-actions { grid-column: 1 / -1; width: 100%; }
  .account-actions .account-button { flex: 1; }
  .admin-stats { grid-template-columns: 1fr; }
  .admin-stats > div { min-height: 72px; }
  .web-version-panel { grid-template-columns: 1fr; grid-template-areas: "qr" "content" "actions"; padding: 14px; gap: 12px; }
  .qr-frame { width: min(172px, 66%); justify-self: center; }
  .web-link-block { text-align: center; }
  .mini-actions { grid-column: auto; }
}

@media (display-mode: standalone) {
  .app-shell { padding-bottom: max(106px, calc(env(safe-area-inset-bottom) + 88px)); }
  .tab-bar { position: fixed; top: auto; bottom: max(10px, env(safe-area-inset-bottom)); left: 12px; right: 12px; z-index: 30; margin: 0 auto; max-width: 540px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
