/* CCB Audio — mobile first. Everything is scoped under .ccb-* so it never fights the theme. */

:root {
	--ccb-accent: #7a4b2a;
	--ccb-bg: #ffffff;
	--ccb-bg-2: #f6f3ef;
	--ccb-line: #e7e1d9;
	--ccb-text: #1f1b17;
	--ccb-muted: #6f675e;
	--ccb-on-accent: #ffffff;
	--ccb-radius: 14px;
	--ccb-shadow: 0 -6px 24px rgba(0, 0, 0, .08);
	--ccb-bar-h: 68px;
	--ccb-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
	:root {
		--ccb-bg: #191714;
		--ccb-bg-2: #24211d;
		--ccb-line: #34302a;
		--ccb-text: #f3efe9;
		--ccb-muted: #b2a99d;
		--ccb-shadow: 0 -6px 24px rgba(0, 0, 0, .4);
	}
}

.ccb-player, .ccb-lib, .ccb-single, .ccb-latest, .ccb-toast { font-family: var(--ccb-font); -webkit-tap-highlight-color: transparent; }
.ccb-player *, .ccb-lib *, .ccb-single *, .ccb-latest * { box-sizing: border-box; }
.ccb-player [hidden], .ccb-lib [hidden], .ccb-single [hidden] { display: none !important; }

/* Reset theme button styling inside our components */
.ccb-player button, .ccb-lib button, .ccb-single button, .ccb-latest button {
	font-family: inherit; color: inherit; background: none; border: 0; margin: 0; padding: 0;
	box-shadow: none; text-transform: none; letter-spacing: normal; line-height: 1.2; font-size: 15px; font-weight: 500;
	cursor: pointer; border-radius: 0; min-height: 0; width: auto;
}
.ccb-player button:focus-visible, .ccb-lib button:focus-visible, .ccb-single button:focus-visible,
.ccb-lib a:focus-visible, .ccb-lib select:focus-visible {
	outline: 3px solid var(--ccb-accent); outline-offset: 2px;
}
.ccb-i { width: 24px; height: 24px; fill: currentColor; display: block; flex: none; }
.ccb-i text { fill: currentColor; }

.ccb-btn {
	display: inline-flex !important; align-items: center; justify-content: center;
	width: 44px !important; height: 44px; border-radius: 50% !important; color: var(--ccb-text);
}
.ccb-btn:disabled { opacity: .3; cursor: default; }
.ccb-btn:not(:disabled):active { background: var(--ccb-bg-2) !important; }

/* ---------- player bar ---------- */
html.ccb-has-player body { padding-bottom: calc(var(--ccb-bar-h) + env(safe-area-inset-bottom, 0px)); }

.ccb-player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 99990; color: var(--ccb-text); }
.ccb-bar {
	position: relative; display: flex; align-items: center; gap: 4px;
	height: calc(var(--ccb-bar-h) + env(safe-area-inset-bottom, 0px));
	padding: 0 8px env(safe-area-inset-bottom, 0px) 8px;
	background: var(--ccb-bg); border-top: 1px solid var(--ccb-line); box-shadow: var(--ccb-shadow);
}
.ccb-progress-line { position: absolute; top: -1px; left: 0; right: 0; height: 3px; background: transparent; }
.ccb-progress-line span { display: block; height: 100%; width: 0; background: var(--ccb-accent); transition: width .25s linear; }

