/* Boot skeleton: the frame of the app (rail | list | main) drawn as grey shapes, before and while the app loads. Loaded by <link> in <head> of
   index.html (CSP style-src 'self': no <style>, no style=""). The same markup is rendered by src/app/shell-skeleton.tsx, so when React takes
   over, the shapes stay where they are. Colours = the --dz-* tokens of tokens-base.css / tokens-dark.css (boot-skeleton.test.ts keeps them equal):
   they are literal here because this file loads before the app's CSS. */
:root {
  color-scheme: light;
  --boot-bg: #ffffff;
  --boot-bg-2: #fafafa;
  --boot-line: #e4e4e7;
  --boot-shape: #e4e4e7; /* = --dz-line: --dz-line-2 is too faint on the grey frame */
  --boot-rail-w: 72px;
  --boot-list-w: 296px;
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --boot-bg: #1a1a1c;
  --boot-bg-2: #0e0e0f;
  --boot-line: #2d2d30;
  --boot-shape: #232325;
}
:root[data-theme='light'] {
  color-scheme: light;
}
/* before boot.js ran (or with scripts off): follow the OS */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --boot-bg: #1a1a1c;
    --boot-bg-2: #0e0e0f;
    --boot-line: #2d2d30;
    --boot-shape: #232325;
  }
}
@media (min-width: 769px) and (max-width: 1099px) {
  :root {
    --boot-rail-w: 56px;
  }
}
@media (min-width: 1280px) {
  :root {
    --boot-list-w: 320px;
  }
}
html,
body {
  margin: 0;
  height: 100%;
  background: var(--boot-bg);
}
#root {
  height: 100%;
}

.dz-boot {
  display: grid;
  grid-template-columns: var(--boot-rail-w) var(--boot-list-w) minmax(0, 1fr);
  height: 100%;
  min-height: 100vh;
  background: var(--boot-bg);
}
.dz-boot__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* The shapes appear after 180 ms: a fast load never shows them; the background is right from the first paint. */
.dz-boot__rail,
.dz-boot__list,
.dz-boot__main,
.dz-boot__tabs {
  opacity: 0;
  animation: dz-boot-in 120ms ease-out 180ms forwards;
}
/* boot.js sets data-boot-shown at 180 ms. Shapes drawn after that (React replaces the nodes) are on at once: a new node would start the fade again
   and the frame would go off and on. Also covers a script that ran late: whatever the animation was doing, it is on. */
[data-boot-shown] .dz-boot__rail,
[data-boot-shown] .dz-boot__list,
[data-boot-shown] .dz-boot__main,
[data-boot-shown] .dz-boot__tabs {
  animation: none;
  opacity: 1;
}
/* /cb: only the ground. */
[data-boot='auth'] .dz-boot > * {
  visibility: hidden;
}
.dz-boot__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  background: var(--boot-bg-2);
  border-right: 1px solid var(--boot-line);
}
.dz-boot__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-right: 1px solid var(--boot-line);
}
.dz-boot__main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 24px;
  background: var(--boot-bg-2);
}
.dz-boot__tabs {
  display: none;
}
.dz-boot__tile,
.dz-boot__bar,
.dz-boot__row,
.dz-boot__block,
.dz-boot__tab {
  display: block;
  background: var(--boot-shape);
  animation: dz-boot-pulse 1.6s ease-in-out infinite;
}
.dz-boot__tile {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
.dz-boot__bar {
  width: 55%;
  height: 20px;
  border-radius: 6px;
}
.dz-boot__main > .dz-boot__bar {
  width: 35%;
  margin-bottom: 10px;
}
.dz-boot__row {
  height: 44px;
  border-radius: 8px;
}
.dz-boot__block {
  height: 56px;
  width: 70%;
  border-radius: 10px;
}
.dz-boot__block:nth-of-type(even) {
  width: 55%;
  align-self: flex-end;
}
@keyframes dz-boot-in {
  to {
    opacity: 1;
  }
}
@keyframes dz-boot-pulse {
  50% {
    opacity: 0.55;
  }
}
/* 390: the list page as the app draws it (ground --boot-bg, a title bar, rows) and the 80 px tab bar at the foot (`.tabbar`: five 56x30 pills); no rail, no main. */
@media (max-width: 768px) {
  .dz-boot {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) calc(80px + env(safe-area-inset-bottom, 0px));
  }
  .dz-boot__rail,
  .dz-boot__main {
    display: none;
  }
  .dz-boot__list {
    border-right: 0;
  }
  .dz-boot__tabs {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding: 6px 4px calc(22px + env(safe-area-inset-bottom, 0px));
    background: var(--boot-bg);
    box-shadow: inset 0 1px 0 var(--boot-line);
  }
  .dz-boot__tab {
    width: 56px;
    height: 30px;
    border-radius: 15px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dz-boot__rail,
  .dz-boot__list,
  .dz-boot__main,
  .dz-boot__tabs {
    animation: dz-boot-in 1ms linear 180ms forwards;
  }
  .dz-boot__tile,
  .dz-boot__bar,
  .dz-boot__row,
  .dz-boot__block,
  .dz-boot__tab {
    animation: none;
  }
}
