/* v1.0.45 — correção de cabeçalhos e topo padronizado */
:root {
  --appbar-height: calc(84px + env(safe-area-inset-top));
}

.appbar,
body[data-screen="verses"] .appbar,
body[data-screen="hino"] .appbar {
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
}

.appbar-main,
body[data-screen="verses"] .appbar-main,
body[data-screen="hino"] .appbar-main {
  height: 52px;
}

.brand {
  flex: 1 1 auto;
  gap: 10px;
  min-width: 0;
}

.brand-mark,
body[data-screen="verses"] .brand-mark,
body[data-screen="hino"] .brand-mark {
  flex-basis: 42px;
  width: 42px;
  height: 42px;
  border-radius: 14px;
}

.brand-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.appbar-title,
body[data-screen="verses"] .appbar-title,
body[data-screen="hino"] .appbar-title {
  font-size: clamp(18px, 5vw, 21px);
  line-height: 1.12;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.appbar-subtitle,
body[data-screen="verses"] .appbar-subtitle,
body[data-screen="hino"] .appbar-subtitle {
  display: none;
}

body[data-screen="verses"],
body[data-screen="hino"] {
  --appbar-height: calc(84px + env(safe-area-inset-top));
}

.screen-title-row {
  min-height: 44px;
  margin: 0 16px 14px;
}

.screen-title-row h1,
.sub-title-row h1,
.hino-top h1 {
  max-width: 100%;
  padding: 0;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  text-wrap: balance;
}

.sub-title-row,
.hino-top {
  display: grid !important;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 8px;
  align-items: center;
  min-height: 64px;
  margin: 0 16px 18px;
  padding: 10px 0 8px;
  text-align: center;
}

.sub-title-row.no-back-title {
  grid-template-columns: minmax(0, 1fr);
}

.sub-title-row .back-btn,
.hino-top .back-btn,
.hino-top .back-btn.absolute {
  grid-column: 1;
  justify-self: start;
  position: static !important;
  left: auto;
  top: auto;
}

.sub-title-row h1,
.hino-top h1 {
  grid-column: 2;
  justify-self: center;
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: clamp(1.45rem, 5.7vw, 2.25rem);
  line-height: 1.14;
  font-weight: 900;
  letter-spacing: -.35px;
}

.sub-title-row.no-back-title h1 {
  grid-column: 1;
}

.hino-top h1 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: clamp(1.28rem, 5.2vw, 2rem);
  line-height: 1.16;
}

.screen-title-row h1 {
  font-size: clamp(1.75rem, 7vw, 2.5rem);
  line-height: 1.12;
}

@media (max-width: 420px) {
  .sub-title-row,
  .hino-top {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    margin-left: 14px;
    margin-right: 14px;
  }

  .sub-title-row h1,
  .hino-top h1 {
    font-size: clamp(1.34rem, 5.9vw, 1.85rem);
  }

  .hino-top h1 {
    font-size: clamp(1.16rem, 5.6vw, 1.68rem);
  }
}

@media (max-width: 380px) {
  :root,
  body[data-screen="verses"],
  body[data-screen="hino"] {
    --appbar-height: calc(80px + env(safe-area-inset-top));
  }

  .appbar,
  body[data-screen="verses"] .appbar,
  body[data-screen="hino"] .appbar {
    padding-left: 12px;
    padding-right: 12px;
  }

  .appbar-main,
  body[data-screen="verses"] .appbar-main,
  body[data-screen="hino"] .appbar-main {
    height: 50px;
    gap: 10px;
  }

  .brand { gap: 8px; }

  .brand-mark,
  body[data-screen="verses"] .brand-mark,
  body[data-screen="hino"] .brand-mark {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
    border-radius: 13px;
  }

  .quick-read-btn,
  .appbar-menu {
    min-width: 42px;
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .appbar-title,
  body[data-screen="verses"] .appbar-title,
  body[data-screen="hino"] .appbar-title {
    font-size: 16.8px;
    letter-spacing: -.45px;
  }

  .sub-title-row,
  .hino-top {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    margin-left: 12px;
    margin-right: 12px;
  }
}


@media (max-width: 340px) {
  .appbar-main,
  body[data-screen="verses"] .appbar-main,
  body[data-screen="hino"] .appbar-main {
    gap: 8px;
  }

  .appbar-actions { gap: 6px; }

  .brand-mark,
  body[data-screen="verses"] .brand-mark,
  body[data-screen="hino"] .brand-mark {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .quick-read-btn,
  .appbar-menu {
    min-width: 40px;
    width: 40px;
    height: 40px;
  }

  .appbar-title,
  body[data-screen="verses"] .appbar-title,
  body[data-screen="hino"] .appbar-title {
    font-size: 16px;
  }
}
