/* Heart Turn Global: Bible Chat (/study/). The studies read like a book page; the talk under them is quiet
   and warm. Uses the site's tokens from assets/site.css. */
.chat-band { padding-bottom: clamp(40px, 6vw, 80px); }
.chat-band h1 { max-width: 18ch; }
.chat-h1 { font-size: clamp(44px, 6.2vw, 88px); max-width: 20ch; }
.chat-eyebrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; font: 800 13px/1.2 var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--sky); }
.chat-eyebrow a { color: var(--sky); text-decoration: none; }
.chat-eyebrow a:hover { text-decoration: underline; text-underline-offset: 3px; }
.chat-eyebrow span[aria-hidden] { color: var(--on-night-muted); }
.chat-by { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; font: 600 16px/1.4 var(--ui); color: var(--on-night-muted); }
.chat-by span:first-child { color: var(--on-night); font-weight: 800; }
.chat-by a { color: var(--on-night-muted); }
.chat-band-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.chat-band .btn-line { color: var(--on-night); }
.chat-verse { margin-top: 36px; max-width: 34em; color: var(--on-night); }
.chat-verse cite { color: var(--on-night-muted); }
.chat-sec { padding-top: clamp(40px, 6vw, 72px); }

/* the list of studies */
.chat-home { display: grid; gap: 28px; }
.chat-tools { display: grid; gap: 14px; }
.chat-q { max-width: 520px; }
.chat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-chip { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--white); color: var(--ink); font: 800 14.5px/1 var(--ui); cursor: pointer; }
.chat-chip:hover { border-color: var(--sky-ink); }
.chat-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--white); }
.chat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 18px; }
.chat-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 24px 24px 20px; border-radius: 20px; background: var(--white); border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: transform .18s, box-shadow .18s, border-color .18s; overflow: hidden; }
.chat-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--sky), #9BDCFB); opacity: .9; }
.chat-card:hover { transform: translateY(-3px); border-color: #A9CFE6; box-shadow: 0 26px 50px -34px rgba(11, 26, 42, .55); }
.chat-card:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.chat-card-top { display: flex; gap: 10px; align-items: center; font: 700 13.5px/1.2 var(--ui); color: var(--muted); }
.chat-topic { padding: 5px 10px; border-radius: 999px; background: var(--sky-wash); color: var(--sky-ink); font-weight: 800; }
.chat-card-h { font: 800 clamp(30px, 3vw, 38px)/1 var(--display); letter-spacing: -.005em; }
.chat-card-x { font: 400 16.5px/1.55 var(--read); color: #2E3F50; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.chat-card-refs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chat-card-refs span { padding: 4px 9px; border-radius: 8px; background: var(--paper); border: 1px solid var(--line); font: 700 12.5px/1.2 var(--ui); color: var(--muted); }
.chat-card-f { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); font: 700 14px/1 var(--ui); color: var(--muted); }
.chat-card-f > span:first-child { margin-right: auto; color: var(--ink); }
.chat-count, .chat-badge { display: inline-flex; align-items: center; gap: 5px; }
.chat-count svg, .chat-badge svg { width: 17px; height: 17px; }
.chat-badge { padding: 4px 8px 4px 6px; border-radius: 8px; background: #FFF4DE; color: var(--dawn-ink); }
.chat-empty { margin: 0; padding: 26px; border-radius: 18px; background: var(--white); border: 1px dashed #B9C8D4; color: var(--muted); }
.chat-how { margin-top: 24px; padding: clamp(24px, 4vw, 40px); border-radius: 22px; background: var(--sky-wash); }
.chat-how h2 { margin: 0 0 18px; }
.chat-steps { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; counter-reset: s; }
.chat-steps li { display: grid; align-content: start; gap: 6px; padding-top: 44px; position: relative; counter-increment: s; }
.chat-steps li::before { content: counter(s); position: absolute; top: 0; left: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--white); display: grid; place-items: center; font: 800 16px/1 var(--ui); }
.chat-steps b { font: 800 18px/1.25 var(--ui); }
.chat-steps span { color: var(--muted); }
@media (max-width: 760px) { .chat-steps { grid-template-columns: 1fr; } }

/* one study */
.chat-post { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: clamp(28px, 5vw, 72px); align-items: start; }
.chat-article { min-width: 0; }
.chat-prose { max-width: 40em; font-size: clamp(18px, 1.5vw, 20px); }
.chat-prose h2 { font: 800 clamp(30px, 3vw, 40px)/1.02 var(--display); margin: 1.5em 0 .45em; }
.chat-prose h3 { font: 800 21px/1.25 var(--ui); margin: 1.4em 0 .4em; }
.chat-prose h2:first-child, .chat-prose h3:first-child { margin-top: 0; }
.chat-prose ul, .chat-prose ol { margin: 0 0 1.05em; padding-left: 1.25em; }
.chat-prose li { margin: .25em 0; }
.chat-prose li::marker { color: var(--sky-ink); font-weight: 800; }
.chat-prose blockquote { margin: 1.2em 0; padding: 4px 0 4px 22px; border-left: 4px solid var(--sky); color: #23384C; font-style: italic; }
.chat-prose blockquote p { margin: 0 0 .6em; }
.chat-prose blockquote p:last-child { margin: 0; }
.chat-prose a:not(.sref) { color: var(--sky-ink); font-weight: 600; overflow-wrap: anywhere; }
.chat-prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.sref { color: var(--sky-ink); font-weight: 700; text-decoration: none; border-bottom: 1.5px dotted currentColor; white-space: nowrap; }
.sref:hover, .sref[aria-expanded="true"] { border-bottom-style: solid; }
.chat-pdf { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; margin: 28px 0 0; padding: 18px 20px; border-radius: 18px; background: var(--white); border: 1px solid var(--line); box-shadow: 0 20px 40px -34px rgba(11, 26, 42, .5); max-width: 40em; }
.chat-pdf-ic { width: 52px; height: 60px; display: grid; place-items: center; border-radius: 12px; background: #FFF4DE; color: var(--dawn-ink); }
.chat-pdf-ic svg { width: 34px; height: 34px; }
.chat-pdf-t { display: grid; gap: 3px; min-width: 0; }
.chat-pdf-t b { font: 800 17px/1.25 var(--ui); overflow-wrap: anywhere; }
.chat-pdf-t span { font: 600 14px/1.2 var(--ui); color: var(--muted); }
.chat-pdf-a { display: flex; gap: 8px; }
.chat-pdf-a .btn { min-height: 44px; padding: 0 18px; font-size: 15px; }
@media (max-width: 620px) { .chat-pdf { grid-template-columns: auto minmax(0, 1fr); } .chat-pdf-a { grid-column: 1 / -1; } .chat-pdf-a .btn { flex: 1; } }
.chat-acts { display: flex; flex-wrap: wrap; gap: 10px; margin: 32px 0 0; padding-top: 22px; border-top: 1px solid var(--line); max-width: 40em; }
.chat-act { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--white); color: var(--ink); font: 800 15px/1 var(--ui); text-decoration: none; cursor: pointer; }
.chat-act svg { width: 20px; height: 20px; }
.chat-act b { font-weight: 800; color: var(--muted); }
.chat-act:hover { border-color: var(--sky-ink); }
.chat-act[aria-pressed="true"] { background: #FFE9EF; border-color: #F3A6BB; color: #9C1B44; }
.chat-act[aria-pressed="true"] svg path { fill: currentColor; }
.chat-act[aria-pressed="true"] b { color: #9C1B44; }
.chat-act.pop svg { animation: chatPop .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes chatPop { from { transform: scale(.4); } }
.chat-side { position: sticky; top: 24px; display: grid; gap: 18px; }
.chat-box { padding: 22px; border-radius: 20px; background: var(--white); border: 1px solid var(--line); display: grid; gap: 12px; }
.chat-box-h { display: flex; align-items: center; gap: 8px; margin: 0; font: 800 15px/1.2 var(--ui); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.chat-box-h svg { width: 20px; height: 20px; color: var(--sky-ink); }
.chat-box p { margin: 0; color: var(--muted); }
.chat-box .btn { justify-self: start; }
.chat-refs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chat-refs .sref { display: inline-block; padding: 7px 11px; border-radius: 10px; background: var(--sky-wash); border: 0; font-size: 14.5px; }
.chat-refs .sref:hover { background: #CDEBFB; }
.chat-note { font-size: 14px; }
.chat-join.is-in { background: var(--sky-wash); border-color: #B8E0F6; }
.chat-me { display: flex; align-items: center; gap: 10px; font: 700 15px/1.3 var(--ui); }
.chat-me .cm-av { flex: none; }
.chat-me button { margin-left: auto; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--sky-ink); font: inherit; font-weight: 800; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 1000px) { .chat-post { grid-template-columns: minmax(0, 1fr); } .chat-side { position: static; grid-row: 2; } }

/* the discussion */
.chat-talk { grid-column: 1; min-width: 0; max-width: 46em; display: grid; gap: 18px; padding-top: 12px; }
.chat-talk h2 { margin: 0; }
.chat-form { display: grid; gap: 10px; padding: 18px; border-radius: 18px; background: var(--white); border: 1px solid var(--line); }
.chat-form textarea, .cm-reply textarea { width: 100%; min-height: 110px; resize: vertical; padding: 14px; border-radius: 14px; border: 1.5px solid #B9C8D4; background: var(--white); color: var(--ink); font: 400 17px/1.5 var(--read); }
.chat-form textarea:focus, .cm-reply textarea:focus { outline: none; border-color: var(--sky-ink); box-shadow: 0 0 0 4px rgba(91, 194, 247, .3); }
.chat-form-f { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.chat-form-f .btn { min-height: 46px; }
.chat-form-f small { color: var(--muted); font: 600 13.5px/1.35 var(--ui); margin-right: auto; }
.chat-signin { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 18px 20px; border-radius: 18px; background: var(--sky-wash); }
.chat-signin p { margin: 0; flex: 1 1 260px; font: 600 16px/1.45 var(--ui); }
.cm-list, .cm-replies { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.cm { display: grid; gap: 8px; padding: 18px 20px; border-radius: 18px; background: var(--white); border: 1px solid var(--line); }
.cm.cm-admin { border-color: #B8E0F6; box-shadow: inset 4px 0 0 var(--sky); }
.cm.cm-wait { border-style: dashed; background: #FBFCFD; }
.cm.cm-new { animation: chatIn .5s ease-out; }
@keyframes chatIn { from { opacity: 0; transform: translateY(8px); } }
.cm-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font: 600 14px/1.2 var(--ui); color: var(--muted); }
.cm-h b { font: 800 16px/1.2 var(--ui); color: var(--ink); }
.cm-av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--night); color: var(--sky); font: 800 15px/1 var(--ui); }
.cm-admin > .cm-h .cm-av { background: var(--sky); color: #04263A; }
.cm-tag { padding: 3px 8px; border-radius: 999px; background: var(--sky-wash); color: var(--sky-ink); font: 800 11.5px/1.1 var(--ui); letter-spacing: .06em; text-transform: uppercase; }
.cm-tag.wait { background: #FFF4DE; color: var(--dawn-ink); }
.cm-b { font: 400 17px/1.6 var(--read); overflow-wrap: anywhere; }
.cm-b p { margin: 0 0 .6em; }
.cm-b p:last-child { margin: 0; }
.cm-b blockquote { margin: .4em 0; padding-left: 14px; border-left: 3px solid var(--line); color: var(--muted); }
.cm-f { display: flex; flex-wrap: wrap; gap: 6px; }
.cm-f:empty { display: none; }
.cm-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); color: var(--muted); font: 800 13.5px/1 var(--ui); cursor: pointer; }
.cm-btn svg { width: 16px; height: 16px; }
.cm-btn:hover { color: var(--ink); border-color: var(--sky-ink); }
.cm-btn[aria-pressed="true"] { color: #9C1B44; border-color: #F3A6BB; background: #FFE9EF; }
.cm-btn[aria-pressed="true"] svg path { fill: currentColor; }
.cm-btn.ok { color: #0F4D27; border-color: #9FD7B2; background: #E3F6EA; }
.cm-btn.bad { color: #7A1A13; }
.cm-replies { margin-top: 6px; padding-left: clamp(14px, 3vw, 28px); border-left: 2px solid var(--line); }
.cm-replies .cm { background: var(--paper); }
.cm-reply { display: grid; gap: 8px; margin-top: 4px; }
.cm-reply textarea { min-height: 80px; }
.chat-more { grid-column: 1 / -1; display: grid; gap: 18px; margin-top: clamp(40px, 6vw, 72px); padding-top: clamp(32px, 5vw, 56px); border-top: 1px solid var(--line); }
.chat-more h2 { margin: 0; }
.chat-more p { margin: 0; }
.chat-live { font: 600 13.5px/1.3 var(--ui); color: var(--muted); }

/* the verse when a reference is tapped */
.chat-pop { position: absolute; z-index: 70; width: min(380px, calc(100vw - 24px)); padding: 16px 18px 14px; border-radius: 16px; background: var(--night); color: var(--on-night); box-shadow: 0 24px 60px rgba(0, 0, 0, .35); font: 400 16.5px/1.55 var(--read); }
.chat-pop b { display: block; font: 800 13px/1.2 var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--sky); margin-bottom: 6px; }
.chat-pop p { margin: 0; max-height: 15em; overflow: auto; }
.chat-pop sup { font: 800 11px/1 var(--ui); color: var(--sky); margin-right: 3px; }
.chat-pop a { display: inline-block; margin-top: 10px; color: var(--sky); font: 800 14px/1.2 var(--ui); }
.chat-pop small { display: block; margin-top: 8px; color: var(--on-night-muted); font: 600 12px/1.3 var(--ui); }
@media (max-width: 560px) { .chat-pop { position: fixed; left: 12px !important; right: 12px; top: auto !important; bottom: max(12px, env(safe-area-inset-bottom)); width: auto; } }

/* dialogs: sign in, the pastor's writing desk, waiting comments */
.chat-dlg { border: 0; padding: 0; width: min(520px, calc(100% - 28px)); max-height: calc(100dvh - 28px); overflow: auto; border-radius: 24px; background: var(--white); color: var(--ink); box-shadow: 0 40px 90px -30px rgba(2, 8, 14, .6); }
.chat-dlg.wide { width: min(980px, calc(100% - 28px)); }
.chat-dlg::backdrop { background: rgba(3, 9, 15, .6); backdrop-filter: blur(4px); }
.chat-dlg[open] { animation: chatIn .25s ease-out; }
.chat-dlg-in { display: grid; gap: 16px; padding: 24px; }
.chat-dlg-h { display: flex; align-items: start; gap: 12px; }
.chat-dlg-h h2 { margin: 0; flex: 1; font: 800 34px/1 var(--display); }
.chat-dlg-h p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.chat-x { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: var(--white); font: 700 17px/1 var(--ui); cursor: pointer; }
.chat-dlg label.f { display: grid; gap: 6px; font: 700 14.5px/1.2 var(--ui); }
.chat-dlg .input { min-height: 48px; font-size: 16px; }
.chat-dlg .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.chat-dlg .btn { min-height: 48px; }
.chat-dlg .hint { margin: 0; color: var(--muted); font-size: 14px; }
.chat-dlg .notice { padding: 12px 14px; font-size: 15px; }
.chat-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.chat-seg { display: inline-grid; grid-auto-flow: column; gap: 4px; padding: 4px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); justify-self: start; }
.chat-seg button { min-height: 38px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; font: 800 14.5px/1 var(--ui); color: var(--muted); cursor: pointer; }
.chat-seg button[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.chat-desk { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.chat-desk textarea { width: 100%; min-height: 420px; resize: vertical; padding: 14px; border-radius: 14px; border: 1.5px solid #B9C8D4; font: 400 15.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--ink); background: var(--white); }
.chat-desk textarea:focus { outline: none; border-color: var(--sky-ink); box-shadow: 0 0 0 4px rgba(91, 194, 247, .3); }
.chat-prev { min-height: 420px; max-height: 60vh; overflow: auto; padding: 18px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.chat-prev .chat-prose { font-size: 17px; }
.chat-bar { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-bar button { min-width: 38px; min-height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--white); font: 800 14px/1 var(--ui); cursor: pointer; }
.chat-bar button:hover { border-color: var(--sky-ink); }
@media (max-width: 760px) { .chat-desk { grid-template-columns: 1fr; } .chat-desk textarea, .chat-prev { min-height: 260px; } .chat-dlg { width: 100%; max-width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; } .chat-dlg:not(.wide) { height: fit-content; margin: auto 0 0; border-radius: 24px 24px 0 0; padding-bottom: env(safe-area-inset-bottom); } }
.chat-q-item { display: grid; gap: 8px; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--paper); }
.chat-q-item .meta { font: 600 13.5px/1.35 var(--ui); color: var(--muted); }
.chat-q-item .meta b { color: var(--ink); }
.chat-q-item .txt { font: 400 16px/1.55 var(--read); white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-admin { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 16px 18px; border-radius: 18px; background: var(--night); color: var(--on-night); }
.chat-admin b { font: 800 15px/1.2 var(--ui); margin-right: auto; }
.chat-admin .btn { min-height: 42px; padding: 0 16px; font-size: 14.5px; }
.chat-admin .btn-line { color: var(--on-night); }
.chat-pill { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--dawn); color: #2A1B00; font: 800 12.5px/1 var(--ui); }
.chat-drafts { display: grid; gap: 8px; }
.chat-drafts .it { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--white); }
.chat-drafts .it b { font: 800 16px/1.25 var(--ui); margin-right: auto; }
.chat-drafts .it small { color: var(--muted); font-weight: 700; }
.chat-toast { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90; max-width: calc(100% - 28px); padding: 13px 18px; border-radius: 14px; background: var(--night); color: var(--white); font: 700 15px/1.35 var(--ui); box-shadow: 0 14px 36px rgba(0, 0, 0, .3); opacity: 0; pointer-events: none; transition: opacity .2s; }
.chat-toast.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .chat-card, .chat-dlg[open], .cm.cm-new, .chat-act.pop svg { animation: none; transition: none; } }
