:root {
  --cream: #f2f0e6;
  --ink: #141414;
  --black: #000;
  --page: var(--black);
  --fg: var(--cream);
  --control-bg: var(--cream);
  --control-fg: var(--ink);
  --control-bg-hover: #e7e3d5;
  --control-bg-active: #dbd6c6;
  --back-bg: var(--ink);
  --back-fg: var(--cream);
  --back-edge: var(--cream);
  --back-bg-hover: #000;
  --field-fg: var(--cream);
  --field-border: rgba(242, 240, 230, 0.55);
  --quiet: var(--cream);
  --focus: var(--cream);
  --toast-bg: var(--cream);
  --toast-fg: var(--ink);
}

html[data-theme="light"] {
  --page: var(--cream);
  --fg: var(--ink);
  --control-bg: var(--ink);
  --control-fg: var(--cream);
  --control-bg-hover: #2a2a2a;
  --control-bg-active: #000;
  --back-bg: var(--cream);
  --back-fg: var(--ink);
  --back-edge: var(--ink);
  --back-bg-hover: #fff;
  --field-fg: var(--ink);
  --field-border: rgba(20, 20, 20, 0.45);
  --quiet: var(--ink);
  --focus: var(--ink);
  --toast-bg: var(--ink);
  --toast-fg: var(--cream);
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--page);
  color: var(--fg);
  overscroll-behavior: none;
}

/* The holding page is one screen. A band past the viewport becomes a
   scroll in Instagram, and that scroll flashes white and moves the
   wordmark. The installed app and the signed-in shell keep their height. */
html:not(.is-signed-in):not(.pwa-standalone) {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #000;
}

html:not(.is-signed-in):not(.pwa-standalone) body {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #000;
}

/* Installed iOS app draws under the status bar. The first portrait viewport
   is short of the screen until a rotation, so --app-height is the screen
   itself. Do not cap it at 100dvh, and do not add the status-bar inset. */
html.pwa-standalone {
  --app-height: 100dvh;
}

html.pwa-standalone,
html.pwa-standalone body {
  height: var(--app-height);
  min-height: var(--app-height);
  overflow: hidden;
}

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--fg);
  color: var(--page);
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--black);
  contain: paint;
  isolation: isolate;
}

html.is-signed-in .atmosphere {
  display: none;
}

html.is-signed-in,
html.is-signed-in body {
  overflow: hidden;
  overscroll-behavior: none;
}

.glow {
  position: absolute;
  overflow: visible;
}

/* Blur a quarter-size disc, then scale it up. The filter runs on a small
   bitmap; the parent only moves that texture. */
.glow__soft {
  position: absolute;
  width: 25%;
  height: 25%;
  border-radius: 50%;
  filter: blur(22px);
  transform: scale(4);
}

.glow--warm {
  width: 72vw;
  height: 78vh;
  left: 14%;
  top: 8%;
  animation: drift-warm 30s ease-in-out infinite alternate;
}

.glow--warm .glow__soft {
  top: 0;
  left: 0;
  transform-origin: top left;
  background: radial-gradient(
    circle,
    rgba(214, 168, 128, 0.95) 0%,
    rgba(150, 102, 72, 0.42) 42%,
    transparent 70%
  );
}

.glow--cool {
  width: 64vw;
  height: 72vh;
  right: 6%;
  bottom: 2%;
  animation: drift-cool 36s ease-in-out infinite alternate;
}

.glow--cool .glow__soft {
  right: 0;
  bottom: 0;
  transform-origin: bottom right;
  background: radial-gradient(
    circle,
    rgba(148, 168, 188, 0.8) 0%,
    rgba(70, 88, 108, 0.38) 46%,
    transparent 72%
  );
}

.atmosphere__veil {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

@keyframes drift-warm {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(5%, 4%, 0) scale(1.07);
  }
}

@keyframes drift-cool {
  from {
    transform: translate3d(0, 0, 0) scale(1.04);
  }
  to {
    transform: translate3d(-6%, -3%, 0) scale(1);
  }
}

/* Pointer follow replaces the ambient keyframes. Values are set from glow.js. */
.atmosphere.is-following .glow--warm {
  animation: none;
  transform: translate3d(var(--warm-x, 0px), var(--warm-y, 0px), 0);
}

