/* FBCN Word - styles follow the FBCN Graphics Guide.
   Brand: green #9CC447, orange #F59340, blue #329AD3 as accents; neutrals carry the layout.
   Fonts: Montserrat (web stand-in for Gotham) for titles, Nunito Sans (for Avenir Next) for body. */
:root {
  --green: #9CC447; --orange: #F59340; --blue: #329AD3;
  --green-ink: #5E7F1F; --orange-ink: #A8561A; --blue-ink: #1D6E9C;
  --charcoal: #2E2E2E; --gray: #58595B; --gray-2: #8A8B8D; --line: #E3E3E1;
  --paper: #F4F4F2; --card: #FFFFFF; --ink: #1F1F1F; --muted: #5F6062;
  --title: "Montserrat", "Gotham", "Avenir Next", Arial, sans-serif;
  --body: "Nunito Sans", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--body); color: var(--ink); background: var(--paper); line-height: 1.6; font-size: 15.5px; }
button, input { font: inherit; }
a { color: var(--blue-ink); }
[hidden] { display: none !important; }

/* ---------- logo (built from the guide: dots always green, orange, blue) */
.dots { display: inline-flex; gap: .32em; }
.dots i { width: .78em; height: .78em; border-radius: 50%; display: block; }
.dots i:nth-child(1) { background: var(--green); }
.dots i:nth-child(2) { background: var(--orange); }
.dots i:nth-child(3) { background: var(--blue); }
.logo-wide { display: inline-flex; align-items: center; gap: .7em; font-family: var(--title); letter-spacing: .22em; text-transform: uppercase; font-size: 15px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.logo-wide .fbc { font-weight: 300; }
.logo-wide .nc { font-weight: 500; }
.logo-stacked { display: flex; flex-direction: column; align-items: center; gap: 14px; font-family: var(--title); text-transform: uppercase; letter-spacing: .28em; text-align: center; }
.logo-stacked .dots { font-size: 22px; gap: 8px; }
.logo-stacked .l1 { font-weight: 300; font-size: 15px; }
.logo-stacked .l2 { font-weight: 500; font-size: 20px; margin-top: -10px; }

/* ---------- login */
#login { min-height: 100%; background: var(--gray); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 16px; gap: 34px; }
.theme-mark { border: 1.5px solid rgba(255,255,255,.85); padding: 10px 18px; font-family: var(--title); font-weight: 400; letter-spacing: .32em; font-size: 12px; text-transform: uppercase; white-space: nowrap; }
.login-card { background: #fff; color: var(--ink); border-radius: var(--radius); padding: 28px; width: 100%; max-width: 360px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.login-card h1 { font-family: var(--title); font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.login-card h2 { font-family: var(--title); font-size: 26px; letter-spacing: .04em; text-transform: uppercase; font-weight: 700; margin: 2px 0 6px; }
.login-card p { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.login-card input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; }
.login-card input:focus { outline: 2px solid var(--blue); border-color: transparent; }
.err { color: #B42318; font-size: 13.5px; margin-top: 8px; }

.btn { border: 0; border-radius: 8px; padding: 11px 18px; font-weight: 700; cursor: pointer; background: var(--charcoal); color: #fff; letter-spacing: .02em; }
.btn:hover { background: #000; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-ghost { background: transparent; color: var(--gray); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--paper); color: var(--ink); }
.btn-block { width: 100%; }

/* ---------- app shell */
#app { height: 100dvh; display: flex; flex-direction: column; }
header.top { background: #fff; border-bottom: 1px solid var(--line); padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.brand .divider { width: 1px; height: 34px; background: var(--line); }
.brand-title .kicker { font-family: var(--title); font-size: 10.5px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.brand-title .name { font-family: var(--title); font-size: 19px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; line-height: 1.2; }
.top-right { display: flex; align-items: center; gap: 10px; }
.badge { font-family: var(--title); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gray); background: var(--paper); border-radius: 999px; padding: 6px 12px; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }

.quick { padding: 10px 20px; display: flex; align-items: center; gap: 8px; overflow-x: auto; border-bottom: 1px solid var(--line); background: #fff; }
.quick .label { font-family: var(--title); font-size: 10.5px; letter-spacing: .2em; color: var(--muted); text-transform: uppercase; white-space: nowrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 13px; font-size: 13.5px; cursor: pointer; white-space: nowrap; color: var(--ink); }
.chip:hover { border-color: var(--gray-2); }
.chip.manage { color: var(--muted); margin-left: auto; }

main#feed { flex: 1; overflow-y: auto; padding: 22px 20px 8px; }
.feed-inner { max-width: 920px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }

.welcome { background: var(--charcoal); color: #fff; border-radius: var(--radius); padding: 26px 24px; }
.welcome .theme-mark { display: inline-block; font-size: 10.5px; margin-bottom: 16px; }
.welcome h2 { font-family: var(--title); font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.welcome p { color: #D6D6D6; max-width: 62ch; }
.welcome ul { list-style: none; display: grid; gap: 6px; margin-top: 14px; color: #EAEAEA; font-size: 14.5px; }
.welcome li { display: flex; gap: 10px; align-items: baseline; }
.welcome li i { flex: none; width: 9px; height: 9px; border-radius: 50%; transform: translateY(1px); }

.msg-user { align-self: flex-end; background: var(--charcoal); color: #fff; padding: 10px 16px; border-radius: 16px 16px 4px 16px; max-width: 80%; white-space: pre-wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card-pad { padding: 18px 20px; }
.loading { color: var(--muted); display: flex; align-items: center; gap: 12px; }
.loading .dots i { animation: pulse 1.2s infinite ease-in-out; }
.loading .dots i:nth-child(2) { animation-delay: .2s; }
.loading .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }

.section { border-top: 1px solid var(--line); }
.section:first-child { border-top: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px 0; font-family: var(--title); font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; font-weight: 600; color: var(--gray); }
.section-head .tag { display: inline-flex; align-items: center; gap: 9px; }
.section-head .tag::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent, var(--gray-2)); }
.section-body { padding: 8px 20px 18px; }
.section-body p + p { margin-top: 10px; }
.section-body ul { margin: 6px 0 6px 20px; }
.section-body li + li { margin-top: 4px; }
.acc-blue { --accent: var(--blue); } .acc-green { --accent: var(--green); } .acc-orange { --accent: var(--orange); } .acc-gray { --accent: var(--gray-2); }
.verify { font-size: 12.5px; color: var(--muted); padding: 10px 20px; background: var(--paper); border-top: 1px solid var(--line); }

/* scripture */
.scripture-toggle { cursor: pointer; user-select: none; }
.scripture-ref { font-family: var(--title); letter-spacing: .04em; text-transform: none; font-size: 14px; color: var(--ink); }
.versions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.vchip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer; color: var(--muted); }
.vchip.on { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }
.vtext { border-left: 3px solid var(--green); padding: 2px 0 2px 14px; margin-top: 10px; font-size: 15px; }
.vtext b { font-family: var(--title); font-size: 11px; letter-spacing: .16em; color: var(--muted); display: block; }
.compare-out { margin-top: 12px; background: var(--paper); border-radius: 8px; padding: 12px 14px; font-size: 14.5px; }
.copyright { font-size: 11.5px; color: var(--gray-2); margin-top: 10px; }

/* citations + sermon pills */
.cite { display: inline-flex; align-items: stretch; vertical-align: baseline; border: 1px solid #CFE3F1; border-radius: 999px; overflow: hidden; font-size: 12.5px; line-height: 1.5; margin: 0 1px; white-space: nowrap; }
.cite a { text-decoration: none; padding: 0 8px; }
.cite a:first-child { background: #EEF6FC; color: var(--blue-ink); font-weight: 700; }
.cite a:last-child { color: var(--muted); border-left: 1px solid #CFE3F1; }
.cite a:hover { background: #DDEEF9; }

.sources { display: grid; gap: 10px; }
.source { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; }
.source .t { font-weight: 700; }
.source .t small { font-weight: 600; color: var(--muted); margin-left: 6px; font-family: var(--title); font-size: 10.5px; letter-spacing: .12em; }
.source .m { color: var(--muted); font-size: 13px; }
.source .x { grid-column: 1 / -1; color: var(--muted); font-size: 13.5px; font-style: italic; }
.actions { display: flex; gap: 6px; align-items: flex-start; }
.pill { font-size: 12.5px; font-weight: 700; text-decoration: none; border-radius: 999px; padding: 3px 11px; border: 1px solid var(--line); color: var(--ink); white-space: nowrap; background: #fff; }
.pill:hover { border-color: var(--gray-2); }
.pill.play { color: #fff; background: var(--charcoal); border-color: var(--charcoal); }

/* result tables (phrase + year) */
.result-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: baseline; justify-content: space-between; }
.result-head h3 { font-family: var(--title); font-size: 15px; font-weight: 600; }
.result-head span { color: var(--muted); font-size: 13.5px; }
.row { display: grid; grid-template-columns: 92px 1fr auto; gap: 14px; padding: 11px 20px; border-top: 1px solid var(--line); align-items: start; }
.row:first-of-type { border-top: 0; }
.row .d { font-family: var(--title); font-size: 12px; color: var(--muted); letter-spacing: .04em; padding-top: 2px; }
.row .t { font-weight: 700; }
.row .s { color: var(--muted); font-size: 14px; }
mark { background: #FDE6CF; color: inherit; border-radius: 3px; padding: 0 2px; }
.more { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; }

/* ---------- input dock */
.dock { background: #fff; border-top: 1px solid var(--line); padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); }
.dock-inner { max-width: 920px; margin: 0 auto; }
.modes { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.mode { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 12px; font-size: 13.5px; font-weight: 700; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.mode i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.mode.on { color: var(--ink); border-color: var(--ink); box-shadow: inset 0 -3px 0 var(--c); }
.mode-hint { color: var(--muted); font-size: 12.5px; margin: -4px 0 8px; }
.ask { display: flex; gap: 8px; }
.ask input { flex: 1; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.ask input:focus { outline: 2px solid var(--blue); border-color: transparent; background: #fff; }
.policy { font-size: 11.5px; color: var(--gray-2); text-align: center; margin-top: 8px; }

/* ---------- modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.modal-card { background: #fff; border-radius: var(--radius); width: 100%; max-width: 560px; max-height: 90dvh; overflow: auto; }
.modal-card header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-card h3 { font-family: var(--title); font-size: 13px; letter-spacing: .2em; text-transform: uppercase; }
.x-btn { border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--muted); }
.p-item { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 10px 20px; border-bottom: 1px solid var(--line); }
.p-item small { display: block; color: var(--muted); }
.p-form { padding: 16px 20px; display: grid; gap: 8px; }
.p-form input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.modal-foot { padding: 0 20px 18px; display: flex; justify-content: flex-end; gap: 8px; }

@media (max-width: 640px) {
  header.top { padding: 10px 16px; flex-wrap: nowrap; }
  .top-right .btn { padding: 8px 12px; }
  .modes { flex-wrap: nowrap; overflow-x: auto; gap: 5px; }
  .mode { white-space: nowrap; }
  #resetBtn { display: none; }
  .welcome { padding: 20px 18px; }
  .brand .divider, .brand .logo-wide .txt { display: none; }
  .brand-title .name { font-size: 16px; }
  .brand-title .kicker { display: none; }
  .badge { display: none; }
  .quick, main#feed, .dock { padding-left: 16px; padding-right: 16px; }
  .row { grid-template-columns: 1fr; gap: 4px; padding: 12px 16px; }
  .source { grid-template-columns: 1fr; }
  .msg-user { max-width: 92%; }
  .mode { font-size: 12.5px; padding: 6px 10px; }
}

/* ---------- V2: parallel translations, moments, references drawer */
.vgrid { display: grid; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); gap: 0 18px; }
.vgrid .vtext { border-left-color: var(--blue); }
.chip.cmp:disabled { opacity: .45; cursor: default; }
.cmp-head { font-family: var(--title); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.src-link { font-size: 13px; margin-top: 8px; }
.moments { display: grid; gap: 10px; }
.moment { border: 1px solid var(--line); border-left: 3px solid var(--green); border-radius: 8px; padding: 12px 14px; }
.moment .mh { display: flex; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; }
.moment .t { font-weight: 700; }
.moment .m { color: var(--muted); font-size: 13px; }
.moment .ctx { font-size: 14px; color: var(--gray); margin-top: 6px; }
.moment blockquote { margin-top: 8px; font-style: italic; font-size: 15px; padding-left: 12px; border-left: 2px solid var(--line); }
.drawer { border-top: 1px solid var(--line); }
.drawer-btn { width: 100%; text-align: left; background: #fff; border: 0; padding: 12px 20px; font-family: var(--title); font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; color: var(--gray); cursor: pointer; }
.drawer-btn:hover { background: var(--paper); }
.ref-grid { padding: 0 20px 14px; }
.ref-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px 128px; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.ref-row .rt { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref-row .rd { color: var(--muted); font-family: var(--title); font-size: 12px; }
.ref-row .pill { justify-self: end; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 4px 12px; font-size: 12.5px; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--charcoal); color: #fff; }
.result-head > div:first-child { display: flex; flex-direction: column; }
@media (max-width: 640px) {
  .vgrid { grid-template-columns: 1fr; }
  .ref-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ref-row .rd { grid-row: 2; }
  .ref-row .pill { grid-row: 1 / 3; grid-column: 2; }
}
