:root {
	--blue: #1E4FD6;
	--blue-2: #4B7BFF;
	--blue-ink: #0F2A6B;
	--bg: #F5F7FB;
	--card: #ffffff;
	--text: #152238;
	--ink: #152238;
	--muted: #5C6B86;
	--line: #E2E8F4;
	--ok: #0F7B4B;
	--err: #B42318;
	--accent: #1E4FD6;
	--accent-ink: #0F2A6B;
	--radius: 10px;
	--shadow: 0 8px 24px rgba(15, 42, 107, 0.06);
	--font: "DM Sans", "Segoe UI", system-ui, sans-serif;
	--max: 720px;
	--jsa-pwa-theme: #1E4FD6;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
	font-family: var(--font);
	color: var(--text);
	background: var(--bg);
	min-height: 100vh;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

.container { width: min(var(--max), calc(100% - 1.75rem)); margin-inline: auto; }
.page { padding: 1.15rem 0 2rem; }

/* —— Header —— */
.site-header {
	position: sticky; top: 0; z-index: 40;
	background: rgba(255,255,255,0.94);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--line);
}
.header-inner {
	display: flex; align-items: center; justify-content: space-between;
	gap: 1rem; min-height: 56px;
	width: min(960px, calc(100% - 1.75rem));
	margin-inline: auto;
}
.brand { display: inline-flex; align-items: center; gap: .65rem; color: inherit; text-decoration: none; }
.brand img, .site-logo { border-radius: 8px; width: 40px; height: 40px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { color: var(--blue-ink); font-size: 1.05rem; letter-spacing: -0.02em; }
.brand-center { justify-content: center; margin-bottom: 1rem; flex-direction: column; gap: .5rem; }

.header-auth {
	display: flex;
	align-items: center;
	gap: .55rem;
	margin-left: auto;
}
.header-auth-link {
	color: var(--text);
	font-weight: 600;
	font-size: .9rem;
	text-decoration: none;
	padding: .35rem .15rem;
}
.header-auth-link:hover { color: var(--blue); }

.site-nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.site-nav a { color: var(--text); font-weight: 600; font-size: .92rem; text-decoration: none; }
.site-nav a:hover { color: var(--blue); }
.nav-toggle { display: none; }

.btn, button.btn {
	display: inline-flex; align-items: center; justify-content: center;
	background: var(--blue); color: #fff; border: 0; border-radius: 8px;
	padding: .65rem 1.1rem; font-weight: 700; font: inherit; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--blue-ink); text-decoration: none; color: #fff; }
.btn-outline { background: transparent; color: var(--blue); border: 1.5px solid var(--blue); }
.btn-outline:hover { background: var(--blue); color: #fff; }
.btn-sm { padding: .4rem .75rem; font-size: .88rem; }
.linkish { background: none; border: 0; color: var(--blue); font: inherit; font-weight: 700; cursor: pointer; padding: 0; }
.inline { display: inline; }

/* —— Feed / bulletin home (Pocket Church style) —— */
.app-welcome {
	padding: .25rem 0 1rem;
}
.app-welcome h1 {
	margin: 0 0 .35rem;
	font-size: clamp(1.45rem, 4vw, 1.85rem);
	letter-spacing: -0.03em;
	color: var(--blue-ink);
}
.app-welcome p { margin: 0; color: var(--muted); max-width: 36rem; }

.feed-list { display: grid; gap: 1rem; }
.feed-card {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: var(--shadow);
	text-decoration: none;
	color: inherit;
	display: block;
	transition: border-color .15s ease, transform .15s ease;
}
.feed-card:hover { border-color: #c5d2ef; text-decoration: none; transform: translateY(-1px); }
.feed-card img {
	width: 100%;
	aspect-ratio: 16/9;
	object-fit: cover;
	background: #e8eefc;
}
.feed-card-body { padding: 1rem 1.1rem 1.15rem; }
.feed-card-body h2 {
	margin: 0 0 .4rem;
	font-size: 1.15rem;
	letter-spacing: -0.02em;
	color: var(--blue-ink);
	line-height: 1.3;
}
.feed-meta {
	display: flex; flex-wrap: wrap; gap: .35rem .75rem;
	color: var(--muted); font-size: .82rem; margin-bottom: .45rem;
}
.feed-card-body p { margin: 0; color: var(--muted); font-size: .95rem; }

.section-label {
	font-size: .75rem; font-weight: 700; letter-spacing: .06em;
	text-transform: uppercase; color: var(--muted); margin: 1.25rem 0 .65rem;
}

.hero, .hero-copy, .module-card, .card, .ad-card, .auth-card, .phase-note, .section-head, .article, .note-item, .form-card {
	background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.hero { display: grid; gap: 1rem; margin-bottom: 1.25rem; }
.hero-copy { padding: 1.25rem; }
.hero h1 { margin: 0 0 .5rem; color: var(--blue-ink); font-size: clamp(1.6rem, 4vw, 2rem); letter-spacing: -0.02em; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }

.grid-modules {
	display: grid; grid-template-columns: repeat(2, 1fr);
	gap: .75rem; margin: 1rem 0 1.5rem;
}
.module-card { padding: 1rem; color: inherit; text-decoration: none; }
.module-card:hover { border-color: var(--blue-2); text-decoration: none; }
.module-card h2 { margin: 0 0 .25rem; color: var(--blue); font-size: 1rem; }
.module-card p { margin: 0; color: var(--muted); font-size: .85rem; }

.ad-rail { display: grid; gap: .75rem; margin: 1rem 0; }
.ad-card { position: relative; overflow: hidden; padding: .75rem; color: inherit; text-decoration: none; }
.ad-card img { width: 100%; border-radius: 8px; margin-bottom: .5rem; aspect-ratio: 16/9; object-fit: cover; background: #e8eefc; }
.ad-label {
	position: absolute; top: .95rem; left: .95rem;
	background: rgba(15,42,107,.85); color: #fff; font-size: .7rem;
	padding: .15rem .45rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em;
}
.phase-note, .section-head { padding: 1.15rem; margin-top: 0; margin-bottom: 1rem; }
.section-head h1 { margin: 0 0 .25rem; color: var(--blue-ink); font-size: 1.45rem; letter-spacing: -0.02em; }
.muted { color: var(--muted); }

.site-footer { border-top: 1px solid var(--line); padding: 1.5rem 0; margin-top: 2rem; background: #fff; }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; width: min(960px, calc(100% - 1.75rem)); margin-inline: auto; }

.flash-wrap { display: grid; gap: .5rem; margin-bottom: 1rem; }
.flash { padding: .75rem 1rem; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.flash-success { border-color: #9AD4B7; background: #EAF8F0; color: var(--ok); }
.flash-error { border-color: #F0B4AE; background: #FDECEC; color: var(--err); }

.auth-body { display: grid; place-items: center; min-height: 100vh; padding: 1rem; background:
	radial-gradient(ellipse at top left, rgba(30,79,214,.12), transparent 50%),
	var(--bg); }
.auth-card { width: min(420px, 100%); padding: 1.5rem; }
.stack { display: grid; gap: .85rem; }
label { display: grid; gap: .35rem; font-weight: 600; font-size: .92rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], textarea, select {
	width: 100%; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 8px;
	font: inherit; background: #fff;
}
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(30,79,214,.22); border-color: var(--blue); }

.admin-body { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.admin-nav { background: var(--blue-ink); color: #fff; padding: 1rem; }
.admin-nav .brand { color: #fff; margin-bottom: 1rem; }
.admin-nav nav { display: grid; gap: .45rem; }
.admin-nav a { color: #d7e4ff; text-decoration: none; padding: .45rem .55rem; border-radius: 8px; }
.admin-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-nav a.muted { opacity: .55; pointer-events: none; }
.admin-main { padding: 1.25rem; }
.admin-top { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.badge { background: #E8EEFC; color: var(--blue-ink); border-radius: 999px; padding: .15rem .55rem; font-size: .8rem; font-weight: 700; }
.admin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.card { padding: 1rem; }
.card h3 { margin: 0 0 .35rem; color: var(--blue-ink); }
.card p { margin: 0; color: var(--muted); }

.row-between { display:flex; justify-content:space-between; align-items:center; gap:1rem; flex-wrap:wrap; }
.table { width:100%; border-collapse:collapse; background:#fff; border:1px solid var(--line); border-radius:10px; overflow:hidden; margin:1rem 0; }
.table th, .table td { padding:.7rem .8rem; border-bottom:1px solid var(--line); text-align:left; vertical-align:top; font-size:.92rem; }
.table th { background:#EEF3FF; color:var(--blue-ink); }
.actions { display:flex; gap:.75rem; align-items:center; }
.danger { color:var(--err) !important; }
.inline-form { display:flex; gap:.5rem; align-items:center; flex-wrap:wrap; margin:.75rem 0; }
.form-card { max-width:720px; padding:1.25rem; }
.thumb { max-width:220px; border-radius:8px; margin-top:.5rem; }
.card-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:1rem; }
.card-grid .card { padding:1rem; }
.card-grid img, .article-cover { width:100%; border-radius:8px; margin-bottom:.75rem; aspect-ratio:16/9; object-fit:cover; background:#e8eefc; }
.price { color:var(--blue-ink); font-weight:800; margin:.35rem 0; }
.price.big { font-size:1.4rem; }
.img-ph { background:#e8eefc; border-radius:8px; aspect-ratio:16/9; display:grid; place-items:center; color:var(--muted); margin-bottom:.75rem; }
.img-ph.tall { min-height:240px; aspect-ratio:1; }
.product-layout { display:grid; grid-template-columns:1fr 1.1fr; gap:1.25rem; }
.wa-btn { background:#25D366 !important; }
.wa-btn:hover { background:#1da851 !important; }
.video-wrap { position:relative; padding-top:56.25%; margin:1rem 0; background:#000; border-radius:10px; overflow:hidden; }
.video-wrap iframe { position:absolute; inset:0; width:100%; height:100%; border:0; }
.live { background:#E11D48; color:#fff; font-size:.7rem; padding:.15rem .4rem; border-radius:999px; vertical-align:middle; }
.note-item { padding:.75rem 1rem; margin:.5rem 0; }
.pager { display:flex; justify-content:space-between; margin-top:1rem; }
.prose { white-space:pre-wrap; }
.article { padding:1.25rem; }
.tv-notes-block { margin-top: 1.5rem; }
.tv-notes-block h2 { margin: 0 0 .75rem; font-size: 1.15rem; color: var(--blue-ink); }
.source-pill {
	display:inline-block; font-size:.7rem; font-weight:700; text-transform:uppercase;
	letter-spacing:.04em; padding:.12rem .45rem; border-radius:999px;
	background:#EEF3FF; color:var(--blue-ink);
}
.source-pill.mother { background:#F3F0E8; color:#6B5420; }

.social-meta { display:flex; justify-content:space-between; gap:.75rem; margin-bottom:.35rem; }
.social-actions { display:flex; flex-wrap:wrap; gap:.85rem; align-items:center; margin-top:.5rem; }

/* —— Bottom tab bar (mobile + PWA) —— */
.site-tabbar { display: none !important; }
.tab-ico { display: block; }
@media (max-width: 860px), (display-mode: standalone), (display-mode: minimal-ui), (display-mode: fullscreen) {
	body.has-tabbar {
		padding-bottom: calc(4.35rem + env(safe-area-inset-bottom, 0px));
	}
	body.has-tabbar .site-header .site-nav { display: none; }
	body.has-tabbar .site-footer { display: none; }
	body.has-tabbar .header-auth { display: flex; }
	.site-tabbar {
		display: flex !important;
		position: fixed;
		left: 0; right: 0; bottom: 0;
		z-index: 80;
		align-items: stretch;
		justify-content: space-around;
		gap: 0.1rem;
		padding: 0.3rem 0.2rem calc(0.3rem + env(safe-area-inset-bottom, 0px));
		height: auto;
		min-height: 55px;
		background: #fff;
		border-top: 1px solid var(--line);
		box-shadow: 0 -4px 16px rgba(15, 42, 107, 0.08);
	}
	.tabbar-item {
		flex: 1;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 0.12rem;
		min-width: 0;
		padding: 0.3rem 0.15rem;
		color: var(--muted);
		text-decoration: none;
		font-size: 0.68rem;
		font-weight: 600;
		line-height: 1.1;
	}
	.tabbar-item:hover { text-decoration: none; color: var(--ink); }
	.tabbar-item.is-active { color: var(--blue); }
	.tabbar-ico {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 1.5rem;
		height: 1.5rem;
	}
	.tabbar-label {
		max-width: 100%;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
}
@media (min-width: 861px) and (display-mode: browser) {
	.site-tabbar { display: none !important; }
	body.has-tabbar { padding-bottom: 0 !important; }
	body.has-tabbar .site-header .site-nav { display: flex !important; }
	body.has-tabbar .site-footer { display: block !important; }
}

@media (min-width: 861px) {
	.header-inner { flex-wrap: nowrap; }
	.brand { order: 1; }
	.site-nav { order: 2; margin-left: auto; margin-right: 1rem; }
	.header-auth { order: 3; margin-left: 0; }
}
@media (max-width: 860px) {
	.site-nav { display: none; }
	.header-auth { display: flex; }
}

@media (max-width: 800px) {
	.product-layout { grid-template-columns: 1fr; }
	.admin-body { grid-template-columns: 1fr; }
	.grid-modules { grid-template-columns: 1fr 1fr; }
}
.jsa-pwa-modal {
	position: fixed; inset: 0; z-index: 200;
	display: flex; align-items: flex-end; justify-content: center;
	padding: 1rem;
	pointer-events: none;
}
.jsa-pwa-modal[hidden] { display: none !important; }
.jsa-pwa-modal.is-open { pointer-events: auto; }
.jsa-pwa-modal__scrim {
	position: absolute; inset: 0;
	background: rgba(15, 42, 107, 0.35);
	opacity: 0; transition: opacity .2s ease;
}
.jsa-pwa-modal.is-open .jsa-pwa-modal__scrim { opacity: 1; }
.jsa-pwa-modal__dialog {
	position: relative;
	width: min(100%, 420px);
	background: #fff;
	border-radius: 14px 14px 10px 10px;
	padding: 1.25rem 1.15rem 1.35rem;
	box-shadow: 0 16px 40px rgba(15,42,107,.18);
	transform: translateY(12px);
	opacity: 0;
	transition: transform .2s ease, opacity .2s ease;
}
.jsa-pwa-modal.is-open .jsa-pwa-modal__dialog {
	transform: translateY(0);
	opacity: 1;
}
.jsa-pwa-modal__dialog h3 { margin: 0 0 .75rem; color: var(--blue-ink); }
.jsa-pwa-modal__close {
	position: absolute; top: .55rem; right: .65rem;
	border: 0; background: none; font-size: 1.4rem; color: var(--muted); cursor: pointer; line-height: 1;
}
.jsa-pwa-modal__dialog.jsa-pwa-prompt-card {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: .75rem;
	padding-right: 2.2rem;
}
.jsa-pwa-prompt-card__icon img { border-radius: 10px; }
.jsa-pwa-prompt-card__text { margin: 0; font-weight: 600; color: var(--text); font-size: .95rem; }
.jsa-pwa-prompt-card__btn {
	border: 0; border-radius: 8px; padding: .55rem .9rem;
	background: var(--jsa-pwa-theme, var(--blue));
	color: #fff; font: inherit; font-weight: 700; cursor: pointer;
}
.jsa-pwa-steps { margin: 0; padding-left: 1.2rem; color: var(--muted); }
.jsa-pwa-steps li { margin: .35rem 0; }
body.jsa-pwa-lock { overflow: hidden; }
@media (min-width: 640px) {
	.jsa-pwa-modal { align-items: center; }
}

/* —— PWA splash screen —— */
html.jsa-splash-active,
html.jsa-splash-active body {
	overflow: hidden;
}
.jsa-splash {
	position: fixed;
	inset: 0;
	z-index: 300;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--jsa-splash-bg, var(--bg, #F5F7FB));
	opacity: 0;
	transition: opacity .3s ease;
	padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.jsa-splash[hidden] { display: none !important; }
.jsa-splash.is-visible { opacity: 1; }
.jsa-splash.is-hiding { opacity: 0; }
.jsa-splash__inner {
	display: flex;
	align-items: center;
	justify-content: center;
	width: min(100%, 420px);
	padding: 1.5rem;
	text-align: center;
}
.jsa-splash__logo {
	width: min(148px, 42vw);
	height: auto;
	border-radius: 22px;
	animation: jsa-splash-pop .55s ease both;
}
.jsa-splash__image {
	max-width: min(320px, 86vw);
	max-height: 70vh;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 12px;
	animation: jsa-splash-pop .55s ease both;
}
.jsa-splash__custom {
	width: 100%;
	color: var(--blue-ink, #0F2A6B);
	animation: jsa-splash-pop .55s ease both;
}
.jsa-splash__custom img { margin-inline: auto; max-width: 100%; }
@keyframes jsa-splash-pop {
	from { opacity: 0; transform: scale(.92); }
	to { opacity: 1; transform: scale(1); }
}