.atmosphere.is-following .glow--cool {
  animation: none;
  transform: translate3d(var(--cool-x, 0px), var(--cool-y, 0px), 0);
}

@media (prefers-reduced-motion: reduce) {
  .glow--warm,
  .glow--cool {
    animation: none;
  }

  .atmosphere.is-following .glow--warm,
  .atmosphere.is-following .glow--cool {
    animation: none;
    transform: none;
  }
}

.home,
.login-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
}

html:not(.is-signed-in):not(.pwa-standalone) .home,
html:not(.is-signed-in):not(.pwa-standalone) .login-page {
  height: 100%;
  min-height: 0;
  max-height: 100%;
}

.home {
  display: grid;
  place-items: center;
  padding: 24px;
}

h1 {
  position: fixed;
  z-index: 1;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  pointer-events: none;
  font-weight: inherit;
  font-size: inherit;
  line-height: 0;
}

.wordmark {
  display: grid;
  width: min(180px, calc(100vw - 48px));
  aspect-ratio: 321.78 / 78.76;
  margin-inline: auto;
}

/* Matches critical.css: discount the ® so the letters, not the mark, are centred. */
.home .wordmark {
  translate: 5.50485% 0;
}

.wordmark .logo {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: auto;
}

.logo--dark {
  opacity: 0;
}

html[data-theme="light"] .logo--light {
  opacity: 0;
}

html[data-theme="light"] .logo--dark {
  opacity: 1;
}

.login {
  position: fixed;
  z-index: 2;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  right: calc(env(safe-area-inset-right, 0px) + 16px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px 0 18px;
  border-radius: 999px;
  background: var(--control-bg);
  color: var(--control-fg);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
}

.login:hover,
.action:hover {
  background: var(--control-bg-hover);
}

.login:active,
.action:active {
  background: var(--control-bg-active);
}

.login:focus-visible,
.back:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
}

.back {
  position: fixed;
  z-index: 2;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  left: calc(env(safe-area-inset-left, 0px) + 16px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--back-edge);
  border-radius: 999px;
  background: var(--back-bg);
  color: var(--back-fg);
  text-decoration: none;
}

.back:hover,
.back:active {
  background: var(--back-bg-hover);
  color: var(--back-fg);
}

.login-stage {
  position: fixed;
  z-index: 1;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
}

.login-block {
  width: min(22rem, calc(100vw - 48px));
  text-align: center;
  pointer-events: auto;
}

.login-page h1 {
  position: static;
  inset: auto;
  display: block;
  margin: 0 0 1.5rem;
}

.login-flow {
  position: static;
  width: auto;
  text-align: center;
}

.code-boxes {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
}

.step input {
  display: block;
  width: 100%;
  height: 44px;
  margin: 0 0 12px;
  padding: 0 16px;
  border: 1px solid var(--field-border);
  border-radius: 999px;
  background: transparent;
  color: var(--field-fg);
  font: inherit;
  font-size: 16px;
  text-align: center;
}

.step input.code-box {
  height: 48px;
  margin: 0;
  padding: 0;
  border-radius: 12px;
  font-size: 22px;
  line-height: 48px;
}

.step input::placeholder {
  color: color-mix(in srgb, var(--field-fg) 48%, transparent);
}

.step input[aria-invalid="true"] {
  border-color: #ef4444;
}

.login-field-error {
  display: block;
  font-size: 13px;
  color: #ef4444;
  margin: -4px 0 10px;
  text-align: center;
}

.login-field-error[hidden] {
  display: none;
}

.toasts[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.step input:focus-visible,
.action:focus-visible,
.quiet:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40px;
  margin-top: 4px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--control-bg);
  color: var(--control-fg);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
}

.action:disabled {
  opacity: 0.55;
}

.quiet {
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--quiet);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.35em;
  text-transform: uppercase;
  cursor: pointer;
}

.done-line {
  margin: 0;
  color: var(--fg);
  font-size: 16px;
  line-height: 1.5;
}

.app-shell[hidden] {
  display: none !important;
}

