/* Keep the shared app navigation independent of Quiz content layout. */
body.widget-page[data-bible-page] .social-header {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 16px;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  row-gap: 20px;
  min-height: 72px;
  padding: 22px clamp(18px, 5vw, 56px) 16px;
  border: 0;
  background: transparent;
}
body.widget-page .social-header > .premium-button {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  position: static;
  align-self: center;
  height: 34px;
  min-height: 34px;
  margin: 0;
}
.widget-shell { flex: 1; min-height: 0; }
.widget-page .widget-shell {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px clamp(18px, 5vw, 56px) calc(88px + env(safe-area-inset-bottom));
}
.widget-onboarding { width: 100%; max-width: 600px; margin: 0 auto; text-align: center; }
.widget-intro { max-width: 520px; margin: 0 auto 18px; }
.widget-intro h1 {
  margin: 0;
  color: #344b3c;
  font: 600 26px/1.2 Georgia, serif;
  letter-spacing: -.03em;
  white-space: nowrap;
}
:root[data-theme="dark"] .widget-intro h1 { color: #dfc595; }
.widget-add-button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 49px;
  margin: 20px auto 0;
  padding: 12px 20px;
  border: 1px solid #344b3c;
  border-radius: 16px;
  color: #fff9ed;
  background: linear-gradient(120deg, #526d50, #2f4c3a);
  font-family: var(--font-ui, sans-serif);
  font-size: 17px;
  font-weight: 600;
  box-shadow: 0 4px 12px #344b3c12;
  cursor: pointer;
}
.widget-add-button > svg { flex: none; width: 24px; height: 24px; }
.widget-add-button::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(110deg, transparent 25%, rgba(255,246,229,.05) 39%, rgba(255,246,229,.2) 50%, rgba(255,246,229,.05) 61%, transparent 75%);
  transform: translateX(-130%); animation: widget-add-shine 4.5s ease-in-out infinite;
}
@keyframes widget-add-shine {
  0%, 45% { transform: translateX(-130%); opacity: 0; }
  55% { opacity: 1; }
  94%, 100% { transform: translateX(130%); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .widget-add-button::after { display: none; animation: none; } }
.widget-add-button:focus-visible { outline: 2px solid var(--theme-text-strong); outline-offset: 4px; }
.widget-setup-hint { max-width: 340px; margin: 12px auto 0; font-size: .875rem; line-height: 1.5; color: var(--theme-history-text); }
@media (max-width: 679px) {
  html:has(body.widget-page) { height: 100%; overflow: hidden; }
  body.widget-page {
    --widget-title-above: 30px;
    --widget-title-below: 20px;
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: var(--widget-viewport-height, 100dvh);
    min-height: 0;
    overflow: hidden;
    padding-bottom: 0;
    overscroll-behavior: none;
  }
  body.widget-page[data-bible-page] .social-header {
    padding-top: max(22px, env(safe-area-inset-top));
  }
  .widget-page .widget-shell {
    display: flex;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    /* The header already contributes 16px below Premium. */
    padding-top: calc(var(--widget-title-above) - 16px);
    padding-bottom: calc(var(--widget-nav-height, 65px) + max(22px, env(safe-area-inset-top)));
  }
  .widget-onboarding {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: var(--widget-title-below);
  }
  .widget-intro { flex: none; margin-bottom: 0; }
  .widget-add-button { flex: none; margin: 0 auto; }
  .widget-setup-hint {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    margin: 0;
  }
  body.widget-page .bottom-nav { position: fixed; bottom: 0; }
}
@media (max-width: 679px) and (max-height: 650px) {
  body.widget-page { --widget-title-above: 24px; --widget-title-below: 14px; }
}
@media (min-width: 680px) {
  .widget-page .social-header { padding-top: 58px; min-height: 0; }
  body.widget-page .social-header > .premium-button { display: none; }
  .widget-page .widget-shell { overflow: visible; padding-bottom: 36px; }
  .widget-intro { margin-bottom: 24px; }
  .widget-intro h1 { font-size: 36px; }
  .widget-add-button { max-width: 350px; min-height: 56px; font-size: 19px; margin-top: 25px; }
}
@media (max-width: 359px) { .widget-intro h1 { font-size: 23px; } }
