/* Christ Gen Kleinmond · Small Group Toolkit */
:root {
  --paper: #FBF8F3;
  --card: #FFFFFF;
  --ink: #16232B;
  --muted: #5E6C73;
  --teal: #14565B;
  --teal-soft: #E4EEEB;
  --sand: #B98A3E;
  --line: #E6DFD2;
  --mark: #F5E2B8;
  --shadow: 0 1px 2px rgba(22,35,43,.05), 0 8px 24px -12px rgba(22,35,43,.18);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #10171B;
    --card: #162026;
    --ink: #EDEAE3;
    --muted: #97A4A9;
    --teal: #7FC2BE;
    --teal-soft: #1D3236;
    --sand: #D6A964;
    --line: #26343A;
    --mark: #4A3C1C;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -14px rgba(0,0,0,.7);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

.wrap { width: min(760px, 100% - 32px); margin-inline: auto; }

.skip {
  position: absolute; left: -9999px;
}
.skip:focus {
  left: 16px; top: 8px; z-index: 50; background: var(--card);
  padding: 8px 12px; border-radius: 8px; color: var(--ink);
}

/* ---------------------------------------------------------------- masthead */
.masthead { padding: calc(18px + env(safe-area-inset-top)) 0 12px; }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; min-width: 0; }
.kicker {
  font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap;
}
@media (max-width: 380px) { .kicker { display: none; } }
.logo { height: 34px; width: auto; display: block; }

/* the Home tab and quick chips only exist in the field theme */
.tab[data-tab="home"] { display: none; }
html[data-theme="field"] .tab[data-tab="home"] { display: block; }
.quick { display: none; }

/* home launcher is inert unless the field theme asks for it */
#panel-home .eyebrow { color: var(--teal); }
.eyebrow {
  margin: 0 0 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted);
}
@media (prefers-color-scheme: dark) { .logo { filter: invert(1) brightness(1.6); } }

.install {
  font: inherit; font-size: 13px; font-weight: 600; letter-spacing: .01em;
  color: var(--teal); background: var(--teal-soft); border: 0;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
}
.install:active { transform: scale(.97); }