.ccb-bar-open { flex: 1; min-width: 0; display: flex !important; align-items: center; gap: 12px; text-align: left; height: 100%; padding: 0 4px !important; }
.ccb-bar-art { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex: none; background: var(--ccb-bg-2); }
.ccb-bar-text { display: flex; flex-direction: column; min-width: 0; }
.ccb-bar-title { font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ccb-bar-sub { font-size: 13px; color: var(--ccb-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.ccb-player.is-resume .ccb-bar-sub::before { content: "Continue · "; color: var(--ccb-accent); font-weight: 600; }
.ccb-player.has-error .ccb-bar-sub { color: #b3261e; white-space: normal; }

.ccb-toggle .ccb-i-pause { display: none; }
.ccb-player.is-playing .ccb-toggle .ccb-i-play { display: none; }
.ccb-player.is-playing .ccb-toggle .ccb-i-pause { display: block; }
.ccb-bar .ccb-toggle { background: var(--ccb-accent) !important; color: var(--ccb-on-accent); }
.ccb-player.is-loading .ccb-toggle { animation: ccb-pulse 1s ease-in-out infinite; }
@keyframes ccb-pulse { 50% { opacity: .55; } }

/* ---------- full-screen player ---------- */
html.ccb-full-open, html.ccb-full-open body { overflow: hidden; }
.ccb-full {
	position: fixed; inset: 0; z-index: 99995; overflow-y: auto; overscroll-behavior: contain;
	background: var(--ccb-bg); color: var(--ccb-text);
	padding: max(12px, env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom)) 20px;
	transform: translateY(100%); transition: transform .22s ease-out;
	display: flex; flex-direction: column; align-items: center;
}
.ccb-full.is-in { transform: none; }
@media (prefers-reduced-motion: reduce) { .ccb-full { transition: none; } }
.ccb-full > * { width: 100%; max-width: 480px; }

.ccb-full-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ccb-full-kicker { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ccb-muted); text-align: center; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccb-full-art {
	display: block; width: 100%; max-width: min(480px, 46vh) !important; aspect-ratio: 1; object-fit: cover;
	border-radius: 18px; margin: 16px auto 20px; background: var(--ccb-bg-2);
	box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
}
.ccb-full-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ccb-full-title { font-size: 22px; line-height: 1.25; font-weight: 700; margin: 0 0 4px; color: var(--ccb-text); }
.ccb-full-sub { font-size: 15px; color: var(--ccb-muted); margin: 0; }

.ccb-fav .ccb-heart { fill: none; stroke: currentColor; stroke-width: 1.8; }
.ccb-fav[aria-pressed="true"] { color: #d23a4a; }
.ccb-fav[aria-pressed="true"] .ccb-heart { fill: currentColor; }

.ccb-seek { margin-top: 18px; }
.ccb-range {
	-webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 0; padding: 0; border: 0;
	--p: 0%;
}
.ccb-range::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--ccb-accent) var(--p), var(--ccb-line) var(--p)); }
.ccb-range::-moz-range-track { height: 6px; border-radius: 3px; background: var(--ccb-line); }
.ccb-range::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--ccb-accent); }
.ccb-range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--ccb-accent); margin-top: -6px; border: 0; }
.ccb-range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--ccb-accent); border: 0; }
.ccb-times { display: flex; justify-content: space-between; font-size: 13px; color: var(--ccb-muted); font-variant-numeric: tabular-nums; }

.ccb-controls { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 10px; }
.ccb-controls .ccb-btn { width: 52px !important; height: 52px; }
.ccb-controls .ccb-i { width: 30px; height: 30px; }
.ccb-controls .ccb-big { width: 76px !important; height: 76px; background: var(--ccb-accent) !important; color: var(--ccb-on-accent); }
.ccb-controls .ccb-big .ccb-i { width: 38px; height: 38px; }

.ccb-extras { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 6px 0 18px; }
.ccb-player .ccb-chip, .ccb-lib .ccb-chip, .ccb-single .ccb-chip {
	display: inline-flex !important; align-items: center; min-height: 36px; padding: 0 14px !important;
	border-radius: 999px !important; border: 1px solid var(--ccb-line) !important; background: var(--ccb-bg) !important;
	font-size: 14px; font-weight: 600; color: var(--ccb-text); white-space: nowrap;
}
.ccb-chip[aria-pressed="true"], .ccb-chip.is-on { background: var(--ccb-accent) !important; border-color: var(--ccb-accent) !important; color: var(--ccb-on-accent); }

.ccb-upnext h3 { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--ccb-muted); margin: 8px 0; }
.ccb-queue { list-style: none; margin: 0; padding: 0; }
.ccb-queue li { margin: 0; border-top: 1px solid var(--ccb-line); }
.ccb-queue button { display: flex !important; flex-direction: column; width: 100% !important; text-align: left; padding: 12px 0 !important; }
.ccb-q-title { font-weight: 600; font-size: 15px; }
.ccb-full-scripture { font-size: 15px; color: var(--ccb-muted); margin: 2px 0 0; }
.ccb-q-sub { font-size: 13px; color: var(--ccb-muted); margin-top: 2px; }

/* ---------- library ---------- */
.ccb-lib { color: var(--ccb-text); max-width: 760px; margin: 0 auto; }
.ccb-lib-head {
	position: sticky; top: 0; z-index: 5; background: var(--ccb-bg);
	padding: 10px 0 8px; margin: 0 0 4px; border-bottom: 1px solid var(--ccb-line);
}
.admin-bar .ccb-lib-head { top: 46px; }
@media (min-width: 783px) { .admin-bar .ccb-lib-head { top: 32px; } }

