/* BiblicalTools site guide (optional). Pilot: home, Bible Reader, Bible on Audio, Who Is My Neighbor?
   Everything is scoped under .sg- names so the page's own styles are untouched. */
.sg-root, .sg-root * { box-sizing: border-box; }
.sg-root {
  --sg-accent: #8B4513;
  --sg-ink: #2b2420;
  --sg-soft: #6b5f57;
  --sg-paper: #fffdf9;
  --sg-line: #e7ded4;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px; line-height: 1.5; color: var(--sg-ink);
  letter-spacing: normal; text-transform: none; text-align: left; font-weight: 400;
}
.sg-root button, .sg-root a.sg-btn {
  font: inherit; font-size: 14px; line-height: 1.2; letter-spacing: normal; text-transform: none;
  margin: 0; min-height: 32px; padding: 6px 10px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--sg-line); background: #fff; color: var(--sg-ink);
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  box-shadow: none; width: auto; height: auto; transform: none;
}
.sg-root button:hover, .sg-root a.sg-btn:hover { border-color: var(--sg-accent); }
.sg-root button:focus-visible, .sg-root a.sg-btn:focus-visible, .sg-title:focus-visible {
  outline: 3px solid var(--sg-accent); outline-offset: 2px;
}
.sg-root .sg-primary { background: var(--sg-accent); border-color: var(--sg-accent); color: #fff; }
.sg-root .sg-primary:hover { background: #723810; }
.sg-root .sg-quiet { border-color: transparent; background: transparent; color: var(--sg-soft); padding: 6px 7px; }
.sg-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* launcher pill */
.sg-launch {
  position: fixed; left: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 2147483000;
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 5px !important;
  border-radius: 999px !important; background: var(--sg-paper) !important; border: 1px solid var(--sg-line) !important;
  box-shadow: 0 4px 16px rgba(43, 36, 32, .14) !important; color: var(--sg-ink) !important;
}
.sg-launch .sg-face { width: 30px; height: 30px; }
.sg-launch[hidden] { display: none !important; }
/* arrival: the pill fades in while the sparrow flies to it (reduced motion: the fade only) */
.sg-launch { transition: opacity .45s ease; }
.sg-launch.sg-arriving { opacity: 0; }
.sg-launch.sg-bird-away .sg-face { visibility: hidden; }
.sg-flyer { position: fixed; left: 0; top: 0; z-index: 2147483002; pointer-events: none; will-change: transform; }
.sg-flyer .sg-face { width: 100%; height: 100%; }
.sgc.is-flying .sgc-wing { animation: sgc-flap .2s ease-in-out 5; }
.sgc.is-flare .sgc-wing { animation: sgc-flare .2s ease-in-out 2; }
@keyframes sgc-flare { 0%, 100% { transform: none; } 50% { transform: rotate(-30deg); } }

/* the character */
.sg-face { display: block; width: 34px; height: 34px; flex: none; overflow: visible; }

/* sparrow motion (only when a sparrow is switched on): hop beside the button, one head tilt while waiting,
   a short flutter toward a new step, then rest. No constant flapping. */
.sgc .sgc-bird, .sgc .sgc-head, .sgc .sgc-wing { transform-box: view-box; }
.sgc .sgc-bird { transform-origin: 24px 44px; }
.sgc .sgc-head { transform-origin: 30px 23px; transition: transform .25s ease; }
.sgc .sgc-wing { transform-origin: 21px 26px; }
.sgc.is-hop .sgc-bird { animation: sgc-hop .6s ease-out 2; }
.sgc.is-tilt .sgc-head { animation: sgc-tilt 1.6s ease-in-out 1; }
.sgc.is-tilted .sgc-head { transform: rotate(-12deg); }
.sgc.is-flutter .sgc-bird { animation: sgc-flit .8s ease-out 1; }
.sgc.is-flutter .sgc-wing { animation: sgc-flap .16s ease-in-out 4; }
@keyframes sgc-hop {
  0% { transform: none; } 18% { transform: scale(1.04, .94); } 45% { transform: translateY(-5px); }
  72% { transform: scale(1.03, .96); } 100% { transform: none; }
}
@keyframes sgc-tilt { 0%, 100% { transform: none; } 22%, 70% { transform: rotate(-14deg); } }
@keyframes sgc-flap { 0%, 100% { transform: none; } 50% { transform: rotate(-30deg); } }
@keyframes sgc-flit { 0% { transform: none; } 40% { transform: translate(5px, -5px); } 100% { transform: none; } }

/* highlight ring around the real control (never blocks it) */
.sg-ring {
  position: fixed; z-index: 2147482999; pointer-events: none; border-radius: 10px;
  border: 3px solid var(--sg-accent); box-shadow: 0 0 0 4px rgba(255, 253, 249, .85);
}
.sg-glide .sg-ring { transition: left .35s ease, top .35s ease, width .35s ease, height .35s ease; }
.sg-ring[hidden] { display: none !important; }

/* speech bubble */
.sg-bubble {
  position: fixed; z-index: 2147483001; width: min(304px, calc(100vw - 24px));
  max-height: calc(100vh - 24px); overflow: auto;
  background: var(--sg-paper); border: 1px solid var(--sg-line); border-radius: 12px;
  box-shadow: 0 8px 26px rgba(43, 36, 32, .2); padding: 9px 11px 8px;
  font-size: 14px; line-height: 1.42;
}
.sg-glide .sg-bubble { transition: left .35s ease, top .35s ease; }
.sg-bubble[hidden] { display: none !important; }
/* head: character | kicker · Home · close on one line, the title full width below it */
.sg-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; column-gap: 6px; }
.sg-head > .sg-face { grid-row: 1 / span 2; align-self: center; }
.sg-meta { display: contents; }
.sg-kicker { grid-column: 2; grid-row: 1; font-size: 11.5px; color: var(--sg-soft); line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-head > .sg-home { grid-column: 3; grid-row: 1; }
.sg-head > .sg-x { grid-column: 4; grid-row: 1; }
.sg-title { grid-column: 2 / span 3; grid-row: 2; font-size: 15px; font-weight: 650; margin: 0; color: var(--sg-ink); outline: none; line-height: 1.25;
  font-family: inherit; letter-spacing: normal; text-transform: none; }
.sg-root .sg-x { font-size: 20px; min-width: 30px; min-height: 28px; padding: 2px 6px; }
.sg-root .sg-home { font-size: 13px; min-height: 28px; padding: 3px 8px; gap: 4px; color: var(--sg-ink); border-color: var(--sg-line); }
.sg-root .sg-home:hover { border-color: var(--sg-accent); color: var(--sg-accent); }
.sg-text { margin: 6px 0 0; }
.sg-text p { margin: 0 0 6px; }
.sg-sample {
  margin: 6px 0 0; padding: 6px 9px; border: 1px dashed var(--sg-accent); border-radius: 8px; background: #fff;
  font-size: 13.5px;
}
.sg-sample b.sg-tag { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--sg-accent); margin-bottom: 4px; }
.sg-sample code { font-family: ui-monospace, Menlo, Consolas, monospace; background: #f6f1ea; padding: 1px 5px; border-radius: 4px; }
.sg-status { margin: 4px 0 0; font-size: 13px; color: var(--sg-accent); font-weight: 600; min-height: 0; }
.sg-status:empty { display: none; }
.sg-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sg-row.sg-foot { justify-content: space-between; gap: 2px; border-top: 1px solid var(--sg-line); padding-top: 5px; margin-top: 7px; }
.sg-root .sg-foot button { min-height: 30px; padding-top: 4px; padding-bottom: 4px; }
.sg-paths { display: grid; gap: 6px; margin-top: 8px; }
.sg-paths button { justify-content: flex-start !important; text-align: left; }
.sg-pointer { font-size: 13px; color: var(--sg-soft); margin-top: 6px; }

/* phone (<= 600px, set by site-guide.js): a compact bottom sheet with the sparrow perched on its edge */
.sg-perch { display: none !important; }
.sg-bubble.sg-sheet {
  left: 8px; right: 8px; width: auto; top: auto; bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  max-height: none; overflow: visible; padding: 7px 10px 5px; border-radius: 14px;
  box-shadow: 0 -4px 22px rgba(43, 36, 32, .18);
}
.sg-glide .sg-bubble.sg-sheet { transition: none; }
.sg-sheet .sg-head { grid-template-columns: 0 minmax(0, 1fr) auto auto; column-gap: 0; }
.sg-sheet .sg-kicker { padding-left: 42px; }   /* room for the perched sparrow; the title below uses the full width */
.sg-sheet .sg-head > .sg-face { display: none; }
.sg-sheet .sg-head > .sg-home { margin-left: 6px; }
.sg-sheet .sg-head > .sg-x { margin-left: 4px; }
.sg-sheet .sg-title { grid-column: 2 / span 3; }
.sg-root .sg-sheet .sg-perch {
  display: block !important; position: absolute; top: -30px; left: 8px; width: 42px; height: 42px;
  min-height: 0 !important; padding: 0 !important; border: 0 !important; background: transparent !important; border-radius: 50% !important;
}
.sg-sheet .sg-perch .sg-face { width: 40px; height: 40px; }
.sg-sheet .sg-body { max-height: var(--sg-sheet-max, 45vh); overflow: auto; }
.sg-sheet .sg-text { margin-top: 3px; }
.sg-sheet .sg-text p { margin-bottom: 3px; }
.sg-sheet .sg-row { margin-top: 4px; }
.sg-sheet .sg-row.sg-foot { margin-top: 5px; padding-top: 3px; }
.sg-bubble.sg-collapsed { display: none !important; }
.sg-root .sg-mini {
  position: fixed; left: 10px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 2147483001;
  width: 52px; height: 52px; min-height: 0; padding: 5px !important; border-radius: 50% !important;
  background: var(--sg-paper) !important; border: 1px solid var(--sg-line) !important; box-shadow: 0 4px 16px rgba(43, 36, 32, .18) !important;
}
.sg-mini .sg-face { width: 40px; height: 40px; }
.sg-mini[hidden] { display: none !important; }

@media (max-width: 480px) {
  .sg-bubble { padding: 8px 10px 7px; }
  .sg-face { width: 30px; height: 30px; }
}
/* touch screens keep comfortable targets */
@media (pointer: coarse) {
  .sg-root button, .sg-root a.sg-btn, .sg-root .sg-foot button { min-height: 40px; }
  .sg-root .sg-x, .sg-root .sg-home { min-height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .sg-ring, .sg-bubble, .sg-glide .sg-ring, .sg-glide .sg-bubble { transition: none !important; }
  .sgc *, .sgc .sgc-head { animation: none !important; transition: none !important; }
  .sg-flyer { display: none !important; }
}
/* the reader's older one-time tour stays out of the way while the guide is open */
html.sg-open #tourOverlay { display: none !important; }
@media print { .sg-root { display: none !important; } }