.app-shell {
  position: fixed;
  z-index: 2;
  inset: 0;
  display: flex;
  height: 100dvh;
  background: var(--page);
  overscroll-behavior: none;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

html.pwa-standalone .app-shell,
html.pwa-standalone .app-shell.is-timeline,
html.pwa-standalone .app-shell.is-timeline:has(.app-rail[data-state="collapsed"]) {
  height: var(--app-height, 100dvh);
  max-height: none;
  bottom: 0;
}

/* 100dvh is the short first-load viewport. The shell hangs from the top at
   the screen height so it reaches the physical bottom before any rotation. */
@media (orientation: portrait) {
  html.pwa-standalone .app-shell,
  html.pwa-standalone .app-shell.is-timeline,
  html.pwa-standalone .app-shell.is-timeline:has(.app-rail[data-state="collapsed"]),
  html.pwa-standalone .app-rail,
  html.pwa-standalone .app-scrim {
    top: 0;
    bottom: auto;
    height: var(--app-height, 100dvh);
    max-height: none;
  }
}

.app-shell::after {
  content: "";
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: calc(3.5rem - 1px);
  height: 1px;
  background: var(--field-border);
  pointer-events: none;
}

.app-rail {
  display: none;
  flex-shrink: 0;
  overflow: hidden;
}

.app-rail__inner {
  position: relative;
  display: flex;
  width: 18rem;
  min-width: 18rem;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--field-border);
  background: color-mix(in srgb, var(--page) 72%, transparent);
  backdrop-filter: blur(20px);
}

.app-rail__crumb {
  position: relative;
  z-index: 4;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  height: 3.5rem;
  padding: 0 12px 0 0;
}

.app-rail__brand {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  padding-left: 20px;
  color: inherit;
  text-decoration: none;
}

.logo-fade {
  display: block;
  opacity: 0;
  transform: translateX(-8px);
  transition:
    opacity 50ms linear,
    transform 50ms linear;
}

.logo-fade.is-on {
  opacity: 1;
  transform: translateX(0);
  transition:
    opacity 150ms linear 100ms,
    transform 150ms var(--ease-smooth-out, cubic-bezier(0.22, 1, 0.36, 1)) 100ms;
}

.app-rail__crumb .wordmark {
  width: calc(24px * 321.78 / 78.76);
  height: 24px;
  margin-inline: 0;
}

.app-rail__crumb .wordmark .logo {
  width: 100%;
  height: 100%;
}

.app-rail__sections {
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  font-family: Satoshi, ui-sans-serif, system-ui, sans-serif;
}

.app-rail__sections .t-tabs {
  max-width: 100%;
}

.app-rail__slash {
  flex-shrink: 0;
  color: color-mix(in srgb, var(--fg) 40%, transparent);
}

.app-rail__crumbs {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 8px;
  overflow: hidden;
}

.app-rail__crumb-btn,
.app-rail__crumb-label {
  min-width: 0;
  overflow: hidden;
  border: 0;
  background: none;
  padding: 0;
  color: color-mix(in srgb, var(--fg) 62%, transparent);
  font: inherit;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-rail__crumb-label.is-current {
  color: var(--fg);
}

.app-rail__crumb-btn {
  cursor: pointer;
}

.app-rail__menu {
  position: relative;
  z-index: 4;
  display: flex;
  flex-shrink: 0;
  height: calc(3.5rem);
}

.app-rail__menu-button,
.app-rail__option {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 15px;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.app-rail__menu-button {
  height: 100%;
  padding: 0 20px;
}

.app-rail.is-menu-open .app-rail__menu-button {
  opacity: 0.42;
}

.app-rail__choice {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.app-rail__choice-label,
.app-rail__family-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-rail__chip,
.app-rail__count {
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--fg) 18%, transparent);
  border-radius: 999px;
  padding: 2px 8px;
  color: color-mix(in srgb, var(--fg) 62%, transparent);
  font-size: 11px;
  line-height: 1;
}

.app-rail__count {
  font-variant-numeric: tabular-nums;
}

.app-rail__chevron {
  flex-shrink: 0;
  color: color-mix(in srgb, var(--fg) 62%, transparent);
  transition: transform 200ms var(--motion-ease, ease);
}

.app-rail.is-menu-open .app-rail__chevron {
  transform: rotate(180deg);
}

.app-rail__families {
  position: relative;
  flex: 1;
  min-height: 0;
}

.app-rail__families-scroll {
  display: flex;
  height: 100%;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: none;
  scrollbar-width: none;
}

.app-rail__families-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.app-rail__rows {
  display: flex;
  flex: 1 0 auto;
  min-height: 100%;
  flex-direction: column;
}

.app-rail__family {
  display: flex;
  flex: 1 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 2.5rem;
  padding: 2px 20px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 15px;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.app-rail__family + .app-rail__family {
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--fg) 8%, transparent);
}