.ccb-search { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 14px; border-radius: 12px; background: var(--ccb-bg-2); color: var(--ccb-muted); }
.ccb-search input {
	flex: 1; min-width: 0; height: 100%; border: 0 !important; background: transparent !important; box-shadow: none !important;
	font-size: 16px; /* 16px stops iPhone zooming in */ color: var(--ccb-text); padding: 0 !important; outline: none;
}
.ccb-tabs { display: flex; gap: 4px; margin: 10px 0 0; overflow-x: auto; scrollbar-width: none; }
.ccb-tabs::-webkit-scrollbar, .ccb-chips::-webkit-scrollbar { display: none; }
.ccb-player .ccb-tab, .ccb-lib .ccb-tab, .ccb-single .ccb-tab { padding: 10px 12px !important; font-size: 15px; font-weight: 600; color: var(--ccb-muted) !important; border-bottom: 3px solid transparent !important; white-space: nowrap; }
.ccb-tab.is-on { color: var(--ccb-text) !important; border-bottom-color: var(--ccb-accent) !important; }

.ccb-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 10px 0 2px; }
.ccb-search-row { display: flex; align-items: center; gap: 4px; }
.ccb-search-row .ccb-search { flex: 1; min-width: 0; }
.ccb-clear { display: inline-flex !important; align-items: center; justify-content: center; width: 36px !important; height: 36px; border-radius: 18px !important; color: var(--ccb-muted) !important; flex: none; }
.ccb-clear .ccb-i { width: 18px; height: 18px; }
.ccb-filter-btn { position: relative; margin-right: -8px !important; }
.ccb-filter-dot { position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--ccb-accent); border: 2px solid var(--ccb-bg); }
.ccb-lib .ccb-chips { padding-top: 12px; }
.ccb-lib.is-personal .ccb-search-row { display: none; }
mark.ccb-hit { background: none; color: var(--ccb-accent); padding: 0; }

/* filter sheet */
html.ccb-sheet-open, html.ccb-sheet-open body { overflow: hidden; }
.ccb-sheet { position: fixed; inset: 0; z-index: 99996; color: var(--ccb-text); font-family: var(--ccb-font); }
.ccb-sheet[hidden] { display: none; }
.ccb-sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); opacity: 0; transition: opacity .2s; }
.ccb-sheet-panel {
	position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto; margin: 0 auto; max-width: 560px;
	display: flex; flex-direction: column; gap: 16px; box-sizing: border-box;
	padding: 10px 20px calc(20px + env(safe-area-inset-bottom, 0px)); border-radius: 24px 24px 0 0;
	background: var(--ccb-bg-2); transform: translateY(100%); transition: transform .2s ease-out;
}
.ccb-sheet.is-in .ccb-sheet-backdrop { opacity: 1; }
.ccb-sheet.is-in .ccb-sheet-panel { transform: none; }
@media (prefers-reduced-motion: reduce) { .ccb-sheet-panel, .ccb-sheet-backdrop { transition: none; } }
.ccb-sheet-grab { align-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--ccb-line); }
.ccb-sheet-head { display: flex; align-items: center; justify-content: space-between; }
.ccb-sheet-head h2 { margin: 0; font-size: 22px; font-weight: 800; color: var(--ccb-text); }
.ccb-sheet button.ccb-sheet-reset { min-height: 44px; padding: 0 4px; font-size: 15px; font-weight: 700; color: var(--ccb-muted); background: none; border: 0; cursor: pointer; font-family: inherit; }
.ccb-field { display: flex; flex-direction: column; gap: 8px; }
.ccb-field[hidden] { display: none; }
.ccb-field > span { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ccb-muted); }
.ccb-field select {
	width: 100%; min-height: 48px; padding: 0 14px; border-radius: 12px; margin: 0;
	border: 1px solid var(--ccb-line); background: var(--ccb-bg); color: var(--ccb-text); font-family: inherit; font-size: 16px;
}
.ccb-sheet button.ccb-sheet-done {
	min-height: 52px; border-radius: 26px; border: 0; margin-top: 4px; cursor: pointer;
	background: var(--ccb-accent); color: var(--ccb-on-accent); font-family: inherit; font-size: 17px; font-weight: 800;
}

.ccb-count { font-size: 13px; color: var(--ccb-muted); margin: 10px 0 2px; min-height: 1em; }
.ccb-lib.is-loading .ccb-list { opacity: .5; transition: opacity .2s; }

