@font-face {
  font-family: Inter;
  src: url("/fonts/Inter.woff") format("woff");
  font-weight: 100 900;
  font-display: optional;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/SpaceGrotesk.woff") format("woff");
  font-weight: 300 700;
  font-display: optional;
}

:root {
  --font-body: Inter, system-ui, sans-serif;
  --font-editorial: "Space Grotesk", Inter, system-ui, sans-serif;
  --action: #ff914f;
  --action-ink: #321a10;
  --bg: #f7f7f2;
  --card: #fff;
  --ink: #172a23;
  --muted: #43564d;
  --forest: #174539;
  --green: #1c5d49;
  --mint: #e6f2e9;
  --line: #d4e0d8;
  --gold: #e8a154;
  --warm-ink: #73411e;
  --paper: #fff3e4;
  --shadow: 0 5px 20px #142e230e;
}
body { background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--font-body); }
body button, body input, body textarea, body select { font-family: var(--font-body); }
body .heading, body .sidebar .logo {
  font: 700 clamp(29px,4vw,48px)/1.12 var(--font-editorial);
  letter-spacing: -.035em;
  color: var(--forest);
}
body .sidebar .logo { font-size: 26px; color: #fff; }
body .sidebar .logo small { color: #cce8d9; font-family: var(--font-body); }
body .section h2, body .section h3, body .card h2, body .card h3 {
  font-family: var(--font-editorial);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.025em;
}
body .section h2 { font-size: clamp(21px,2.4vw,29px); }
body .section h3 { font-size: clamp(17px,1.7vw,22px); }
body .muted { color: var(--muted); }
body .eyebrow, body .v17-section-eyebrow { color: var(--warm-ink); font-size: 11px; }
body .content { max-width: 1420px; }
body .card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
body .btn { background: var(--green); border-color: var(--green); color: #fff; font-size: 14px; }
body .btn.light { background: var(--mint); border-color: var(--line); color: var(--forest); }
body .btn.ghost { background: #fff; border-color: #9eafa5; color: var(--forest); }
body .btn.cream { background: var(--paper); border-color: #e8c7a5; color: var(--forest); }
body .btn:disabled { cursor: default; }
body .input, body input[type="number"], body textarea, body select { border-color: #9eafa5; color: var(--ink); }
body .tag { background: var(--mint); color: var(--forest); border-color: var(--line); }
body .sidebar { background: #15372d; }
body .sidebar::before { display: none; }
body .sidebar .nav button { color: #fff; font-family: var(--font-editorial); }
body .sidebar .nav button:hover { background: #255344; }
body .sidebar .nav button.active { background: #e5f4e9; color: #174539; box-shadow: inset 3px 0 0 #ff8c42; }
body .sidebar .nav button.active .nav-symbol { color: #174539; }
body :is(button,a,input,textarea,select,summary):focus-visible { outline: 3px solid #18624b; outline-offset: 3px; }

body #home .hero {
  background: #16523f;
  border-color: #16523f;
  color: #fff;
  padding: clamp(23px,4.8vw,52px);
  border-radius: 22px;
}
body #home .hero h2 {
  font: 700 clamp(33px,5vw,61px)/1.06 var(--font-editorial);
  color: #fff;
  letter-spacing: -.035em;
}
body #home .hero p, body #home .hero .hero-reference { color: #fff; }
body #home .hero .eyebrow { color: #cce8d9; }
body #home .hero p { font-size: 17px; max-width: 62ch; }
body #home .hero .btn { background: var(--action); color: var(--action-ink); border-color: var(--action); }
body #home .hero .q219-metric { background: #1e614d; border-color: #639681; }
body #home .hero .q219-metric b, body #home .hero .q219-metric span { color: #fff; }
body #home .hero .q219-metric b { font: 700 23px/1.15 var(--font-body); }
body #home .hero :focus-visible { outline-color: #ffbd88; }
body #home .v203-pending-card, body #home .v203-home-secondary,
body #group .v203-group-fold, body #group .group-hero .card:first-child {
  background: #fff; border-color: var(--line);
}
body #home .v203-pending-title h3, body #home .v203-home-secondary > summary,
body #group .v203-group-fold > summary, body #home .v203-pending-list > button {
  font-family: var(--font-body); color: var(--forest);
}
body #home .v203-pending-list > button { border-color: var(--line); }
body #home .v203-pending-list > button:hover { background: var(--mint); border-color: #98a78d; }
body #home .home-prayer-action { background: var(--mint); border-color: var(--line); }
body #home .home-prayer-action .btn { background: var(--green); color: #fff; }
body #home .home-prayer-action .btn.ghost { background: #fff; color: var(--forest); }
body #study .card, body #group .card, body #adminAI .card { border-color: var(--line); }
body #study #study-title { font: 700 clamp(29px,3.5vw,43px)/1.15 var(--font-editorial); color: var(--forest); }
body #study .question-edit { background: #f2f7f3; border-color: var(--line); padding: clamp(14px,2vw,22px); }
body #study .question-edit :is(h3,h4) { color: var(--ink); font: 700 16px/1.5 var(--font-body); }
body #study .question-type { color: var(--forest); background: var(--mint); border-color: var(--line); }
body #study .answer { color: var(--ink); background: #fff; border-color: #9eafa5; min-height: 48px; padding: 10px 12px; font-size: 16px; line-height: 1.55; }
body #study .answer:has(input:checked) { background: var(--mint); border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
body #study input[type="radio"] { accent-color: var(--green); }
body #study > .two { grid-template-columns: minmax(0,1fr); align-items: start; max-width: 78rem; margin-inline: auto; }
body #study > .two > .stack:first-child { width: 100%; max-width: 76ch; margin-inline: auto; }
body #study > .two > .stack:last-child { min-width: 0; }
body #study #study-rich-text, body #study #bible-reader { font-size: 17px; line-height: 1.75; }
body #study #study-rich-text p { line-height: 1.75; }
body #study #study-questions textarea { font-size: 16px; line-height: 1.6; }
body #study .answer:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }
@media(min-width:1100px) {
  body #study > .two { grid-template-columns: minmax(0,1fr) minmax(215px,26%); gap: 22px; }
}

body #admin .card.admin-banner, body #adminReview .card.admin-banner { background: #16523f; }
body #adminAI .v21-tab.active { background: var(--green); color: #fff; border-color: var(--green); }
body #adminAI .v21-proposal-item { background: #f2f7f3; border-color: var(--line); }

body #auth.auth { background: #eef3ec; }
body #auth .auth-art {
  background: #174f3d;
  color: #fff;
  justify-content: space-between;
  padding: clamp(28px,5.3vw,84px);
  overflow: hidden;
}
body #auth .auth-art::before {
  inset: auto -13vw -25vw auto;
  width: min(70vw,1000px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid #e8a15465;
  box-shadow: 0 0 0 32px #e8a15415,0 0 0 72px #e8a1540c;
}
body #auth .auth-art::after { content: none; }
body #auth .auth-brand { position: relative; z-index: 1; color: #fff; font: 700 17px/1.4 var(--font-editorial); }
body #auth .auth-art-kicker { color: #cce8d9; }
body #auth .auth-art h2 { color: #fff; font: 700 clamp(42px,6vw,96px)/.98 var(--font-editorial); letter-spacing: -.055em; }
body #auth .auth-art h2 em { color: #cce8d9; font-weight: 400; }
body #auth .auth-art p { color: #fff; font-size: 16px; max-width: 36ch; margin-top: 20px; }
body #auth .auth-art-verse { margin-top: 16px; padding-top: 12px; color: #fff; font: italic 400 19px/1.5 var(--font-body); }
body #auth .auth-art-verse small { color: #cce8d9; }
body #auth .authbox { background: #fff; border: 1px solid #d4e0d8; border-radius: 22px; box-shadow: 0 20px 60px #1745391a; }
body #auth .authbox h1 { font: 700 clamp(29px,3.5vw,44px)/1.08 var(--font-editorial); color: var(--forest); letter-spacing: -.035em; }
body #auth .login-intro { background: var(--mint); border-color: var(--line); color: var(--forest); }
body #auth .authbox #auth-submit { width: 100%; min-height: 48px; background: var(--action); border-color: var(--action); color: var(--action-ink); }

#group-ranking-card .rank { border-bottom-color: var(--line); }
#group-ranking-card .rank .rank-index, #group-ranking-card .rank .xp { color: var(--warm-ink); font-family: var(--font-body); }
#group .group-mini { background: var(--mint); border-color: var(--line); }
#group .group-mini strong { color: var(--forest); font-family: var(--font-body); }
.q219-trail .q219-trail-head h3, .q219-trail .q219-stage-title { font: 700 17px/1.25 var(--font-body); color: var(--forest); }
.q219-trail :is(.q219-party,.q219-avatar-icon,.q219-stage-crowd) { background: #edf6ef; border-color: var(--line); }
.q219-trail :is(.q219-party-head,.q219-route-caption,.q219-count,.q219-beyond > strong,.trail-count) { color: var(--forest); }
.q219-trail .q219-count, .q219-trail .q219-stage-badge { background: var(--paper); border-color: #e8c7a5; color: var(--warm-ink); }
.q219-trail .q219-route-scene { background: #eaf3eb; border-color: #ccdbd1; padding: 14px; }
.q219-trail .q219-route-scene::before { background-image: radial-gradient(#8ca396 1px,transparent 1px); }
.q219-trail .q219-stage { background: #fff; border-color: #ceded3; box-shadow: none; }
.q219-trail .q219-stage[data-current="true"] { border-color: #38755e; box-shadow: 0 0 0 1px #38755e; }
.q219-trail .q219-stage-step, .q219-trail .q219-stage-current {
  position: absolute; top: 8px; padding: 5px 8px; font-size: 10px; line-height: 1.2; border-radius: 30px;
}
.q219-trail .q219-stage-step { left: 8px; background: #174539; color: #fff; }
.q219-trail .q219-stage-current { right: 8px; background: var(--paper); color: var(--forest); font-weight: 700; }
.q219-trail .q219-stage-crowd { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; padding: 6px; }
.q219-trail .q219-stage-tile {
  display: flex; flex-direction: column; gap: 3px; padding: 4px 2px;
  height: auto; min-height: 58px; color: var(--ink); border-color: var(--line);
}
.q219-trail .q219-stage-tile .avatar { width: min(100%,36px)!important; height: 37px!important; }
.q219-tile-name { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.q219-trail .q219-beyond { border-color: #9eafa5; background: #fff; }
.q219-trail .q219-beyond-entry b, .q219-trail .q219-beyond-entry small { color: var(--forest); }
.q219-route-controls { display: grid; grid-template-columns: max-content minmax(0,1fr) max-content; align-items: center; gap: 6px; }
.q219-route-controls .btn { width: auto; min-height: 44px; padding: 8px 10px; white-space: nowrap; overflow-wrap: normal; }
.q219-route-position { text-align: center; min-width: 0; }
.q219-route-controls .trail-follow[hidden] { display: none; }
.q219-route-controls .trail-follow { margin-inline: auto; }
.q219-swipe-hint { margin: 0; color: var(--muted); font-size: 12px; }
.q219-trail .trail-follow { display: block; color: var(--green); }
.q219-trail .journey-thought-wall { background: var(--mint); border-color: var(--line); }
.q219-trail .journey-thought-wall summary { color: var(--forest); }

.q-instruction-reader, body .q-instruction-editor { background: var(--paper); border: 1px solid #e6c9a8; border-radius: 14px; color: var(--forest); }
.q-instruction-reader > summary, .q-instruction-editor > summary {
  cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  list-style: none; font-weight: 700;
}
.q-instruction-reader > summary::-webkit-details-marker, .q-instruction-editor > summary::-webkit-details-marker { display: none; }
.q-instruction-reader > summary { padding: 14px 17px; }
.q-instruction-reader > summary small { display: block; letter-spacing: .08em; font-size: 10px; color: var(--warm-ink); }
.q-instruction-reader > summary strong { font-size: 17px; overflow-wrap: anywhere; }
.q-instruction-reader > summary > span:first-child { min-width: 0; }
.q-instruction-open { font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.q-instruction-label-close, .q-instruction-reader[open] .q-instruction-label-open { display: none; }
.q-instruction-reader[open] .q-instruction-label-close { display: inline; }
.q-instruction-content { overflow-wrap: anywhere; color: var(--ink); }
.q-instruction-reader .q-instruction-content { padding: 4px 17px 14px; border-top: 1px solid #e6c9a8; }
.q-instruction-content p { margin: 9px 0; white-space: pre-wrap; }
.q-instruction-editor > summary { font-size: 17px; min-height: 42px; }
.q-instruction-editor > summary small { font-size: 12px; color: var(--warm-ink); }
.q-instruction-form { display: grid; gap: 12px; margin-top: 12px; }
.q-instruction-form .field { margin: 0; }
.q-instruction-form > p { margin: 0; }
.q-instruction-form textarea { resize: vertical; }

@media(max-width:900px) {
  body .sidebar .nav button.active { box-shadow: inset 0 3px 0 #ff8c42; }
  body #auth .auth-art { min-height: 0; padding: 21px 20px 25px; gap: 14px; }
  body #auth .auth-art::before { inset: auto -15vw -40vw auto; }
  body #auth .auth-art-main { text-align: left; margin: 0; }
  body #auth .auth-art h2 { font-size: clamp(35px,7vw,57px); }
  body #auth .auth-art h2 br { display: none; }
  body #auth .auth-art h2 em { display: inline-block; margin-left: .14em; }
  body #auth .authbox { margin-top: 15px; }
  .q219-trail .q219-trail-wrap { grid-template-columns: minmax(0,1fr); }
  .q219-trail .q219-route-list {
    --stage-width: min(84%,340px);
    --stage-gap: 10px;
    display: flex; gap: var(--stage-gap); padding: 3px 0 8px;
    overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: x mandatory;
    scrollbar-width: thin; scrollbar-color: #749184 transparent;
  }
  .q219-trail .q219-route-list::before, .q219-trail .q219-stage::before { content: none; }
  .q219-trail .q219-route-list::after { content: ""; flex: 0 0 max(0px,calc(100% - var(--stage-width) - var(--stage-gap))); }
  .q219-trail .q219-route-list > .q219-stage {
    flex: 0 0 var(--stage-width); min-width: 0; margin: 0;
    overflow: hidden; scroll-snap-align: start;
  }
  .q219-route-controls .btn { font-size: 12px; }
  .q219-trail .q219-route-scene { padding: 10px; }
  .q219-trail .q219-stage-crowd { border-radius: 0 0 16px 16px; }
}

body #home .hero .hero-study-status { color: #704120; background: #ffebd4; }
body #home .hero .hero-study-status.is-complete { color: #174539; background: #e6f2e9; }

body .q-instruction-content .q-instruction-heading {
  font: 700 clamp(24px,3vw,32px)/1.2 var(--font-editorial);
  color: var(--forest);
  margin: 18px 0 8px;
}
body .q-instruction-content .q-instruction-subheading {
  font: 700 clamp(18px,2vw,22px)/1.3 var(--font-body);
  color: var(--forest);
  margin: 14px 0 6px;
}


/* Leitura e rótulos. A escala dos títulos fica nas regras acima. */
body #page-sub { font-size: 14px; }
body #home .hero .hero-study-status { font-size: 13px; }
body #home .hero .q219-metric span { font-size: 13px; }
body #home .v203-pending-list > button { font-size: 15px; }
body #home .v203-pending-list > button small { font-size: 13px; }
body #home .v203-home-secondary > summary small,
body #group .v203-group-fold > summary small { font-size: 13px; }
body #study .card > p.muted:not([id]) { font-size: 14px; }
body #study #study-desc { font-size: 17px; }
body .q219-trail .q219-trail-head p, body .q219-trail .q219-swipe-hint { font-size: 13px; }
body .q219-trail .q219-stage-date, body .q219-trail .q219-tile-name { font-size: 11px; }
body .q-instruction-open { font-size: 13px; }


/* A identidade já está disponível antes de verificar a sessão. */
#quarteto-startup { display: none; }
body[data-booting] #auth, body[data-booting] #app { display: none !important; }
body[data-booting] #quarteto-startup {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  gap: .5rem;
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
}
.startup-brand {
  color: var(--forest);
  font: 700 clamp(24px,5vw,38px)/1.15 var(--font-editorial);
}


/* Fluxos mais usados. */
.q-admin-actions .q-admin-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 14px; }
.q-admin-grid .btn { text-align: left; min-height: 64px; white-space: normal; font-size: 15px; }
.q-admin-grid .btn small { display: block; font-size: 12px; margin-top: 3px; font-weight: 400; }
body .q-admin-grid [data-task="study"], body #study #study-submit { background: var(--action); color: var(--action-ink); border-color: var(--action); }
.q-study-progress { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0; padding: 10px 12px; background: var(--mint); color: var(--forest); border-radius: 9px; font-weight: 700; }
.q-study-progress[hidden], .q-study-progress [hidden] { display: none; }
body #study #study-questions select[data-slot] { min-height: 40px; max-width: 100%; font-size: 16px; }
#study-questions :is(input, select, textarea), #v205-member-feedback, #v205-desk-body { scroll-margin-block: 24px 96px; }
@media(max-width:420px) {
  .q-admin-actions .q-admin-grid { grid-template-columns: minmax(0,1fr); }
  body #study #study-submit { width: 100%; }
}

/* Movimentos suaves na trilha e na prévia, respeitando a preferência do dispositivo. */
@media(prefers-reduced-motion:no-preference) {
  :is(#avatar-preview,.q219-stage-tile,.q219-avatar) .character-svg:not([class*="motion-"]) .character-body {
    transform-origin: 60px 137px;
    animation: q-avatar-idle 4.2s ease-in-out infinite;
  }
  :is(#avatar-preview,.q219-stage-tile,.q219-avatar) .character-eyes {
    transform-origin: 60px 53px;
    animation: q-avatar-blink 6s linear infinite;
  }
  :is(.q219-stage-tile,.q219-avatar).q-avatar-celebrate .character-svg {
    animation: q-avatar-hop .62s ease-out both;
  }
}
@keyframes q-avatar-idle { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(.976); } }
@keyframes q-avatar-blink { 0%,92%,97%,100% { transform: scaleY(1); } 94%,95% { transform: scaleY(.12); } }
@keyframes q-avatar-hop { 0%,100% { transform: translateY(0); } 43% { transform: translateY(-14%); } }


/* Marca do Coram Deo: a mesma arte no cabeçalho, no login e na abertura. */
.q-brand-image { display: block; object-fit: contain; flex: none; }
.q-sidebar-mark { margin-bottom: 13px; }
.q-startup-mark { margin: 0 auto 8px; }
.q-brand-image.q-mobile-mark { display: none; }
@media(max-width:900px) {
  .page-title-block:has(.q-mobile-mark) { display: grid; grid-template-columns: 30px minmax(0,1fr); column-gap: 10px; align-items: center; }
  .q-brand-image.q-mobile-mark { display: block; grid-row: 1 / span 2; align-self: center; }
  .page-title-block #page-sub { grid-column: 2; }
}
