/* App chrome: top bar, bottom navigation, page columns, toasts. */

#app {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
}

.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  z-index: 50;
  border-radius: 9999px;
  background: var(--ink);
  padding: 0.5rem 1rem;
  color: var(--surface);
}

.skip-link:focus {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--page) 80%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.topbar-inner {
  margin: 0 auto;
  display: flex;
  height: 3.5rem;
  max-width: 64rem;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1rem;
}

/* Centred in the bar, then raised 2px so the wordmark's baseline lines up with the
   nav links' and buttons' text (a geometrically centred logo reads as low beside them). */
.topbar-logo {
  position: relative;
  top: -0.125rem;
  margin-left: -0.25rem;
  display: flex;
  align-items: center;
  border-radius: 0.5rem;
  padding: 0.25rem;
}

.topnav { margin-left: 1.5rem; display: none; align-items: center; gap: 0.25rem; }

.topnav-link {
  display: inline-flex;
  height: 2rem; /* the same as .btn-sm in the actions on the right */
  align-items: center;
  border-radius: 9999px;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s, background-color 0.15s;
}
.topnav-link:hover { color: var(--ink); }
.topnav-link.is-active { background: var(--surface-2); color: var(--ink); }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 0.25rem; }
.topbar-signup { margin-right: 0.25rem; }

.logo { display: inline-flex; align-items: center; gap: 0.5rem; }
.logo-word {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  /* Optical centring. The box is centred on the bell, but "belltake" has ascenders and
     no descenders, so its ink sits in the top of the box and reads as too high. This
     moves the ink (ascender top to baseline) onto the bell's centre line. */
  position: relative;
  top: 0.12em;
}

.bell-glyph { flex-shrink: 0; }
.bell-bg { fill: var(--logo-tile); }
.bell-wash { fill: var(--logo-ink); }
.bell-curve { stroke: var(--logo-ink); }

.main { flex: 1; padding-bottom: 7rem; }

.bottomnav {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 40;
  border-top: 1px solid var(--line);
  background: color-mix(in oklab, var(--page) 90%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

.bottomnav-list { margin: 0 auto; display: grid; max-width: 28rem; grid-template-columns: repeat(3, 1fr); }

.bottomnav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  padding: 0.5rem 0 0.25rem;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--muted);
}
.bottomnav-link.is-active { color: var(--ink); }

/* Standard page column: wide for pages with charts, narrow for focused tasks. */
.page { margin: 0 auto; width: 100%; max-width: 42rem; padding: 1.25rem 1rem 0; }
.page-wide { max-width: 48rem; }
.page-narrow { max-width: 36rem; }

.page-loading {
  display: flex;
  justify-content: center;
  padding: 6rem 0;
  color: var(--muted);
  /* Only shows if loading takes a moment. */
  opacity: 0;
  animation: bt-fade-in 200ms 250ms forwards;
}

.page-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.lede { margin-top: 0.5rem; max-width: 36rem; font-size: 1.0625rem; line-height: 1.625; color: var(--ink-2); }

.route-error { margin: 4rem auto 0; max-width: 36rem; }

.button-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.back {
  margin: 0 0 0.75rem -0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 9999px;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}
.back:hover { color: var(--ink); }

/* ─── Toasts ─────────────────────────────────────────────────────────────── */

.toasts {
  pointer-events: none;
  position: fixed;
  inset-inline: 0;
  bottom: 5rem;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1rem;
}

.toast {
  pointer-events: auto;
  display: flex;
  max-width: 28rem;
  align-items: center;
  gap: 0.75rem;
  border-radius: 9999px;
  padding: 0.625rem 0.625rem 0.625rem 1rem;
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  animation: bt-fade-up 260ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.toast-neutral { background: var(--ink); color: var(--surface); }
.toast-error { background: var(--danger-fill); color: #fff; }

.toast-close {
  display: inline-flex;
  height: 1.75rem;
  width: 1.75rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  opacity: 0.7;
}
.toast-close:hover { opacity: 1; }

@media (min-width: 640px) {
  .topnav { display: flex; }
  .bottomnav { display: none; }
  .main { padding-bottom: 4rem; }
  .page { padding-top: 2rem; }
  .toasts { bottom: 1.5rem; }
}
