:root {
  font-family:
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #30362f;
  background: #fffefa;
  font-synthesis: none;
  font-size: 15px;
  --green: #3e5948;
  --muted: #697165;
  --line: #e2e4d9;
  --serif: Georgia, "Times New Roman", serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  display: flex;
  height: 100dvh;
  overflow: hidden;
}
button,
select,
input,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
  touch-action: manipulation;
}
button:hover {
  background: #e9ede3;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
button:focus-visible,
a:focus-visible,
textarea:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #49665c;
  outline-offset: 3px;
}
a {
  color: var(--green);
  text-underline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.skip {
  position: absolute;
  left: -1000px;
}
.skip:focus {
  left: 10px;
  top: 10px;
  z-index: 8;
  background: white;
  padding: 10px;
}
#sidebar {
  width: 234px;
  flex-shrink: 0;
  background: #f1f2e9;
  border-right: 1px solid var(--line);
  padding: 28px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.brand {
  font-size: 23px;
  font-family: var(--serif);
  text-decoration: none;
  color: #334a3c;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px 12px;
}
.brand-sub {
  display: block;
  font:
    11px/1.8 ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  letter-spacing: 0.025em;
  color: #616c5b;
}
.mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 42px;
  flex-shrink: 0;
  font-size: 27px;
  border: 1px solid #9caa91;
  border-radius: 17px 17px 2px 2px;
}
#new-chat {
  border: 1px solid #cdd4c3;
  background: #fbfcf6;
  font-size: 14px;
}
.sidebar-label {
  font-size: 10px;
  color: #737a69;
  letter-spacing: 0.09em;
  padding: 4px 10px 0;
}
#histories {
  display: flex;
  flex-direction: column;
  overflow: auto;
  flex: 1;
  gap: 5px;
}
#histories button {
  width: 100%;
  font-size: 13px;
  min-height: 59px;
  flex-shrink: 0;
}
#histories .history-title {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
#histories small {
  display: block;
  font-size: 10px;
  color: #6b7664;
  margin-top: 5px;
}
#histories button[aria-current="true"] {
  background: #e3e8d9;
}
.sidebar-bottom {
  display: flex;
  flex-direction: column;
  border-top: 1px solid #dce1d2;
  padding-top: 12px;
  font-size: 13px;
  color: #59634f;
}
.sidebar-note {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  line-height: 1.6;
  color: #737c67;
  padding: 20px 12px 0;
}
main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
header {
  height: 70px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 30px;
  color: #616b59;
  font-size: 13px;
}
.prototype-notice {
  flex-shrink: 0;
  margin: 0 18px 8px;
  padding: 10px 14px;
  border: 1px solid #ded4af;
  border-radius: 8px;
  background: #faf4df;
  color: #554b2f;
  font-size: 13px;
  line-height: 1.5;
}
.prototype-notice strong {
  display: block;
}
#context-name {
  margin-right: auto;
}
.header-detail {
  color: #838978;
}
header button {
  font-size: 12px;
}
.pill {
  border: 1px solid #dcdcc6;
  border-radius: 30px;
  padding: 5px 10px;
  color: #77734e;
  font-size: 10px;
  background: #f7f6e9;
}
#menu {
  display: none;
}
#sidebar-backdrop {
  display: none;
}
#thread {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 18px max(26px, calc((100% - 730px) / 2));
  scroll-behavior: smooth;
}
.empty {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 25px 0 36px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.15em;
  color: #7a806c;
  margin-bottom: 22px;
}
.empty h1 {
  font: 400 clamp(30px, 3.3vw, 43px)/1.17 var(--serif);
  white-space: pre-line;
  color: #324b3b;
  letter-spacing: -0.025em;
  margin: 0 0 17px;
}
.welcome-tagline {
  font-size: 15px;
  line-height: 1.8;
  color: #68725e;
  white-space: pre-line;
  margin: 0 0 31px;
}
.starters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  gap: 10px;
  max-width: 610px;
}
.starters button {
  border: 1px solid #e1e4d8;
  border-radius: 12px;
  background: #fafbf5;
  min-height: 67px;
  font-size: 13px;
  line-height: 1.5;
  padding: 14px 17px;
  color: #465740;
}
.starters button:hover {
  border-color: #b7c3aa;
  background: #f0f4e9;
}
.turn {
  margin: 8px 0 36px;
}
.question-row {
  background: #edf0e6;
  border-radius: 19px;
  padding: 12px 18px;
  white-space: pre-wrap;
  width: fit-content;
  max-width: 88%;
  margin-left: auto;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.answer-row {
  padding: 24px 0 0;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.answer-row p {
  margin: 0 0 14px;
  white-space: pre-wrap;
}
.answer-row h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  color: #3e5744;
  margin: 24px 0 9px;
}
.answer-row ul,
.answer-row ol {
  padding-left: 23px;
}
.answer-row .exploring-title,
.answer-row .sources-title {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-top: 25px;
}
.source-lines {
  border-left: 2px solid #cdd6bd;
  padding-left: 14px;
  color: #69725e;
  font-size: 12px;
  line-height: 1.7;
}
.answer-row .followups {
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
  margin: 10px 0 20px;
}
.followups button {
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid #e0e5d7;
  background: #fafbf7;
  padding: 9px 13px;
  width: 100%;
}
.turn-tools {
  font-size: 11px;
  color: #68745e;
  padding: 5px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.composer-wrap {
  width: min(782px, 100%);
  align-self: center;
  padding: 8px 26px 18px;
  background: #fffefa;
}
.mode-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 9px;
  min-height: 34px;
  flex-wrap: wrap;
}
.mode-row label {
  font-size: 11px;
  color: #747c6a;
}
.mode-row select {
  font-size: 12px;
  border: 1px solid #dfe3d6;
  border-radius: 7px;
  padding: 7px 26px 7px 9px;
  background: #f7f9f1;
  max-width: 100%;
  cursor: pointer;
}
.mode-row button {
  font-size: 11px;
  color: var(--green);
  padding: 8px;
  margin-left: auto;
}
.mode-note {
  font-size: 11px;
  color: #70775f;
  margin: 0 0 10px;
  line-height: 1.5;
}
.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  border: 1px solid #cdd5c2;
  background: #f9faf4;
  border-radius: 22px;
  padding: 12px 12px 12px 18px;
  box-shadow: 0 3px 10px #4b5c3710;
}
textarea {
  resize: none;
  border: 0;
  background: none;
  width: 100%;
  line-height: 1.5;
  max-height: 180px;
  padding: 5px 0;
}
textarea::placeholder {
  color: #7a816e;
}
#question {
  font-size: 14px;
}
#question:focus-visible {
  outline-offset: 1px;
  border-radius: 4px;
}
#send {
  background: var(--green);
  color: #fff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  text-align: center;
  padding: 4px;
  font-size: 23px;
}
#progress {
  display: block;
  min-height: 14px;
  text-align: center;
  font-size: 11px;
  color: #6c755e;
  padding-top: 5px;
  line-height: 1.5;
}
#progress:not(:empty) {
  padding-bottom: 6px;
}
#error,
.note-error {
  font-size: 13px;
  color: #8d3b2f;
  line-height: 1.5;
}
footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  line-height: 1.6;
  color: #797f70;
  text-align: center;
}
footer a {
  color: #596a4f;
}
#pastor-link {
  font-size: 11px;
}
.phone-break {
  display: none;
}
dialog {
  margin: 0 0 0 auto;
  max-height: none;
  height: 100dvh;
  width: min(460px, 100%);
  max-width: 100%;
  border: 0;
  border-left: 1px solid var(--line);
  padding: 0;
  background: #fffefa;
  color: inherit;
  box-shadow: -12px 0 36px #0000000d;
}
dialog::backdrop {
  background: #25301e32;
}
.drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  height: 70px;
}
.drawer-top h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}
#drawer-close {
  min-height: 40px;
  min-width: 40px;
  text-align: center;
}
#drawer-content {
  height: calc(100% - 70px);
  overflow: auto;
  padding: 22px;
  line-height: 1.7;
}
#drawer-content h3 {
  font: 400 23px/1.3 var(--serif);
  color: #3e5744;
  margin: 24px 0 12px;
}
#drawer-content p,
#drawer-content li {
  font-size: 14px;
}
#drawer-content label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-top: 15px;
}
#drawer-content input,
#drawer-content select,
#note-text {
  padding: 10px;
  border: 1px solid #d8ddd0;
  border-radius: 8px;
  width: 100%;
  background: #fff;
  margin: 8px 0;
  max-height: none;
}
#note-text {
  min-height: 240px;
  font-size: 13px;
  resize: vertical;
}
#drawer-content button {
  display: block;
  width: 100%;
  margin: 4px 0;
}
#drawer-content .primary {
  background: var(--green);
  color: white;
  text-align: center;
}
.prototype-note {
  border: 1px solid #e1dfc8;
  background: #f7f6ea;
  border-radius: 8px;
  padding: 12px;
  color: #716e4c;
}
.about-tagline {
  font-style: italic;
  color: #657458;
}
.source-item {
  border-bottom: 1px solid #e2e6d9;
  padding: 12px 0;
}
.source-item small,
.meta {
  display: block;
  color: #6e7764;
  font-size: 12px;
}
.reader-passage {
  padding: 15px 0;
  border-bottom: 1px solid #e2e6d9;
}
.reader-passage.target {
  background: #f0f4e8;
  padding: 15px;
}
.reader-passage p {
  white-space: pre-wrap;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
}
@media (max-width: 700px) {
  #sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 4;
    transform: translateX(-100%);
    transition: transform 0.15s;
  }
  body.sidebar-open #sidebar {
    transform: translateX(0);
    box-shadow: 10px 0 30px #0002;
  }
  body.sidebar-open #sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: #24301f50;
    z-index: 3;
    border-radius: 0;
  }
  #menu {
    font-size: 18px;
    display: block;
    min-width: 40px;
    min-height: 40px;
    padding: 8px;
  }
  header {
    padding: 0 12px;
    height: 58px;
    gap: 8px;
  }
  #context-name {
    font-size: 13px;
  }
  .header-detail {
    display: none;
  }
  #sources-open {
    padding: 9px 5px;
    min-height: 40px;
  }
  #thread {
    padding: 10px 20px;
  }
  .composer-wrap {
    padding: 6px 14px max(12px, env(safe-area-inset-bottom));
  }
  .empty {
    padding: 20px 0 25px;
  }
  .eyebrow {
    font-size: 9px;
    margin-bottom: 18px;
  }
  .empty h1 {
    font-size: 32px;
    line-height: 1.18;
  }
  .welcome-tagline {
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 22px;
  }
  .starters {
    gap: 8px;
  }
  .starters button {
    font-size: 12px;
    padding: 11px;
    min-height: 75px;
    border-radius: 10px;
  }
  .composer {
    padding: 10px 10px 10px 14px;
    border-radius: 20px;
  }
  #question {
    font-size: 16px;
  }
  #question::placeholder {
    font-size: 13px;
  }
  .mode-row {
    gap: 6px;
    margin-bottom: 7px;
  }
  .mode-row select {
    font-size: 11px;
    min-height: 36px;
    padding-left: 7px;
  }
  .mode-row button {
    font-size: 10px;
    min-height: 36px;
    padding: 5px 0;
  }
  .mode-note {
    font-size: 10px;
  }
  .answer-row {
    line-height: 1.75;
  }
  .question-row {
    max-width: 94%;
  }
  footer {
    font-size: 10px;
    gap: 3px;
  }
  .phone-break {
    display: initial;
  }
  #pastor-link {
    font-size: 10px;
  }
  dialog {
    width: 100%;
  }
}
@media (max-width: 360px) {
  .mode-row label {
    display: none;
  }
  .empty h1 {
    font-size: 28px;
  }
  .eyebrow {
    font-size: 8px;
  }
  .starters button {
    padding: 9px;
    font-size: 11px;
  }
  .composer-wrap {
    padding-left: 10px;
    padding-right: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

#attach-open { color: var(--green); flex-shrink: 0; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; }
#attach-open:hover { background: #e5ebda; }
.attachment-privacy { font-size: 10px; color: #70775f; line-height: 1.4; margin: 7px 3px 3px; }
#attachments { display: flex; flex-wrap: wrap; gap: 6px; max-height: 112px; overflow-y: auto; }
.attachment-chip { display: flex; align-items: center; gap: 6px; max-width: 100%; background: #edf1e5; border: 1px solid #d4dcc8; border-radius: 8px; margin-bottom: 8px; padding: 3px 5px 3px 10px; font-size: 11px; color: var(--green); }
.attachment-chip span { overflow-wrap: anywhere; min-width: 0; }
.attachment-chip button { flex-shrink: 0; min-width: 30px; min-height: 30px; font-size: 20px; }
#attachment-status { font-size: 12px; color: #8a432a; line-height: 1.5; }
#attachment-status:not(:empty) { margin-bottom: 8px; }
.composer-wrap.dragging .composer { outline: 3px dashed var(--green); outline-offset: 3px; }

.followup-card { margin: 12px 0 4px; padding: 14px 16px; border: 1px solid #d4dcc8; border-radius: 10px; background: #f6f8f1; max-width: 560px; }
.followup-card h3, #drawer-content .followup-card h3 { font-size: 15px; margin: 0 0 6px; color: var(--green); }
.followup-crisis { font-size: 13px; color: #8a432a; line-height: 1.45; margin: 0 0 10px; }
.followup-form { display: grid; gap: 4px; }
.followup-form label { font-size: 12px; font-weight: 600; color: #4c5440; margin-top: 4px; }
.followup-form input[type="text"], .followup-form input[type="tel"], .followup-form input[type="email"], .followup-form textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; padding: 8px 10px; border: 1px solid #c9d1bc; border-radius: 8px; background: #fff; }
.followup-form label.followup-check { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13px; margin-top: 8px; }
.followup-hint, .followup-consent { font-size: 12px; color: #6a7160; line-height: 1.45; margin: 2px 0; }
.followup-form .primary { justify-self: start; margin-top: 8px; background: var(--green); color: #fff; border-radius: 8px; padding: 9px 14px; font-weight: 600; }
.followup-form .primary:disabled { opacity: .6; }
.followup-result { font-size: 13px; margin: 4px 0 0; min-height: 1em; }
.followup-result.error { color: #8a432a; }
.followup-sent { font-size: 14px; color: var(--green); font-weight: 600; margin: 4px 0 0; }