.ccb-list { list-style: none !important; margin: 0 !important; padding: 0 !important; }
.ccb-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--ccb-line); margin: 0 !important; }
.ccb-item::marker { content: none; }
.ccb-item-play { position: relative; flex: none; width: 56px !important; height: 56px; border-radius: 10px !important; overflow: hidden; background: var(--ccb-bg-2) !important; }
.ccb-item-play img, .ccb-noart { width: 56px; height: 56px; object-fit: cover; display: block; }
.ccb-noart { background: linear-gradient(135deg, var(--ccb-accent), #c49a6c); }
.ccb-item-icon, .ccb-eq { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .28); color: #fff; }
.ccb-eq { display: none; gap: 3px; align-items: flex-end; padding-bottom: 18px; background: rgba(0, 0, 0, .45); }
.ccb-eq i { width: 4px; height: 8px; background: #fff; border-radius: 2px; animation: ccb-eq .9s ease-in-out infinite; }
.ccb-eq i:nth-child(2) { animation-delay: -.3s; } .ccb-eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes ccb-eq { 50% { height: 20px; } }
.ccb-item.is-playing .ccb-eq { display: flex; }
.ccb-item.is-playing .ccb-item-icon { display: none; }
@media (prefers-reduced-motion: reduce) { .ccb-eq i { animation: none; height: 14px; } }

.ccb-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; text-decoration: none !important; color: var(--ccb-text) !important; }
.ccb-item-type { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ccb-accent); }
.ccb-item-title { font-size: 16px; font-weight: 650; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ccb-item.is-current .ccb-item-title { color: var(--ccb-accent); }
.ccb-item-sub { font-size: 13px; color: var(--ccb-muted); margin-top: 2px; }
.ccb-done-mark { display: none; color: #2e7d32; font-weight: 700; }
.ccb-item.is-done .ccb-done-mark { display: inline; }
.ccb-item-track { display: block; height: 3px; margin-top: 6px; border-radius: 2px; background: transparent; overflow: hidden; }
.ccb-item-progress { display: block; height: 100%; width: 0; background: var(--ccb-accent); }
.ccb-row-fav { color: var(--ccb-muted); }
.ccb-row-fav .ccb-i { width: 20px; height: 20px; }

.ccb-player .ccb-more, .ccb-lib .ccb-more, .ccb-single .ccb-more { display: block !important; width: 100% !important; min-height: 48px; margin: 14px 0 !important; border-radius: 12px !important; background: var(--ccb-bg-2) !important; font-weight: 600; }
.ccb-empty { text-align: center; color: var(--ccb-muted); padding: 32px 12px; }

/* ---------- single page card ---------- */
.ccb-single { display: flex; flex-direction: column; gap: 16px; margin: 0 0 24px; color: var(--ccb-text); }
.ccb-single-art { width: 100%; max-width: 360px; aspect-ratio: 1; object-fit: cover; border-radius: 18px; box-shadow: 0 14px 34px rgba(0, 0, 0, .15); }
.ccb-single-sub { font-size: 17px; margin: 4px 0 0; }
.ccb-single-sub2 { font-size: 15px; color: var(--ccb-muted); margin: 4px 0 0; }
.ccb-single-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.ccb-player .ccb-single-play, .ccb-lib .ccb-single-play, .ccb-single .ccb-single-play {
	display: inline-flex !important; align-items: center; gap: 8px; min-height: 52px; padding: 0 24px 0 18px !important;
	border-radius: 999px !important; background: var(--ccb-accent) !important; color: var(--ccb-on-accent) !important; font-weight: 700; font-size: 17px;
}
.ccb-single-play small { font-weight: 500; opacity: .85; font-size: 14px; }
.ccb-single-play .ccb-i-play { width: 26px; height: 26px; }
.ccb-download { color: var(--ccb-text); }
.ccb-back-link a { font-weight: 600; }
@media (min-width: 700px) {
	.ccb-single { flex-direction: row; align-items: center; gap: 28px; }
	.ccb-single-art { width: 240px; }
}

/* ---------- latest ---------- */
.ccb-latest { color: var(--ccb-text); }
.ccb-all-link { display: inline-block; margin-top: 12px; font-weight: 600; }

/* ---------- toast ---------- */
.ccb-toast {
	position: fixed; left: 50%; bottom: calc(var(--ccb-bar-h) + 20px + env(safe-area-inset-bottom)); transform: translate(-50%, 10px);
	background: #222; color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 99999; opacity: 0; transition: .2s;
}
.ccb-toast.is-in { opacity: 1; transform: translate(-50%, 0); }

/* Larger screens: bar gets a little roomier */
@media (min-width: 900px) {
	.ccb-bar { padding-left: max(16px, calc((100vw - 1100px) / 2)); padding-right: max(16px, calc((100vw - 1100px) / 2)); }
}

/* Search field: one clear button (ours), focus ring on the whole field */
.ccb-search input::-webkit-search-cancel-button, .ccb-search input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.ccb-search input:focus, .ccb-search input:focus-visible { outline: none !important; box-shadow: none !important; }
.ccb-search:focus-within { box-shadow: inset 0 0 0 2px var(--ccb-accent); }

/* "hidden" always wins over the display rules above */
.ccb-player [hidden][hidden], .ccb-lib [hidden][hidden], .ccb-single [hidden][hidden], .ccb-sheet [hidden][hidden], .ccb-latest [hidden][hidden] { display: none !important; }