.app-rail__family-name {
  min-width: 0;
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-rail__family-meta {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
}

.app-rail__unmarked {
  color: #8a7030;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.app-shell.is-ink-dark .app-rail__unmarked {
  color: #d7cdaa;
}

.app-rail__family:hover {
  background: color-mix(in srgb, var(--fg) 4%, transparent);
}

.app-rail__family.is-current {
  background: color-mix(in srgb, var(--fg) 8%, transparent);
}

.app-rail__block {
  flex-shrink: 0;
  color: color-mix(in srgb, var(--fg) 62%, transparent);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.app-rail__empty {
  margin: 0;
  padding: 32px 12px;
  color: color-mix(in srgb, var(--fg) 62%, transparent);
  font-size: 13px;
  text-align: center;
}

.app-rail__thumb {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 1px;
  pointer-events: none;
}

.app-rail__thumb-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: var(--thumb-h, 28px);
  border-radius: 999px;
  background: var(--fg);
  opacity: 0;
  transform: translateY(var(--thumb-y, 0px)) scaleY(0.72);
  transform-origin: center;
  transition:
    opacity 180ms ease,
    transform 220ms var(--motion-ease, ease);
}

.app-rail__thumb.is-shown .app-rail__thumb-bar {
  opacity: 0.85;
  transform: translateY(var(--thumb-y, 0px)) scaleY(1);
}

.app-rail__finder {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  height: 3.5rem;
  padding: 0 20px;
  border-top: 1px solid color-mix(in srgb, var(--fg) 8%, transparent);
  background: color-mix(in srgb, var(--page) 80%, transparent);
}

.app-rail__finder .t-clear {
  position: relative;
  display: flex;
  min-width: 0;
  flex: 1;
  height: 100%;
  align-items: center;
}

.app-rail__finder input {
  position: relative;
  z-index: 1;
  min-width: 0;
  flex: 1;
  height: 100%;
  margin: 0;
  padding: 0 28px 0 0;
  border: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 15px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.app-rail__finder .t-clear-mirror {
  padding-right: 28px;
  color: var(--fg);
  font-size: 15px;
}

.app-rail__finder .t-clear-btn {
  position: absolute;
  right: 0;
  z-index: 4;
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: color-mix(in srgb, var(--fg) 62%, transparent);
  cursor: pointer;
}

.app-rail__finder .t-clear-btn[hidden] {
  display: none;
}

.app-rail__finder input::placeholder {
  color: color-mix(in srgb, var(--fg) 45%, transparent);
}

.app-rail__finder .app-rail__placeholder {
  display: none;
  gap: 8px;
  color: color-mix(in srgb, var(--fg) 45%, transparent);
}

.app-rail__search-icon {
  display: none;
  flex-shrink: 0;
  color: currentColor;
}

.app-rail__finder input[type="search"]::-webkit-search-decoration,
.app-rail__finder input[type="search"]::-webkit-search-cancel-button,
.app-rail__finder input[type="search"]::-webkit-search-results-button {
  display: none;
}

.app-rail__clear {
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: color-mix(in srgb, var(--fg) 62%, transparent);
  cursor: pointer;
}

.app-rail__layer {
  position: absolute;
  z-index: 6;
  display: flex;
  flex-direction: column;
  grid-column: 1;
  grid-row: 1 / -1;
  left: 0;
  right: 0;
  top: 7rem;
  bottom: 0;
  height: auto;
}

.app-rail__veil {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: color-mix(in oklab, var(--background, var(--page)) 96%, transparent);
  opacity: 0;
  cursor: default;
  transition: opacity 200ms ease;
}

.app-rail.is-menu-open .app-rail__veil {
  opacity: 1;
}

.app-rail__layer.is-spot .app-rail__veil {
  background: radial-gradient(
    circle 14rem at var(--spot-x, 50%) var(--spot-y, 50%),
    color-mix(in oklab, var(--background, var(--page)) 78%, transparent) 0%,
    color-mix(in oklab, var(--background, var(--page)) 90%, transparent) 42%,
    color-mix(in oklab, var(--background, var(--page)) 98%, transparent) 72%
  );
}

.app-rail__dropdown {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  align-self: stretch;
  min-height: 100%;
  overflow: auto;
  overscroll-behavior: none;
  background: var(--background, var(--page));
  transform-origin: top left;
  transform: scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 250ms var(--motion-ease, cubic-bezier(0.22, 1, 0.36, 1)),
    opacity 250ms var(--motion-ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.app-rail.is-menu-open .app-rail__dropdown {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}

.app-rail.is-menu-closing .app-rail__dropdown {
  transform: scale(0.99);
  opacity: 0;
  pointer-events: none;
  transition-duration: 150ms;
}

.app-rail__option {
  height: 3.5rem;
  padding: 0 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--fg) 8%, transparent);
  background: var(--background, var(--page));
}

.app-rail__option.is-current {
  background: color-mix(in srgb, var(--fg) 8%, var(--background, var(--page)));
}

.app-rail__option:hover {
  background: color-mix(in srgb, var(--fg) 4%, var(--background, var(--page)));
}

.app-column {
  position: relative;
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.app-topbar {
  position: relative;
  display: grid;
  flex-shrink: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  height: 3.5rem;
  padding: 0;
  background: transparent;
}

/* The installed app fills the screen, so the old status-bar band is gone.
   Pad the controls by that inset without growing the shell. */
html.pwa-standalone .app-topbar,
html.pwa-standalone .app-rail__crumb {
  height: calc(3.5rem + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
}

/* The section overlay is anchored to the padding edge, which includes
   the status-bar inset. Start it below that pad so it shares the
   content box with the menu and the avatar. */
html.pwa-standalone .app-topbar .app-rail__sections {
  top: env(safe-area-inset-top, 0px);
}

html.pwa-standalone .app-shell::after {
  top: calc(3.5rem + env(safe-area-inset-top, 0px) - 1px);
}

html.pwa-standalone .app-rail__layer {
  top: calc(7rem + env(safe-area-inset-top, 0px));
}

html.pwa-standalone .app-shell.is-timeline,
html.pwa-standalone .app-shell.is-timeline:has(.app-rail[data-state="collapsed"]) {
  grid-template-rows:
    calc(3.5rem + env(safe-area-inset-top, 0px))
    3.5rem
    minmax(0, 1fr)
    3.5rem;
}

.app-topbar__menu,
.app-topbar__collapse {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  margin-left: 0;
  z-index: 2;
}

.app-topbar__logo {
  position: absolute;
  z-index: 2;
  left: 48px;
  top: 28px;
  transform: translateY(-50%);
  pointer-events: none;
}

html.pwa-standalone .app-topbar__logo {
  top: calc(env(safe-area-inset-top, 0px) + 28px);
}

.app-topbar__logo .wordmark {
  width: calc(24px * 321.78 / 78.76);
  height: 24px;
  margin-inline: 0;
}

.app-topbar__logo .wordmark .logo {
  width: 100%;
  height: 100%;
}

.app-topbar .app-rail__sections {
  position: static;
  z-index: 3;
  grid-column: 2;
  grid-row: 1;
  justify-self: start;
  align-self: center;
  display: flex;
  width: auto;
  max-width: none;
  margin-left: 8px;
  pointer-events: auto;
}

/* 12px column gap + 8px = 20px after the sidebar toggle. When the
   header wordmark is showing, sit 20px past that wordmark instead. */
.app-topbar__logo:not([aria-hidden="true"]) ~ .app-rail__sections {
  position: absolute;
  grid-column: 1 / -1;
  left: calc(48px + 24px * 321.78 / 78.76 + 20px);
  right: auto;
  width: max-content;
  top: 0;
  bottom: 0;
  align-items: center;
  justify-content: flex-start;
  margin-left: 0;
}

.app-topbar #ws-hud {
  position: relative;
  z-index: 2;
  grid-column: 3;
  grid-row: 1;
  min-width: max-content;
  justify-self: end;
  margin-right: 20px;
}

.app-topbar .ws-hud__tools:empty {
  display: none;
}

.app-topbar .ws-account-btn {
  width: 34px;
  height: 34px;
  margin-left: 0;
}

.app-topbar .ws-hud__tools:not(:empty) {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  right: calc(100% + 10px);
  margin: 0;
}



.app-topbar__menu,
.app-topbar__collapse {
  position: relative;
  display: inline-flex;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--fg);
  cursor: pointer;
}

.app-topbar__menu:focus-visible,
.app-topbar__collapse:focus-visible {
  outline: 2px solid var(--focus, currentColor);
  outline-offset: 2px;
}

.app-topbar__menu .t-badge-dot {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: #a14a4a;
  color: #f2f0e6;
  font-size: 10px;
  font-style: normal;
  line-height: 16px;
  text-align: center;
}

.app-toasts {
  position: absolute;
  z-index: 7;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.app-toasts .t-toast {
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--page, #f2f0e6);
  color: var(--fg, #0c0c0e);
  font-size: 13px;
}

.app-topbar .app-rail__crumbs {
  flex: 0 1 auto;
  align-items: center;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
}

.app-topbar__crumb {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 8px;
  color: color-mix(in srgb, var(--fg) 62%, transparent);
  font-size: 12px;
}

.app-topbar__crumb #section-label {
  flex-shrink: 0;
  color: var(--fg);
}

.app-topbar__description {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: none;
  padding: 24px;
}

.app-scrim {
  display: none;
}

@media (min-width: 768px) {
  .app-rail {
    display: flex;
    width: 0;
    transition: width var(--duration-fast, 250ms) var(--ease-smooth-out, cubic-bezier(0.22, 1, 0.36, 1));
  }

  .app-rail[data-state="expanded"] {
    width: 18rem;
  }

  .app-topbar__menu {
    display: none;
  }
}

@media (min-width: 768px) and (min-height: 501px) {
  html[data-rail="open"] .app-rail {
    width: 18rem;
  }

  html[data-rail="closed"] .app-rail {
    width: 0;
  }

  html[data-rail="open"] .app-shell.is-timeline:has(.app-rail),
  html[data-rail="closed"] .app-shell.is-timeline:has(.app-rail) {
    transition: grid-template-columns var(--duration-fast, 250ms) var(--ease-smooth-out, cubic-bezier(0.22, 1, 0.36, 1));
  }

  html[data-rail="open"] .app-shell.is-timeline:has(.app-rail) {
    grid-template-columns: 18rem minmax(0, 1fr);
  }

  html[data-rail="closed"] .app-shell.is-timeline:has(.app-rail) {
    grid-template-columns: 0px minmax(0, 1fr);
  }
}

@media (max-width: 767px) {
  .app-topbar__collapse,
  .app-topbar__description {
    display: none;
  }

  .app-rail__finder {
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }

  .app-rail__finder .app-rail__placeholder {
    display: flex;
    justify-content: flex-start;
  }

  .app-rail__search-icon {
    display: block;
  }

  .app-rail__finder input::placeholder {
    color: transparent;
  }

  .app-rail {
    position: fixed;
    z-index: 4;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    width: 18rem;
    transform: translate3d(calc(-100% - 24px), 0, 0);
    transition: transform var(--duration-fast, 250ms) var(--ease-smooth-out, cubic-bezier(0.22, 1, 0.36, 1));
  }

  .app-rail__brand {
    padding-left: max(20px, calc(env(safe-area-inset-left, 0px) + 20px));
  }

  .app-shell.is-rail-snap .app-rail {
    transition: none;
  }

  .app-shell.is-drawer .app-rail {
    z-index: 6;
    transform: none;
  }

  .app-shell.is-drawer .app-scrim {
    display: block;
    position: fixed;
    z-index: 3;
    inset: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.4);
  }

  .app-topbar {
    column-gap: 8px;
  }

  .app-topbar #ws-hud {
    margin-right: 8px;
  }

  .app-topbar .ws-account-btn {
    width: 38px;
    height: 38px;
  }

  .app-topbar .app-rail__sections {
    margin-left: 12px;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .app-topbar {
    column-gap: 8px;
  }

  .app-topbar #ws-hud {
    margin-right: 8px;
  }

  .app-topbar .ws-account-btn {
    width: 38px;
    height: 38px;
  }

  .app-rail__crumb {
    display: flex;
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }

  .app-rail__menu,
  .app-rail__finder {
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }

  .app-rail__brand {
    padding-left: 0;
    padding-inline-start: 0;
    margin-inline-end: auto;
    margin-inline-start: max(
      calc((100% - 98px) / 2),
      calc(env(safe-area-inset-left, 0px) + 12px)
    );
  }

  .app-rail__finder .app-rail__placeholder {
    display: flex;
    justify-content: flex-start;
  }

  .app-rail__search-icon {
    display: block;
  }

  .app-rail__finder input::placeholder {
    color: transparent;
  }

  .app-shell.is-drawer .app-rail {
    z-index: 6;
  }

  .app-shell.is-drawer .app-scrim {
    display: block;
    position: fixed;
    z-index: 3;
    inset: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.4);
  }

  .app-topbar .app-rail__sections {
    margin-left: 12px;
  }
}

