/* Stay Biblical Community: counselling chat and counsellor inbox. */

.sbc-wrap { box-sizing: border-box; width: 100%; max-width: 1248px; margin-inline: auto; padding-inline: 24px; }
.sbc-chat-page { padding: 28px 0 56px; font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; color: #1F2A36; }
.sbc-box { background: #fff; border: 1px solid #E4E1DA; border-radius: 20px; padding: 22px; box-sizing: border-box; }
.sbc-muted { font-size: 14px; line-height: 1.6; color: #5B6673; }
.sbc-notice { margin: 0; padding: 0 6px; font-size: 13px; line-height: 1.6; color: #5B6673; }
.sbc-chip { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: #EEF2F5; color: #12283A; white-space: nowrap; }
.sbc-chip[hidden] { display: none; }
.sbc-form__msg { margin: 0; font-size: 14px; color: #9E1E1E; }
.sbc-form__msg:empty { display: none; }

.sbc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; box-sizing: border-box; }
.sbc-btn--lg { min-height: 48px; }
.sbc-btn--sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.sbc-btn--red { background: #BF2626; color: #fff; }
.sbc-btn--red:hover { background: #9E1E1E; color: #fff; }
.sbc-btn--red:disabled { opacity: .7; }
.sbc-btn--outline { border-color: #BF2626; color: #BF2626; background: #fff; }
.sbc-btn--outline:hover { background: #FBEDED; color: #9E1E1E; }
.sbc-btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.sbc-btn[hidden] { display: none; }

.sbc-avatar { flex: none; width: 40px; height: 40px; border-radius: 12px; background: #EEF2F5; color: #12283A; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.sbc-avatar--navy { background: #12283A; color: #fff; }
.sbc-avatar--lg { width: 44px; height: 44px; border-radius: 13px; font-size: 15px; }

/* Signed-out card */
.sbc-signin { max-width: 720px; margin: 0 auto; background: #fff; border: 1px solid #E4E1DA; border-radius: 24px; padding: 40px; display: flex; flex-direction: column; gap: 18px; }
.sbc-signin__title { margin: 0; font-family: 'Fjalla One', 'Arial Narrow', sans-serif; font-weight: 400; font-size: 40px; line-height: 1.1; }
.sbc-signin__lead { margin: 0; font-size: 17px; line-height: 1.6; color: #3B4652; }
.sbc-signin__steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 12px; }
.sbc-signin__steps li { counter-increment: s; display: flex; align-items: center; gap: 14px; font-size: 16px; }
.sbc-signin__steps li::before { content: counter(s); flex: none; width: 32px; height: 32px; border-radius: 10px; background: #BF2626; color: #fff; display: grid; place-items: center; font-weight: 700; }

/* Visitor start form (name + email instead of an account) */
.sbc-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sbc-guest-fields { display: flex; flex-direction: column; gap: 12px; }
.sbc-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.sbc-field input { min-height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid #D9D5CC; font: inherit; font-size: 15px; font-weight: 400; background: #fff; color: #1F2A36; box-sizing: border-box; width: 100%; }
.sbc-field input:focus { outline: 2px solid #12283A; outline-offset: 0; border-color: #12283A; }
.sbc-privacy { margin: 0; font-size: 12px; line-height: 1.5; color: #5B6673; }
.sbc-privacy a { color: #5B6673; text-decoration: underline; }

/* Layout */
.sbc-chat { display: flex; flex-wrap: wrap; gap: 24px; align-items: stretch; }
.sbc-chat__side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.sbc-chat__intro { display: flex; flex-direction: column; gap: 14px; }
.sbc-chat__h1 { margin: 0; font-family: 'Fjalla One', 'Arial Narrow', sans-serif; font-weight: 400; font-size: 30px; line-height: 1.15; }
.sbc-topics { display: flex; flex-wrap: wrap; gap: 8px; }
.sbc-topic { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid #E4E1DA; background: #fff; color: #12283A; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.sbc-topic:hover { border-color: #12283A; }
.sbc-topic[aria-pressed="true"] { border-color: #12283A; background: #12283A; color: #fff; }
.sbc-filter { display: inline-flex; padding: 4px; gap: 4px; border-radius: 14px; background: #E9E6DF; align-self: flex-start; }
.sbc-filter button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; color: #4A5562; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.sbc-filter button.is-active { background: #fff; color: #1F2A36; }
.sbc-push-btn.is-on { border-color: #CFE6D8; color: #1F5E3A; background: #E7F3EC; cursor: default; }
.sbc-push-link { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 6px; border: 0; background: none; color: #BF2626; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.sbc-push-link.is-on { color: #1F5E3A; cursor: default; }
.sbc-push-link[hidden], .sbc-push-help[hidden] { display: none; }
.sbc-push-help { margin: 0; padding: 12px 14px; border-radius: 12px; background: #FFF4E0; color: #7A4A00; font-size: 13px; line-height: 1.5; }

/* Conversation list */
.sbc-convs { background: #fff; border: 1px solid #E4E1DA; border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; max-height: 520px; overflow-y: auto; }
.sbc-convs__loading, .sbc-convs__empty { padding: 18px; font-size: 14px; color: #5B6673; }
.sbc-convs__item { display: flex; gap: 12px; padding: 16px 18px; color: #1F2A36; border-bottom: 1px solid #EFECE6; text-decoration: none; }
.sbc-convs__item:last-child { border-bottom: 0; }
.sbc-convs__item:hover { background: #F8F7F4; color: #1F2A36; }
.sbc-convs__item.is-active { background: #FBEDED; }
.sbc-convs__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.sbc-convs__text strong { font-size: 14px; }
.sbc-convs__topic { font-size: 12px; font-weight: 600; color: #12283A; }
.sbc-convs__preview { font-size: 13px; color: #5B6673; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.has-unread .sbc-convs__preview { color: #1F2A36; font-weight: 600; }
.sbc-convs__side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.sbc-convs__time { font-size: 12px; color: #5B6673; }
.sbc-convs__badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #BF2626; color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; box-sizing: border-box; }

/* Conversation */
.sbc-conv { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; background: #fff; border: 1px solid #E4E1DA; border-radius: 20px; overflow: hidden; height: min(780px, calc(100vh - 140px)); min-height: 560px; }
.sbc-conv__head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #EFECE6; }
.sbc-conv__back { display: none; }
.sbc-conv__who { display: flex; flex-direction: column; min-width: 0; }
.sbc-conv__who strong { font-size: 16px; }
.sbc-conv__status { font-size: 13px; color: #5B6673; }
.sbc-conv__status.is-online { color: #2E7D4F; font-weight: 600; }
.sbc-conv__private { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #5B6673; }
.sbc-conv__body { flex: 1; overflow-y: auto; padding: 24px 20px; display: flex; flex-direction: column; gap: 12px; background: #F8F7F4; overscroll-behavior: contain; }
.sbc-conv__empty { margin: auto; max-width: 320px; text-align: center; color: #5B6673; font-size: 15px; line-height: 1.6; }
.is-offline .sbc-conv__body { box-shadow: inset 0 3px 0 #E5A23A; }

.sbc-day { align-self: center; font-size: 12px; font-weight: 600; color: #5B6673; padding: 4px 10px; border-radius: 999px; background: #EDEAE3; }
.sbc-msg { align-self: flex-start; max-width: 70%; padding: 12px 16px; border-radius: 18px 18px 18px 6px; background: #fff; border: 1px solid #E4E1DA; font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.sbc-msg--right { align-self: flex-end; border-radius: 18px 18px 6px 18px; background: #BF2626; border-color: #BF2626; color: #fff; }
.sbc-msg--verse { display: flex; flex-direction: column; gap: 6px; border-radius: 16px; padding: 14px 16px; white-space: normal; }
.sbc-msg--verse strong { font-size: 12px; color: #BF2626; letter-spacing: 1px; text-transform: uppercase; }
.sbc-msg__verse { font-family: 'Source Serif 4', Georgia, serif; font-size: 16px; line-height: 1.6; }
.sbc-msg--verse a { font-size: 13px; font-weight: 600; color: #BF2626; }
.sbc-msg--verse.sbc-msg--right { background: #fff; border-color: #E4E1DA; color: #1F2A36; border-radius: 16px; }
.sbc-options { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 8px; }
.sbc-options button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid #E4E1DA; background: #fff; font: inherit; font-size: 14px; font-weight: 600; color: #12283A; cursor: pointer; }
.sbc-options button:hover:not(:disabled) { border-color: #12283A; }
.sbc-options button:disabled { opacity: .6; cursor: default; }
.sbc-chat[data-mode="counsellor"] .sbc-options { align-self: flex-end; }
.sbc-closed { align-self: center; margin-top: 6px; padding: 10px 14px; border-radius: 12px; background: #EDEAE3; color: #4A5562; font-size: 13px; text-align: center; }
.sbc-error { align-self: center; padding: 10px 14px; border-radius: 12px; background: #FBEDED; color: #9E1E1E; font-size: 13px; }

.sbc-verse-box { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; padding: 12px 16px 0; border-top: 1px solid #EFECE6; }
.sbc-verse-box[hidden] { display: none; }
.sbc-verse-box input, .sbc-verse-box textarea { min-height: 44px; padding: 10px 12px; border-radius: 12px; border: 1px solid #D9D5CC; font: inherit; font-size: 14px; resize: vertical; box-sizing: border-box; width: 100%; }
.sbc-verse-box [data-sbc-options] { grid-column: 1 / -1; }
.sbc-composer { display: flex; align-items: flex-end; gap: 10px; padding: 14px 16px; border-top: 1px solid #EFECE6; background: #fff; }
.sbc-verse-box:not([hidden]) + .sbc-composer { border-top: 0; }
.sbc-composer[hidden] { display: none; }
.sbc-composer__field { flex: 1; display: flex; min-width: 0; }
.sbc-composer textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 160px; padding: 11px 14px; border-radius: 12px; border: 1px solid #D9D5CC; font: inherit; font-size: 15px; line-height: 1.4; resize: none; box-sizing: border-box; }
.sbc-composer textarea:focus, .sbc-verse-box input:focus, .sbc-verse-box textarea:focus { outline: 2px solid #12283A; outline-offset: 0; border-color: #12283A; }
.sbc-icon-btn { flex: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid #E4E1DA; background: #fff; display: grid; place-items: center; color: #12283A; cursor: pointer; padding: 0; }
.sbc-icon-btn[aria-expanded="true"] { background: #12283A; color: #fff; border-color: #12283A; }
.sbc-icon-btn--send { border: 0; background: #BF2626; color: #fff; }
.sbc-icon-btn--send:hover { background: #9E1E1E; }
.sbc-icon-btn--send:disabled { opacity: .6; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

/* wp-admin inbox */
.sbc-admin-wrap { margin-right: 20px; }
.sbc-admin-tip { max-width: 1200px; margin: 12px auto 16px; padding: 12px 16px; background: #fff; border-left: 4px solid #BF2626; font-size: 14px; }
.sbc-chat--admin { padding-inline: 0; }
.sbc-chat--admin .sbc-conv { height: calc(100vh - 200px); }

/* Phone: list first; an open conversation fills the screen (like a messaging app). */
@media (max-width: 760px) {
	.sbc-wrap { padding-inline: 16px; }
	.sbc-chat-page { padding: 16px 0 40px; }
	.sbc-signin { padding: 24px 20px; }
	.sbc-signin__title { font-size: 32px; }
	.sbc-conv { display: none; }
	.sbc-chat.is-open .sbc-conv { display: flex; position: fixed; inset: 0; z-index: 100000; height: auto; min-height: 0; border: 0; border-radius: 0; height: 100dvh; }
	.sbc-chat.is-open .sbc-conv__head { flex-wrap: nowrap; padding: 12px 16px; background: #12283A; color: #fff; border-bottom: 0; padding-top: max(12px, env(safe-area-inset-top)); }
	.sbc-chat.is-open .sbc-conv__back { display: grid; place-items: center; width: 44px; height: 44px; margin-left: -8px; border: 0; background: none; color: #fff; cursor: pointer; padding: 0; }
	.sbc-chat.is-open .sbc-avatar--navy { background: #BF2626; }
	.sbc-chat.is-open .sbc-conv__who { flex: 1; }
	.sbc-chat.is-open .sbc-conv__status { color: #C9D3DC; font-size: 12px; }
	.sbc-chat.is-open .sbc-conv__status.is-online { color: #9ED9B4; }
	.sbc-chat.is-open .sbc-chip { display: none; }
	.sbc-chat.is-open .sbc-conv__private span { display: none; }
	.sbc-chat.is-open .sbc-conv__private { color: #C9D3DC; margin-left: 0; }
	.sbc-chat.is-open [data-sbc-close] { min-height: 32px; padding: 0 10px; font-size: 12px; background: transparent; color: #fff; border-color: #3B5974; }
	.sbc-conv__body { padding: 16px; gap: 10px; }
	.sbc-msg { max-width: 82%; padding: 11px 14px; }
	.sbc-msg--verse { max-width: 86%; }
	.sbc-composer { align-items: center; gap: 8px; padding: 12px 12px max(20px, env(safe-area-inset-bottom)); }
	.sbc-composer textarea { border-radius: 22px; }
	.sbc-icon-btn--send { border-radius: 22px; }
	.sbc-verse-box { grid-template-columns: 1fr; padding: 12px 12px 0; }
	html.sbc-chat-open, html.sbc-chat-open body { overflow: hidden; }
	.sbc-convs { max-height: none; }
}
