:root{
  --navy:#08376B;
  --cyan:#35C0ED;
  --ink:#102033;
  --muted:#667386;
  --line:#DDE5ED;
  --soft:#F4F8FB;
  --white:#FFFFFF;
  --danger:#B42318;
  --radius:20px;
  color-scheme:light;
}
*{box-sizing:border-box}
html{background:#eef3f7}
body{
  margin:0;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:var(--ink);
  background:var(--white);
  min-width:280px;
}
button,a{font:inherit}
button{cursor:pointer}
a{color:inherit}
img{max-width:100%;display:block}
.app{
  width:min(100%,760px);
  min-height:100vh;
  margin:0 auto;
  background:var(--white);
  padding-bottom:84px;
}
.topbar{
  position:sticky;
  top:0;
  z-index:20;
  background:rgba(255,255,255,.96);
  backdrop-filter:blur(12px);
  border-bottom:1px solid var(--line);
}
.brand-row{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 16px;
}
.brand-logo{width:72px;height:auto;flex:0 0 auto}
.brand-copy{min-width:0}
.app-name{font-size:1.22rem;line-height:1.1;font-weight:800;color:var(--navy)}
.church-name{font-size:.76rem;color:var(--muted);margin-top:2px}
.install-mini{
  margin-left:auto;
  border:1px solid var(--line);
  background:var(--white);
  color:var(--navy);
  min-height:42px;
  padding:0 12px;
  border-radius:12px;
  font-weight:700;
}
.page{display:none;padding:18px 16px 28px}
.page.active{display:block}
.hero{
  border-radius:24px;
  background:linear-gradient(145deg,var(--navy),#0c4d8c);
  color:var(--white);
  padding:22px;
  overflow:hidden;
  position:relative;
}
.hero:after{
  content:"";
  position:absolute;
  width:170px;height:170px;
  border-radius:50%;
  right:-75px;top:-65px;
  background:rgba(53,192,237,.17);
}
.eyebrow{
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding:4px 10px;
  border-radius:999px;
  background:rgba(53,192,237,.16);
  color:var(--navy);
  font-weight:800;
  font-size:.75rem;
}
.hero .eyebrow{background:rgba(255,255,255,.14);color:white}
.hero h1{font-size:1.85rem;line-height:1.08;margin:10px 0 8px;max-width:14ch}
.hero p{margin:0;color:rgba(255,255,255,.82);line-height:1.5;max-width:42ch}
.hero-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px;position:relative;z-index:1}
.btn{
  border:0;
  border-radius:14px;
  min-height:48px;
  padding:11px 16px;
  font-weight:800;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  text-decoration:none;
}
.btn-primary{background:var(--cyan);color:#052847}
.btn-secondary{background:var(--white);color:var(--navy);border:1px solid rgba(255,255,255,.4)}
.btn-outline{background:white;border:1px solid var(--line);color:var(--navy)}
.section-title{
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:12px;
  margin:24px 0 10px;
}
.section-title h2{font-size:1.08rem;margin:0}
.section-title p{font-size:.78rem;color:var(--muted);margin:0}
.cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.card{
  border:1px solid var(--line);
  background:var(--white);
  border-radius:var(--radius);
  padding:16px;
  text-decoration:none;
  min-width:0;
}
.card:active{transform:scale(.99)}
.card-icon{
  width:42px;height:42px;border-radius:13px;
  display:grid;place-items:center;
  background:var(--soft);color:var(--navy);
  font-size:1.2rem;
}
.card h3{font-size:.96rem;margin:12px 0 4px;color:var(--navy)}
.card p{font-size:.79rem;line-height:1.4;margin:0;color:var(--muted)}
.notice{
  border:1px solid #b9e8fa;
  background:#effaff;
  border-radius:var(--radius);
  padding:16px;
}
.notice strong{display:block;color:var(--navy);margin-bottom:4px}
.notice p{margin:0;color:#42566a;font-size:.86rem;line-height:1.45}
.list{display:grid;gap:12px}
.link-row{
  display:flex;align-items:center;gap:14px;
  border:1px solid var(--line);
  border-radius:18px;padding:14px;
  text-decoration:none;background:white;
}
.link-row .row-icon{
  width:46px;height:46px;flex:0 0 46px;
  border-radius:14px;background:var(--soft);
  display:grid;place-items:center;color:var(--navy);font-size:1.22rem
}
.link-row .row-copy{min-width:0;flex:1}
.link-row .row-title{font-weight:800;color:var(--navy)}
.link-row .row-sub{font-size:.78rem;color:var(--muted);margin-top:2px;line-height:1.35}
.chev{color:#8d9bab;font-size:1.2rem}
.live-wrap{
  margin-top:14px;
  width:100%;
  position:relative;
  overflow:hidden;
  border-radius:18px;
  background:#000;
}
#castr-player{
  position:absolute;
  top:0;left:0;
  border:0;
  transform-origin:top left;
}
.status-card{
  margin-top:14px;
  border:1px solid var(--line);
  border-radius:18px;
  padding:14px 16px;
  background:var(--soft);
}
.status-card strong{color:var(--navy)}
.status-card p{font-size:.82rem;color:var(--muted);line-height:1.45;margin:4px 0 0}
.more-box{
  border:1px solid var(--line);
  border-radius:20px;
  padding:16px;
  background:var(--soft);
}
.more-box h3{margin:0 0 6px;color:var(--navy)}
.more-box p{font-size:.82rem;color:var(--muted);line-height:1.45;margin:0 0 14px}
.bottom-nav{
  position:fixed;
  z-index:30;
  bottom:0;
  left:50%;
  transform:translateX(-50%);
  width:min(100%,760px);
  display:grid;
  grid-template-columns:repeat(5,1fr);
  border-top:1px solid var(--line);
  background:rgba(255,255,255,.98);
  backdrop-filter:blur(12px);
  padding-bottom:env(safe-area-inset-bottom);
}
.nav-btn{
  border:0;background:transparent;color:#748196;
  min-height:68px;padding:8px 4px 6px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:3px;font-size:.69rem;font-weight:700;
}
.nav-btn .nav-icon{font-size:1.15rem;line-height:1}
.nav-btn.active{color:var(--navy);background:#f1f9fd}
.modal-backdrop{
  position:fixed;inset:0;z-index:100;
  background:rgba(4,25,45,.6);
  display:none;align-items:flex-end;justify-content:center;
}
.modal-backdrop.open{display:flex}
.modal{
  width:min(100%,520px);background:white;
  border-radius:22px 22px 0 0;
  padding:20px 18px calc(18px + env(safe-area-inset-bottom));
}
.modal h2{margin:0 0 8px;color:var(--navy)}
.modal p,.modal li{font-size:.88rem;line-height:1.5;color:#536476}
.modal ol{padding-left:22px}
.modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:12px}
.offline-badge{
  display:none;
  padding:7px 12px;
  text-align:center;
  font-size:.76rem;
  background:#fff2cc;
  color:#684f00;
  border-bottom:1px solid #ead895;
}
.offline-badge.show{display:block}
@media(max-width:380px){
  .brand-logo{width:58px}
  .church-name{font-size:.7rem}
  .install-mini{display:none}
  .cards{grid-template-columns:1fr}
  .hero{padding:19px}
  .hero h1{font-size:1.6rem}
}
@media(min-width:620px){
  .page{padding:24px}
  .cards{grid-template-columns:repeat(4,minmax(0,1fr))}
  .hero{padding:28px}
}
@media (hover:hover) and (pointer:fine){
  .card:hover,.link-row:hover{border-color:#a9dff2;background:#fbfeff}
  .btn:hover{filter:brightness(.98)}
}

.notification-prefs{gap:10px}
.pref-row{display:flex;align-items:center;justify-content:space-between;gap:16px;border:1px solid var(--line);border-radius:18px;padding:14px 15px;background:#fff}
.pref-row span{min-width:0}.pref-row strong{display:block;color:var(--navy);font-size:.9rem}
.pref-row small{display:block;color:var(--muted);font-size:.75rem;line-height:1.35;margin-top:2px}
.pref-row input{width:22px;height:22px;flex:0 0 auto;accent-color:var(--navy)}
#notification-status{min-height:2.4em}

/* v2.1 mobile notification preference cleanup */
.notification-prefs .pref-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 28px;
  align-items:center;
  column-gap:14px;
  row-gap:4px;
}
.notification-prefs .pref-row span{
  display:block;
  min-width:0;
}
.notification-prefs .pref-row strong{
  display:block;
  margin:0 0 4px 0;
  line-height:1.25;
}
.notification-prefs .pref-row small{
  display:block;
  margin:0;
  line-height:1.4;
  white-space:normal;
}
.notification-prefs .pref-row input{
  justify-self:end;
  align-self:center;
  margin:0;
}
@media(max-width:420px){
  .notification-prefs .pref-row{
    padding:14px;
  }
  .notification-prefs .pref-row strong{
    font-size:.92rem;
  }
  .notification-prefs .pref-row small{
    font-size:.76rem;
  }
}
