/*
 * The static shell-crash fallback (LANGUAGE.md §15, kit `.fallback--shell`).
 *
 * A static file (public/, beside shell-fallback.js). index.html links it with
 * tokens.css and base.css, outside the app bundle, so the fallback still
 * renders when the bundle itself fails to load
 * or throws before React mounts. public/shell-fallback.js clones it from
 * index.html's inert template and reveals it by setting `data-shell-failed`
 * on <html>. Same copy as ShellCrashFallback
 * (src/components/shell/system/CrashFallback.tsx).
 *
 * It also hides the route document's static fallback (the readable page for
 * visitors and crawlers without JavaScript, docs/SEARCH_DISCOVERY.md) from the
 * first paint once shell-fallback.js has marked <html data-js>; the app then
 * removes it when it mounts. Unlayered, so no layered rule shows it again.
 *
 * Linked first, so it also fixes the cascade layer order before base.css
 * (linked statically too) opens `base`: the app bundle's Tailwind order.
 */

@layer theme, base, components, utilities;

:root[data-js] [data-onepassapps-seo-fallback] {
  display: none;
}

.fallback--shell {
  display: grid;
  min-block-size: 100dvh;
  place-items: center;
  padding: max(var(--frame-edge), var(--space-4));
  background: var(--canvas);
  color: var(--ink-1);
  font-family: var(--font-sans);
}

.fallback--shell[hidden] {
  display: none;
}

:root[data-shell-failed] .fallback--shell[hidden] {
  display: grid;
}

:root[data-shell-failed] #root {
  display: none;
}

.fallback--shell .fallback__card {
  display: flex;
  inline-size: 100%;
  max-inline-size: 28rem;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--inset);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-outer);
  background: var(--pane);
  text-align: center;
}

.fallback--shell .fallback__mark {
  display: block;
  inline-size: 3rem;
  block-size: 3rem;
}

.fallback--shell .fallback__title {
  margin: 0;
  font-size: var(--text-title);
  line-height: var(--leading-title);
  font-weight: var(--weight-semibold);
  text-wrap: balance;
}

.fallback--shell .fallback__copy {
  margin: 0;
  color: var(--ink-2);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  text-wrap: pretty;
}

.fallback--shell .fallback__help {
  margin: 0;
  color: var(--ink-3);
  font-size: var(--text-caption);
  line-height: var(--leading-caption);
}

.fallback--shell .fallback__help a {
  color: var(--ink-1);
}

.fallback--shell .fallback__reload {
  display: inline-flex;
  inline-size: 100%;
  min-block-size: var(--control-lg);
  align-items: center;
  justify-content: center;
  border: 1px solid var(--brand-edge);
  border-radius: var(--radius-pill);
  background: var(--brand-wash);
  color: var(--ink-1);
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  text-decoration: none;
}

.fallback--shell .fallback__reload:hover {
  border-color: var(--brand);
}

.fallback--shell a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