/* ---------------------------------------------------------------- sticky bar */
.sticky {
  position: sticky; top: 0; z-index: 20;
  padding: 8px 0 10px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.sticky.is-stuck { border-bottom-color: var(--line); box-shadow: 0 10px 20px -22px rgba(0,0,0,.6); }

.searchbar {
  display: flex; align-items: center; gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  height: 48px;
  box-shadow: var(--shadow);
}
.searchbar:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.searchbar .ico { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
#q {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 16px; padding: 12px 0; outline: none;
}
#q::placeholder { color: var(--muted); }
#q::-webkit-search-cancel-button { display: none; }
.clear {
  border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1;
  cursor: pointer; padding: 4px 2px;
}

.tabs { display: flex; gap: 6px; overflow-x: auto; margin-top: 10px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  font: inherit; font-size: 14px; font-weight: 600;
  color: var(--muted); background: transparent;
  border: 1px solid transparent; border-radius: 999px;
  padding: 9px 15px; cursor: pointer; white-space: nowrap;
}
.tab.is-on { color: var(--teal); background: var(--teal-soft); border-color: color-mix(in srgb, var(--teal) 22%, transparent); }

/* ---------------------------------------------------------------- panels */
main { padding-top: 6px; outline: none; }
.panel { animation: fade .18s ease; }
@keyframes fade { from { opacity: .4 } to { opacity: 1 } }

.panel-head { padding: 18px 0 12px; }
h1 {
  font-family: var(--serif); font-weight: 600; font-size: clamp(26px, 6vw, 34px);
  line-height: 1.15; margin: 0 0 8px; letter-spacing: -.01em;
}
.lede { margin: 0; color: var(--muted); font-size: 15px; max-width: 58ch; }

.offline {
  margin: 12px 0 0; padding: 9px 14px; border-radius: 10px;
  background: var(--teal-soft); color: var(--teal); font-size: 13px; font-weight: 600;
}

/* ---------------------------------------------------------------- A-Z rail */
.az { display: flex; gap: 4px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.az::-webkit-scrollbar { display: none; }
.az button {
  font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  color: var(--muted); background: none; border: 0; border-radius: 8px;
  min-width: 34px; height: 36px; cursor: pointer;
}
.az button.is-on { color: var(--teal); background: var(--teal-soft); }
.az button:disabled { opacity: .28; cursor: default; }

/* ---------------------------------------------------------------- topics */
.topics { display: grid; gap: 8px; padding-bottom: 8px; }

.topic {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.topic > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
}
.topic > summary::-webkit-details-marker { display: none; }
.topic > summary:hover { background: color-mix(in srgb, var(--teal-soft) 45%, transparent); }
.topic-name {
  font-family: var(--serif); font-size: 18px; font-weight: 600; letter-spacing: -.005em;
  flex: 1; min-width: 0;
}
.count { font-size: 12px; font-weight: 700; color: var(--teal); background: var(--teal-soft); border-radius: 999px; padding: 3px 9px; }
.chev { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; transition: transform .18s ease; }
.topic[open] .chev { transform: rotate(90deg); }
.topic[open] > summary { border-bottom: 1px solid var(--line); }

.verses { margin: 0; padding: 4px 0 6px; }
.verse {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 11px 16px;
}
.verse + .verse { border-top: 1px dashed color-mix(in srgb, var(--line) 80%, transparent); }
.verse-text { flex: 1; font-size: 15.5px; }
.vtext.is-clamped { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.more {
  font: inherit; font-size: 12.5px; font-weight: 700; letter-spacing: .04em;
  color: var(--teal); background: none; border: 0; padding: 0 0 0 6px; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.recent-empty { font-size: 13.5px; color: var(--muted); }
.verse-ref {
  display: block; margin-top: 3px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--teal);
}
.copy {
  flex: none; border: 1px solid var(--line); background: transparent; color: var(--muted);
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer; display: grid; place-items: center;
}
.copy:hover { color: var(--teal); border-color: var(--teal); }
.copy svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.related { padding: 10px 16px 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.related .lbl { font-size: 13px; color: var(--muted); }
.chip {
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--teal);
  background: var(--teal-soft); border: 0; border-radius: 999px; padding: 6px 12px; cursor: pointer;
}

/* ---------------------------------------------------------------- one step */
.steps { display: grid; gap: 10px; padding-bottom: 8px; }
.step {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px 18px;
}
.step-top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.step-n {
  font-family: var(--serif); font-size: 13px; font-weight: 700; color: var(--sand);
  letter-spacing: .08em; text-transform: uppercase;
}
.step-tag { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.step-q { font-family: var(--serif); font-size: 19px; line-height: 1.35; margin: 0 0 12px; }
.step-row { display: flex; gap: 10px; font-size: 14.5px; padding: 8px 0; border-top: 1px dashed var(--line); }
.step-row .k {
  flex: none; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--teal); padding-top: 3px; width: 52px;
}
.step-row .v { color: var(--ink); }

/* ---------------------------------------------------------------- icebreakers */
.ice { display: grid; gap: 8px; padding-bottom: 8px; counter-reset: ice; }
.ice-item {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start;
}
.ice-item .num {
  flex: none; font-family: var(--serif); font-size: 14px; font-weight: 700; color: var(--sand);
  min-width: 20px; padding-top: 3px;
}
.ice-item .body { flex: 1; cursor: pointer; }
.ice-q { font-size: 16px; }
.ice-why { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); font-style: italic; }

/* ---------------------------------------------------------------- fun */
.fun { list-style: none; margin: 0; padding: 0 0 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.fun li {
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 16px; font-size: 15px;
}

/* ---------------------------------------------------------------- results */
.results { display: grid; gap: 8px; padding-bottom: 8px; }
.res-group { margin-top: 14px; }
.res-group:first-child { margin-top: 0; }
.res-group h2 {
  font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 8px;
}
.res {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 16px;
}
.res .where { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--teal); text-transform: uppercase; }
.res .what { margin-top: 4px; font-size: 15.5px; }
.res .what.serif { font-family: var(--serif); font-size: 17px; }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }
.empty { padding: 30px 4px; color: var(--muted); }

/* ---------------------------------------------------------------- footer */
.foot { border-top: 1px solid var(--line); margin-top: 26px; padding: 20px 0 40px; }
.foot p { margin: 0 0 8px; font-size: 13.5px; }
.foot .fine { color: var(--muted); font-size: 12.5px; max-width: 62ch; }

/* ---------------------------------------------------------------- toast */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--paper);
  padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  transition: opacity .2s ease, transform .2s ease; z-index: 40;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