@media (max-width: 767px), (orientation: landscape) and (max-height: 500px) {
  .app-rail__finder .app-rail__placeholder {
    justify-content: flex-start;
    gap: 8px;
    padding-inline-start: 16px;
  }

  .app-rail__finder input,
  .app-rail__finder .t-clear-mirror {
    padding-inline-start: calc(16px + 8px + 16px);
    font-size: 16px;
  }
}



html.is-signed-in .login-stage,
html.is-signed-in .back {
  display: none;
}

#ws-panel {
  --panel-translate-y: 24px;
}

[hidden] {
  display: none !important;
}

.family-mark {
  color: inherit;
  text-decoration: none;
}

.family.is-open {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.family-card {
  width: min(28rem, calc(100vw - 48px));
  text-align: center;
}

.family-card .wordmark {
  width: min(120px, 40vw);
  margin-bottom: 1.75rem;
}

.family-city {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.family h1 {
  position: static;
  inset: auto;
  display: block;
  margin: 0 0 0.75rem;
  font-size: 1.75rem;
  font-weight: 560;
}

.family-meta {
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

.family-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.5rem;
  margin: 0;
}

.family-stats div {
  display: grid;
  gap: 0.15rem;
}

.family-stats dt {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}

.family-stats dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

/* The keyboard and its accessory bar sit outside the visual viewport.
   The installed portrait shell is taller than that viewport, so this has to
   win over the screen-height rail. */
html.is-keyboard .app-rail,
html.pwa-standalone.is-keyboard .app-rail {
  top: var(--vv-top, 0px);
  bottom: auto;
  height: var(--vv-height, 100%);
  max-height: var(--vv-height, 100%);
}

html.is-rail-snap .app-rail,
.app-shell.is-rail-snap .app-rail,
html.is-rail-snap[data-rail] .app-rail,
html.is-rail-snap .logo-fade,
.app-shell.is-rail-snap .logo-fade,
html.is-rail-snap .app-shell.is-timeline,
.app-shell.is-rail-snap.is-timeline,
html.is-rail-snap[data-rail] .app-shell.is-timeline:has(.app-rail) {
  transition: none;
}

@media (min-width: 768px) and (min-height: 501px) {
  html.is-rail-snap[data-rail="open"] .app-rail__brand .logo-fade,
  html.is-rail-snap[data-rail="closed"][data-logo-fit="wordmark"] .app-topbar__logo .logo-fade {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (forced-colors: active) {
  .app-rail__brand .wordmark,
  .app-topbar__logo .wordmark {
    background: CanvasText;
    -webkit-mask: url("/brand/custo-dark.svg") center / contain no-repeat;
    mask: url("/brand/custo-dark.svg") center / contain no-repeat;
  }

  .app-rail__brand .logo,
  .app-topbar__logo .logo,
  html[data-theme] .app-rail__brand .logo,
  html[data-theme] .app-topbar__logo .logo {
    opacity: 0;
  }

  .app-topbar__menu:focus-visible,
  .app-topbar__collapse:focus-visible,
  .ws-view__btn:focus-visible,
  .ws-view__option:focus-visible {
    outline-color: Highlight;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-rail,
  html[data-rail] .app-rail,
  .app-shell.is-timeline,
  html[data-rail] .app-shell.is-timeline:has(.app-rail),
  .logo-fade,
  .logo-fade.is-on,
  .app-rail__chevron,
  .app-rail__dropdown,
  .app-rail__veil,
  .app-rail__thumb-bar {
    transition: none;
  }

  .logo-fade,
  .logo-fade.is-on {
    transform: none;
  }

  .app-rail__thumb-bar {
    transform: translateY(var(--thumb-y, 0px));
  }
}
