/* Navigation chrome has one owner across tabs, pushed pages and presented tasks. */
.navigation-bar {
  position: relative;
  z-index: 45;
  display: grid;
  grid-template-columns: minmax(44px, 1fr) minmax(0, 1.8fr) minmax(44px, 1fr);
  align-items: center;
  gap: 4px;
  min-height: 56px;
  margin: 0;
  padding: 4px 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, .94);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}
.has-tab-navigation > .navigation-bar {
  position: sticky;
  top: 0;
  padding-top: calc(4px + var(--safe-top));
  border-bottom: 1px solid rgba(32, 42, 61, .08);
  backdrop-filter: blur(20px) saturate(1.3);
}
.navigation-title {
  min-width: 0;
  margin: 0;
  text-align: center;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.2;
  text-wrap: balance;
  outline: none;
}
.navigation-leading, .navigation-trailing {
  display: flex;
  align-items: center;
  min-width: 0;
  color: var(--blue);
}
.navigation-trailing { justify-content: flex-end; }
.navigation-bar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  padding: 4px;
  margin: 0;
  border: 0;
  box-shadow: none;
  border-radius: 22px;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  text-transform: none;
  touch-action: manipulation;
}
.navigation-bar .navigation-back { gap: 0; max-width: 100%; flex-shrink: 1; justify-content: flex-start; }
.navigation-back svg { flex: 0 0 22px; }
.navigation-back span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navigation-bar .navigation-close { width: 44px; height: 44px; }
.navigation-bar .navigation-back:has(span) { justify-content: flex-start; }
.navigation-bar .navigation-back:not(:has(span)) { justify-content: center; }
.navigation-bar svg { display: block; }
.navigation-counter { font-size: 13px; color: var(--muted); padding-left: 4px; }
.navigation-bar .navigation-done { font-size: 14px; font-weight: 600; white-space: nowrap; }
.navigation-bar .navigation-settings { overflow: hidden; width: 44px; height: 44px; padding: 4px; }
.navigation-settings img, .navigation-settings svg { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.navigation-bar button:active { background: rgba(0, 100, 225, .09); opacity: .72; }
.has-tab-navigation .screen { padding-top: 24px; }
.has-tab-navigation .bottom-nav {
  position: sticky;
  bottom: 0;
  flex-shrink: 0;
  min-height: calc(60px + var(--safe-bottom));
  background: rgba(255, 255, 255, .94);
  box-shadow: none;
}
.has-tab-navigation .nav-button { min-height: 60px; gap: 3px; font-size: 11px; font-weight: 700; }
.has-tab-navigation .nav-button svg { width: 24px; height: 24px; }
.focus-composition-top > .navigation-bar { width: auto; margin: 0 -22px 12px; background: #fff; }
.setup-with-header > .navigation-bar { position: sticky; top: 0; padding-top: calc(4px + var(--safe-top)); }
.journey-header { display: block; }
.journey-header, .focus-composition-top { position: sticky; top: var(--safe-top); z-index: 45; background: #fff; box-shadow: 0 -24px #fff; }
.journey-header .navigation-bar { margin: 0 -24px 12px; background: #fff; }
@media (max-width: 374px) { .journey-header .navigation-bar { margin-inline: -18px; } }
.journey-progress-row { display: flex; align-items: center; gap: 12px; }
.journey-progress-row .journey-track { flex: 1; }
.journey-progress-row .journey-step-count { flex: 0 0 auto; }
/* One sheet stays on screen while its content moves through its own hierarchy. */
.focus-composition-top.has-setup-exit { display: grid; }
.sheet-backdrop { bottom: var(--keyboard-inset, 0px); animation: none; }
.sheet {
  padding: 0;
  scroll-padding-block: 88px 24px;
  max-height: min(calc(100dvh - var(--safe-top) - var(--keyboard-inset, 0px) - 12px), 820px);
  border-radius: 28px 28px 0 0;
  overscroll-behavior-y: contain;
  animation: none;
}
.sheet-toolbar { position: sticky; z-index: 3; top: 0; background: rgba(255,255,255,.97); backdrop-filter: blur(20px); }
.sheet-grabber { display: flex; align-items: center; justify-content: center; width: 100%; height: 24px; min-height: 24px; padding: 0; border: 0; background: transparent; touch-action: none; }
.sheet-grabber span { width: 36px; height: 5px; border-radius: 3px; background: #c7cbd1; }
.sheet-toolbar .navigation-bar { padding-block: 0 6px; background: transparent; }
.sheet-body { padding: 20px 24px calc(28px + var(--safe-bottom)); }
.sheet-body input, .sheet-body textarea, .sheet-body select { font-size: max(16px, 1rem); scroll-margin-block: 100px 24px; }
.sheet-body .settings-list { margin-block: 8px; }
.sheet-body .settings-row { min-height: 56px; }
.sheet-body .settings-row[data-action="open-account"]::after,
.sheet-body .settings-row[data-action="open-subscription"]::after { content: '›'; margin-left: auto; color: #a1a6af; font-size: 25px; font-weight: 400; }
#app[data-sheet-motion="present"] .sheet { animation: nativeSheetIn 280ms cubic-bezier(.2,.8,.2,1) both; }
#app[data-sheet-motion="push"] .sheet-body { animation: nativeDetailIn 220ms cubic-bezier(.2,.8,.2,1) both; }
@keyframes nativeSheetIn { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes nativeDetailIn { from { opacity: .4; transform: translateX(32px); } to { opacity: 1; transform: none; } }
/* Tab/navigation chrome has a separate snapshot so content pushes don't move it. */
.has-tab-navigation > .navigation-bar { view-transition-name: navigation-header; }
.bottom-nav { view-transition-name: navigation-tabs; }
::view-transition-group(navigation-header), ::view-transition-group(navigation-tabs) { animation-duration: 0s; }
::view-transition-old(navigation-header), ::view-transition-old(navigation-tabs) { display: none; }
::view-transition-new(navigation-header), ::view-transition-new(navigation-tabs) { animation: none; }
html[data-transition="present"]::view-transition-new(root) { animation: nativeSheetIn 280ms cubic-bezier(.2,.8,.2,1) both; }
html[data-transition="dismiss"]::view-transition-old(root) { animation: nativeSheetIn 240ms cubic-bezier(.2,.8,.2,1) reverse both; z-index: 2; }
html[data-transition="dismiss"]::view-transition-new(root) { animation: none; }
@media (prefers-reduced-motion: reduce) {
  #app[data-sheet-motion] .sheet, #app[data-sheet-motion] .sheet-body { animation: none; }
  html[data-transition]::view-transition-old(root), html[data-transition]::view-transition-new(root) { animation: none; }
}
.navigation-bar .navigation-settings { background: #e8f2ff; color: #2460ae; font-weight: 600; }
.navigation-settings:has(img) { background: transparent; }
html { scroll-padding-top: calc(64px + var(--safe-top)); scroll-padding-bottom: calc(76px + var(--safe-bottom)); }
.has-tab-navigation .content { padding-bottom: 16px; }
.sheet-body .settings-row[data-action="open-account"],
.sheet-body .settings-row[data-action="open-subscription"] { grid-template-columns: 42px minmax(0, 1fr) 16px; }
.account-stack-sheet { height: min(calc(100dvh - var(--safe-top) - var(--keyboard-inset, 0px) - 16px), 760px); }
#app[data-sheet-motion="back"] .sheet-body { animation: nativeDetailBack 200ms ease-out both; }
@keyframes nativeDetailBack { from { opacity: .4; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #app[data-sheet-motion="back"] .sheet-body { animation: none; } }
.has-task-navigation > .navigation-bar { position: sticky; top: 0; padding-top: calc(4px + var(--safe-top)); }
.has-task-navigation .screen { min-height: calc(100dvh - 56px - var(--safe-top)); padding-top: 24px; }

.journey-screen:has(.journey-header), .focus-composition:has(.navigation-bar) { padding-top: var(--safe-top); }
